前言
IplImage在4.0版本中对应的操作函数大多被废弃,例如cvCreateImage,所以如果需要使用目前在3.0版本上测试通过
当前以对接虹软SDK的例子为例子简单说明
//裁剪图片
void CutIplImage(IplImage* src, IplImage* dst, int x, int y)
{
CvSize size = cvSize(dst->width, dst->height);//区域大小
cvSetImageROI(src, cvRect(x, y, size.width, size.height));//设置源图像ROI
cvCopy(src, dst); //复制图像
cvResetImageROI(src);//源图像用完后,清空ROI
}
IplImage* img1 = cvLoadImage("F:/2-123.jpg");
IplImage* cutImg1 = cvCreateImage(cvSize(img1->width - img1->width % 4, img1->height), IPL_DEPTH_8U, img1->nChannels);
CutIplImage(img1, cutImg1, 0, 0);
ASVLOFFSCREEN offscreen1 = { 0 };
offscreen1.u32PixelArrayFormat = ASVL_PAF_RGB24_B8G8R8;
offscreen1.i32Width = cutImg1->width;
offscreen1.i32Height = cutImg1->height;
offscreen1.pi32Pitch[0] = cutImg1->widthStep;
offscreen1.ppu8Plane[0] = (MUInt8*)cutImg1->imageData;
res = ASFDetectFacesEx(handle, &offscreen1, &detectedFaces1);
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。