Exemple #1
0
////////////////////////////////////////////////////////////////////////////////
// public member functions
////////////////////////////////////////////////////////////////////////////////
int IntelCamera::NextFrame()
{
	// color & depth image : force to synchronize
	if ( ProcessColor()==-1 ) return -1;
	if ( ProcessDepth()==-1 ) return -1;

	// point cloud
	if ( MapColorToDepth()==-1 ) return -1;

	return 1;
}
//NOTE: Based on tests, data range seems to be valid between 511 (0x1FF) and 8191 (0x1FFF).
void GetData(ColorImage& colorImage, DepthImage& depthImage, BinaryImage& validityImage)
{
	
	static DepthImage rawDepthImage;

	
	//Get the colour and depth data
	static DataTypes::ColorImage unalignedColorImage;
	//!!GetColorAndDepthImages(colorImage, rawDepthImage);
	GetColorAndDepthImages(unalignedColorImage, depthImage);
	
	// Align the color and depth images
	MapColorToDepth(depthImage, unalignedColorImage, colorImage);

	// Get an image which specifies the valid depth pixels
	//!!GetValidPixelMap(rawDepthImage, validityImage);
	GetValidPixelMap(depthImage, validityImage);
	
	// Process the depth data
	//!!PreProcessDepthData(rawDepthImage, depthImage);
	PreProcessDepthData(depthImage, depthImage);
	
	return;
}