| 694 | } |
| 695 | |
| 696 | void Plot::plotCameraSource(const Eigen::VectorXi &pts_cam_source_in, |
| 697 | const PointCloudRGBA::Ptr &cloud) { |
| 698 | PointCloudRGBA::Ptr left_cloud(new PointCloudRGBA); |
| 699 | PointCloudRGBA::Ptr right_cloud(new PointCloudRGBA); |
| 700 | |
| 701 | for (int i = 0; i < pts_cam_source_in.size(); i++) { |
| 702 | if (pts_cam_source_in(i) == 0) |
| 703 | left_cloud->points.push_back(cloud->points[i]); |
| 704 | else if (pts_cam_source_in(i) == 1) |
| 705 | right_cloud->points.push_back(cloud->points[i]); |
| 706 | } |
| 707 | |
| 708 | PCLVisualizer viewer = createViewer("Camera Sources"); |
| 709 | viewer->addPointCloud<pcl::PointXYZRGBA>(left_cloud, "left point cloud"); |
| 710 | viewer->setPointCloudRenderingProperties( |
| 711 | pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "left point cloud"); |
| 712 | viewer->setPointCloudRenderingProperties( |
| 713 | pcl::visualization::PCL_VISUALIZER_COLOR, 1.0, 0.0, 0.0, |
| 714 | "left point cloud"); |
| 715 | viewer->addPointCloud<pcl::PointXYZRGBA>(right_cloud, "right point cloud"); |
| 716 | viewer->setPointCloudRenderingProperties( |
| 717 | pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "right point cloud"); |
| 718 | viewer->setPointCloudRenderingProperties( |
| 719 | pcl::visualization::PCL_VISUALIZER_COLOR, 0.0, 1.0, 0.0, |
| 720 | "right point cloud"); |
| 721 | runViewer(viewer); |
| 722 | } |
| 723 | |
| 724 | void Plot::addCloudNormalsToViewer(PCLVisualizer &viewer, |
| 725 | const PointCloudPointNormal::Ptr &cloud, |