Point Cloud Library (PCL)
1.3.1
|
00001 /* 00002 * Software License Agreement (BSD License) 00003 * 00004 * Copyright (c) 2010, Willow Garage, Inc. 00005 * All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 00011 * * Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * * Redistributions in binary form must reproduce the above 00014 * copyright notice, this list of conditions and the following 00015 * disclaimer in the documentation and/or other materials provided 00016 * with the distribution. 00017 * * Neither the name of Willow Garage, Inc. nor the names of its 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00025 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00026 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00027 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00028 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00029 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00030 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00031 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00032 * POSSIBILITY OF SUCH DAMAGE. 00033 */ 00034 00035 #ifndef PCL_RANGE_IMAGE_PLANAR_H_ 00036 #define PCL_RANGE_IMAGE_PLANAR_H_ 00037 00038 #include <pcl/range_image/range_image.h> 00039 00040 namespace pcl 00041 { 00049 class RangeImagePlanar : public RangeImage 00050 { 00051 public: 00052 // =====TYPEDEFS===== 00053 typedef RangeImage BaseClass; 00054 typedef boost::shared_ptr<RangeImagePlanar> Ptr; 00055 typedef boost::shared_ptr<const RangeImagePlanar> ConstPtr; 00056 00057 // =====CONSTRUCTOR & DESTRUCTOR===== 00059 PCL_EXPORTS RangeImagePlanar (); 00061 PCL_EXPORTS ~RangeImagePlanar (); 00062 00065 virtual RangeImage* 00066 getNew () const { return new RangeImagePlanar; } 00067 00068 // =====PUBLIC METHODS===== 00070 inline Ptr 00071 makeShared () { return Ptr (new RangeImagePlanar (*this)); } 00072 00083 PCL_EXPORTS void 00084 setDisparityImage (const float* disparity_image, int di_width, int di_height, 00085 float focal_length, float base_line, float desired_angular_resolution=-1); 00086 00099 PCL_EXPORTS void 00100 setDepthImage (const float* depth_image, int di_width, int di_height, float di_center_x, float di_center_y, 00101 float di_focal_length_x, float di_focal_length_y, float desired_angular_resolution=-1); 00102 00115 PCL_EXPORTS void 00116 setDepthImage (const unsigned short* depth_image, int di_width, int di_height, float di_center_x, float di_center_y, 00117 float di_focal_length_x, float di_focal_length_y, float desired_angular_resolution=-1); 00118 00132 template <typename PointCloudType> void 00133 createFromPointCloudWithFixedSize (const PointCloudType& point_cloud, 00134 int di_width, int di_height, float di_center_x, float di_center_y, 00135 float di_focal_length_x, float di_focal_length_y, 00136 const Eigen::Affine3f& sensor_pose, 00137 CoordinateFrame coordinate_frame=CAMERA_FRAME, float noise_level=0.0f, 00138 float min_range=0.0f); 00139 00140 // Since we reimplement some of these overloaded functions, we have to do the following: 00141 using RangeImage::calculate3DPoint; 00142 using RangeImage::getImagePoint; 00143 00151 virtual inline void 00152 calculate3DPoint (float image_x, float image_y, float range, Eigen::Vector3f& point) const; 00153 00161 virtual inline void 00162 getImagePoint (const Eigen::Vector3f& point, float& image_x, float& image_y, float& range) const; 00163 00177 PCL_EXPORTS virtual void 00178 getSubImage (int sub_image_image_offset_x, int sub_image_image_offset_y, int sub_image_width, 00179 int sub_image_height, int combine_pixels, RangeImage& sub_image) const; 00180 00182 PCL_EXPORTS virtual void 00183 getHalfImage(RangeImage& half_image) const; 00184 00185 protected: 00186 float focal_length_x_, focal_length_y_; 00187 float focal_length_x_reciprocal_, focal_length_y_reciprocal_; 00188 float center_x_, center_y_; 00189 }; 00190 } // namespace end 00191 00192 00193 #include "pcl/range_image/impl/range_image_planar.hpp" // Definitions of templated and inline functions 00194 00195 #endif //#ifndef PCL_RANGE_IMAGE_H_