Converting from IplImage* to cv::Mat

asked 2013-01-07 03:50:11 -0500

thomas11 gravatar image

Dear all, I have OpenCV image, get the image data from the Queue.

IplImage *opcvImg = cvCreateImage(cvSize(col_size, row_size), IPL_DEPTH_8U,1); opcvImg = ImageQueue::getQueue(); Upto here, in the watch window I can see that opcvImg has all information.

But when I convert the IplImage* to cv::Mat as Mat matData(opcvImg, true); OR Mat matData = cvarrToMat(opcvImg); matData in the watch window shows Unavailable syschronous data.

Let me put in some more information, actually the code runs in a separate thread as follow

void processingbyWatershed::run() { IplImage *opcvImg = cvCreateImage(cvSize(col_size, row_size), IPL_DEPTH_8U,1);

while(1)
{

    if(!ImageQueue::isEmpty())
    {
         opcvImg = ImageQueue::getQueue();
        Mat original(opcvImg, true);
        //Mat original = cvarrToMat(opcvImg);
    }
}

}

What could be the problem? Thanks

edit retag flag offensive close merge delete