diff options
Diffstat (limited to 'rotord/cvimage.h')
| -rw-r--r-- | rotord/cvimage.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rotord/cvimage.h b/rotord/cvimage.h index cbf2840..6c237b4 100644 --- a/rotord/cvimage.h +++ b/rotord/cvimage.h @@ -85,7 +85,7 @@ namespace Rotor { ownsRGBdata=ownsAdata=ownsZdata=false; } bool setup(int _w,int _h){ //set up with internal data - rgb.create(_w,_h,CV_8UC3); + rgb.create(_h,_w,CV_8UC3); RGBdata=rgb.data; //can move to use the bare pointer eventually ownsRGBdata=false; //will not be necessary w=_w; @@ -108,8 +108,12 @@ namespace Rotor { 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 - std::cerr<<"creating cv::Mat with step= "<<((_w*3)+linepadding)<<std::endl; - rgb=cv::Mat(_w,_h,CV_8UC3,pRGBdata,(_w*3)+linepadding); + + //linepadding causes crash, but it doesn't seem to be necessary + // Mat::Mat(int rows, int cols, int type, void* data, size_t step=AUTO_STEP) + rgb=cv::Mat(_h,_w,CV_8UC3,pRGBdata,(_w*3)+linepadding); + //std::cerr<<"created cv::Mat with step= "<<rgb.step<<",should be "<<((_w*3)+linepadding)<<std::endl; + RGBdata=rgb.data; //can move to use the bare pointer eventually ownsRGBdata=false; //will not be necessary w=_w; |
