Ask Your Question
0

Resizing Image

asked 2013-01-29 03:21:57 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Does anyone know how I can resize my image to the exact size by OpenCV( Decreasing resolution)? thanks for help

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
4

answered 2013-01-29 03:28:40 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >50 is welcome to improve it.

Hi. You can use resize function. The documentation contains a small example on how to use it.

edit flag offensive delete link more
1

answered 2013-01-29 03:37:03 -0500

updated 2013-01-29 03:37:42 -0500

Another solution for decreasing resolution is pyrDown.

edit flag offensive delete link more
0

answered 2013-06-18 08:52:14 -0500

Anishu89 gravatar image

updated 2013-06-18 08:53:28 -0500


I hope this helps :)
#include <stdio.h>
#include "cv.h"
#include "highgui.h" int main() {

    IplImage *img=NULL; //pull picture in //for reading image
    img=cvLoadImage("test.jpg"); //image path, put in the proj folder
    IplImage *smallImage=cvCreateImage(cvSize(50,50),img->depth,img->nChannels);
    IplImage *largeImage=cvCreateImage(cvSize(256,256),img->depth,img->nChannels);
    cvShowImage("Test",img);// put it on top
    cvResize(img,smallImage);
    cvResize(img,largeImage);
    cvShowImage("Large",largeImage);
    cvShowImage("Small",smallImage); cvWaitKey(0); cvReleaseImage(&img); return 0; }

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-01-29 03:21:57 -0500

Seen: 469 times

Last updated: Jun 18 '13