Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Why do you use the old deprecated c style? Try c++ which will also be supported in the future. This probably wont fix your issue though.

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv ){
   Mat image = imread( argv[1], CV_LOAD_IMAGE_COLOR);

   if(!image.data ){
      cout << "No image - no Display \n";
      return -1;
   }

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

   waitKey(0);
   return 0;
}

Why do you use the old deprecated c style? Try c++ which will also be supported in the future. This probably wont fix your issue though.

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>

using namespace cv;
using namespace std;

int main( int argc, char** argv ){
   Mat image = imread( argv[1], CV_LOAD_IMAGE_COLOR);

   if(!image.data ){
      cout << "No image - no Display \n";
      return -1;
   }

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

   waitKey(0);
   return 0;
}