Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

rectA & rectB not working

$
0
0
I am trying to get the intersection of 2 rectangles. What happens if the 2 rectangles do not intersect at all ? Will it give me an error ? Because the output below is what I am getting. The limits are (0,0,1242,375). I don't know the rectangles I am passing in. I just want to keep those that intersect and to retain the intersection. [1170 x 232 from (72, 0)] [1242 x 375 from (0, 0)] [1242 x 375 from (0, 0)] [967 x 211 from (275, 0)] [1242 x 375 from (0, 0)] [1242 x 375 from (0, 0)] [1242 x 375 from (0, 0)] [2147449647 x 375 from (2147483647, 0)] [1242 x 375 from (0, 0)] I am using this temporary fix after the intersection operator to remove all erroneous rectangles if (rect.tl().x < 0 || rect.tl().y < 0 || rect.br().x >= image.cols || rect.br().y >= image.rows || rect.area() >= image.cols * image.rows || rect.area() == 0)

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>