CvRect r=cvRect(0,0,100,100);
cvSetImageROI(sourceimg,r); // size of sourceimg:100x100,now
CvMat *sub=cvCreateMat(r.x,r.y,sourceimg->depth); // r.width, r.height here?07/28/05
//get sub-image in variable sub
cvGetSubRect(sourceimg,sub,r);
//pass that sub variable to an IplImage (extract the sub image from
sourceimg)
IplImage *res=cvGetImage(sub,sourceimg);
//to align correctly (vertical flip)
res->origin=1;
No comments:
Post a Comment