GStreamer Video Analytics (GVA) Plugin
|
Go to the documentation of this file.
18 #include <gst/video/gstvideometa.h>
68 const char *str = g_quark_to_string(
_gst_meta->roi_type);
69 return std::string(str ? str :
"");
85 GstStructure *object_id_struct = gst_video_region_of_interest_meta_get_param(
_gst_meta,
"object_id");
86 if (!object_id_struct)
89 gst_structure_get_int(object_id_struct,
"id", &
id);
109 GstStructure *tensor = gst_structure_new_empty(name.c_str());
110 gst_video_region_of_interest_meta_add_param(
_gst_meta, tensor);
149 throw std::invalid_argument(
"GVA::RegionOfInterest: meta is nullptr");
151 _tensors.reserve(g_list_length(meta->params));
153 for (GList *l = meta->params; l; l = g_list_next(l)) {
154 GstStructure *s = (GstStructure *)l->data;
155 if (not gst_structure_has_name(s,
"object_id")) {
176 GstStructure *
object_id = gst_video_region_of_interest_meta_get_param(
_gst_meta,
"object_id");
178 gst_structure_set(
object_id,
"id", G_TYPE_INT,
id, NULL);
180 object_id = gst_structure_new(
"object_id",
"id", G_TYPE_INT,
id, NULL);
189 GstVideoRegionOfInterestMeta *
_meta()
const {
Template structure for rectangle containing x, y, w, h fields.
Definition: region_of_interest.h:31
Tensor * _detection
last added detection Tensor instance, defined as Tensor with name set to "detection"
Definition: region_of_interest.h:208
int label_id() const
Get label_id from detection Tensor, last added to this RegionOfInterest.
Definition: region_of_interest.h:138
Tensor detection()
Returns detection Tensor, last added to this RegionOfInterest. As any other Tensor,...
Definition: region_of_interest.h:127
double get_double(const std::string &field_name, double default_value=0) const
Get double contained in value stored at field_name.
Definition: tensor.h:226
double confidence() const
Get confidence of detection or classification result extracted from the tensor.
Definition: tensor.h:155
void set_object_id(int32_t id)
Set object ID.
Definition: region_of_interest.h:175
int32_t object_id() const
Get unique id of the RegionOfInterest. The id typically created by gvatrack element.
Definition: region_of_interest.h:84
This file contains GVA::Tensor class which contains and describes neural network inference result.
Rect< double > normalized_rect()
Get bounding box of the RegionOfInterest as normalized coordinates in the range [0,...
Definition: region_of_interest.h:57
Tensor add_tensor(const std::string &name)
Add new tensor (inference result) to this RegionOfInterest with name set. To add detection tensor,...
Definition: region_of_interest.h:108
int label_id() const
Get label id.
Definition: tensor.h:324
void set_label(std::string label)
Set RegionOfInterest label.
Definition: region_of_interest.h:167
GstVideoRegionOfInterestMeta * _meta() const
Internal function, don't use or use with caution.
Definition: region_of_interest.h:189
RegionOfInterest(GstVideoRegionOfInterestMeta *meta)
Construct RegionOfInterest instance from GstVideoRegionOfInterestMeta. After this,...
Definition: region_of_interest.h:147
This class represents region of interest - object describing detection result (bounding box) and cont...
Definition: region_of_interest.h:43
This class represents tensor - map-like storage for inference result information, such as output blob...
Definition: tensor.h:38
std::vector< Tensor > tensors() const
Get all Tensor instances added to this RegionOfInterest.
Definition: region_of_interest.h:97
Rect< uint32_t > rect() const
Get bounding box of the RegionOfInterest as pixel coordinates in original image.
Definition: region_of_interest.h:49
std::vector< Tensor > _tensors
vector of Tensor objects added to this RegionOfInterest (describing detection & inference results),...
Definition: region_of_interest.h:204
double confidence() const
Get RegionOfInterest detection confidence (set by gvadetect)
Definition: region_of_interest.h:76
GstVideoRegionOfInterestMeta * _gst_meta
GstVideoRegionOfInterestMeta containing fields filled with detection result (produced by gvadetect el...
Definition: region_of_interest.h:199
std::string label() const
Get RegionOfInterest label.
Definition: region_of_interest.h:67