Identify a blob inside another blob in separate images

4 views (last 30 days)
Hi. I´ve got 2 different binary images, BwImg1 and BwImg2. With bwlabel, bwboundaries and regionprops, I get their regions or blobs. What I mean is to discover the blobs in, for instance, BwIm1 that surround any blob in BwImg2 if both images were overlaid. To clarify, think that we overlay BwIm1 and BwIm2 and in such a case, blob_B in BwIm2 would be inside blob_A in BwIm1. Is there any relatively direct way to get this? Thanks a lot in advance. Regards.

Answers (1)

Image Analyst
Image Analyst on 18 Jan 2014
This is called "morphological reconstruction" and is done by imreconstruct(). The smaller/inside blob is the " marker" image, and the larger/surrounding/outside blob image is the main binary image.
  3 Comments
Image Analyst
Image Analyst on 20 Jan 2014
Edited: Image Analyst on 20 Jan 2014
Please post an image. I don't know if you're talking about a donut in one image and a spot in the hole in the other image (like a bullseye target) or if the bigger blob completely overlaps the smaller one in the other image. Posting the two images would clear that up. I'm not sure if you just want to AND the images to find overlap, or if you want to use imreconstruct() or if you need to use bwboundaries() to get the nesting relationship.
Francisco
Francisco on 21 Jan 2014
The blobs in both images are independent. It could happen whatever thing you think, a blob in Im1 without any blob in Im2, a blob in Im1 with blobs in Im2 overlapping, blobs in Im1 containing any blob(s) in Im2, etc. Here I attach the two binary images. Thanks.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!