| 89 | } |
| 90 | |
| 91 | void |
| 92 | compute (ConstCloudPtr &input, Cloud &output, float resolution, const std::string& method) |
| 93 | { |
| 94 | // Estimate |
| 95 | TicToc tt; |
| 96 | tt.tic (); |
| 97 | |
| 98 | print_highlight (stderr, "Computing "); |
| 99 | |
| 100 | if (method == "dilate") |
| 101 | { |
| 102 | applyMorphologicalOperator<PointType> (input, resolution, MORPH_DILATE, output); |
| 103 | } |
| 104 | else if (method == "erode") |
| 105 | { |
| 106 | applyMorphologicalOperator<PointType> (input, resolution, MORPH_ERODE, output); |
| 107 | } |
| 108 | else if (method == "open") |
| 109 | { |
| 110 | applyMorphologicalOperator<PointType> (input, resolution, MORPH_OPEN, output); |
| 111 | } |
| 112 | else if (method == "close") |
| 113 | { |
| 114 | applyMorphologicalOperator<PointType> (input, resolution, MORPH_CLOSE, output); |
| 115 | } |
| 116 | else |
| 117 | { |
| 118 | PCL_ERROR ("%s is not a valid morphological operator! Quitting!\n", method.c_str ()); |
| 119 | return; |
| 120 | } |
| 121 | |
| 122 | print_info ("[done, "); print_value ("%g", tt.toc ()); print_info (" ms : "); print_value ("%d", output.width * output.height); print_info (" points]\n"); |
| 123 | } |
| 124 | |
| 125 | void |
| 126 | saveCloud (const std::string &filename, const Cloud &output) |
no test coverage detected