43 template <
typename Po
intCloudType>
void
45 int di_width,
int di_height,
46 float di_center_x,
float di_center_y,
47 float di_focal_length_x,
float di_focal_length_y,
48 const Eigen::Affine3f& sensor_pose,
56 center_x_ = di_center_x;
57 center_y_ = di_center_y;
58 focal_length_x_ = di_focal_length_x;
59 focal_length_y_ = di_focal_length_y;
60 focal_length_x_reciprocal_ = 1 / focal_length_x_;
61 focal_length_y_reciprocal_ = 1 / focal_length_y_;
66 to_world_system_ = sensor_pose * to_world_system_;
68 to_range_image_system_ = to_world_system_.inverse (Eigen::Isometry);
72 points.resize (size, unobserved_point);
75 doZBuffer (point_cloud, noise_level, min_range, top, right, bottom, left);
89 float delta_x = (image_x-center_x_)*focal_length_x_reciprocal_,
90 delta_y = (image_y-center_y_)*focal_length_y_reciprocal_;
91 point[2] = range / (sqrtf (delta_x*delta_x + delta_y*delta_y + 1));
92 point[0] = delta_x*point[2];
93 point[1] = delta_y*point[2];
94 point = to_world_system_ * point;
101 Eigen::Vector3f transformedPoint = to_range_image_system_ * point;
102 range = transformedPoint.norm ();
104 image_x = center_x_ + focal_length_x_*transformedPoint[0]/transformedPoint[2];
105 image_y = center_y_ + focal_length_y_*transformedPoint[1]/transformedPoint[2];