kylemcdonald/ofxCcv

how to display submat ?

avilleret opened this issue · 1 comments

the following code displays a scrambled submat :

#include "ofMain.h"
#include "ofxCv.h"

class ofApp : public ofBaseApp
{
  public:
    void setup  ();
    void update ();
    void draw   ();

    ofVideoGrabber vidGrabber;
    cv::Mat subMat;
};

void ofApp::setup()
{
  vidGrabber.initGrabber(640,480);
}

void ofApp::update()
{
  vidGrabber.update();
  Mat img = toCv(vidGrabber);
  cv::Rect rect(320,240,64,48);
  subMat = img(rect);
}

void ofApp::draw()
{
  vidGrabber.draw(0,0);
  drawMat(subMat,0,0);
}

it seems that row step is wrong or maybe I'm doing something wrong ?

oups a typo in the URL puts this in the wrong repo...
see kylemcdonald/ofxCv#163