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.
void enableRecognition (const bool& enable)
enable/disable the recognition stageProcess will be faster when disabled when you don't need to recognize people
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.
True/False
bool learnFace (const string& pId)
Add a new face in the database.
ID of the person to save
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
ID of the person to save
true if the operation succeeds
string version ()
Returns the version of the module.
A string containing the version of the module.
AL::ALValue getMethodHelp (const string& methodName)
Retrieves a method's description.
The name of the method.
A structure containing the method's description.
AL::ALValue getModuleHelp ()
Retrieves the module's description.
A structure describing the module.
string getUsage (const string& name)
Gets the method usage string. This summarise how to use the method.
The name of the method.
A string that summarises the usage of the method.
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 of the module which subscribes.
Refresh period (in milliseconds) if relevant.
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 of the module which subscribes.
void unsubscribe (const string& name)
Unsubscribes from the extractor.
Name of the module which had subscribed.
void updatePeriod (const string& name, const int& period)
Updates the period if relevant.
Name of the module which has subscribed.
Refresh period (in milliseconds).
void updatePrecision (const string& name, const float& precision)
Updates the precision if relevant.
Name of the module which has subscribed.
Precision of the extractor.
int getMyPeriod (const string& name)
Gets the period for a specific subscription.
Name of the module which has subscribed.
Refresh period (in milliseconds).
float getMyPrecision (const string& name)
Gets the precision for a specific subscription.
name of the module which has subscribed
precision of the extractor
AL::ALValue getSubscribersInfo ()
Gets the parameters given by the module.
Array of names and parameters of all subscribers.
vector<string> getOutputNames ()
Get the list of values updated in ALMemory.
Array of values updated by this extractor in ALMemory