39 #ifndef PCL_RANGE_IMAGE_PLANAR_IMPL_HPP_
40 #define PCL_RANGE_IMAGE_PLANAR_IMPL_HPP_
42 #include <pcl/pcl_macros.h>
43 #include <pcl/common/eigen.h>
49 template <
typename Po
intCloudType>
void
51 int di_width,
int di_height,
52 float di_center_x,
float di_center_y,
53 float di_focal_length_x,
float di_focal_length_y,
54 const Eigen::Affine3f& sensor_pose,
81 doZBuffer (point_cloud, noise_level, min_range, top, right, bottom, left);
97 point[2] = range / (sqrtf (delta_x*delta_x + delta_y*delta_y + 1));
98 point[0] = delta_x*point[2];
99 point[1] = delta_y*point[2];
108 if (transformedPoint[2]<=0)
110 image_x = image_y = range = -1.0f;
113 range = transformedPoint.norm ();
float focal_length_x_reciprocal_
virtual void getImagePoint(const Eigen::Vector3f &point, float &image_x, float &image_y, float &range) const
Calculate the image point and range from the given 3D point.
PCL_EXPORTS void recalculate3DPointPositions()
Recalculate all 3D point positions according to their pixel position and range.
std::vector< PointWithRange, Eigen::aligned_allocator< PointWithRange > > points
The point data.
void doZBuffer(const PointCloudType &point_cloud, float noise_level, float min_range, int &top, int &right, int &bottom, int &left)
Integrate the given point cloud into the current range image using a z-buffer.
PointWithRange unobserved_point
This point is used to be able to return a reference to a non-existing point.
uint32_t width
The point cloud width (if organized as an image-structure).
bool is_dense
True if no points are invalid (e.g., have NaN or Inf values).
float center_y_
The principle point of the image.
Eigen::Affine3f to_range_image_system_
Inverse of to_world_system_.
float focal_length_y_
The focal length of the image in pixels.
int image_offset_y_
Position of the top left corner of the range image compared to an image of full size (360x180 degrees...
uint32_t height
The point cloud height (if organized as an image-structure).
static PCL_EXPORTS void getCoordinateFrameTransformation(RangeImage::CoordinateFrame coordinate_frame, Eigen::Affine3f &transformation)
Get the transformation that transforms the given coordinate frame into CAMERA_FRAME.
float focal_length_y_reciprocal_
1/focal_length -> for internal use
virtual void calculate3DPoint(float image_x, float image_y, float range, Eigen::Vector3f &point) const
Calculate the 3D point according to the given image point and range.
Eigen::Affine3f to_world_system_
Inverse of to_range_image_system_.
void createFromPointCloudWithFixedSize(const PointCloudType &point_cloud, int di_width, int di_height, float di_center_x, float di_center_y, float di_focal_length_x, float di_focal_length_y, const Eigen::Affine3f &sensor_pose, CoordinateFrame coordinate_frame=CAMERA_FRAME, float noise_level=0.0f, float min_range=0.0f)
Create the image from an existing point cloud.