Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hansalemaos/a_cv2_imshow_thread
Solution for the "window - not responding" problem with cv2.imshow()
https://github.com/hansalemaos/a_cv2_imshow_thread
cv2 imshow opencv python
Last synced: 18 days ago
JSON representation
Solution for the "window - not responding" problem with cv2.imshow()
- Host: GitHub
- URL: https://github.com/hansalemaos/a_cv2_imshow_thread
- Owner: hansalemaos
- License: mit
- Created: 2022-10-16T02:34:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-16T02:35:52.000Z (about 2 years ago)
- Last Synced: 2024-10-10T17:42:36.956Z (about 1 month ago)
- Topics: cv2, imshow, opencv, python
- Language: Python
- Homepage: https://pypi.org/project/a-cv2-imshow-thread
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
### Solution for the "window - not responding" problem with cv2.imshow()
```python
pip install a-cv2-imshow-thread
``````python
Usage:import glob
import os
from a_cv2_imshow_thread import add_imshow_thread_to_cv2
add_imshow_thread_to_cv2() #monkey patching
import cv2
image_background_folder=r'C:\yolovtest\backgroundimages'
pics=[cv2.imread(x) for x in glob.glob(f'{image_background_folder}{os.sep}*.png')]
cv2.imshow_thread( image=pics[0], window_name='screen1',sleep_time=None, quit_key='q') #single picture
cv2.imshow_thread( image=pics, window_name='screen1',sleep_time=.2, quit_key='e') #sequence of pics like a video clipParameters:
image: Union[list, np.ndarray]
You can pass a list of images or a single image
window_name: str
Window title
(default = "")
sleep_time: Union[float, int, None] = None
Useful if you have an image sequence.
If you pass None, you will have to press the quit_key to continue
(default = None)
quit_key: str = "q"
key to close the window
Returns:
None
```