cvSetData( pImgEmbed, data, m_width ) doesn't work! Anybody Help!
IplImage* gray;
BYTE* data;
int m_width;
int m_height;
IplImage * pImgEmbed = NULL;
char*filename=argc==2?argv[1]:(char*)"14.bmp";
gray=cvLoadImage(filename,0);
data=(uchar *)gray->imageData;
m_width=gray->width;
m_height=gray->height;
pImgEmbed=cvCreateImageHeader(cvSize(m_width, m_height), IPL_DEPTH_8U, 1);
cvSetData( pImgEmbed, data, m_width );
Now ,I think pImgEmbed is a IplImage image ,but I can't use
cvNamedWindow("window");
cvShowImage("window", pImgEmbed);
to show it,Why?