Thursday, September 29, 2005

IPP images in OpenCV

#include "stdafx.h"
#include "ipp.h"
#include "cv.h"
#include "highgui.h"
#include

int _tmain(int argc, _TCHAR* argv[])
{
FILE *fp;
IppiSize size = {500, 400};
int stride;
Ipp8u* pSrc = ippiMalloc_8u_C3(size.width, size.height, &stride);
ippiImageJaehne_8u_C3R(pSrc, stride, size);
IplImage *img = cvCreateImage( cvSize(size.width, size.height), 8, 3 );
for (int y=0; yimageData + img->widthStep*y))[x*3] = pSrc[y*stride + 3*x];
((uchar*)(img->imageData + img->widthStep*y))[x*3+1] = pSrc[y*stride + 3*x + 1];
((uchar*)(img->imageData + img->widthStep*y))[x*3+2] = pSrc[y*stride + 3*x + 2];
}
}
cvNamedWindow("img", 1);
cvShowImage("img", img);
cvWaitKey(0);
return 0;}


//?? how is R G B?

No comments:

Post a Comment