人脸识别中截取面部的实现方法
void GetImageRect(IplImage* orgImage, CvRect rectInImage, IplImage* imgRect,double scale) { //从图像orgImage中提取一块(rectInImage)子图像imgRect IplImage *result=imgRect; CvRect size; size.x=rectInImage.x*scale; size.y=rectInImage.y*scale; size.width=rectInImage.width*scale; size.height=rectInImage.height*scale; //result=cvCreateImage( size, orgImage->depth, orgImage->nChannels ); //从图像中提取子图像 cvSetImageROI(orgImage,size); cvCopy(orgImage,result); cvResetImageROI(orgImage); } 此网站为英文页面, 是否需要翻译?×不再翻译此网站人工翻译
脑子是空的不要紧,主要是不要进水······