Table of Contents

y()

Function Definition: y(landmark_number = 1, pose_number = 1)

Parameters

NameTypeDescriptionExpected ValuesDefault Value
landmark_numberintThe landmark point for which the X position is required.0-161
pose_numberintThe pose number for which the landmark position is required.1-1001

Description

This function returns the y position of the pose landmark detected. The position is mapped with the stage coordinates.

0 nose
1 leftEye
2 rightEye
3 leftEar
4 rightEar
5 leftShoulder
6 rightShoulder
7 leftElbow
8 rightElbow
9 leftWrist
10 rightWrist
11 leftHip
12 rightHip
13 leftKnee
14 rightKnee
15 leftAnkle
16 rightAnkle

 

Example

The example demonstrates how to use human body detection to track the nose and make someone clown.

Code

sprite = Sprite('Ball')
pose = Posenet()

pose.video("on", 0)
pose.enablebox()

while True:
  pose.analysestage()
  
  if (pose.isdetected(0, 1)):
    sprite.setx(pose.x(0, 1))
    sprite.sety(pose.y(0, 1))
    sprite.show()
  
  else:
    sprite.hide()

Output

Read More
All articles loaded
No more articles to load