首页 文章

Kinect校准和深度图像

提问于
浏览
0

我已经开始查看PCL及其Kinect SDK . 我有一个非常基本的问题 . 我使用带有Checkerboard图案的RGBDemo作为控制图像校准了RGB和IR相机 . 我收到了失真系数和偏移量 . 我遇到使用系数接收校准点 Cloud 的问题 .

我想弄清楚的是接收输入深度图像以实现校准模型的过程 . 我找到了带有 getDepthMetaData().Data() 函数的 openni_wrapper::DepthImage 类,它以毫米为单位提供深度 .

这是原始深度吗?

如果没有,是否还有另一个功能来接收原始深度图像而无需事先使用PCL进行校准?

1 回答

  • 0

    这听起来像抓取器教程中可以找到的信息:http://pointclouds.org/documentation/tutorials/openni_grabber.php

    您可以更改教程以使用以下任一方法:

    void (const boost::shared_ptr<openni_wrapper::DepthImage>&)
    //This provides the depth image, without any color or intensity information
    

    要么

    void (const boost::shared_ptr<openni_wrapper::Image>&, const  
          boost::shared_ptr<openni_wrapper::DepthImage>&, float constant)
    // When a callback of this type is registered, the grabber sends both RGB image 
    // and depth image and the constant (1 / focal length), which you need if you 
    // want to do your own disparity conversion.
    

    在代码中,这变为:

    #include <pcl/io/openni_grabber.h>
    
    class KinectGrabber
    {
    public:
     void cloud_cb_ (const boost::shared_ptr<openni_wrapper::DepthImage> &depthImage)
     {
        // Do something with depthImage
     }
    
     void run ()
     {
       pcl::Grabber* interface = new pcl::OpenNIGrabber();
    
       boost::function<void (const boost::shared_ptr<openni_wrapper::DepthImage>&)> f =
         boost::bind (&KinectGrabber::cloud_cb_, this, _1);
    
       interface->registerCallback (f);
    
       interface->start ();
    
       while (//place something to stop on)
       {
         //boost::this_thread::sleep (boost::posix_time::seconds (1));
         // or other function
       }
    
       interface->stop ();
     }
    };
    
    int main ()
    {
       KinectGrabber v;
       v.run ();
       return 0;
    }
    

相关问题