Commit a8eab26b authored by Alexander Shishkov's avatar Alexander Shishkov

fixed incorrect code in introduction tutorial

parent 8cbb284b
...@@ -25,29 +25,34 @@ Let's use a simple program such as DisplayImage.cpp shown below. ...@@ -25,29 +25,34 @@ Let's use a simple program such as DisplayImage.cpp shown below.
.. code-block:: cpp .. code-block:: cpp
#include <stdio.h> #include <stdio.h>
#include <opencv2/opencv.hpp> #include <opencv2/opencv.hpp>
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 ); {
printf("usage: DisplayImage.out <Image_Path>\n");
if( argc != 2 || !image.data ) return -1;
{ }
printf( "No image data \n" );
return -1; Mat image;
} image = imread( argv[1], 1 );
namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); if ( !image.data )
imshow( "Display Image", image ); {
printf("No image data \n");
waitKey(0); return -1;
}
return 0; namedWindow("Display Image", CV_WINDOW_AUTOSIZE );
} imshow("Display Image", image);
waitKey(0);
return 0;
}
Create a CMake file Create a CMake file
--------------------- ---------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment