Hi
In this video instructor has used a command ‘0xFF’ to convert 32 bit number into 8 bit, so what’s the need for that ?
Following is command as told by instructor:
key_pressed=cv2.waitKey(1) & 0xFF
Reason to convert number into 8 bit
Hey @pasta, its because ord(‘q’) = 8 bit ascii code of ‘q’. When we use cv2.waitKey(1) it returns 32 bit long integer, and so we just want to compare last 8 bits to that of ord(‘q’).
Hope this resolved your doubt.
Plz mark the doubt as resolved in my doubts section.