Tinkering with OpenCV, stumped.

I am a complete beginner in every sense of the word but have a tendency to learn better on projects rather than tinkering with calculators and 'hello world' type stuff. I recently started using Orielly 'Learning OpenCV' and working through the examples in the book and I am now getting to the point where some previous knowledge would be useful to fill in the blanks. I am working on Example 2-5 in the book, the objective is to take an image and scale it down. The book has given me the 'new' functions but has left out the rest of the necessary logic to complete the task. I am getting better at filling in the blanks but this one has me stumped. I think it is more of a general coding error more so than an OpenCV error.

I am working on Windows 7, VS2010 and OpenCV 2.4.2. Any help would be greatly appreciated.

#include "stdafx.h"
#include "cv.h"
#include "cxcore.h"
#include "highgui.h"

int main(int argc, char** argv){
IplImage* in=cvLoadImage ("D:\\sample.JPG");
cvNamedWindow("Example5-in");
cvNamedWindow("Example5-out");
cvShowImage("Example5-in", in);
IplImage* doPyrDown(IplImage* in, int filter = IPL_GAUSSIAN_5x5);{
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);
}
cvWaitKey(0);
cvReleaseImage(&in);
cvReleaseImage(&out);
}
Honestly, if you are total begginer it is very, very wise to 'tinker' with calculators before jumping into a more complex project. If you dont know the C++ well then you wont go far with such projects
Topic archived. No new replies allowed.