# GstAnalyticsKeypointMtd

This metadata type represents individual keypoints with 2D or 3D positions. Keypoints can be grouped using GstAnalyticsGroupMtd with semantic tags (e.g., "hand-21-kp", "pose-17-kp", "face-68-kp").

Skeleton links between keypoints are represented as relations using GST_ANALYTICS_REL_TYPE_RELATE_TO, allowing standard relation queries to traverse the skeleton structure.

## Creating Keypoint Groups

The most common usage is to create a group of keypoints with skeleton structure:

     GstAnalyticsGroupMtd hand_group;
     gint positions[] = {100, 200, 150, 250, ...}; // 21 x,y pairs for hand
     gfloat confidences[] = {0.9f, 0.85f, 0.95f, ...};
     gint skeleton_pairs[] = {0, 1, 1, 2, 2, 3, ...}; // 20 links (40 values)

     gst_analytics_relation_meta_add_keypoints_group(rmeta,
         "hand-21-kp", GST_ANALYTICS_KEYPOINT_DIMENSIONS_2D,
         42, positions, 21, confidences, NULL, 40, skeleton_pairs, &hand_group);

## Iterating Through Keypoints

Iterate keypoints in a group with type filtering:

     GstAnalyticsMtd member;
     gpointer state = NULL;
     while (gst_analytics_group_mtd_iterate(&hand_group, &state,
             gst_analytics_keypoint_mtd_get_mtd_type(), &member)) {
         gint x, y, z;
         gfloat conf;
         GstAnalyticsKeypointDimensions dim;
         gst_analytics_keypoint_mtd_get_position((GstAnalyticsKeypointMtd*)&member,
             &x, &y, &z, &dim);
         gst_analytics_keypoint_mtd_get_confidence((GstAnalyticsKeypointMtd*)&member,
             &conf);
         g_print("Keypoint at (%d, %d) confidence: %.2f\n", x, y, conf);
     }

## Querying Skeleton Links

Verify skeleton connections between keypoints:

     // Get first two keypoints
     GstAnalyticsMtd wrist_kp, thumb_kp;
     gst_analytics_group_mtd_get_member(&hand_group, 0, &wrist_kp);
     gst_analytics_group_mtd_get_member(&hand_group, 1, &thumb_kp);

     // Verify skeleton link exists
     gboolean has_link = gst_analytics_relation_meta_exist(rmeta,
         wrist_kp.id, thumb_kp.id, 1,
         GST_ANALYTICS_REL_TYPE_RELATE_TO, NULL);
     if (has_link) {
         g_print("Skeleton link exists between wrist and thumb\n");
     }

## Relating Keypoints to Other Metadata

Since keypoints are GstAnalyticsMtd, they can participate in relations:

     // Get first keypoint
     GstAnalyticsMtd keypoint;
     gst_analytics_group_mtd_get_member(&hand_group, 0, &keypoint);

     // Relate to object detection
     gst_analytics_relation_meta_set_relation(rmeta,
         GST_ANALYTICS_REL_TYPE_CONTAINED_BY, keypoint.id, od_mtd.id);

## GstAnalyticsKeypointMtd

Handle containing data required to use gst_analytics_keypoint_mtd APIs. This type is generally expected to be allocated on the stack.

### Members

`id` (guint) –

Instance identifier.

`meta` (GstAnalyticsRelationMeta *) –

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

Since : 1.30

## GstAnalytics.KeypointMtd

Handle containing data required to use gst_analytics_keypoint_mtd APIs. This type is generally expected to be allocated on the stack.

### Members

`id` (Number) –

Instance identifier.

`meta` (GstAnalytics.RelationMeta) –

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

Since : 1.30

## GstAnalytics.KeypointMtd

Handle containing data required to use gst_analytics_keypoint_mtd APIs. This type is generally expected to be allocated on the stack.

### Members

`id` (int) –

Instance identifier.

`meta` (GstAnalytics.RelationMeta) –

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

Since : 1.30

### Methods

#### gst_analytics_keypoint_mtd_get_confidence

    gboolean
    gst_analytics_keypoint_mtd_get_confidence (const GstAnalyticsKeypointMtd * handle,
                                               gfloat * confidence)

