How I can adapt this code to opencv 3.0.0

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

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

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);
tmpImg->=m_pcImageMemory

thanks in advance

edit retag flag offensive close merge delete

Comments

tmpImg.data=m_pcImageMemory; but what is m_pcImageMemory? How did you allocated it?

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

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 -0600 )edit

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

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