is there an alternate function for region props

조회 수: 6 (최근 30일)
Lorenzo Chatterpal
Lorenzo Chatterpal 2014년 9월 27일
편집: Matt J 2014년 9월 29일
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?

답변 (2개)

Image Analyst
Image Analyst 2014년 9월 27일
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
Image Analyst
Image Analyst 2014년 9월 27일
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.

댓글을 달려면 로그인하십시오.


Matt J
Matt J 2014년 9월 27일
편집: Matt J 2014년 9월 27일
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
Matt J
Matt J 2014년 9월 27일
편집: Matt J 2014년 9월 29일
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 2014년 9월 27일
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?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by