fixed display_image tutorial sample

This commit is contained in:
Dmitriy Anisimov
2014-09-22 21:46:18 +04:00
parent 55c799a474
commit 71348651eb
3 changed files with 15 additions and 13 deletions

View File

@@ -1,21 +1,23 @@
#include <opencv2/core/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
int main( int argc, char** argv )
{
if( argc != 2)
string imageName("../data/HappyFish.jpg"); // by default
if( argc > 1)
{
cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
return -1;
imageName = argv[1];
}
Mat image;
image = imread(argv[1], IMREAD_COLOR); // Read the file
image = imread(imageName.c_str(), IMREAD_COLOR); // Read the file
if( image.empty() ) // Check for invalid input
{