Utilities to work with celantur::CelanturDetection.
More...
|
| void | celantur::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. More...
|
| |
| std::vector< CelanturDetection > | celantur::deserialise_image_metrics_from_json (std::string_view is) |
| | Construct detections vector from the JSON string. More...
|
| |
| std::vector< CelanturDetection > | celantur::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 vector of CelanturDetection objects and filters them according to the specified thresholds for each class. More...
|
| |
| std::vector< CelanturDetection > | celantur::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 objects and filters them to include only those whose class names are present in the provided set. More...
|
| |
| std::vector< CelanturDetection > | celantur::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 to include only those whose class IDs are present in the provided set. More...
|
| |
| cv::Mat | celantur::generate_binary_mask (const cv::Size &image_size, const std::vector< CelanturDetection > &detections, PerTypeProcessingConfig config) |
| | Generate a binary mask for a specific class from detections. This function creates a binary mask image where pixels corresponding to the specified class in the detections are set to 255 (white) and all other pixels are set to 0 (black). More...
|
| |
| cv::Mat | celantur::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 CelanturDetection objects, and draws bounding boxes and class labels on the image to visualize the detections. Can be used for debug purposes. More...
|
| |
Utilities to work with celantur::CelanturDetection.
◆ deserialise_image_metrics_from_json()
| std::vector< CelanturDetection > celantur::deserialise_image_metrics_from_json |
( |
std::string_view |
is | ) |
|
◆ filter_detections_by_class()
◆ filter_detections_by_class_name()
| std::vector< CelanturDetection > celantur::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 objects and filters them to include only those whose class names are present in the provided set.
- Parameters
-
| detections | The vector of CelanturDetection objects to be filtered. |
| classes | A set of class names to filter by. |
- Returns
- A vector of CelanturDetection objects whose class names are in the provided set.
References celantur::CelanturDetection::class_name.
◆ filter_detections_by_threshold()
◆ generate_binary_mask()
Generate a binary mask for a specific class from detections. This function creates a binary mask image where pixels corresponding to the specified class in the detections are set to 255 (white) and all other pixels are set to 0 (black).
- Parameters
-
| image_size | The size of the output mask image as a cv::Size object. Can be obtained from the original image with orig_img.size(). |
| detections | The vector of CelanturDetection objects containing the detected objects. |
| config | a config used to create the detection |
- Returns
- A cv::Mat object representing the binary mask for the specified class.
References celantur::BBox_Oval, celantur::BBox_Rectangle, celantur::None, and celantur::Segmentation.
◆ serialise_image_metrics_to_json()
| void celantur::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.
- Parameters
-
| image | The input image as a cv::Mat object. |
| detections | The vector of CelanturDetection objects to be serialized. |
| image_name | The name of the image (filename or custom identifier). |
| input_folder | The input folder path where the image is located. |
| os | The output stream where the JSON will be written. |
◆ visualise_detections()
| cv::Mat celantur::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 CelanturDetection objects, and draws bounding boxes and class labels on the image to visualize the detections. Can be used for debug purposes.
- Parameters
-
| image | The input image as a cv::Mat object. |
| detections | The vector of CelanturDetection objects to be visualized. |
- Returns
- A new cv::Mat object with the detections drawn on it.