0

i used to display a usb camera capture from a second window (not main) and the window opened with ocv.imshow is not closed with ocv.destroywindow(name).

Here is the code which works from the main window :

cap = ocv.VideoCapture(0)
if(cap.isOpened()):
    while(cap.isOpened()):
        # Capture frame-by-frame
        ret, the_frame = cap.read()
        if ret==True:
             ocv.imshow('frame',the_frame)              
        if ocv.waitKey(10) & 0xFF == ord('q'): #if (ocv.waitKey(5) != -1):
            cap.release()
            ocv.destroyWindow('frame') #destroyAllWindows()#
            break
else:
   print("No Usb Cam.")

Thanks for help,

frlan
  • 6,950
  • 3
  • 31
  • 72
  • Maybe this could help http://stackoverflow.com/questions/6116564/destroywindow-does-not-close-window-on-mac-using-python-and-opencv – Titanoboa Jul 28 '16 at 10:54
  • I already red that, but i think my problem is to want to destroyWindow from another windows. From the main, it works, as well as under windows with eclipse. – Christophe M. Jul 28 '16 at 15:31

0 Answers0