Created
October 4, 2013 10:12
-
-
Save apremalal/6823788 to your computer and use it in GitHub Desktop.
Simple opencv application
This file contains hidden or 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 <QCoreApplication> | |
| #include <cv.h> | |
| #include<cxcore.h> | |
| #include <highgui.h> | |
| #include<iostream> | |
| using namespace std; | |
| using namespace cv; | |
| int main(int argc, char *argv[]) | |
| { | |
| QCoreApplication a(argc, argv); | |
| Mat image; | |
| image = imread("<path to image file>"); // Read the file | |
| if(image.empty()) // Check for invalid input | |
| { | |
| cout << "Could not open or find the image" << std::endl ; | |
| return -1; | |
| } | |
| namedWindow( "Display window", CV_WINDOW_AUTOSIZE );//Create a window for display. | |
| imshow( "Display window", image ); // Show our image inside it. | |
| waitKey(0); | |
| return a.exec(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment