Ask Your Question
1

How can I resize an image with OpenCV ?

asked 2013-05-03 00:55:19 -0600

hor gravatar image

Hi I am looking for a way to resizing an image in OpenCV? What is the simplest way to do it?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
10

answered 2013-05-03 13:15:34 -0600

Qichao Chen gravatar image

updated 2013-05-03 13:18:35 -0600

if you use opencv2,you can do like this:

Size size(100,100);//the dst image size,e.g.100x100
Mat dst;//dst image
Mat src;//src image
resize(src,dst,size);//resize image

edit flag offensive delete link more
3

answered 2013-05-03 01:34:11 -0600

Siegfried gravatar image

Hi. Take a look at the resize function in the OpenCV documentation. It contains a description of the function and a small example.

edit flag offensive delete link more
1

answered 2013-05-03 01:02:05 -0600

NightLife gravatar image

updated 2013-05-03 01:03:25 -0600

You can use it to resize the image:

IplImage* resizing (IplImage *source) {

IplImage *destination = cvCreateImage ( cvSize(Your favourite width , Your favourite height ), source->depth, source>nChannels );


cvResize(source, destination);

return destination;

}

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-05-03 00:55:19 -0600

Seen: 356,501 times

Last updated: May 03 '13