Hi d_stranz,
thank you very much for your response! I changed my code as you wrote. Hope it is correct now. At least it works and I'am really happy =)
Cheers,
Saul
By the way: the program will not execute the break command if I press ESC.
void Webcam::showWebcam()
{
IplImage *image;
CvCapture *capture;
capture = cvCaptureFromCAM(0);
int esc = 0;
while(true)
{
image = cvQueryFrame(capture);
cvCvtColor(image, image,CV_BGR2RGB);
QImage qimg
((const uchar
*)image
->imageData, image
->width, image
->height,
QImage::Format_RGB888);
ui.
label->setPixmap
(QPixmap::fromImage(qimg
));
ui.label->update();
esc = cvWaitKey(10);
if (esc == 27) break;
}
cvReleaseCapture(&capture);
}
void Webcam::showWebcam()
{
IplImage *image;
CvCapture *capture;
capture = cvCaptureFromCAM(0);
int esc = 0;
while(true)
{
image = cvQueryFrame(capture);
cvCvtColor(image, image,CV_BGR2RGB);
QImage qimg((const uchar *)image->imageData, image->width, image->height, QImage::Format_RGB888);
ui.label->setPixmap(QPixmap::fromImage(qimg));
ui.label->update();
QCoreApplication::processEvents();
esc = cvWaitKey(10);
if (esc == 27) break;
}
cvReleaseCapture(&capture);
}
To copy to clipboard, switch view to plain text mode
Bookmarks