Skip to content

ResizeArea perf test is wrong for INTER_AREA #24408

@vrabaud

Description

@vrabaud

System Information

4.x on the latest Debian.

Detailed description

The perf test at

Size to(cvRound(from.width * scale), cvRound(from.height * scale));
expands the image which triggers the INTER_LINEAR resize algorithm. The image should be shrunk so that proper INTER_AREA is used. I tried changing it locally, but that triggers something like:

[ RUN      ] MatInfo_Size_Scale_Area_ResizeArea.ResizeArea/17, where GetParam() = (8UC4, 1280x720, 1.3)
/usr/local/google/home/vrabaud/software/opencv/modules/ts/src/ts_perf.cpp:370: Failure
The difference between expect_min and actual_min is 3, which exceeds eps, where
expect_min evaluates to 0,
actual_min evaluates to 3, and
eps evaluates to 1.
Argument "dst" has unexpected minimal value

params    = (8UC4, 1280x720, 1.3)
termination reason:  reached maximum number of iterations
bytesIn   =    3686400
bytesOut  =    2182760
samples   =        100
outliers  =          8
frequency = 1000000000
min       =    1644728 = 1.64ms
median    =    1681773 = 1.68ms
gmean     =    1992408 = 1.99ms
gstddev   = 0.30419330 = 4.16ms for 97% dispersion interval
mean      =    2098547 = 2.10ms
stddev    =     765643 = 0.77ms
[  FAILED  ] MatInfo_Size_Scale_Area_ResizeArea.ResizeArea/17, where GetParam() = (8UC4, 1280x720, 1.3) (228 ms)

I tried updating the data in OPENCV_TEST_DATA_PATH as mentioned at https://github.com/opencv/opencv/wiki/HowToUsePerfTests#how-to-update-perf-data but that did not change anything.

I need this to provide benchmarks for an upcoming pul lrequest improving INTER_AREA. Thx!

Steps to reproduce

Fix the * by a / and run:

make -j opencv_perf_imgproc
./bin/opencv_perf_imgproc --gtest_filter=*MatInfo_Size_Scale_Area*

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions