summaryrefslogtreecommitdiff
path: root/rotord/cvimage.h
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-07-15 15:47:48 +0100
committerTim Redfern <tim@herge.(none)>2013-07-15 15:47:48 +0100
commit6fe1b6e664f2a5d26e5ace7c7082169b656eef05 (patch)
treecd7873d3121bba7b8345a6c295b1bbff382f57a4 /rotord/cvimage.h
parent512cd1f386b40a6539663bcda987b851cbc8ba7f (diff)
transform node working
Diffstat (limited to 'rotord/cvimage.h')
-rw-r--r--rotord/cvimage.h10
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;