Regionprops on binary image gives wrong values

조회 수: 2 (최근 30일)
Joe Parks
Joe Parks 2016년 8월 13일
답변: Image Analyst 2016년 8월 13일
I am trying to using region props to detect some blobs in a binary image. There is very little noise in the image but when I run region props and look at the 'stats' output I get a very long array of many small centroids also the first row of the stats output is the only large value for in the array, about 2000 in size when the image is only 2048x2048. Here is the output: https://postimg.org/image/p2shlqn8b/
Is there something I am missing about region props? I thought it should easily return the centroids and axes. Here is the image I am using and I run this line of code on the image BW https://postimg.org/image/sse8sobzp/ stats = regionprops(BW,'Centroid','MajorAxisLength','MinorAxisLength');
Thanks for your input!
  댓글 수: 3
Joe Parks
Joe Parks 2016년 8월 13일
Thanks for the advice, here is the image and the mat file containing the arrays.
Joe Parks
Joe Parks 2016년 8월 13일
Nevermind, I figured it out. The image needed to be inverted with
BW = ~BW;

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

답변 (1개)

Image Analyst
Image Analyst 2016년 8월 13일
Yes, the "foreground" is the white blobs and the "background" is the black blobs. bwlabel() labels only the foreground regions and regionprops() measures only the foreground regions.

Community Treasure Hunt

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

Start Hunting!

Translated by