MCPcopy Create free account
hub / github.com/LimHyungTae/patchwork / calculate_precision_recall

Function calculate_precision_recall

include/patchwork/utils.hpp:191–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190template <typename PointT>
191void calculate_precision_recall(const pcl::PointCloud<PointT> &pc_curr,
192 pcl::PointCloud<PointT> &ground_estimated,
193 double &precision,
194 double &recall,
195 bool consider_outliers = true) {
196 // Ensure that PointT is PointT because this function only works in the
197 // SemanticKITTI
198 if (!std::is_same<PointT, PointXYZILID>::value) {
199 throw invalid_argument(
200 "This function only supports `PointT`. Not "
201 "implemented for this point type.");
202 }
203
204 int num_ground_est = ground_estimated.points.size();
205 int num_ground_gt = count_num_ground(pc_curr);
206 int num_TP = count_num_ground(ground_estimated);
207 if (consider_outliers) {
208 int num_outliers_est = count_num_outliers(ground_estimated);
209 precision = static_cast<double>(num_TP) / (num_ground_est - num_outliers_est) * 100;
210 recall = static_cast<double>(num_TP) / num_ground_gt * 100;
211 } else {
212 precision = static_cast<double>(num_TP) / num_ground_est * 100;
213 recall = static_cast<double>(num_TP) / num_ground_gt * 100;
214 }
215}
216
217template <typename PointT>
218void save_all_labels(const pcl::PointCloud<PointT> &pc, string ABS_DIR, string seq, int count) {

Callers 2

mainFunction · 0.85
callbackNodeFunction · 0.85

Calls 3

count_num_groundFunction · 0.85
count_num_outliersFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected