Hi openframeworks mates!
I just downloaded the 006 version and I am having an issue with convertToGrayscalePlanarImages from ofxOpenCv addon.
I have this code that used to work fine on 005, but not now. The thing is that when I draw hueImg, satImg, briImg (that come from convertToGrayscalePlanarImages(hueImg, satImg, briImg))I get nothing, everything is black and looks like is doing nothing.
Here is the code:
testApp.cpp
#include "testApp.h"
#include "stdio.h"
//--------------------------------------------------------------
testApp::testApp(){
}
//--------------------------------------------------------------
void testApp::setup(){
camWidth = 320;
camHeight = 240;
colorImg.allocate(camWidth,camHeight);
colorImgHSV.allocate(camWidth,camHeight);
hueImg.allocate(camWidth,camHeight);
satImg.allocate(camWidth,camHeight);
briImg.allocate(camWidth,camHeight);
vidGrabber.initGrabber(camWidth, camHeight);
}
//--------------------------------------------------------------
void testApp::update(){
vidGrabber.grabFrame();
colorImg.setFromPixels(vidGrabber.getPixels(), camWidth, camHeight);
colorImgHSV = colorImg;
colorImgHSV.convertRgbToHsv();
colorImgHSV.convertToGrayscalePlanarImages(hueImg, satImg, briImg);
}
//--------------------------------------------------------------
void testApp::draw(){
ofBackground(0,0,0);
ofSetColor(0xffffff);
vidGrabber.draw(0,0);
colorImgHSV.draw(camWidth, 0);
hueImg.draw(0, camHeight);
}
testApp.h
#ifndef _TEST_APP
#define _TEST_APP
#include "ofMain.h"
#include "ofxOpenCv.h"
class testApp : public ofBaseApp{
public:
testApp();
void setup();
void update();
void draw();
ofVideoGrabber vidGrabber;
int camWidth;
int camHeight;
ofxCvColorImage colorImg;
ofxCvColorImage colorImgHSV;
ofxCvGrayscaleImage hueImg;
ofxCvGrayscaleImage satImg;
ofxCvGrayscaleImage briImg;
};
#endif
Is this an error or am I doing something wrong?
Thank you!