I’m using a couple of Asus Xtion sensors and need to basic blob detection.
At the moment I’m using OpenCV 2.4.4 built with OpenNI with
Marek’s of64(https://github.com/mazbox/of64) and Kyle McDonald’s ofxCv.
I’ve tried to use ofxCV’s toOf utility:
toOf(mat1,pix1);
image1.setFromPixels(pix1.getPixels(), W, H, OF_IMAGE_GRAYSCALE, false);
or
toOf(mat1,image1.getPixelsRef());
image1.update();
but I get some strange results:
Any hints on how the conversion should be made ?
Also, I’ve tried ofxCv’s drawMat but that also doesn’t seem to work.
if( !sensor1.grab() ){
cout << "Sensor1 can not grab images." << endl;
return -1;
}else if( sensor1.retrieve( mat1, CV_CAP_OPENNI_DEPTH_MAP ) ) {
imshow("depth1",mat1);
//toOf(mat1,pix1);
//image1.setFromPixels(pix1.getPixels(), W, H, OF_IMAGE_GRAYSCALE, false);
//toOf(mat1,image1.getPixelsRef());
//image1.update();
drawMat(mat1,0,0);
}
I presume it might have something to do about how OpenCV deals with the depth map internally,
but I’m clueless on how to tackle that. Any thoughts ?
Thanks,
George