Skip to content

Instantly share code, notes, and snippets.

@chakkritte
Created June 4, 2015 17:46
Show Gist options
  • Save chakkritte/04dc2485e2cb21995f2e to your computer and use it in GitHub Desktop.
Save chakkritte/04dc2485e2cb21995f2e to your computer and use it in GitHub Desktop.
Example OpenCV
#include<opencv2\core\core.hpp>
#include<opencv2\highgui\highgui.hpp>
#define TEST_IMAGE "D:\\opencv.png"
int main(){
// Open the file.
cv::Mat img = cv::imread(TEST_IMAGE);
// Display the image.
cv::namedWindow("Image:", CV_WINDOW_AUTOSIZE);
cv::imshow("Image:", img);
// Wait for the user to press a key in the GUI window.
cv::waitKey(0);
// Free the resources.
cv::destroyWindow("Image:");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment