Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

change the Height and Width of the image

include "opencv2/opencv.hpp"

include "opencv2/objdetect/objdetect.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc_c.h"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

IplImage* doPyrDown(IplImage* in,int filter = IPL_GAUSSIAN_5x5) { // Best to make sure input image is divisible by two. assert( in->width%2 == 0 && in->height%2 == 0 ); IplImage* out = cvCreateImage(cvSize( in->width/2, in->height/2 ),in->depth,in->nChannels); cvPyrDown( in, out ); return( out ); }

int main( int argc, char* argv[]) { IplImage* img = cvLoadImage( argv[1],1);//load the image and 1 for color image cvNamedWindow( "Display", CV_WINDOW_AUTOSIZE );//Create and Name the window

doPyrDown(img,0);

cvShowImage( "Display",img);//Display the image cvWaitKey(0);//wait until user hits a key,if number is +ve then that much milli seconds image will wait to be closed cvDestroyWindow( "Display" );//Destroy and De-allocate memory }

hi i got "sample.cpp:15:47: error: ‘IPL_GAUSSIAN_5x5’ was not declared in this scope" while compiling...please help me to get output...

click to hide/show revision 2
the "101010" button is your friend !

updated 2013-06-05 01:20:29 -0600

berak gravatar image

change the Height and Width of the image

include "opencv2/opencv.hpp"

#include "opencv2/opencv.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"
#include "opencv2/imgproc/imgproc.hpp"
 #include <iostream>
#include <stdio.h>
 

include "opencv2/objdetect/objdetect.hpp"

include "opencv2/highgui/highgui.hpp"

include "opencv2/imgproc/imgproc_c.h"

include "opencv2/imgproc/imgproc.hpp"

include <iostream>

include <stdio.h>

using namespace std; using namespace cv;

cv;

IplImage* doPyrDown(IplImage* in,int filter = IPL_GAUSSIAN_5x5) { // Best to make sure input image is divisible by two. assert( in->width%2 == 0 && in->height%2 == 0 ); IplImage* out = cvCreateImage(cvSize( in->width/2, in->height/2 ),in->depth,in->nChannels); cvPyrDown( in, out ); return( out ); }

}

int main( int argc, char* argv[]) { IplImage* img = cvLoadImage( argv[1],1);//load the image and 1 for color image cvNamedWindow( "Display", CV_WINDOW_AUTOSIZE );//Create and Name the window

window doPyrDown(img,0);

doPyrDown(img,0);

cvShowImage( "Display",img);//Display the image cvWaitKey(0);//wait until user hits a key,if number is +ve then that much milli seconds image will wait to be closed cvDestroyWindow( "Display" );//Destroy and De-allocate memory }

}

hi i got "sample.cpp:15:47: error: ‘IPL_GAUSSIAN_5x5’ was not declared in this scope" while compiling...please help me to get output...