fixed incorrect code in introduction tutorial

This commit is contained in:
Alexander Shishkov 2014-02-17 18:10:08 +04:00
parent 8cbb284b7b
commit a8eab26bae

View File

@ -30,19 +30,24 @@ Let's use a simple program such as DisplayImage.cpp shown below.
using namespace cv; using namespace cv;
int main( int argc, char** argv ) int main(int argc, char** argv )
{ {
Mat image; if ( argc != 2 )
image = imread( argv[1], 1 );
if( argc != 2 || !image.data )
{ {
printf( "No image data \n" ); printf("usage: DisplayImage.out <Image_Path>\n");
return -1; return -1;
} }
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); Mat image;
imshow( "Display Image", image ); image = imread( argv[1], 1 );
if ( !image.data )
{
printf("No image data \n");
return -1;
}
namedWindow("Display Image", CV_WINDOW_AUTOSIZE );
imshow("Display Image", image);
waitKey(0); waitKey(0);