Plz Help! Can not debug grogram
Dear pros, i'm the beginner in studying OPENCV. I got stuck in this beginning program, it could not debugged by OPENCV2.4.5.
Pls help me to figure it out. Many thanks.
#include <highgui.h>
#include <stdio.h>
#include <cv.h>
#include <assert.h>
IplImage* doPyrDown(
IplImage* in,
int filter
)
{
assert(in->width%2 == 0 && in->height%2 == 0);
IplImage * out = cvCreateImage(
cvGetSize(in),
IPL_DEPTH_8U,
3
);
cvPyrDown( in, out);
return(out);
}
void main() {
int filter = IPL_GAUSSIAN_5x5;
IplImage* in = cvLoadImage("F:\\chandung.png");
cvNamedWindow( "Example-in");
cvNamedWindow( "Example-out");
IplImage* out = doPyrDown(in, filter);
cvShowImage( "Example-in", in);
cvShowImage( "Example-out", out);
cvReleaseImage( &out);
cvWaitKey( 0);
cvDestroyWindow( "Example-in");
cvDestroyWindow( "Example-out");
}
When i run it, this error exists:
When i debugged it, errors exists while executing CANNY edge detection function. Following is the screenshot that illustrates the issue:
Thank you. However, i have not gotten the picture. What do you mean by "NEWER C++ STYLE API" ? It is for example new version of Visual Studio or other environment such as Eclipse, right?
No word can say my appreciation to you, pros. Could you please give me some advice about learning OPENCV with this new C++ API ( such as book, or tutorial for the beginner? - the tutorial on docs.Opencv seems to be too hard to catch up with). Recently, i have been learning "OPENCV- computer vision with the OPENCv libarary" by Gary Bradski & Adrian Kaebler which relies on C-API.
Copied data to my own answer ;) - comments removed -