Question related to Image analysis Functions: bwconncomp and regionprops

4 views (last 30 days)
Hi When I pass the output of bwconncomp structure to regionprops function to get information about 'Area' of each region of interest (ROI) for example. Will the length(bwconncomp_output) be equal to length(regionprops_output). So, do the connected components number from bwconncomp be equal to the number of Area values returned by regionprops? I don't understand even why they should be equal or may be unequal. Please explain. PS: I tried working with my image set to check this, no.of connected componenets identified by bwconncomp is not equal to the number of Property values returned by regionprops function. Thank you Harish
  1 Comment
Jeff E
Jeff E on 26 Jul 2013
The documentation does sound like they should have the same length. I routinely feed the results of bwlabel to regionprops, and they always behave in this regard.
I highly recommend posting your binary image somewhere, as well as the relevant code and resulting error message you are receiving.

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 26 Jul 2013
The number of connected components from bwlabel() or bwconncomp() will match the number of structures in the structure array returned by regionprops. Each blob has one structure,and that structure may have as many members as properties you requested. For example if you asked for area and perimeter, of 100 blobs, then you'd have an array of 100 structures, with each structure having 2 members (fields).

More Answers (0)

Community Treasure Hunt

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

Start Hunting!