You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
472 B
C++
28 lines
472 B
C++
11 years ago
|
#include <stdio.h>
|
||
|
#include <opencv2/opencv.hpp>
|
||
|
|
||
|
using namespace cv;
|
||
|
|
||
|
int main(int argc, char **argv)
|
||
|
{
|
||
|
if (argc != 2) {
|
||
|
printf("Usage: DisplayImage image.jpg\n");
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
Mat image;
|
||
|
image = imread(argv[1], 1);
|
||
|
|
||
|
if (argc != 2 || !image.data) {
|
||
|
printf("No image data\n");
|
||
|
return -1;
|
||
|
}
|
||
|
|
||
|
namedWindow("Display Image", CV_WINDOW_AUTOSIZE);
|
||
|
imshow("Display Image", image);
|
||
|
|
||
|
waitKey(0);
|
||
|
|
||
|
return 0;
|
||
|
}
|