Hey, so I have a setup with my webcam working, except that the conversion from cv::Mat to QImage is pretty slow.
QImage VideoReader
::getFrame() { Mat frame;
cap >> frame;
QImage image
= QImage((uchar
*)frame.
data, frame.
cols, frame.
rows, frame.
step,
QImage::Format_RGB888);
return image;
}
QImage VideoReader::getFrame() {
Mat frame;
cap >> frame;
QImage image = QImage((uchar*)frame.data, frame.cols, frame.rows, frame.step, QImage::Format_RGB888);
return image;
}
To copy to clipboard, switch view to plain text mode
Grabbing the frame from the camera only takes around 5 milliseconds, but the conversion to QImage takes around 15. Is there any way to cut down on this time?
Bookmarks