Ask Your Question

Reducing the cv::Mat size

asked 2012-09-21 11:51:08 -0500

Thomas_N gravatar image

updated 2019-01-19 12:42:00 -0500

If i use the image, the image size can be reduced as follow

int scale = 2;  
IplImage *small_image = cvCreateImage(cvSize(image->width/scale,image->height/2), IPL_DEPTH_8U, 3);  
cvPyrDown(image, small_image, CV_GAUSSIAN_5x5);

But now my image data is in cv::Mat matrix. How can I reduce the matrix size to have the same effect as in the above discussion?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2012-09-25 10:48:38 -0500

Kirill Kornyakov gravatar image

My guess is that you can do this by a single call:

pyrDown(image, small_image);

Check pyrDown documentation for more information.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2012-09-21 11:51:08 -0500

Seen: 1,019 times

Last updated: Sep 25 '12