示例#1
1
文件: test_pca.cpp 项目: nttputus/PCL
TEST(PCA, projection)
{
  pcl::PointXYZ projected, reconstructed;
  for(size_t i = 0; i < cloud.size(); i++)
  {
    pca.project (cloud[i], projected);
    pca.reconstruct (projected, reconstructed);
    EXPECT_NEAR_VECTORS (reconstructed.getVector3fMap (), cloud[i].getVector3fMap (), 2.5e-4);
  }
}
示例#2
0
TEST(PCA, projection)
{
  pcl::PointXYZ projected, reconstructed;
  for(const auto &point : cloud)
  {
    pca.project (point, projected);
    pca.reconstruct (projected, reconstructed);
    EXPECT_NEAR_VECTORS (reconstructed.getVector3fMap (), point.getVector3fMap (), 2.5e-4);
  }
}
示例#3
0
文件: test_pca.cpp 项目: nttputus/PCL
TEST(PCA, cloud_projection)
{
  pcl::PointCloud<pcl::PointXYZ> cloud_projected, cloud_reconstructed;
  try
  {
    pca.project (cloud, cloud_projected);
    EXPECT_EQ (cloud.size (), cloud_projected.size ());
    pca.reconstruct (cloud_projected, cloud_reconstructed);
    EXPECT_EQ (cloud_reconstructed.size (), cloud_projected.size ());
    for(size_t i = 0; i < cloud.size(); i++)
      EXPECT_NEAR_VECTORS (cloud[i].getVector3fMap (),
                           cloud_reconstructed[i].getVector3fMap (),
                           2.5e-4);
  }
  catch (pcl::InitFailedException &e)
  {
    std::cerr << "something wrong" << std::endl;
  }
}