GstAnalytics.SegmentationMtd

Fields

Name

Type

Access

Description

id

int

r/w

Instance identifier

meta

GstAnalytics.RelationMeta

r/w

Instance of GstAnalytics.RelationMeta where the analytics-metadata identified by id is stored.

Methods

class

get_mtd_type ()

get_mask ()

get_region_count ()

get_region_id (index)

get_region_index (id)

Details

class GstAnalytics.SegmentationMtd

This type of metadata holds information on which pixels belongs to a region of the image representing a type of object.

It supports two types of segmentation, semantic or instance:

New in version 1.26.

classmethod get_mtd_type()
Returns:

A #GstAnalyticsMtdType type

Return type:

int

Get an instance of #GstAnalyticsMtdType that represent segmentation metadata type.

New in version 1.26.

get_mask()
Returns:

Segmentation mask data stored in a Gst.Buffer

masks_loc_x:

Left coordinate of the rectangle corresponding to the mask in the image.

masks_loc_y:

Top coordinate of the rectangle corresponding to the mask in the image.

masks_loc_w:

Width of the rectangle corresponding to the mask in the image.

masks_loc_h:

Height of the rectangle corresponding to the mask in the image.

Return type:

(Gst.Buffer, masks_loc_x: int, masks_loc_y: int, masks_loc_w: int, masks_loc_h: int)

Get segmentation mask data.

New in version 1.26.

get_region_count()
Returns:

Number of regions segmented

Return type:

int

Get the regions count.

New in version 1.26.

get_region_id(index)
Parameters:

index (int) – Region index

Returns:

The region ID

Return type:

int

Get id of the region corresponding to index, which should be smaller than the return value of GstAnalytics.SegmentationMtd.get_region_count()

New in version 1.26.

get_region_index(id)
Parameters:

id (int) – Region id

Returns:

True if a region with id exist, otherwise False

index:

Region index

Return type:

(bool, index: int)

Get region index of the region identified by id.

New in version 1.26.