Ask Your Question

Revision history [back]

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: image description

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: exists: image description


When i debugged it, errors exists while executing CANNY edge detection function. Following is the screenshot that illustrates the issue:

image description