Ask Your Question

Revision history [back]

Use c++ interface and

#include <iostream>
#include "opencv2/opencv.hpp"

Use c++ interface and

#include <iostream>
#include "opencv2/opencv.hpp"
using namespace cv; 
using namespace std; 
int main( int argc, char** argv ){
    Mat image; image = imread( argv[1] );
    if( argc != 2 || !image.data ) 
        { 
            cout << "No image data \n" <<endl; 
            return="" -1;="" 
    }
    namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); 
    imshow( "Display Image", image );

    waitKey(0);

    return 0; 
}

Use c++ interface and

#include <iostream>
#include "opencv2/opencv.hpp"
 using namespace cv; 
using namespace std;  
int main( int argc, char** argv ){
    Mat image; image = imread( argv[1] );
    if( argc != 2 || !image.data ) 
     { 
         cout << "No image data \n" <<endl; 
         return="" -1;="" 
-1;
    }
     namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); 
    imshow( "Display Image", image );

    waitKey(0);
     return 0; 
}

Use c++ interface and

#include <iostream>
#include "opencv2/opencv.hpp"

using namespace cv; 
using namespace std; 

int main( int argc, char** argv ){
    Mat image;  image = imread( argv[1] );
    if( argc != 2 || !image.data ) 
    { 
        cout << "No image data \n" <<endl; 
        return="" -1;
return=-1;
    }

    namedWindow( "Display Image", CV_WINDOW_AUTOSIZE ); 
    imshow( "Display Image", image );

    waitKey(0);
    return 0; 
}