range_image_creation.cpp
Go to the documentation of this file.
00001 /* \author Bastian Steder */
00002 
00003 #include "pcl/range_image/range_image.h"
00004 
00005 int main (int argc, char** argv) {
00006   pcl::PointCloud<pcl::PointXYZ> pointCloud;
00007   
00008   // Generate the data
00009   for (float y=-0.5f; y<=0.5f; y+=0.01f) {
00010     for (float z=-0.5f; z<=0.5f; z+=0.01f) {
00011       pcl::PointXYZ point;
00012       point.x = 2.0f - y;
00013       point.y = y;
00014       point.z = z;
00015       pointCloud.points.push_back(point);
00016     }
00017   }
00018   pointCloud.width = pointCloud.points.size();
00019   pointCloud.height = 1;
00020   
00021   // We now want to create a range image from the above point cloud, with a 1° angular resolution
00022   float angularResolution =   1.0f * (M_PI/180.0f);  //   1.0 degree in radians
00023   float maxAngleWidth     = 360.0f * (M_PI/180.0f);  // 360.0 degree in radians
00024   float maxAngleHeight    = 180.0f * (M_PI/180.0f);  // 180.0 degree in radians
00025   Eigen::Affine3f sensorPose = (Eigen::Affine3f)Eigen::Translation3f(0.0f, 0.0f, 0.0f);
00026   pcl::RangeImage::CoordinateFrame coordinate_frame = pcl::RangeImage::CAMERA_FRAME;
00027   float noiseLevel=0.00;
00028   float minRange = 0.0f;
00029   int borderSize = 1;
00030   
00031   pcl::RangeImage rangeImage;
00032   rangeImage.createFromPointCloud(pointCloud, angularResolution, maxAngleWidth, maxAngleHeight,
00033                                   sensorPose, coordinate_frame, noiseLevel, minRange, borderSize);
00034   
00035   std::cout << rangeImage << "\n";
00036 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


narf_recognition
Author(s): Juergen Hess
autogenerated on Wed Dec 26 2012 16:37:09