0

I have started looking at PCL and its SDK for Kinect. I am having a very basic problem. I have calibrated the RGB and IR cameras using RGBDemo with Checkerboard pattern as the control images. I have received the distortion coefficients and the offsets. I am having a problem of using the coefficients to receive a calibrated point cloud.

What I am trying to figure out is a procedure to receive the input depth image to implement the calibration model. I have found the openni_wrapper::DepthImageclass with getDepthMetaData().Data()function which provides the depth in millimeters.

Is this the raw depth?

If not, is there another function to receive the raw depth image without prior calibration using PCL?

4

1 回答 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;
}
于 2013-11-20T16:15:10.743 回答