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

1 次查看(过去 30 天)
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 个评论
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