OpenNI2 stream flicker problem


#1

hi, my problem is same as this link.

http://forums.structure.io/t/openni2-640x480-stream-problem/4536

and also my source code is this. and link.
http://predator.hateblo.jp/entry/2014/07/02/142013

void Oni2Grabber::createAndStartStream_(openni::VideoStream &stream, openni::SensorType sensor_type) {
stream.create(device_, sensor_type);
stream.start();
streams_.push_back(&stream);
}

how to change to 640x480 stream?


#2

solve this probelm…

stream.create(device_, sensor_type);
///

if(sensor_type == openni::SENSOR_DEPTH)
{
	const openni::SensorInfo* sinfo = device_.getSensorInfo(openni::SENSOR_DEPTH);
	const openni::Array<openni::VideoMode> &modesDepth = sinfo->getSupportedVideoModes();
//	for (int i = 0; i<modesDepth.getSize(); i++) {

// printf("%i: %ix%i, %i fps, %i format\n", i, modesDepth[i].getResolutionX(), modesDepth[i].getResolutionY(),
// modesDepth[i].getFps(), modesDepth[i].getPixelFormat()); //PIXEL_FORMAT_DEPTH_1_MM = 100, PIXEL_FORMAT_DEPTH_100_UM
// }
stream.setVideoMode(modesDepth[4]);
}

///

stream.start();
streams_.push_back(&stream);