/*----------------------------------------------------------------------------*/
void pcl::SoftKineticDevice::configureDepthNode()
{
    g_dnode.newSampleReceivedEvent().connect(newDepthSampleCallback);

    DepthNode::Configuration config = g_dnode.getConfiguration();
    config.frameFormat = FRAME_FORMAT_QVGA;
    config.framerate = 25;
    config.mode = DepthNode::CAMERA_MODE_CLOSE_MODE;
    config.saturation = true;
    
    g_dnode.setEnableVertices(true);
    g_dnode.setEnableVerticesFloatingPoint(true);
    g_dnode.setEnableDepthMapFloatingPoint(true);

    try 
    {
        context_.requestControl(g_dnode,0);
        g_dnode.setConfiguration(config);
    }
    catch (ArgumentException& e)
    {
        printf("Argument Exception: %s\n",e.what());
    }
    catch (UnauthorizedAccessException& e)
    {
        printf("Unauthorized Access Exception: %s\n",e.what());
    }
    catch (IOException& e)
    {
        printf("IO Exception: %s\n",e.what());
    }
    catch (InvalidOperationException& e)
    {
        printf("Invalid Operation Exception: %s\n",e.what());
    }
    catch (ConfigurationException& e)
    {
        printf("Configuration Exception: %s\n",e.what());
    }
    catch (StreamingException& e)
    {
        printf("Streaming Exception: %s\n",e.what());
    }
    catch (TimeoutException&)
    {
        printf("TimeoutException\n");
    }

}
예제 #2
0
/*----------------------------------------------------------------------------*/
void SoftKineticCamera::configureDepthNode()
{
	m_dnode.newSampleReceivedEvent().connect(&onNewDepthSample);

	DepthNode::Configuration config = m_dnode.getConfiguration();
	config.frameFormat = FRAME_FORMAT_QVGA;
	config.framerate = 25;
	config.mode = DepthNode::CAMERA_MODE_CLOSE_MODE;
	config.saturation = true;

	m_dnode.setEnableDepthMap(true);
	try 
	{
		m_context.requestControl(m_dnode,0);
		m_dnode.setEnableConfidenceMap(true);
		m_dnode.setConfidenceThreshold(120);
		m_dnode.setConfiguration(config);
	}
	catch (ArgumentException& e)
	{
		printf("Argument Exception: %s\n",e.what());
	}
	catch (UnauthorizedAccessException& e)
	{
		printf("Unauthorized Access Exception: %s\n",e.what());
	}
	catch (IOException& e)
	{
		printf("IO Exception: %s\n",e.what());
	}
	catch (InvalidOperationException& e)
	{
		printf("Invalid Operation Exception: %s\n",e.what());
	}
	catch (ConfigurationException& e)
	{
		printf("Configuration Exception: %s\n",e.what());
	}
	catch (StreamingException& e)
	{
		printf("Streaming Exception: %s\n",e.what());
	}
	catch (TimeoutException&)
	{
		printf("TimeoutException\n");
	}

}