Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

since the image from the webcam usually points to static memory inside the capture, you will have to clone() it, and thus work on a 'deep copy':

cv::Mat Camera::getWebcamFrame(){
    Mat camFrame, videoFrame;

    myMutex.lock();
     myWebcam.read(camFrame);
     videoFrame = camFrame.clone();
    myMutex.unlock();

    return videoFrame;
}