Kinect 2 Common Bridge sample project problem


#1

I am evaluating the Cinder-KCB2 block for a project and running into run-time errors with the sample projects included with the block. The only one which works fine is the FaceApp project. Both BasicApp and BodyApp compile fine but throw runtime errors about unhandled exceptions while iterating through the while loop in Kinect2.cpp:

Channel8uRef channel16To8( const Channel16uRef& channel, uint8_t bytes )
{
	Channel8uRef channel8;
	if ( channel ) {
		channel8				= Channel8u::create( channel->getWidth(), channel->getHeight() );
		Channel16u::Iter iter16	= channel->getIter();
		Channel8u::Iter iter8	= channel8->getIter();
		while ( iter8.line() && iter16.line() ) {
			while ( iter8.pixel() && iter16.pixel() ) {
				**iter8.v()				= static_cast<uint8_t>( iter16.v() >> bytes );**
			}
		}
	}
	return channel8;
}

Both iter8 and iter16 have the same error while reading:

**iter16**	{mInc=0 '\0' mRowInc=-842150655 mLinePtr=0xe55562d1 <Error reading characters of string.> ...}	cinder::ChannelT<unsigned short>::Iter
**iter8** 	{mInc=0 '\0' mLinePtr=0xcdcdcd01 <Error reading characters of string.> mPtr=0xe9266099 <Error reading characters of string.> ...}	cinder::ChannelT<unsigned char>::Iter

Both of them break when trying to create a texture with the Channel16uRef data.

gl::TextureRef tex = gl::Texture::create( *Kinect2::channel16To8( mChannelDepth ) );

Any idea what could be going wrong here?

Also, the PointCloud sample references the MayaCamUI.h file which seems to be missing from Cinder v9.0. I can see it in the older versions.