Using other keys for the waitKey() function of opencv

前端 未结 11 709
天涯浪人
天涯浪人 2020-11-29 19:16

I\'m working on a program (python ,opencv) in which I use the spacebar to go to the next frame, and Esc to exit the program. These are the only two

11条回答
  •  庸人自扰
    2020-11-29 19:39

    If you want to pause the program to take screenshots of the progress

    (shown in let's say cv2.imshow)

    cv2.waitKey(0) would continue after pressing "Scr" button (or its combination), but you can try this

    cv2.waitKey(0)
    input('')
    

    cv2.waitkey(0) to give the program enough time to process everything you want to see in the imshow and input('')

    to make it wait for you to press Enter in the console window

    this works on python 3

提交回复
热议问题