1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-28 23:03:03 +04:00

14 Commits

Author SHA1 Message Date
Thebinary110 9c487708f9 highgui test: force offscreen Qt platform to avoid CI crash
CI (Ubuntu ARM64 x2) showed the Python test suite aborting the whole
process with exit code 134: on a Qt-enabled build, namedWindow() tried
the "xcb" platform plugin, found no display (the Python test step,
unlike the C++ gtest step, does not run under xvfb-run), and Qt
aborted the process instead of raising a catchable exception -- so the
existing try/except around namedWindow never got a chance to run.

Fix: set QT_QPA_PLATFORM=offscreen (only if not already set) before
any GUI call. "offscreen" is the platform plugin Qt ships specifically
for headless/CI use, and is listed as available in the failing CI
job's own log output.

Verified locally: built opencv_python3 with WITH_QT=ON (real Qt6, not
the WITH_QT=OFF build used in the initial verification), and confirmed
that in a clean environment (no DISPLAY, no QT_QPA_PLATFORM preset),
namedWindow + saveWindowParameters + loadWindowParameters all succeed
with this fix, where they would previously depend on a native display
backend being reachable.
2026-07-24 12:31:53 +05:30
Thebinary110 8308fbf9ba highgui: expose saveWindowParameters and loadWindowParameters to Python
Both functions persist/restore a window's size, position, flags,
trackbar values, and zoom/pan state (Qt highgui backend only), take
only a plain String argument, and were already fully documented -- but
were declared CV_EXPORTS instead of CV_EXPORTS_W, so they were
unreachable from Python.

Sibling Qt-only functions in the same header (displayOverlay,
displayStatusBar) already follow the CV_EXPORTS_W + runtime
"not implemented without Qt" convention this change follows.

Adds a Python test that exercises namedWindow + save/loadWindowParameters
and gracefully skips when no GUI backend or no Qt support is present,
consistent with how other environment-dependent tests in this suite
(e.g. CUDA) skip rather than fail.

Verified locally: built opencv_python3 from this branch (WITH_QT=OFF)
and confirmed cv2.saveWindowParameters / cv2.loadWindowParameters are
present on the built module and correctly raise the expected
"compiled without QT support" error, proving the binding reaches the
C++ layer end-to-end.
2026-07-24 05:19:08 +05:30
Alexander Smorkalov 1a6f669763 Merge branch 4.x 2026-04-09 18:44:48 +03:00
ZIHAN DAI 1610602884 Merge pull request #28699 from PDGGK:fix/highgui-system-exit
Replace System.exit(-1) with exceptions in HighGui.java (#28696) #28699

## Summary

Library code should never call System.exit() as it kills the entire JVM. Replaced all 3 instances with appropriate exceptions.

Closes #28696

## Changes

- `imshow()` with empty image: `System.exit(-1)` -> `throw new IllegalArgumentException("Image is empty")`
- `waitKey()` with no windows: `System.exit(-1)` -> `throw new IllegalStateException("No windows created. Call imshow() first")`
- `waitKey()` with null window image: `System.exit(-1)` -> `throw new IllegalStateException("No image set for window: ... Call imshow() first")`
- `InterruptedException` catch: `printStackTrace()` -> `Thread.currentThread().interrupt()`
2026-03-23 16:20:50 +03:00
Maksim Shabunin e44e3ab0a7 build: raise min cmake version to 3.13 in other places 2024-10-30 14:39:04 +03:00
Corentin Noël da078c4b75 highgui: Make GThread mandatory with GTK
The GThread API is available since more than 11 years with GLib, it is now safe
to assume that it is always available.
2024-07-15 16:30:39 +02:00
sepperliu 45587f23db Update highgui+HighGui.java
toBufferedImage
Modifying the original array copying method here can double the speed.
2024-04-03 13:29:10 +03:00
Alexander Alekhin 327109f327 highgui: update backends handling, fix WITH_OPENGL=ON build 2021-06-07 11:28:05 +00:00
Alexander Alekhin fb9a00c36d highgui: cleanup and fixes 2021-05-31 17:03:53 +00:00
Alexander Alekhin 70f69cb265 highgui: backends and plugins 2021-05-24 16:12:02 +00:00
Alexander Alekhin 1237faef80 java: disable highgui wrapped code 2018-01-13 02:12:39 +00:00
Vitaly Tuzov 51cb56ef2c Implementation of bit-exact resize. Internal calls to linear resize updated to use bit-exact version. (#9468) 2017-12-13 15:00:38 +03:00
tribta 6512a4b7e3 OpenCV Java Highgui Class
The objective is to:

    *Reduce greatly the number of lines of code in the Java codes;
    *Make it easy for Java users to add a trackbar and show the results;
    *Get the code more similar between C++, Java and Python, making the tutorials more uniform.
2017-07-01 11:07:20 +01:00
abratchik 037d8fbdcd Refactor OpenCV Java Wrapping 2017-06-15 20:35:12 +04:00