imread.cpp

Florian Thillmann, 2012-05-14 03:00 pm

Download (472 Bytes)

 
1
 #include "opencv2/highgui/highgui.hpp"
2
 #include "opencv2/imgproc/imgproc.hpp"
3
 #include <iostream>
4
 #include <stdio.h>
5
 using namespace std;
6
 using namespace cv;
7
8
 int main( int argc, const char** argv )
9
 {
10
        Mat frame;
11
   frame = imread("d:\\lena.jpg",CV_LOAD_IMAGE_COLOR);
12
   
13
   if (!frame.data)
14
   {
15
           cout << "Error" << endl;
16
           getchar();
17
           return -1;
18
   }
19
   else
20
   {        
21
           imshow("Capt_Img",frame);
22
           getchar();
23
   }
24
   return 0;
25
 }