Tuesday, December 29, 2009

Python & OpenCV: How to crop images

cropped = cvCreateImage( cvSize(new_width, new_height), 8, 3)
src_region = cvGetSubRect(image, opencv.cvRect(left, top, new_width, new_height) )
cvCopy(src_region, cropped)

Reference:

No comments:

Post a Comment