Camera*const camera; /// Device kinect::Device device; bool initialized; /// Streams kinect::VideoStream g_depthStream; kinect::VideoStream g_colorStream; /// Frames kinect::VideoFrameRef g_depthFrame; kinect::VideoFrameRef g_colorFrame; float fov_h = g_depthStream.getHorizontalFieldOfView(); float fl_h = .5*w / tan(.5*fov_h); float h = g_depthStream.getVideoMode().getResolutionY(); float fov_v = g_depthStream.getVerticalFieldOfView(); float fl_v = .5*h / tan(.5*fov_v); std::cout << "cameras focal lengths" << fl_h << fl_v; #endif initialized = true; return true; } SensorOpenNI::~SensorOpenNI() { if(initialized){ LOG(INFO) << "Shutting down Kinect..."; flush(std::cout); g_depthStream.destroy(); g_colorStream.destroy();
double getVFov()const{ return m_stream.getVerticalFieldOfView(); }