opencv on mbed

Dependencies:   mbed

Committer:
joeverbout
Date:
Thu Mar 31 21:16:38 2016 +0000
Revision:
0:ea44dc9ed014
OpenCV on mbed attempt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
joeverbout 0:ea44dc9ed014 1 //! [includes]
joeverbout 0:ea44dc9ed014 2 #include "opencv2/core/core.hpp"
joeverbout 0:ea44dc9ed014 3 #include "opencv2/imgcodecs.hpp"
joeverbout 0:ea44dc9ed014 4 #include "opencv2/highgui/highgui.hpp"
joeverbout 0:ea44dc9ed014 5
joeverbout 0:ea44dc9ed014 6 #include "mbed.h"
joeverbout 0:ea44dc9ed014 7
joeverbout 0:ea44dc9ed014 8 #include <iostream>
joeverbout 0:ea44dc9ed014 9 #include <string>
joeverbout 0:ea44dc9ed014 10 //! [includes]
joeverbout 0:ea44dc9ed014 11
joeverbout 0:ea44dc9ed014 12 //! [namespace]
joeverbout 0:ea44dc9ed014 13 using namespace cv;
joeverbout 0:ea44dc9ed014 14 //! [namespace]
joeverbout 0:ea44dc9ed014 15
joeverbout 0:ea44dc9ed014 16 using namespace std;
joeverbout 0:ea44dc9ed014 17
joeverbout 0:ea44dc9ed014 18 int main(int argc, char** argv)
joeverbout 0:ea44dc9ed014 19 {
joeverbout 0:ea44dc9ed014 20
joeverbout 0:ea44dc9ed014 21
joeverbout 0:ea44dc9ed014 22 //! [mat]
joeverbout 0:ea44dc9ed014 23 Mat image;
joeverbout 0:ea44dc9ed014 24 //! [mat]
joeverbout 0:ea44dc9ed014 25
joeverbout 0:ea44dc9ed014 26 //! [imread]
joeverbout 0:ea44dc9ed014 27 image = imread(imageName.c_str(), IMREAD_COLOR); // Read the file
joeverbout 0:ea44dc9ed014 28 //! [imread]
joeverbout 0:ea44dc9ed014 29
joeverbout 0:ea44dc9ed014 30 if (image.empty()) // Check for invalid input
joeverbout 0:ea44dc9ed014 31 {
joeverbout 0:ea44dc9ed014 32 cout << "Could not open or find the image" << std::endl;
joeverbout 0:ea44dc9ed014 33 return -1;
joeverbout 0:ea44dc9ed014 34 }
joeverbout 0:ea44dc9ed014 35
joeverbout 0:ea44dc9ed014 36 return 0;
joeverbout 0:ea44dc9ed014 37 }