Intersect() Problem when none of the pixels overlap
1 view (last 30 days)
Show older comments
When I used intersect() to find the intersection between A (red) and B (blue), I failed to get any because the pixels don't overlap. What can I do to estimate the intersection point?

Accepted Answer
Image Analyst
on 28 Jan 2016
There is no one pixel where the overlap occurs. If you'll accept any of those 4 pixel locations as an overlap, then perhaps if you dilated, ANDed, then called bwulterode. Something like (untested)
intImage = imdilate(bw1, true(3)) & imdilate(bw2, true(3));
intPoints = bwulterode(intImage);
bwulterode() has some connectivity options, so you might play around with those.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!