I\'m trying understand what 0xFF does under the hood in the following code snippet:
if cv2.waitKey(0) & 0xFF == ord(\'q\'):
break
A
cv2.waitKey() is the function which bind your code with keyboard and any thing you type will be returned by this function. output from waitKey is then logically AND with 0xFF so that last 8 bits can be accessed. Therefore last 8 bit represent input from keyboard and this is compared using == with the character you want.