Home > other >  Ubuntu16.04 opencv create window display pictures can't close the window
Ubuntu16.04 opencv create window display pictures can't close the window

Time:10-11

Ubuntu16.04 after installation opencv3.1 test program, procedures are as follows:
 
The import cv2

Img=cv2. Imread (18. PNG, 0)
Print (img. Shape)
Canny=cv2. Canny (img 50150)
Print (canny. Shape)

Cv2. Imshow (" canny ", canny)
Cv2. WaitKey (0)
Cv2. Imwrite (' test. PNG, img)
Cv2. DestroyAllWindows ()


Can print out two shape, can display the image, open the window to normal imwrite, but can't normally closed the window, close the window after the show:


Erro tip for:


Because not familiar with the system, ubuntu has been to find the cause of the error, forget the great god,

CodePudding user response:

Waitkey (0), should click on esc to exit, click exit no.
  • Related