# Revision history [back]

your program seems to want the image-name as an argument to the cmdline.

(no idea, how to supply that in eclipse, i'm not using it. but did you try running your prog from the console, and actually supply an image name [like "myprog.exe lena.jpg"] ? )

but to make your prog more safe against the absence of args:

int main( int argc, char **argv )
{
if ( argc<2 ) // check, if there's args at all
{             // i think, your prog crashes, because you're using argv[1], and there's no such thing
return -1;
}
if ( image.empty() )
{
return -1;
}

...


your program seems to want the image-name as an argument to the cmdline.

(no idea, how to supply that in eclipse, i'm not using it. but did you try running your prog from the console, and actually supply an image name [like "myprog.exe lena.jpg"] ? )

but to make your prog more safe against the absence of args:

int main( int argc, char **argv )
{
if ( argc<2 ) // check, if there's args at all
{             // i think, your prog crashes, because you're using argv[1], and there's no such thing
return -1;
}
if ( image.empty() )
{
return -1;
}

...