Borrar filtros
Borrar filtros

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

6 visualizaciones (últimos 30 días)
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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by