필터 지우기
필터 지우기

Find X and Y coordinates of white pixels in a grayscale image

조회 수: 1 (최근 30일)
Aditya Chivate
Aditya Chivate 2022년 10월 27일
편집: Matt J 2022년 10월 27일
Hi, I want to find the x and y coordinates of all the pixels corresponding to the white pixels in this image and store them in an array. Later I want to find the equation of the best fitting curve passing through these coordinates. Can someone please help me with how this can be done?
PS I am very new to MATLAB and programming in general.
Thank you in advance

채택된 답변

Matt J
Matt J 2022년 10월 27일
편집: Matt J 2022년 10월 27일
You will first need to get rid of the horizontal line of white pixels near the top,
load Image
Image(1:20,:)=0; Image=bwpropfilt(Image>0,'ConvexArea',1); %Image cleanup
[y,x]=find(Image); %Get coordinates
plot(x,y,'x')
  댓글 수: 4
Aditya Chivate
Aditya Chivate 2022년 10월 27일
Thanks for the suggestion. I'll give a try on this
Matt J
Matt J 2022년 10월 27일
편집: Matt J 2022년 10월 27일
You're welcome, but if your posted question (about finding X,Y) has been answered, kindly Accept-click.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by