Check if a binary image is within a particular binary area
4 ビュー (過去 30 日間)
古いコメントを表示
I have a binary image BW_large, and another binary image BW_small
How do I check if BW_small is within BW_large?
0 件のコメント
採用された回答
DGM
2022 年 4 月 24 日
編集済み: DGM
2022 年 4 月 24 日
I'm assuming your images are the same size, but contain objects of differing size.
The intersection of two binary images A and B is
intAB = A & B;
If the intersection is equal to one of the two images, then that image is wholly contained within the other.
BinA = isequal(B,intAB);
Otherwise, if you have different size images which contain similarly-sized and oriented copies of the same object, you might look at normxcorr() or something.
6 件のコメント
DGM
2022 年 4 月 25 日
This gives the ratio of the intersection area to the area of BW3
nnz(intAB3)/nnz(BW3)
その他の回答 (1 件)
Image Analyst
2022 年 4 月 24 日
If you just want to know if ANY part of it is within the other blob, then you can make up your marker image and main image, and call imreconstruct(). You have years of image processing experience now so you should be able to figure it out.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Image Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!