I have these two statement in the end of my python program:
cv2.waitKey(0)
cv2.destroyAllWindows()
Somehow cv2.waitKey(0) not working, no response to keyboard input 0, to end my program I had to close my Mac terminal window.
I tried the following to fix the problem
if cv2.waitKey(0) & 0xFF == ord('q'):
break
then I got this message: SyntaxError: 'break' outside loop
Not sure what's wrong. I am using a Macbook Air, Mac OS X 10.11.6 Please help.
Thanks