Cpp-Processing
detections-utils.h
1 #pragma once
2 
3 #include <opencv2/core.hpp>
4 #include <vector>
5 #include "CelanturDetection.h"
6 #include "CommonParameters.h"
7 #include "opencv2/core/mat.hpp"
8 #include <set>
9 
10 
11 namespace celantur {
33  void serialise_image_metrics_to_json(cv::Mat image, std::vector<CelanturDetection> detections, std::string image_name, std::string input_folder, std::ostream &os);
34 
35 
44  std::vector<CelanturDetection> filter_detections_by_threshold(const std::vector<CelanturDetection>& detections, const ModelThresholds& thresholds);
45 
54  std::vector<CelanturDetection> filter_detections_by_class_name(const std::vector<CelanturDetection>& detections, const std::set<std::string>& classes);
55 
64  std::vector<CelanturDetection> filter_detections_by_class(const std::vector<CelanturDetection>& detections, const std::set<CelanturClassId>& classes);
65 
67  std::string serialise_detections_proto(const std::vector <CelanturDetection>& detections);
68  std::vector<CelanturDetection> deserialise_detections_proto(const std::string& string);
70 
79  cv::Mat visualise_detections(const cv::Mat image, std::vector<CelanturDetection> detections);
81 }
82 
83 
84 
std::vector< CelanturDetection > filter_detections_by_class(const std::vector< CelanturDetection > &detections, const std::set< CelanturClassId > &classes)
Filter detections by type. This function takes a vector of CelanturDetection objects and filters them...
Definition: detection-utils.cpp:86
std::vector< CelanturDetection > filter_detections_by_class_name(const std::vector< CelanturDetection > &detections, const std::set< std::string > &classes)
Filter detections based on a set of class names. This function takes a vector of CelanturDetection ob...
Definition: detection-utils.cpp:75
void serialise_image_metrics_to_json(cv::Mat image, std::vector< CelanturDetection > detections, std::string image_name, std::string input_folder, std::ostream &os)
serialise detections to JSON format. Is identical to the celantur-container functionality.
Definition: detection-utils.cpp:32
std::vector< CelanturDetection > filter_detections_by_threshold(const std::vector< CelanturDetection > &detections, const ModelThresholds &thresholds)
Filter detections based on confidence thresholds for different object classes. This function takes a ...
Definition: detection-utils.cpp:58
cv::Mat visualise_detections(const cv::Mat image, std::vector< CelanturDetection > detections)
Visualise detections on an image. This function takes an input image and a vector of CelanturDetectio...
Definition: detection-utils.cpp:140
Definition: CelanturDetection.h:6