opencv / opencv

Open Source Computer Vision Library
https://opencv.org
Apache License 2.0
75.95k stars 55.62k forks source link

imgproc: improved test for boundingRect #25484

Closed mshabunin closed 1 week ago

mshabunin commented 3 weeks ago

This PR is intended to fix #25265. In order to do it we should:

  1. Add proper reproducer as a test (done)
  2. Fix implementation to use correct vector types (done)

Test for boundingRect has been converted to modern scheme and parametrized. Also increased test boundaries and added separate alignment test. In order to reproduce the issue one needs to build and run this test on ARMv7 board or emulate using C++ intrinsics with alignment checks (-DOPENCV_EXTRA_CXX_FLAGS="-DCV_STRONG_ALIGNMENT=1 -DCV_FORCE_SIMD128_CPP=1"). To activate second changed block (#if CV_SIMD_WIDTH > 16) use -DCPU_BASELINE=AVX2.

asmorkalov commented 3 weeks ago

@mshabunin please close PRs with other solutions as soon as your is ready.

asmorkalov commented 2 weeks ago

@opencv-alalek could you take a look again?

mshabunin commented 1 week ago

Hmm.. something was wrong with bit-shift approach, so I decided to use std::memcpy.