What is the purpose of keypressed=cv2.waitkey(1)&OxFF

I do undertstand how we are converting a 32 but integer to a 8 bit integer , but i dont understand its purpose

Basically while working with projects like face recognition we use while(True) which means infinite loop, so to come out from loop using break statement, so we used waitkey(1) means the programme will wait for 1ms and if user pressed any key and that key ==‘q’ than the programme will come out of while loop and programme will stop.

Hope this helped :blush: