Filter löschen
Filter löschen

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

6 Ansichten (letzte 30 Tage)
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

Akzeptierte Antwort

Matt J
Matt J am 27 Okt. 2022
Bearbeitet: Matt J am 27 Okt. 2022
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 Kommentare
Aditya Chivate
Aditya Chivate am 27 Okt. 2022
Thanks for the suggestion. I'll give a try on this
Matt J
Matt J am 27 Okt. 2022
Bearbeitet: Matt J am 27 Okt. 2022
You're welcome, but if your posted question (about finding X,Y) has been answered, kindly Accept-click.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by