Skip to content

Instantly share code, notes, and snippets.

@detik19
Created March 7, 2019 16:16
Show Gist options
  • Save detik19/7161a0ebcddf45cd2d709a5cba36a872 to your computer and use it in GitHub Desktop.
Save detik19/7161a0ebcddf45cd2d709a5cba36a872 to your computer and use it in GitHub Desktop.
HelloOpenCV3
#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;
image = imread("D:/view-4011285_960_720.jpg", CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input
{
cout << "Could not open or find the image" << std::endl ;
return -1;
}
namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display.
imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment