is there an alternate function for region props

6 visualizaciones (últimos 30 días)
Lorenzo Chatterpal
Lorenzo Chatterpal el 27 de Sept. de 2014
Editada: Matt J el 29 de Sept. de 2014
I am detecting an image containing shapes, I have done the fundamental stuff of converting the image to grayscale ... Black n white etc... Now I am extracting the extema property from the region props function to determine the corners of each binary image. Is there an alternate method or function that I can use instead of region props?

Respuestas (2)

Image Analyst
Image Analyst el 27 de Sept. de 2014
Depends on what you want to measure. If you want area, you can use bwarea(), but that's also in the Image Processing Toolbox. bwperim() could get you the perimeter length, but again, it's in the IPT. If you don't want to use the IPT, and I'm assuming the reason you're asking is that you haven't purchased it, then you'll have to write your own.
  1 comentario
Image Analyst
Image Analyst el 27 de Sept. de 2014
If you want to find the max Feret diameter, see the attached demo. The Major Axis length does not give the length of the two most distant points.

Iniciar sesión para comentar.


Matt J
Matt J el 27 de Sept. de 2014
Editada: Matt J el 27 de Sept. de 2014
You could use bwboundaries to get the boundary points. Then use max and min to analyze the extreme points, e.g.,
B=bwboundaries(BW);
B1=B{1};
qmin=min(B1,[],1);
topleft=[qmin(1), min( B1(:,B1(:,1)==qmin(1)) )];
  3 comentarios
Matt J
Matt J el 27 de Sept. de 2014
Editada: Matt J el 29 de Sept. de 2014
I should mention, I fully expect this to be a reinvention of what regionprops already does. You should say what shortcoming regionprops has, in your mind, so that people have better context for the advice they give.
Image Analyst
Image Analyst el 27 de Sept. de 2014
And bwboundaries requires the Image Processing Toolbox, so you might as well use regionprops. What would you do with bwboundaries? You could get the bounding box like Matt showed. Or do you have other plans? What do you want to measure?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by