how to find location on a blob

3 visualizaciones (últimos 30 días)
Rohit Thokala
Rohit Thokala el 5 de En. de 2022
Editada: Image Analyst el 6 de En. de 2022
Can somebody suggest a way to find the farthest white pixel in a binary image, shown in the picture with red circle. Thanks in advance
  3 comentarios
Rohit Thokala
Rohit Thokala el 6 de En. de 2022
Editada: Rohit Thokala el 6 de En. de 2022
Hello @Steve Eddins, Sorry for the incomplete question (if it was), I want a way to automatically find the circled pixel and its distance from bottom line as indicated in the image. red line is drawn from the bottom center point in the blob.
Image Analyst
Image Analyst el 6 de En. de 2022
Editada: Image Analyst el 6 de En. de 2022
My Answer below found the point's column value. I think perhaps you overlooked it.
I'll modify it to get the y value from the bottom most pixel.

Iniciar sesión para comentar.

Respuesta aceptada

Image Analyst
Image Analyst el 5 de En. de 2022
Editada: Image Analyst el 6 de En. de 2022
How about
[rows, columns] = find(binaryImage);
[rightMostColumn, index1] = max(columns)
[bottomMostRow, index2] = max(rows)
deltaY = bottomMostRow - rows(index1); % Add 1 if you want.
Or to get the bounding box(es):
props = regionprops(binaryImage, 'BoundingBox');
Be aware that the bounding box is half a pixel outside the actual white pixels.

Más respuestas (0)

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by