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