This function returns the y position of the face detected. You can specify the face for which the value is needed. The position is mapped with the stage coordinates.

Function Definition: y(face = 1)
| Name | Type | Description | Expected Values | Default Value |
|---|---|---|---|---|
| face | int | Face number for which the information is required. | 1-100 | 1 |
This function returns the y position of the face detected. You can specify the face for which the value is needed. The position is mapped with the stage coordinates.

The example demonstrates the application of face detection with a stage feed. Following are the key steps happening:
sprite = Sprite('Square Box')
import time
fd = FaceDetection()
# Disable Bounding Box on the stage
fd.disablebox()
# Set Theshold of the stage
fd.setthreshold(0.4)
fd.analysestage()
print(fd.count())
for i in range(fd.count()):
sprite.setx(fd.x(i + 1))
sprite.sety(fd.y(i + 1))
sprite.setsize(fd.width(i + 1))
sprite.say("Face " + str(i + 1) + ": " + fd.expression(i + 1))
time.sleep(1)

The example demonstrates how to use face detection with a camera feed. Following are the key steps happening:
sprite = Sprite('Square Box')
import time
fd = FaceDetection()
fd.video("on", 0)
# Enable Bounding Box on the stage
fd.enablebox()
# Set Theshold of the stage
fd.setthreshold(0.5)
while True:
fd.analysestage()
for i in range(fd.count()):
sprite.setx(fd.x(i + 1))
sprite.sety(fd.y(i + 1))
sprite.setsize(fd.width(i + 1))
sprite.say(fd.expression(i + 1))

Copyright 2025 – Agilo Research Pvt. Ltd. All rights reserved – Terms & Condition | Privacy Policy