GstAnalytics.RelationMeta¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstAnalytics.RelationMeta¶
An opaque
Gst.Meta
that can be used to hold various types of results from analysis processes.The content should be accessed through the API.
New in version 1.24.
- add_cls_mtd(confidence_levels, class_quarks)¶
- Parameters:
- Returns:
Added successfully
- cls_mtd:
Handle updated to newly added classification meta.
- Return type:
(
bool
, cls_mtd:GstAnalytics.ClsMtd
)
Add analytic classification metadata to self.
New in version 1.24.
- add_od_mtd(type, x, y, w, h, loc_conf_lvl)¶
- Parameters:
- Returns:
Added successfully
- od_mtd:
Handle updated with newly added object detection meta. Add an object-detetion metadata to self.
- Return type:
(
bool
, od_mtd:GstAnalytics.ODMtd
orNone
)
New in version 1.24.
- add_one_cls_mtd(confidence_level, class_quark)¶
- Parameters:
- Returns:
Added successfully
- cls_mtd:
Handle updated to newly added classification meta.
- Return type:
(
bool
, cls_mtd:GstAnalytics.ClsMtd
)
Add analytic classification metadata to self.
New in version 1.24.
- add_oriented_od_mtd(type, x, y, w, h, r, loc_conf_lvl)¶
- Parameters:
type (
int
) – Quark of the object typex (
int
) – x component of bounding box upper-left corner (pre-rotation)y (
int
) – y component of bounding box upper-left corner (pre-rotation)w (
int
) – bounding box widthh (
int
) – bounding box heightr (
float
) – bounding box rotation in radians <0, 2xPI> with respect to the bounding box center (the rotation value is a clock-wise angle)loc_conf_lvl (
float
) – confidence level on the object location
- Returns:
Added successfully
- od_mtd:
Handle updated with newly added object detection meta. Add an object-detetion metadata to self.
- Return type:
(
bool
, od_mtd:GstAnalytics.ODMtd
orNone
)
New in version 1.26.
- add_segmentation_mtd(buffer, segmentation_type, region_ids, masks_loc_x, masks_loc_y, masks_loc_w, masks_loc_h)¶
- Parameters:
buffer (
Gst.Buffer
) – Buffer containing segmentation masks. buffer must have aGstVideo.VideoMeta
attachedsegmentation_type (
GstAnalytics.SegmentationType
) – Segmentation typeregion_ids ([
int
]) – Arrays of region ids present in the mask.masks_loc_x (
int
) – Left coordinate of the rectangle corresponding to the masks in the image.masks_loc_y (
int
) – Top coordinate of the rectangle corresponding to the masks in the image.masks_loc_w (
int
) – Width of the rectangle corresponding to the masks in the image.masks_loc_h (
int
) – Height of the rectangle corresponding to the masks in the image.
- Returns:
True
if added successfully, otherwiseFalse
- segmentation_mtd:
Handle update with newly added segmentation meta.
- Return type:
(
bool
, segmentation_mtd:GstAnalytics.SegmentationMtd
)
Add analytics segmentation metadata to self. The rectangle (masks_loc_x, mask_loc_y, mask_loc_w, mask_loc_h) define a area of the image that correspond to the segmentation masks stored in buffer. For example if the segmentation masks stored in buffer describe the segmented regions for the entire image the rectangular area will be (masks_loc_x = 0, masks_loc_y = 0, masks_loc_w = image_width, masks_loc_h = image_height).
New in version 1.26.
- add_tracking_mtd(tracking_id, tracking_first_seen)¶
- Parameters:
- Returns:
Added successfully
- trk_mtd:
Handle updated with newly added tracking meta. Add an analytic tracking metadata to self.
- Return type:
(
bool
, trk_mtd:GstAnalytics.TrackingMtd
)
New in version 1.24.
- exist(an_meta_first_id, an_meta_second_id, max_relation_span, cond_types)¶
- Parameters:
an_meta_first_id (
int
) – First analysis-metaan_meta_second_id (
int
) – Second analysis-metamax_relation_span (
int
) – Maximum number of relation between an_meta_first_id and an_meta_second_id. A value of 1 mean only only consider direct relation.cond_types (
GstAnalytics.RelTypes
) – condition on relation types.
- Returns:
True
if a relation between exit between an_meta_first_id and an_meta_second_id, otherwiseFalse
.- relations_path:
If not
None
this list will be filled with relation path between an_meta_first_id and an_meta_second_id. List value should be access withGLib.SList
API. Use GPOINTER_TO_INT(iter->data) where iter is aGLib.SList
element to get analysis-meta id on the relation path. Free this list with g_slist_free (relations_path) after using.
- Return type:
Verify existence of relation(s) between an_meta_first_d and an_meta_second_id according to relation condition cond_types. It optionally also return a shortest path of relations ( compliant with cond_types) between an_meta_first_id and an_meta_second_id.
New in version 1.24.
- get_cls_mtd(an_meta_id)¶
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.ClsMtd
instance to retrieve- Returns:
True
if successful.- rlt:
Will be filled with relatable meta
- Return type:
(
bool
, rlt:GstAnalytics.ClsMtd
)
Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return
False
and rlt is invalid.New in version 1.24.
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.Mtd
involved in relation to queryrelation_type (
GstAnalytics.RelTypes
) – Type of relation to filter on.type (
int
) – Type ofGstAnalytics.Mtd
to filter onstate (
object
) – Opaque data to store state of the query. If state point toNone
, the first analytics-metadata directly related to an_meta_id will be set in rlt_mtd. Doesn’t need to be free.
- Returns:
True
if rlt_mtd was updated, other wiseFalse
- state:
Opaque data to store state of the query. If state point to
None
, the first analytics-metadata directly related to an_meta_id will be set in rlt_mtd. Doesn’t need to be free.- rlt_mtd:
Handle updated to directly related relatable meta.
- Return type:
(
bool
, state:object
, rlt_mtd:GstAnalytics.Mtd
)
New in version 1.24.
- get_mtd(an_meta_id, type)¶
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.Mtd
instance to retrievetype (
int
) – Filter on a specific type of analysis, useGstAnalytics.MTD_TYPE_ANY
to match any type
- Returns:
True
if successful.- rlt:
Will be filled with relatable meta
- Return type:
(
bool
, rlt:GstAnalytics.Mtd
)
Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return
False
and rlt is invalid.New in version 1.24.
- get_od_mtd(an_meta_id)¶
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.ODMtd
instance to retrieve- Returns:
True
if successful.- rlt:
Will be filled with relatable meta
- Return type:
(
bool
, rlt:GstAnalytics.ODMtd
)
Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return
False
and rlt is invalid.New in version 1.24.
- get_relation(an_meta_first_id, an_meta_second_id)¶
- Parameters:
- Returns:
relation description between first and second analysis-meta.
- Return type:
Get relations between first and second analysis-meta. Ids (an_meta_first_id and an_meta_second_id) must be from a call to gst_analytics_mtd_get_id (handle).
New in version 1.24.
- get_segmentation_mtd(an_meta_id)¶
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.SegmentationMtd
instance to retrieve- Returns:
True
if successful.- rlt:
Will be filled with relatable meta
- Return type:
(
bool
, rlt:GstAnalytics.SegmentationMtd
)
Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return
False
and rlt is invalid.New in version 1.26.
- get_tracking_mtd(an_meta_id)¶
- Parameters:
an_meta_id (
int
) – Id ofGstAnalytics.Mtd
instance to retrieve- Returns:
True
if successful.- rlt:
Will be filled with relatable meta
- Return type:
(
bool
, rlt:GstAnalytics.TrackingMtd
)
Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return
False
and rlt is invalid.New in version 1.24.
- iterate(state, type)¶
- Parameters:
state (
object
orNone
) – Opaque data to store iteration state, initialize toNone
, no need to free it.type (
int
) – Type ofGstAnalytics.Mtd
to iterate on or useGstAnalytics.MTD_TYPE_ANY
for any.
- Returns:
False
if end was reached and iteration is completed.- rlt_mtd:
Handle updated to iterated GstAnalyticsRelatableMtd.
- Return type:
(
bool
, rlt_mtd:GstAnalytics.Mtd
)
New in version 1.24.
- set_relation(type, an_meta_first_id, an_meta_second_id)¶
- Parameters:
type (
GstAnalytics.RelTypes
) – aGstAnalytics.RelTypes
defining relation between two analysis-metaan_meta_first_id (
int
) – first meta idan_meta_second_id (
int
) – second meta id
- Returns:
- Return type:
Sets the relation (
GstAnalytics.RelTypes
) between an_meta_first and an_meta_second. Ids must have been obtained a call to gst_analytics_mtd_get_id(handle).New in version 1.24.