Opencv_how to catch event
How to catch event keyboard when i keypress on cvNamedWindow in opencv
How to catch event keyboard when i keypress on cvNamedWindow in opencv
use cvWaitKey function:
cvNamedWindow("window")
for(;;)
{
char key = (char) cvWaitKey(10);
if (key == 27 /*escape*/)
break;
}
And to add to this, if you add cvWaitKey(0) then it will wait forever on a single key. Do know that the function can only exist if at least a single namedWindow is defined in your code.
Asked: 2013-04-05 04:54:03 -0600
Seen: 219 times
Last updated: Apr 05 '13
Area of a single pixel object in OpenCV
build problems for android_binary_package - Eclipse Indigo, Ubuntu 12.04
OpenCV DescriptorMatcher matches
Can't compile .cu file when including opencv.hpp
Using OpenCV's stitching module, strange error when compositing images
compile error in opencv2/flann/lsh_table.h when compiling bgslibrary