Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

@berak's right. Don't mix OpenCV GUI with multithreading.

As a solutionI suggest to create a QWidgets application with a label and a button.

In the FrameImageReady function transform the FrameImage variable to QImage variable, than to QPixmap and display it on the label control (ui->label1.setPixmap(...)). Search the forum for tramsforming Mat to QImage.

Use the button control's clicked function to pause the process (cam->setButtonPause(!(getButtonPause()));).

Handling keypresses is OS dependent, so I suggest to avoid it if possible. If you still want to use it, here are some methods how to do it.