This is what I posted on Upwork :
When I try (as in the free openCV crash course on YouTube @ 20 minutes)
window1 = cv.namedWindow("w1")
cv.imshow(window1, cb_img )
cv.waitKey(8000)
cv.destroyWindow(window1)
Jupyter hangs for about 8 seconds and then I can use it again. (There is no window opening/open. That is the problem I am trying to solve. Please don't tell me to close the window :)
If I try :
cv.imshow("test", cb_img )
cv.waitKey(0)
cv.destroyAllWindows()
It hangs forever.
I am on WSL2 (Ubuntu on Windows 10 through Windows Subsystem for Linux)
FYI, I WAN'T to use cv2's imshow. Please don't tell me to use pyplot's imshow. Pyplot's imshow is working perfectly.
What was going on? The window was opening, but it was behind other windows. There were two windows being launched - one tiny (relatively) useless blank one with "w1" in its title that caused me to hard close it umpteen times (thereby also causing the Jupyter kernel to restart) and the one that showed the checkerboard. The destroyWindow(window1) was only taking out the latter.
Comments
Post a Comment