Skip to content

Instantly share code, notes, and snippets.

@abhinavjain241
Created December 2, 2014 23:00
Show Gist options
  • Save abhinavjain241/91bbc71dba34e6b86534 to your computer and use it in GitHub Desktop.
Save abhinavjain241/91bbc71dba34e6b86534 to your computer and use it in GitHub Desktop.
Read an Image - OpenCV
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat image;
string fname;
cout << "Enter name of file:";
cin >> fname;
image = imread(fname,CV_LOAD_IMAGE_COLOR);
namedWindow("Image",WINDOW_AUTOSIZE);
imshow("Image",image);
waitKey(0);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment