kylemcdonald/Makerbot — Issue #2: KinectToSTL FloatImage replacement?
Author: jvcleave
Created: 2011-10-10 17:20:56+00:00
State: open

Hey Kyle,
Thanks for this - I have most working with the OF007 release besides this exception

It seems you removed FloatImage from ofxCv and I can't seem to figure out what to use instead. I tried this

```
//changing kinectBuffer from a FloatImage to a Mat

Mat kinectBuffer;

//making an ofImage to convert from

ofImage kinectBufferImage;

//testApp::update changes

kinectBufferImage.setFromPixels(kinect.getDepthPixels(), 640, 480, OF_IMAGE_GRAYSCALE);

kinectBufferImage.update();

kinectBuffer = toCv(kinectBufferImage);

//the crash happens in testApp::updateSurface
//I removed .toCV() from kinectBuffer as it should be a Mat with the changes above

cv::addWeighted(kinectBuffer, alpha, kinectMat, beta, 0, kinectBuffer);

```

crash log
```
OpenCV Error: Assertion failed (src1.type() == src2.type() && func != 0) in addWeighted, file /Users/theo/Documents/CODE/__OPENFRAMEWORKS/gitOF/__BuildAllLibs/OpenCV-2.2.0/modules/core/src/arithm.cpp, line 1132

terminate called after throwing an instance of 'cv::Exception'

what(): /Users/theo/Documents/CODE/__OPENFRAMEWORKS/gitOF/__BuildAllLibs/OpenCV-2.2.0/modules/core/src/arithm.cpp:1132: error: (-215) src1.type() == src2.type() && func != 0 in function addWeighted
```