Overview

ALFaceDetection is the Module which detects faces.
This module detects if there is one, several or no face in Nao's field of view. Better results are obtained when facing Nao.
The output value is written in ALMemory in the FaceDetected variable.
The output value is organized as follows:

[ [ TimeStampField ] [ Face_info_0 , Face_info_1, . . . , Face_info_N-1, Time_Filtered_Reco_info ] [ Camera_position_info ] ]
with
- TimeStampField = [ TimeStamp_seconds, Timestamp_microseconds ]. This field is the time stamp of the image that was used to perform the detection.
- Face_info = [ ShapeInfo, ExtraInfo ]. For each detected face, we have one Face_info field.
> ShapeInfo = [ 0, alpha, beta, sizeX, sizeY ].
- alpha and beta represent the face's location in terms of camera angles
- sizeX and sizeY are the face's size in camera angle
> ExtraInfo = [ Reco_info_0, Reco_info_1, ..., Reco_info_M ]
with Reco_info_0 = [ faceID, score_reco, face_label, left_eye_points, right_eye_points, left_eyebrow_points, right_eyebrow_points, nose_points, mouth_points ]
and
==> faceID the ID number for the face
==> score_reco the score returned by the rocognition process (the higher the better)
==> face_label the name of the recognized face
==> xxxx_eye_points = [ eyeCenter_x, eyeCenter_y, noseSideLimit_x, noseSideLimit_y, earSideLimit_x, earSideLimit_y, topLimit_x, topLimit_y, bottomLimit_x, bottomLimit_y, midTopEarLimit_x, midTopEarLimit_y, midTopNoseLimit_x, midTopNoseLimit_y ]
==> xxxx_eyebrow_points = [ noseSideLimit_x, noseSideLimit_y, center_x, center_y, earSideLimit_x, earSideLimit_y ]
==> nose_points = [ bottomCenterLimit_x, bottomCenterLimit_y, bottomLeftLimit_x, bottomLeftLimit_y, bottomRightLimit_x, bottomRightLimit_y ]
==> mouth_points = [ leftLimit_x, leftLimit_y, rightLimit_x, rightLimit_y, topLimit_x, topLimit_y, bottomLimit_x, bottomLimit_y, midTopLeftLimit_x, midTopLeftLimit_y, midTopRightLimit_x, midTopRightLimit_y, midBottomRightLimit_x, midBottomRightLimit_y, midBottomLeftLimit_x, midBottomLeftLimit_y ]
...all these coordinates are given in camera angles.
- Time_Filtered_Reco_info can be equal to
> [] if there is nothing new
> [ 2 face_label ] if there is one face recognized
> [ 3 [ face_label_0, ..., face_label_P ] ] if there are several recognized faces
> [ 4 ] if a face has been detected for more than 8 seconds without being recognized. Getting this result is a suggestion to learn this face if desired, but keep in mind that recognition only works for faces looking towards NAO.
- Camera_position_info is a set of 6 float values obtained from the getPosition() method of a motion proxy.

Methods

void enableRecognition (const bool& enable)

enable/disable the recognition stageProcess will be faster when disabled when you don't need to recognize people

enable

True/False

void enableTracking (const bool& enable)

(BETA) Choose to enable or disable tracking. Enabling tracking usually allows you to follow a face for a longer period of time. However, it can lead to more false detections.

enable

True/False

bool isTrackingEnabled ()

(BETA) Returns if tracking is enabled.

Returns

True/False

bool learnFace (const string& pId)

Add a new face in the database.

pId

ID of the person to save

Returns

true if the operation succeeds

bool reLearnFace (const string& pId)

use in a new learning process the latest images where a face has been wrongly recognized

pId

ID of the person to save

Returns

true if the operation succeeds

bool clearDatabase ()

Returns

true if the operation succeeds


Methods inherited from ALModule

void exit ()

Exits and unregisters the module.

string version ()

Returns the version of the module.

Returns

A string containing the version of the module.

bool ping ()

Just a ping. Always returns true

Returns

returns true

vector<string> getMethodList ()

Retrieves the module's method list.

Returns

An array of method names.

AL::ALValue getMethodHelp (const string& methodName)

Retrieves a method's description.

methodName

The name of the method.

Returns

A structure containing the method's description.

AL::ALValue getModuleHelp ()

Retrieves the module's description.

Returns

A structure describing the module.

string getBrokerName ()

Gets the name of the parent broker.

Returns

The name of the parent broker.

string getUsage (const string& name)

Gets the method usage string. This summarise how to use the method.

name

The name of the method.

Returns

A string that summarises the usage of the method.


Methods inherited from ALExtractor

void subscribe (const string& name, const int& period, const float& precision)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData("keyName"). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

name

Name of the module which subscribes.

period

Refresh period (in milliseconds) if relevant.

precision

Precision of the extractor if relevant.

void subscribe (const string& name)

Subscribes to the extractor. This causes the extractor to start writing information to memory using the keys described by getOutputNames(). These can be accessed in memory using ALMemory.getData("keyName"). In many cases you can avoid calling subscribe on the extractor by just calling ALMemory.subscribeToEvent() supplying a callback method. This will automatically subscribe to the extractor for you.

name

Name of the module which subscribes.

void unsubscribe (const string& name)

Unsubscribes from the extractor.

name

Name of the module which had subscribed.

void updatePeriod (const string& name, const int& period)

Updates the period if relevant.

name

Name of the module which has subscribed.

period

Refresh period (in milliseconds).

void updatePrecision (const string& name, const float& precision)

Updates the precision if relevant.

name

Name of the module which has subscribed.

precision

Precision of the extractor.

int getCurrentPeriod ()

Gets the current period.

Returns

Refresh period (in milliseconds).

float getCurrentPrecision ()

Gets the current precision.

Returns

Precision of the extractor.

int getMyPeriod (const string& name)

Gets the period for a specific subscription.

name

Name of the module which has subscribed.

Returns

Refresh period (in milliseconds).

float getMyPrecision (const string& name)

Gets the precision for a specific subscription.

name

name of the module which has subscribed

Returns

precision of the extractor

AL::ALValue getSubscribersInfo ()

Gets the parameters given by the module.

Returns

Array of names and parameters of all subscribers.

vector<string> getOutputNames ()

Get the list of values updated in ALMemory.

Returns

Array of values updated by this extractor in ALMemory


Copyright © 2010 Aldebaran Robotics - All rights reserved