~paparazzi-uav/paparazzi/v5.0-manual

« back to all changes in this revision

Viewing changes to sw/ext/opencv_bebop/opencv/samples/cpp/tutorial_code/introduction/windows_visual_studio_Opencv/introduction_windows_vs.cpp

  • Committer: Paparazzi buildbot
  • Date: 2016-05-18 15:00:29 UTC
  • Revision ID: felix.ruess+docbot@gmail.com-20160518150029-e8lgzi5kvb4p7un9
Manual import commit 4b8bbb730080dac23cf816b98908dacfabe2a8ec from v5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <opencv2/core.hpp>
 
2
#include <opencv2/imgcodecs.hpp>
 
3
#include <opencv2/highgui.hpp>
 
4
#include <iostream>
 
5
 
 
6
using namespace cv;
 
7
using namespace std;
 
8
 
 
9
int main( int argc, char** argv )
 
10
{
 
11
    if( argc != 2)
 
12
    {
 
13
     cout <<" Usage: display_image ImageToLoadAndDisplay" << endl;
 
14
     return -1;
 
15
    }
 
16
 
 
17
    Mat image;
 
18
    image = imread(argv[1], IMREAD_COLOR); // Read the file
 
19
 
 
20
    if( image.empty() ) // Check for invalid input
 
21
    {
 
22
        cout << "Could not open or find the image" << std::endl ;
 
23
        return -1;
 
24
    }
 
25
 
 
26
    namedWindow( "Display window", WINDOW_AUTOSIZE ); // Create a window for display.
 
27
    imshow( "Display window", image ); // Show our image inside it.
 
28
 
 
29
    waitKey(0); // Wait for a keystroke in the window
 
30
    return 0;
 
31
}
 
 
b'\\ No newline at end of file'