View Single Post
Old May 14th, 2007, 10:38 AM   #1
Phanixis
Newbie
 
Join Date: May 2007
Posts: 6
Rep Power: 0 Phanixis is on a distinguished road
OpenCV Help Needed: Can't use the keyboard while running cvcamSetPropetry

If there are any OpenCV experts out there, I could use some help.

I am attempting to modify some C++ code that uses the OpenCV library for image processing. The majority of the code is run within a loop, but the loop is not formed from a traditional control structure such as 'for' or 'while', but from the command cvcamSetProperty(0, CVCAM_PROP_CALLBACK, code).

Essentially, cvcamSetPropetry(0, CVCAM_PROP_CALLBACK, code) continually reads images from a firewire camera attached to the computer, and then sends those images to the function 'code' to be analyzed. This loop will run indefinitely until a press any key other then the function keys.

The problem is that I need to be able to use keyboard inputs to alter the code's operation while cvcamSetProperty is running. I want to set the code up such that when I press a given key on the keyboard, the code 'code' will write to a file I have already opened. The problem is, cvcamSetProperty will automatically terminate the loop as soon as I attempt to use the keyboard for that purpose, as the loop terminates as soon as any key is pressed(other than the function keys).

Is there any way in which I can alter the operation of cvcamSetProperty(0, CVCAM_PROP_CALLBACK, code) so that it will only terminate when a specific key is pressed, as opposed to any key. Or baring that, it there any way I can get C++ to detected a function key as an input.

Thanks for the help.
Phanixis is offline   Reply With Quote