Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

if you got qt support, you could use that.

if all you need is to "click", maybe a simple mousehandler does the trick:

void onmouse( int event, int x, int y, int d, void *p )
{
     bool *trigger = (bool*)p;
     *trigger = (event && d);
}

int main()
{
    VideoCapture cap(0);
    Mat frame; 
    namedWindow("processed", 1);
    bool trigger = false;
    cv::setMouseCallback( "video", onmouse, &trigger );
    for(;;) {
        cap >> frame;
        if(frame.empty()) break;
            if ( trigger )
            {
                // your code here ..
            }
        imshow("video", frame);
        if(waitKey(30) >= 0) break;
    }   
    return 0;
}