How I can adapt this code to opencv 3.0.0

asked 2015-05-26 04:06:38 -0500

spinter696 gravatar image
IplImage* tmpImg=cvCreateImageHeader(cvSize(imX,imY),IPL_DEPTH_8U,1);

I tried a lot but I am not able to adapt correctly the code

this is the last one I have

Mat tmpImg = Mat(imX,mY,CV_8U,1);

thanks in advance

edit retag flag offensive close merge delete

Comments; but what is m_pcImageMemory? How did you allocated it?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-05-26 04:15:41 -0500 )edit

you probably wanted:

Mat img(imY, imX, CV_8U, m_pcImageMemory); // note, it's rows,cols in opencv
berak gravatar imageberak ( 2015-05-26 04:23:15 -0500 )edit

Thanks berak, failing in the last variable..... solved

spinter696 gravatar imagespinter696 ( 2015-05-26 05:30:06 -0500 )edit