Table of Contents

Function Definition: landmarksy(face = 1, landmark = 1)

Parameters

NameTypeDescriptionExpected ValuesDefault Value
faceintFace number for which the information is required.1-1001
landmarkintThe landmark for which the information is required.1-681

Description

When PictoBlox runs face analysis, it detects the 68 landmark points on the face. The following image shows all landmark points:

Face Landmarks

The function returns the y position of the specified landmark point of the specified face with respect to the stage.

Example

The example demonstrates how to use face landmarks in the projects.

The example demonstrates how to use face landmarks in the projects. Following are the key steps happening:

  1. Initializing the program with parameters for the sprite, pen, and face detection library.
  2. Running face detection.
  3. Running the loop to show every landmark on the face.

Code

sprite = Sprite('Ball')
fd = FaceDetection()
import time
pen = Pen()

pen.clear()
sprite.setsize(10)

fd.enablebox()

fd.analysestage()

for i in range(68):
  sprite.setx(fd.landmarksx(1, i+1))
  sprite.sety(fd.landmarksy(1, i+1))
  pen.stamp()
  time.sleep(0.2)

Output

 

Read More
All articles loaded
No more articles to load