| 85 | } |
| 86 | |
| 87 | void |
| 88 | compute (const pcl::PCLPointCloud2::ConstPtr &input, pcl::PCLPointCloud2 &output, |
| 89 | int window_size, double sigma_color, double sigma_depth) |
| 90 | { |
| 91 | PointCloud<PointXYZRGBA>::Ptr cloud (new pcl::PointCloud<PointXYZRGBA> ()); |
| 92 | fromPCLPointCloud2 (*input, *cloud); |
| 93 | |
| 94 | PointCloud<PointXYZRGBA>::Ptr cloud_upsampled (new PointCloud<PointXYZRGBA> ()); |
| 95 | |
| 96 | BilateralUpsampling<PointXYZRGBA, PointXYZRGBA> bu; |
| 97 | bu.setInputCloud (cloud); |
| 98 | bu.setWindowSize (window_size); |
| 99 | bu.setSigmaColor (sigma_color); |
| 100 | bu.setSigmaDepth (sigma_depth); |
| 101 | |
| 102 | // TODO need to fix this somehow |
| 103 | bu.setProjectionMatrix (bu.KinectSXGAProjectionMatrix); |
| 104 | |
| 105 | |
| 106 | TicToc tt; |
| 107 | tt.tic (); |
| 108 | bu.process (*cloud_upsampled); |
| 109 | print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", cloud_upsampled->width * cloud_upsampled->height); print_info (" points]\n"); |
| 110 | |
| 111 | toPCLPointCloud2 (*cloud_upsampled, output); |
| 112 | } |
| 113 | |
| 114 | void |
| 115 | saveCloud (const std::string &filename, const pcl::PCLPointCloud2 &output) |
no test coverage detected