fixed display_image tutorial sample
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user