Skip to content

Instantly share code, notes, and snippets.

@pocket7878
Created July 11, 2014 15:16
Show Gist options
  • Save pocket7878/ab0d3ca442fc434da93d to your computer and use it in GitHub Desktop.
Save pocket7878/ab0d3ca442fc434da93d to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <opencv2/opencv.hpp>
#include <opencv2/nonfree/nonfree.hpp>
using namespace std;
using namespace cv;
int main(int argc, char* argv[]) {
// load color image
const char* imagename = argv[1] ;
Mat colorImage = imread(imagename, 1);
if (colorImage.empty()) {
cout << "file not found" << endl;
return -1;
}
namedWindow("img", CV_WINDOW_AUTOSIZE);
imshow("img", colorImage);
waitKey(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment