Skip to content

Instantly share code, notes, and snippets.

@outsmartin
Created June 29, 2012 13:48
Show Gist options
  • Save outsmartin/3018038 to your computer and use it in GitHub Desktop.
Save outsmartin/3018038 to your computer and use it in GitHub Desktop.
#include <opencv.hpp>
int main ()
{
// Open the file.
cv::Mat image;
image = cv::imread("Img01.jpg");
if (!image.data)
{
printf("Error: Couldn't open the image file.\n");
return 1;
}
// Display the image.
cv::namedWindow("Image:");
cv::imshow("Image:", image);
// 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