-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Description
System Information
opencv: 4.10.0
os: debian 12
python 3.12.7
Detailed description
Expected behaviour:
an overlay should be displayed atop an image and then disappear after delayms has timed out but doesn't.
Also, displayStatusBar doesn't appear to set any text on the window.
Actual:
the overlay appears but doesn't disappear unless a mouse move event happens on the image
Workaround / fix
I have to send a flag to namedWindow, either cv2.WINDOW_GUI_EXPANDED or cv2.WINDOW_NORMAL and call displayStatus bar and set the same timeout value, to get the overlay to disappear without the mouse move event needed.
Presumably this method must be calling something that displayOverlay doesn't.
If I use different timeout values in the two method calls, the overlay doesn't disappear.
Steps to reproduce
For example, this code should display an image, display an overlay for 1.5s and then disappear.
import cv2
im = cv2.imread('foo.png')
cv2.namedWindow('asdf', cv2.WINDOW_GUI_EXPANDED)
cv2.imshow('asdf', im)
cv2.displayOverlay('asdf', 'look at this overlay!', 1500)
cv2.waitKey(0)The overlay appears but doesn't vanish unless I move the mouse cursor across the image.
The overlay disappears with the addition of the displayStatusBar call:
import cv2
im = cv2.imread('foo.png')
cv2.namedWindow('asdf', cv2.WINDOW_GUI_EXPANDED)
cv2.imshow('asdf', im)
cv2.displayOverlay('asdf', 'look at this overlay!', 1500) # the timeout values must be the same between the two calls
cv2.displayStatusBar('asdf', 'asdf', 1500) # doesn't appear to set any text in status bar neither
cv2.waitKey(0)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)