I have seen in THIS openCV example that they use
if cv2.waitKey(1) & 0xFF == ord('q'):
to check if the user pressed the character 'q'
Why are they doing the & 0xFF
part?
If you have a bit x
and you do x AND 1
the bit remains the same. So doing an AND
to all ones (0xFF) would keep the result the same.
Why is it done then?