How to find out overlapping region between bounding boxes?

조회 수: 9 (최근 30일)
Muffin
Muffin 2012년 10월 10일
Hi
Does anyone know if there's a way to find out whether there's an overlap between two bounding boxes drawn around individual connected components??
I need to remove the areas which do not have any overlap with other bounding boxes. which is the same as making the white pixels in those black... I need help with these steps.
Please guide! Any help is greatly appreciated, thanks a lot!

답변 (1개)

Image Analyst
Image Analyst 2012년 10월 10일
overlappedPixels = binaryImage1 & binaryImage2; % Find overlap.
grayImage(overlappedPixels) = 0; % Set to zero.
  댓글 수: 5
Image Analyst
Image Analyst 2012년 11월 1일
Just do a double loop over all blobs, checking the x1,y1,x2,y2 coordinates of each of the two bounding boxes and see which bounding boxes intersect. It's just a dumb, brute force, intuitive and straightforward, easy approach but it will work, and it will work fast.
Muffin
Muffin 2012년 11월 1일
hi, thanks! i thought of that but am unable to find out how to access the coordinates of the bounding box...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by