Odd and difficult problem with cv::waitKey()

For what it is worth, I figured out a work around.

Passing memory variables (memvars) from the streamCamera thread to the main thread to do any highgui stuff worked because, by definition, when streamCamera needed to imshow or whatever, the main thread was in a looping mode and could catch and process them… However, that was not working for the frameGrab thread since that was running constantly as long at the camera was on and, if the main thread happened to be out of it’s looping mode, the passed memvars would not have a means to be processed.

Basically what I had to do was to start a separate thread from the main thread at the time the camera was started so that it is looping all of the time the camera is on. I use that thread to catch and process the memvar from the frameGrab thread.

It works but I still can’t figure out why the frameGrab thread needs a waitKey to begin with. Oh well…all’s well that ends well.

Ed