30 #include <pcl/common/transforms.h>
41 cv::Mat output = laserScan.
data().clone();
49 for(
int i=0;
i<laserScan.
size(); ++
i)
51 const float * ptr = laserScan.
data().ptr<
float>(0,
i);
52 float *
out = output.ptr<
float>(0,
i);
55 pcl::PointXYZ pt(ptr[0], ptr[1], laserScan.
is2d()?0:ptr[2]);
69 pt.z=laserScan.
is2d()?0:ptr[2];
80 out[nx] = pt.normal_x;
81 out[ny] = pt.normal_y;
82 out[nz] = pt.normal_z;
108 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
111 pcl::PointCloud<pcl::PointXYZ>::Ptr output(
new pcl::PointCloud<pcl::PointXYZ>);
116 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
119 pcl::PointCloud<pcl::PointXYZI>::Ptr output(
new pcl::PointCloud<pcl::PointXYZI>);
124 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
127 pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(
new pcl::PointCloud<pcl::PointXYZRGB>);
132 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
135 pcl::PointCloud<pcl::PointNormal>::Ptr output(
new pcl::PointCloud<pcl::PointNormal>);
136 pcl::transformPointCloudWithNormals(*cloud, *output,
transform.toEigen4f());
140 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
143 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr output(
new pcl::PointCloud<pcl::PointXYZRGBNormal>);
144 pcl::transformPointCloudWithNormals(*cloud, *output,
transform.toEigen4f());
148 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
151 pcl::PointCloud<pcl::PointXYZINormal>::Ptr output(
new pcl::PointCloud<pcl::PointXYZINormal>);
152 pcl::transformPointCloudWithNormals(*cloud, *output,
transform.toEigen4f());
157 const pcl::PointCloud<pcl::PointXYZ>::Ptr & cloud,
158 const pcl::IndicesPtr & indices,
161 pcl::PointCloud<pcl::PointXYZ>::Ptr output(
new pcl::PointCloud<pcl::PointXYZ>);
166 const pcl::PointCloud<pcl::PointXYZI>::Ptr & cloud,
167 const pcl::IndicesPtr & indices,
170 pcl::PointCloud<pcl::PointXYZI>::Ptr output(
new pcl::PointCloud<pcl::PointXYZI>);
175 const pcl::PointCloud<pcl::PointXYZRGB>::Ptr & cloud,
176 const pcl::IndicesPtr & indices,
179 pcl::PointCloud<pcl::PointXYZRGB>::Ptr output(
new pcl::PointCloud<pcl::PointXYZRGB>);
184 const pcl::PointCloud<pcl::PointNormal>::Ptr & cloud,
185 const pcl::IndicesPtr & indices,
188 pcl::PointCloud<pcl::PointNormal>::Ptr output(
new pcl::PointCloud<pcl::PointNormal>);
189 pcl::transformPointCloudWithNormals(*cloud, *
indices, *output,
transform.toEigen4f());
193 const pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr & cloud,
194 const pcl::IndicesPtr & indices,
197 pcl::PointCloud<pcl::PointXYZRGBNormal>::Ptr output(
new pcl::PointCloud<pcl::PointXYZRGBNormal>);
198 pcl::transformPointCloudWithNormals(*cloud, *
indices, *output,
transform.toEigen4f());
202 const pcl::PointCloud<pcl::PointXYZINormal>::Ptr & cloud,
203 const pcl::IndicesPtr & indices,
206 pcl::PointCloud<pcl::PointXYZINormal>::Ptr output(
new pcl::PointCloud<pcl::PointXYZINormal>);
207 pcl::transformPointCloudWithNormals(*cloud, *
indices, *output,
transform.toEigen4f());
212 const cv::Point3f & point,
222 const cv::Point3d & point,
232 const pcl::PointXYZ & pt,
238 const pcl::PointXYZI & pt,
244 const pcl::PointXYZRGB & pt,
252 const pcl::PointNormal & point,
255 pcl::PointNormal
ret;
269 const pcl::PointXYZRGBNormal & point,
272 pcl::PointXYZRGBNormal
ret;
288 const pcl::PointXYZINormal & point,
291 pcl::PointXYZINormal
ret;