How to detect an absent object from a mask image and remove it on the original image?
3 ビュー (過去 30 日間)
This is the binary image of the original image:
While, this is the 'masked' image:
I extracted the center part of the blob as part of my segmentation process.
As pointed by the grey-ish arrow, one of the blob in the masked image is removed.
May I know how can I make the original image detect the absence of that blob in the masked image hence removing the whole blob in the original image?
I am thinking of using bwconncomp but I don't know how to start.
Please lend me a hand. Your assistance is very much appreciated!
(I am using R2013a version)
回答 (1 件)
Alessandro Masullo 2016 年 5 月 20 日
I don't know what are your general conditions and I assume your images are always slightly different from each other and every blob is distinct (not overlapping with others).
With these assumptions, I would use bwboundaries to detect the objects first, then I would cycle over the set of objects and I would detect for each of them the centroid, using regionprops. Once you have the centroid in both your images, you can use uniquetol to find duplicates (and so the absence) of some blobs within a certain tolerance.
A different approach could also be evaluating the difference between the two binary images, look for boundaries again with bwboundaries, evaluate the area of each element with regionprops and then select only those areas with an area bigger than a threshold (your minimum blob area).
In both cases, you can then use the pixel coordinates of bwboundaries to delete the detected blob from the original image.
I hope this helps,