Using other keys for the waitKey() function of opencv

前端 未结 11 704
天涯浪人
天涯浪人 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:38

    For C++:

    In case of using keyboard characters/numbers, an easier solution would be:

    int key = cvWaitKey();
    
    switch(key)
    {
       case ((int)('a')):
       // do something if button 'a' is pressed
       break;
       case ((int)('h')):
       // do something if button 'h' is pressed
       break;
    }
    

提交回复
热议问题