Ask Your Question
1

How can I resize an image with OpenCV ?

asked May 3 '13

hor gravatar image

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

Preview: (hide)

3 answers

Sort by » oldest newest most voted
10

answered May 3 '13

Qichao Chen gravatar image

updated May 3 '13

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

Preview: (hide)
3

answered May 3 '13

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.

Preview: (hide)
1

answered May 3 '13

NightLife gravatar image

updated May 3 '13

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;

}

Preview: (hide)

Question Tools

Stats

Asked: May 3 '13

Seen: 356,635 times

Last updated: May 03 '13