How to make a simple window with one button using OpenCV HighGui only?

前端 未结 4 1497
日久生厌
日久生厌 2021-01-12 06:25

I am working on a game-project using OpenCV. Now I have to make a simple GUI: a window with one button, using HighGui only.

I\'m not sure but I think I\'m supposed t

4条回答
  •  有刺的猬
    2021-01-12 07:20

    You can now create buttons and other useful tools on OpenCV windows. The page below shows a couple of useful examples.

    https://docs.opencv.org/master/dc/d46/group__highgui__qt.html

    The gist of it is:

    #include 
    void myButtonName_callback(int state, void*userData) {
        // do something
        printf("Button pressed\r\n");
    }
    createButton("myButtonName",myButtonName_callback,NULL,CV_PUSH_BUTTON,1);
    

提交回复
热议问题