Get keypoint confidence.

Parameters:

`handle` –

handle

`confidence` ( [out]) –

Confidence score

Returns –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.prototype.get_confidence

    function GstAnalytics.KeypointMtd.prototype.get_confidence(): {
        // javascript wrapper for 'gst_analytics_keypoint_mtd_get_confidence'
    }

Get keypoint confidence.

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(Number ) –

TRUE if successful, FALSE otherwise

`confidence` (Number ) –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.get_confidence

    def GstAnalytics.KeypointMtd.get_confidence (self):
        #python wrapper for 'gst_analytics_keypoint_mtd_get_confidence'

Get keypoint confidence.

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(bool ) –

TRUE if successful, FALSE otherwise

`confidence` (float ) –

TRUE if successful, FALSE otherwise

Since : 1.30

#### gst_analytics_keypoint_mtd_get_position

    gboolean
    gst_analytics_keypoint_mtd_get_position (const GstAnalyticsKeypointMtd * handle,
                                             gint * x,
                                             gint * y,
                                             gint * z,
                                             GstAnalyticsKeypointDimensions * dimension)

Get keypoint position and dimension. See gst_analytics_relation_meta_add_keypoint_mtd for more details

Parameters:

`handle` –

handle

`x` ( [out]) –

X coordinate

`y` ( [out]) –

Y coordinate

`z` ( [out][nullable]) –

Z coordinate, or NULL to ignore. Always 0 for 2D keypoints.

`dimension` ( [out]) –

Keypoint dimension (2D or 3D)

Returns –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.prototype.get_position

    function GstAnalytics.KeypointMtd.prototype.get_position(): {
        // javascript wrapper for 'gst_analytics_keypoint_mtd_get_position'
    }

Get keypoint position and dimension. See GstAnalytics.RelationMeta.prototype.add_keypoint_mtd for more details

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(Number ) –

TRUE if successful, FALSE otherwise

`x` (Number ) –

TRUE if successful, FALSE otherwise

`y` (Number ) –

TRUE if successful, FALSE otherwise

`z` (Number ) –

TRUE if successful, FALSE otherwise

`dimension` (GstAnalytics.KeypointDimensions ) –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.get_position

    def GstAnalytics.KeypointMtd.get_position (self):
        #python wrapper for 'gst_analytics_keypoint_mtd_get_position'

Get keypoint position and dimension. See GstAnalytics.RelationMeta.add_keypoint_mtd for more details

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(bool ) –

TRUE if successful, FALSE otherwise

`x` (int ) –

TRUE if successful, FALSE otherwise

`y` (int ) –

TRUE if successful, FALSE otherwise

`z` (int ) –

TRUE if successful, FALSE otherwise

`dimension` (GstAnalytics.KeypointDimensions ) –

TRUE if successful, FALSE otherwise

Since : 1.30

#### gst_analytics_keypoint_mtd_get_visibility_flags

    gboolean
    gst_analytics_keypoint_mtd_get_visibility_flags (const GstAnalyticsKeypointMtd * handle,
                                                     guint8 * visibility_flags)

Get keypoint visibility flags.

Parameters:

`handle` –

handle

`visibility_flags` ( [out]) –

Visibility flags, a combination of GstAnalyticsKeypointVisibility values

Returns –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.prototype.get_visibility_flags

    function GstAnalytics.KeypointMtd.prototype.get_visibility_flags(): {
        // javascript wrapper for 'gst_analytics_keypoint_mtd_get_visibility_flags'
    }

Get keypoint visibility flags.

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(Number ) –

TRUE if successful, FALSE otherwise

`visibility_flags` (Number ) –

TRUE if successful, FALSE otherwise

Since : 1.30

#### GstAnalytics.KeypointMtd.get_visibility_flags

    def GstAnalytics.KeypointMtd.get_visibility_flags (self):
        #python wrapper for 'gst_analytics_keypoint_mtd_get_visibility_flags'

Get keypoint visibility flags.

Parameters:

`handle` (GstAnalytics.KeypointMtd) –

handle

Returns a tuple made of:

(bool ) –

TRUE if successful, FALSE otherwise

