且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何查找重叠的连接组件

更新时间:2023-02-26 15:15:24

您可以对绿色和黑色图像进行逻辑与(&),以告诉您它们重叠的位置.然后,如果需要连接的组件,则可以在生成的重叠图像上调用regionprops.

You can just do a logical AND (&) with the green and black images which will tell you where they overlap. Then if you need connected components, you can call regionprops on the resulting overlap image.

green_and_black = blackImage & greenImage;
overlap_props = regionprops(green_and_black, 'all')