本文整理汇总了C++中openni::VideoStream::getCameraSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoStream::getCameraSettings方法的具体用法?C++ VideoStream::getCameraSettings怎么用?C++ VideoStream::getCameraSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openni::VideoStream
的用法示例。
在下文中一共展示了VideoStream::getCameraSettings方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toggleImageAutoWhiteBalance
void toggleImageAutoWhiteBalance(int)
{
if (g_colorStream.getCameraSettings() == NULL)
{
displayError("Color stream doesn't support camera settings");
return;
}
g_colorStream.getCameraSettings()->setAutoWhiteBalanceEnabled(!g_colorStream.getCameraSettings()->getAutoWhiteBalanceEnabled());
displayMessage("Auto White balance: %s", g_colorStream.getCameraSettings()->getAutoWhiteBalanceEnabled() ? "ON" : "OFF");
}
示例2: toggleCMOSAutoLoops
void toggleCMOSAutoLoops(int )
{
if (g_colorStream.getCameraSettings() == NULL)
{
displayMessage("Color stream doesn't support camera settings");
return;
}
toggleImageAutoExposure(0);
toggleImageAutoWhiteBalance(0);
displayMessage ("CMOS Auto Loops: %s", g_colorStream.getCameraSettings()->getAutoExposureEnabled()?"On":"Off");
}
示例3: changeImageGain
void changeImageGain(int delta)
{
if (g_colorStream.getCameraSettings() == NULL)
{
displayError("Color stream doesn't support camera settings");
return;
}
int gain = g_colorStream.getCameraSettings()->getGain();
openni::Status rc = g_colorStream.getCameraSettings()->setGain(gain + delta);
if (rc != openni::STATUS_OK)
{
displayMessage("Can't change gain");
return;
}
displayMessage("Changed gain to: %d", g_colorStream.getCameraSettings()->getGain());
}
示例4: changeImageExposure
void changeImageExposure(int delta)
{
if (g_colorStream.getCameraSettings() == NULL)
{
displayError("Color stream doesn't support camera settings");
return;
}
int exposure = g_colorStream.getCameraSettings()->getExposure();
openni::Status rc = g_colorStream.getCameraSettings()->setExposure(exposure + delta);
if (rc != openni::STATUS_OK)
{
displayMessage("Can't change exposure");
return;
}
displayMessage("Changed exposure to: %d", g_colorStream.getCameraSettings()->getExposure());
}
示例5: initialize
//.........这里部分代码省略.........
rc = g_depthStream.start();
if (rc != kinect::STATUS_OK)
{
mDebug()<<"Couldn't start depth stream: "<<kinect::OpenNI::getExtendedError();
g_depthStream.destroy();
exit(0);
}
}
else
{
mDebug()<<"Couldn't find depth stream: "<<kinect::OpenNI::getExtendedError();
exit(0);
}
if (!g_depthStream.isValid())
{
mDebug()<<"No valid depth streams. Exiting";
kinect::OpenNI::shutdown();
exit(0);
}
/// Create the color stream
rc = g_colorStream.create(device, kinect::SENSOR_COLOR);
if (rc == kinect::STATUS_OK)
{
/// start the color stream, if its creation was successful
rc = g_colorStream.start();
if (rc != kinect::STATUS_OK)
{
mDebug()<<"Couldn't start color stream: "<<kinect::OpenNI::getExtendedError();
g_colorStream.destroy();
exit(0);
}
}
else
{
mDebug()<<"Couldn't find color stream: "<<kinect::OpenNI::getExtendedError();
exit(0);
}
if (!g_colorStream.isValid())
{
mDebug()<<"No valid color streams. Exiting";
kinect::OpenNI::shutdown();
exit(0);
}
/// Configure resolutions
{
/// Attempt to set for depth
{
kinect::VideoMode mode = g_depthStream.getVideoMode();
if(((int)camera->FPS())==60)
mode.setFps(60);
else
mode.setFps(30);
mode.setResolution(camera->width(), camera->height());
rc = g_depthStream.setVideoMode(mode);
if (rc != kinect::STATUS_OK)
std::cerr << "error setting video mode (depth)" << std::endl;
}
/// Attempt to set for color
{
kinect::VideoMode mode = g_colorStream.getVideoMode();
if(((int)camera->FPS())==60)
mode.setFps(60);
else
mode.setFps(30);
mode.setFps(30); ///< @todo check!!!
mode.setResolution(camera->width(), camera->height());
rc = g_colorStream.setVideoMode(mode);
if (rc != kinect::STATUS_OK)
std::cerr << "error setting video mode (color)" << std::endl;
}
}
#ifdef THIS_CAUSES_INIT_STALLS
/// Enable depth/color frame synchronization
rc = device.setDepthColorSyncEnabled(true);
if (rc != kinect::STATUS_OK)
{
qDebug()<<"Could not synchronise device";
// VGA Kinect always seems to shut down here
kinect::OpenNI::shutdown();
exit(0);
}
#endif
/// Camera settings
kinect::CameraSettings* settings = g_colorStream.getCameraSettings();
settings->setAutoExposureEnabled(true);
settings->setAutoWhiteBalanceEnabled(true);
/// Fetch the camera intrinsics
#if 0
float w = g_depthStream.getVideoMode().getResolutionX();protected:
示例6: toggleImageAutoWhiteBalance
void toggleImageAutoWhiteBalance(int)
{
g_colorStream.getCameraSettings()->setAutoWhiteBalanceEnabled(!g_colorStream.getCameraSettings()->getAutoWhiteBalanceEnabled());
}
示例7: toggleImageAutoExposure
void toggleImageAutoExposure(int)
{
g_colorStream.getCameraSettings()->setAutoExposureEnabled(!g_colorStream.getCameraSettings()->getAutoExposureEnabled());
}
示例8: enableAutoExposure
void enableAutoExposure() {m_stream.getCameraSettings()->setAutoExposureEnabled(true); }
示例9: disableAutoExposure
void disableAutoExposure() {m_stream.getCameraSettings()->setAutoExposureEnabled(false); }