diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-08-29 15:35:32 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-08-29 15:35:32 +0100 |
| commit | 486a76df31169f2b510ae26e8252783d8f90de27 (patch) | |
| tree | 20df24d88064a0bbaf6ba6c8027120a5f4f9acf6 /rotord/src/cvimage.h | |
| parent | caed9b7b05005ee2bcec8e7262bf5f63fe2a4df8 (diff) | |
making still image node
Diffstat (limited to 'rotord/src/cvimage.h')
| -rw-r--r-- | rotord/src/cvimage.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rotord/src/cvimage.h b/rotord/src/cvimage.h index dc421de..6323d4d 100644 --- a/rotord/src/cvimage.h +++ b/rotord/src/cvimage.h @@ -3,6 +3,7 @@ #include <math.h> #include <cv.h> +#include <highgui.h> //converting to use a cv image... //cv::Mat supports most of what we want here @@ -120,6 +121,15 @@ namespace Rotor { else return false; */ } + bool read_file(std::string &filename){ + rgb=cv::imread(filename,CV_LOAD_IMAGE_COLOR); + if (rgb.empty()) return false; + RGBdata=rgb.data; + ownsRGBdata=false; + w=rgb.rows; + h=rgb.cols; + return true; + } bool setup_fromRGB(int _w,int _h,uint8_t *pRGBdata,int linepadding=0){ //here the data belongs to libavcodec or other //could move to using cv::Mat there also and just passing cv:Mat over |
