Files
opencv-MIRROR/modules/core/include/opencv2
Arghya Bose 0b9c7df2dd core: fix Rect_<unsigned> intersection for disjoint rectangles
Rect_::operator&= computed width - (Rx_max.x - Rx_min.x) before knowing whether
the rectangles actually overlap. For unsigned _Tp the subtraction wraps when the
rectangles are disjoint, so the result was a bogus non-empty rectangle instead of
an empty one:

    Rect_<unsigned>(0, 0, 1, 1) & Rect_<unsigned>(2, 2, 1, 1)  // was [1 x 1 from (2, 2)]

Return an empty rectangle once the coordinate gap exceeds the corresponding
width/height, before the subtraction can underflow.
2026-10-06 21:43:57 +05:30
..