Reputation: 23
I have two binary image, A and B ( A and B are same size but have different object). There are many regions in each image. Now I want to find the neighbor of any regions in A. I use imdilate - dilation function in matlab. Because after dilation the regions of A will be increase so this may be connected with a region in B. I will add the region of B to A and continue to do it. I will stop when we can't add any region of B to A.
I don't know how to code this ? can you help me. thank you so much ? will it take a lot of time to calculate?
Upvotes: 0
Views: 859
Reputation: 650
The operation in binary is called a geodesic reconstruction of set B under the dilate of set A. One can also perform this with the Erode of the complement of set A. You can perform this with imreconstruct in matlab. This helps extract certain components in set B by choosing the set A. Here the set A is called the marker and set B is called the mask. The calculation is in nearly linear time like the component labeling operation.
Upvotes: 2