| 50 | } |
| 51 | |
| 52 | int main(int argc, char* argv[]) |
| 53 | { |
| 54 | // SIM |
| 55 | // std::string modelFilepath{"/opt/bags/inf/models/sim_erfnet.onnx"}; |
| 56 | // std::string cloudPath{"/opt/bags/inf/pcds/sim_point_cloud_120.pcd"}; |
| 57 | // auto segmenter = Segmentation(modelFilepath, 22.5, -22.5, 2048, 64, 1); |
| 58 | |
| 59 | // // // // READ PCD FROM FILE, PROJECT |
| 60 | // pcl::PointCloud<pcl::PointXYZI>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZI>); |
| 61 | // pcl::io::loadPCDFile<pcl::PointXYZI> (cloudPath, *cloud) == -1; |
| 62 | // cv::Mat mask = cv::Mat::zeros(64, 2048, CV_8U); |
| 63 | // // segmenter.run(cloud, mask); |
| 64 | // segmenter.speedTest(cloud, 10); |
| 65 | |
| 66 | // Cloud::Ptr trees(new Cloud); |
| 67 | // segmenter.maskCloud(cloud, mask, trees, 255, true); |
| 68 | // findClusters(trees); |
| 69 | // pcl::io::savePCDFileASCII ("/opt/bags/inf/pcds/trees.pcd", *trees); |
| 70 | // // std::cout << "grouind" << std::endl; |
| 71 | // Cloud::Ptr ground(new Cloud); |
| 72 | // segmenter.maskCloud(cloud, mask, ground, 1); |
| 73 | // pcl::io::savePCDFileASCII ("/opt/bags/inf/pcds/ground.pcd", *ground); |
| 74 | |
| 75 | //////////////////////////////// |
| 76 | std::string realModelFilepath{"/opt/bags/inf/models/real_erfnet.onnx"}; |
| 77 | std::string realCloudPath{"/opt/bags/inf/pcds/800m.pcd"}; |
| 78 | // // std::string realCloudPath{"/opt/bags/inf/pcds/s3_p1_f2_800.pcd"}; |
| 79 | auto realSegmenter = Segmentation(realModelFilepath, 22.5, -22.5, 2048, 64, 1, true); |
| 80 | |
| 81 | // // // // READ PCD FROM FILE |
| 82 | pcl::PointCloud<pcl::PointXYZI>::Ptr realCloud (new pcl::PointCloud<pcl::PointXYZI>); |
| 83 | pcl::io::loadPCDFile<pcl::PointXYZI> (realCloudPath, *realCloud) == -1; |
| 84 | |
| 85 | // for(auto i = 0; i < realCloud->points.size(); i++){ |
| 86 | // realCloud->points[i].intensity == 1; |
| 87 | // if(realCloud->points[i].z == 0){ |
| 88 | // PointT p; |
| 89 | // p.x = p.y = p.z = std::numeric_limits<float>::quiet_NaN(); |
| 90 | // realCloud->points[i] = p; |
| 91 | // } |
| 92 | // } |
| 93 | |
| 94 | cv::Mat realMask = cv::Mat::zeros(64, 2048, CV_8U); |
| 95 | realSegmenter.run(realCloud, realMask); |
| 96 | |
| 97 | Cloud::Ptr realTrees(new Cloud); |
| 98 | realSegmenter.maskCloud(realCloud, realMask, realTrees, 255, true); |
| 99 | pcl::io::savePCDFileASCII ("/opt/bags/inf/pcds/erf_trees.pcd", *realTrees); |
| 100 | findClusters(realTrees); |
| 101 | |
| 102 | Cloud::Ptr realGround(new Cloud); |
| 103 | realSegmenter.maskCloud(realCloud, realMask, realGround, 1, false); |
| 104 | pcl::io::savePCDFileASCII ("/opt/bags/inf/pcds/erf_ground.pcd", *realGround); |
| 105 | } |
| 106 | |
| 107 | // auto seg = Segmentation(modelFilepath, 22.5, -22.5, 2048, 64, 1); |
| 108 |
nothing calls this directly
no test coverage detected