20 #ifndef _INITIAL_ALIGNMENT_H 21 #define _INITIAL_ALIGNMENT_H 74 InitialAlignment(PointCloudRGB::Ptr target_cloud, PointCloudRGB::Ptr source_cloud);
83 bool transform_exists_;
96 Eigen::Matrix4f getRigidTransform();
103 void getAlignedCloud(PointCloudRGB::Ptr aligned_cloud);
110 void getAlignedCloudROSMsg(sensor_msgs::PointCloud2& aligned_cloud_msg);
117 void applyTFtoCloud(PointCloudRGB::Ptr cloud);
125 void applyTFtoCloud(PointCloudRGB::Ptr cloud, Eigen::Matrix4f
tf);
139 void setRadiusFactor(
double align_factor);
200 void applyTFtoCloud();
206 void runNormalsBasedAlgorithm();
212 void runKeypointsBasedAlgorithm();
221 void obtainNormalsCluster(PointCloudRGB::Ptr cloud,
222 PointCloudNormal::Ptr normals,
223 std::vector<pcl::PointIndices>& cluster_indices);
232 void obtainDominantNormals(PointCloudNormal::Ptr normals,
233 std::vector<pcl::PointIndices> cluster_indices,
234 PointCloudNormal::Ptr dominant_normals);
246 bool normalsCorrespondences(PointCloudNormal::Ptr source_dominant_normal,
247 PointCloudNormal::Ptr target_dominant_normal,
248 std::vector<int>& source_idx, std::vector<int>& target_idx);
256 void getTransformationFromNormals(PointCloudNormal::Ptr source_normals,
257 PointCloudNormal::Ptr target_normals);
271 bool findIdx(Eigen::MatrixXd source_m, Eigen::MatrixXd target_m,
272 Eigen::MatrixXi source_idx_m, Eigen::MatrixXi target_idx_m,
273 std::vector<int>& source_indx, std::vector<int>& target_indx);
282 Eigen::Matrix3f getCoordinateSystem(PointCloudNormal::Ptr normals,
283 std::vector<int>& index);
293 void matrixFromAngles(PointCloudNormal::Ptr normal,
295 Eigen::MatrixXd& matrix,
296 Eigen::MatrixXi& index_matrix);
306 Eigen::VectorXd nextVector(Eigen::MatrixXd matrix,
307 int current_col,
int current_row);
318 int obtainHarrisKeypoints(PointCloudRGB::Ptr cloud,
319 PointCloudNormal::Ptr normals,
320 PointCloudRGB::Ptr keypoints_cloud,
321 pcl::IndicesPtr keypoints_indices);
333 int obtainBoundaryKeypoints(PointCloudRGB::Ptr cloud,
334 PointCloudNormal::Ptr normals,
335 PointCloudRGB::Ptr keypoints_cloud,
336 pcl::IndicesPtr keypoints_indices,
337 pcl::IndicesPtr non_keypoints_indices);
349 int obtainMultiScaleKeypointsAndFeatures(PointCloudRGB::Ptr cloud,
350 PointCloudNormal::Ptr normals,
351 PointCloudRGB::Ptr keypoints_cloud,
352 pcl::IndicesPtr keypoints_indices,
353 PointCloudFPFH::Ptr features);
364 int obtainFeatures(PointCloudRGB::Ptr cloud,
365 PointCloudNormal::Ptr normals,
366 pcl::IndicesPtr keypoints_indices,
367 PointCloudFPFH::Ptr features);
378 int obtainKeypointsAndFeatures(PointCloudRGB::Ptr cloud,
379 PointCloudNormal::Ptr normals,
380 PointCloudRGB::Ptr keypoints_cloud,
381 PointCloudFPFH::Ptr features_cloud);
387 void obtainCorrespondences();
393 void rejectCorrespondences();
399 void rejectOneToOneCorrespondences();
405 void estimateTransform();
PointCloudNormal::Ptr target_normals_
Target normals.
Perform a rigid alignment from source to target cloud.
Eigen::Vector4f source_centroid_
Source centroid computed.
PointCloudNormal::Ptr target_dominant_normals_
Target dominant normals. Just used int NORMALS method.
PointCloudRGB::Ptr source_keypoints_
Source keypoints.
pcl::PointCloud< pcl::FPFHSignature33 > PointCloudFPFH
PointCloudFPFH::Ptr source_features_
Source features.
PointCloudRGB::Ptr aligned_cloud_
Source pointcloud aligned with target cloud.
pcl::CorrespondencesPtr correspondences_
Correspondences between source and target.
AlignmentMethod
Define possible Alignment methods.
Eigen::Vector4f target_centroid_
Target centroid computed.
~InitialAlignment()
Destroy the Initial Alignment object.
pcl::PointCloud< pcl::PointXYZRGB > PointCloudRGB
PointCloudRGB::Ptr target_keypoints_
Target keypoints.
AlignmentMethod method_
The alignment method.
PointCloudRGB::Ptr target_cloud_
Target pointcloud.
pcl::PointCloud< pcl::Normal > PointCloudNormal
double normal_radius_
Radius to compute normals.
PointCloudNormal::Ptr source_dominant_normals_
Source dominant normals. Just used int NORMALS method.
Eigen::Matrix4f rigid_tf_
Transformation matrix as result of initial alignment.
PointCloudFPFH::Ptr target_features_
Target features.
pcl::PointCloud< pcl::PointXYZ > PointCloudXYZ
PointCloudRGB::Ptr source_cloud_
Source pointcloud.
PointCloudNormal::Ptr source_normals_
Source normals.
double radius_factor_
Factor to apply to radius for computations.