Hello,
i am using a kinect to grab images and play with openCV to detect blobs.
My problem is i can’t make use of cvAdd. It compiles but crashes when attempting to use cvAdd.
It seems there is a problem converting ofxCvGrayscaleImage into iplImage. I thought ofxCvImage::getCvImage() was converting ofxCvGrayscaleImage to iplImage ? is it a bug ?
using oF 0.8.4 in Xcode 6
Maybe there is a workaround but i would prefer to use ofxGrayscaleImage.
or should i write my cvAdd method ?
here is the code :
// load grayscale depth image from the kinect source
depthImage.setFromPixels(kinect.getDepthPixels(), kinect.width, kinect.height);
// ---------- ROI -----------
ofRectangle roiMat = ofRectangle(roi.x, roi.y, roi.width, roi.height);
depthImage.setROI(roiMat);
// threshold
threshNear = depthImage;
threshFar = depthImage;
threshNear.threshold(nearThreshValue, true);
threshFar.threshold(farThreshValue);
cvAnd(threshNear.getCvImage(), threshFar.getCvImage(), depthImage.getCvImage(), NULL); // APP CRASH HERE
// update the cv images
depthImage.flagImageChanged();
//find blob in ROI
contourFinder.findContours(depthImage, minBlobSize, roi.width*roi.height, 1, false);