I'm trying to show images with cv2 library in my Jupiter Notebook with cv2.imshow(img)
and it shows as expected, but I can not use or don't know how to use cv2.waitKey(0)
, hence the cell will not stop executing.
cv2.waitKey(0)
works in script, but not in Notebook.
Here's a snippet:
cv2.imshow('Image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
How do I stop executing cell without restarting the whole kernel?
So, thanks to @Micka, here's the solution:
You must write cv2.startWindowThread()
first, explained here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With