Thursday, May 7, 2009

OpenCV#5: Copy a portion from an image

1. set an ROI in the source image

cvSetImageROI( img_src, cvRect roi );

2. create a new image with the same size as the ROI

IplImage* img_dst = cvCreateImage( cvSize( roi.width, roi.height ), IPL_DEPTH_8U, 1 );

3. copy the portion from the source image to destination image

cvCopy( img_src, img_dst );

No comments:

Post a Comment

Followers