`visibility_flags` (int ) –

TRUE if successful, FALSE otherwise

Since : 1.30

### Functions

#### gst_analytics_keypoint_mtd_get_mtd_type

    GstAnalyticsMtdType
    gst_analytics_keypoint_mtd_get_mtd_type ()

Get an id identifying GstAnalyticsMtd type.

Returns –

opaque id of GstAnalyticsMtd type

Since : 1.30

#### GstAnalytics.KeypointMtd.prototype.get_mtd_type

    function GstAnalytics.KeypointMtd.prototype.get_mtd_type(): {
        // javascript wrapper for 'gst_analytics_keypoint_mtd_get_mtd_type'
    }

Get an id identifying GstAnalytics.Mtd type.

Returns (Number) –

opaque id of GstAnalytics.Mtd type

Since : 1.30

#### GstAnalytics.KeypointMtd.get_mtd_type

    def GstAnalytics.KeypointMtd.get_mtd_type ():
        #python wrapper for 'gst_analytics_keypoint_mtd_get_mtd_type'

Get an id identifying GstAnalytics.Mtd type.

Returns (int) –

opaque id of GstAnalytics.Mtd type

Since : 1.30

## Enumerations

### GstAnalyticsKeypointDimensions

Enum value describing supported keypoint dimension.

##### Members

`GST_ANALYTICS_KEYPOINT_DIMENSIONS_2D` (2) –

keypoints in 2D space with (x,y) coordinates.

`GST_ANALYTICS_KEYPOINT_DIMENSIONS_3D` (3) –

keypoints in 3D space with (x,y,z) coordinates.

Since : 1.30

### GstAnalytics.KeypointDimensions

Enum value describing supported keypoint dimension.

##### Members

`GstAnalytics.KeypointDimensions.2D` (2) –

keypoints in 2D space with (x,y) coordinates.

`GstAnalytics.KeypointDimensions.3D` (3) –

keypoints in 3D space with (x,y,z) coordinates.

Since : 1.30

### GstAnalytics.KeypointDimensions

Enum value describing supported keypoint dimension.

##### Members

`GstAnalytics.KeypointDimensions.2D` (2) –

keypoints in 2D space with (x,y) coordinates.

`GstAnalytics.KeypointDimensions.3D` (3) –

keypoints in 3D space with (x,y,z) coordinates.

Since : 1.30

### GstAnalyticsKeypointVisibility

Flags describing the visibility state of a keypoint.

##### Members

`GST_ANALYTICS_KEYPOINT_VISIBILITY_UNKNOWN` (0) –

Visibility is not known.

`GST_ANALYTICS_KEYPOINT_VISIBILITY_VISIBLE` (1) –

Keypoint is fully visible.

`GST_ANALYTICS_KEYPOINT_VISIBILITY_OCCLUDED` (4) –

Keypoint exists but is occluded.

`GST_ANALYTICS_KEYPOINT_VISIBILITY_PROJECTED` (8) –

Keypoint position was projected by the analysis.

Since : 1.30

### GstAnalytics.KeypointVisibility

Flags describing the visibility state of a keypoint.

##### Members

`GstAnalytics.KeypointVisibility.UNKNOWN` (0) –

Visibility is not known.

`GstAnalytics.KeypointVisibility.VISIBLE` (1) –

Keypoint is fully visible.

`GstAnalytics.KeypointVisibility.OCCLUDED` (4) –

Keypoint exists but is occluded.

`GstAnalytics.KeypointVisibility.PROJECTED` (8) –

Keypoint position was projected by the analysis.

Since : 1.30

### GstAnalytics.KeypointVisibility

Flags describing the visibility state of a keypoint.

##### Members

`GstAnalytics.KeypointVisibility.UNKNOWN` (0) –

Visibility is not known.

`GstAnalytics.KeypointVisibility.VISIBLE` (1) –

Keypoint is fully visible.

`GstAnalytics.KeypointVisibility.OCCLUDED` (4) –

Keypoint exists but is occluded.

`GstAnalytics.KeypointVisibility.PROJECTED` (8) –

Keypoint position was projected by the analysis.

Since : 1.30

The results of the search are