Getting the results

Once ALFaceDetection is started, you want to know how to get the detection results, as to know if NAO has detected any faces, where they are located, etc. The ALFaceDetection module writes its results in a variable in ALMemory (called "FaceDetected"). You can view ALMemory variables by looking at the ALMemory's blue documentation page (at the bottom of the page) or using Telepathe memory viewer.

As you surely want to use the detection results directly in your code, you can check the ALMemory's variable on a regular basis. To do this, just create a proxy to ALMemory, and retrieve the face variable using getData("FaceDetected") from the ALMemory proxy.

from naoqi import ALProxy IP = "your_robot_ip" PORT = 9559 # Create a proxy to ALMemory. memProxy = ALProxy("ALMemory", IP, PORT) # Get data from face detection (assuming face detection has been activated). data = memProxy.getData("FaceDetected")





Copyright © 2010 Aldebaran-Robotics - All rights reserved