13 Commits

Author SHA1 Message Date
ahmadmasood43
0b475cd66f imgproc: saturate out-of-range float coordinates in boundingRect
pointSetBoundingRect() passed CV_32F coordinates to cvFloor() without
honouring its documented INT_MIN..INT_MAX precondition, so a point set
outside the int range collapsed to a 1x1 rect at INT_MIN, while +inf and
-inf gave INT_MIN and INT_MAX - an inverted rectangle. The extrema are
now searched for in floats, as the vectorized path already did, and
floored and saturated to the closest representable bound once, after the
reduction.

The sides are computed in int64 and clamped to INT_MAX: xmax - xmin + 1
overflows int once the extrema saturate, and did so already for a CV_32S
point set spanning the whole int range.

Fixes #29837
2026-09-05 17:12:24 +05:00
Maksim Shabunin
c4ce94232b imgproc: fixed alignment issue and improved test for boundingRect 2024-05-03 21:26:40 +03:00
MaximSmolskiy
ed93384817 Fix bug in maskBoundingRect 2024-03-08 03:25:40 +03:00
Alexander Alekhin
6b581c4e51 build: unreachable code after CV_Error() (part 2) 2018-04-24 16:03:40 +03:00
Alexander Alekhin
4a297a2443 ts: refactor OpenCV tests
- removed tr1 usage (dropped in C++17)
- moved includes of vector/map/iostream/limits into ts.hpp
- require opencv_test + anonymous namespace (added compile check)
- fixed norm() usage (must be from cvtest::norm for checks) and other conflict functions
- added missing license headers
2018-02-03 19:39:47 +00:00
OpenCV Buildbot
81f826db2b Normalize line endings and whitespace 2012-10-17 15:57:49 +04:00
Andrey Kamaev
700c1665c9 Fixed 2 spontaneously failing tests 2012-03-29 03:05:41 +00:00
Vadim Pisarevsky
4985c1b632 fixed hundreds of warnings from MSVC 2010. 2012-03-16 21:21:04 +00:00
Alexander Reshetnikov
6ead21b1a2 added licenses to some tests; updated new highgui tests 2012-02-09 10:51:53 +00:00
Alexander Reshetnikov
07fa62f0c4 some design code changes in new tests 2012-01-25 13:41:48 +00:00
Alexander Reshetnikov
cec641fb83 completed test for boundingRect function 2012-01-20 16:21:27 +00:00
Alexander Reshetnikov
b5bbce5b54 Completed countNonZero test (found that it's already exist, so new implementation isn't used now). 2012-01-19 16:30:35 +00:00
Alexander Reshetnikov
a3d2020db0 countNonZero & boundingRect tests - added first versions 2012-01-19 00:22:22 +00:00