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,