Created
March 7, 2019 16:16
-
-
Save detik19/7161a0ebcddf45cd2d709a5cba36a872 to your computer and use it in GitHub Desktop.
HelloOpenCV3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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