Ask Your Question
1

How to actualize windows events without cvWaitKey

asked 2013-11-08 10:21:08 -0600

Elliott gravatar image

Hello,

I read on this page than cvWaitKey has two actions :

  1. It waits for x milliseconds for a key press. If a key was pressed during that time, it returns the key's ASCII code. Otherwise, it returns -1.

  2. It handles any windowing events, such as creating windows with cv::namedWindow(), or showing images with cv::imshow()..

I have to use cvWaitKey to execute the second action, but I don't want the first (I've a multithreaded program and it's taking the input focus, which I don't want).

Is there a function to execute only the second action ? The thread can wait with a usleep.

Thanks for your help,

Best regards

edit retag flag offensive close merge delete

Comments

you could go down as far as waitKey(1); but if you still don't like the outcome, might change to Qt ui

berak gravatar imageberak ( 2013-11-08 15:57:50 -0600 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2013-11-08 15:18:34 -0600

Davinci gravatar image

updated 2013-11-08 15:18:51 -0600

There is an answer listed here: http://stackoverflow.com/questions/18701236/cvwaitkey-slowing-capture-process-significantly-workaround

But you can also use a very short time.

edit flag offensive delete link more
0

answered 2013-11-12 02:54:00 -0600

Elliott gravatar image

Thank you for your help.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-11-08 10:21:08 -0600

Seen: 960 times

Last updated: Nov 12 '13