When imshow() with small width image, exception is happen.
Because window view width is too small enogh to show title bar.
(In this case, roi is used to fill area. but it has negative position).
kmtr@kmtr-VMware-Virtual-Platform:~/work/build4-main$ ./bin/opencv_test_highgui --gtest_filter="*small*"
:
:
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from Highgui_GUI
[ RUN ] Highgui_GUI.small_width_image
[ INFO:0@0.007] global registry.impl.hpp:114 UIBackendRegistry UI: Enabled backends(3, sorted by priority): GTK(1000); GTK3(990); GTK2(980) + BUILTIN(Wayland)
[*] DEBUG: handle_toplevel_configure: maximized=0 fullscreen=0 resizing=0 focused=0 size=[0 x 0]
Exception message: OpenCV(4.9.0-dev) /home/kmtr/work/opencv4/modules/core/src/matrix.cpp:808: error: (-215:Assertion failed) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function 'Mat'
/home/kmtr/work/opencv4/modules/highgui/test/test_gui.cpp:221: Failure
Expected: waitKey(1000) doesn't throw an exception.
Actual: it throws.
[ FAILED ] Highgui_GUI.small_width_image (59 ms)
[----------] 1 test from Highgui_GUI (59 ms total)
[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (59 ms total)
[ PASSED ] 0 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] Highgui_GUI.small_width_image
System Information
OpenCV version: 4.x ( ba65d2eb0d83e6c9567a2534f8994cd4484a1635 ) Operating System / Platform: Ubuntu 24.04 Compiler & compiler version: GCC 13.2
Detailed description
When imshow() with small width image, exception is happen. Because window view width is too small enogh to show title bar. (In this case, roi is used to fill area. but it has negative position).
Steps to reproduce
Issue submission checklist