ALVisionRecognition is a module which detects and recognizes learned pictures, like pages of a comic books, faces of objects or even locations.
The learning stage is done using the Choregraphe interface. Follow the steps in the green doc that will explain how to create your own database.
The output value is written in ALMemory in the PictureDetected variable.
It contains an array of tags, with the following format:
[ [ TimeStampField ] [ Picture_info_0 , Picture _info_1, . . . , Picture_info_N-1 ] ]
with as many Picture_info tags as things currently recognized.
Picture_info = [[labels_list], matched_keypoints, ratio, [boundary_points]]
with labels_list = [label_0, label_1, ..., label_N-1] and label_n belongs to label_n+1
and boundary_points = [[x0,y0], [x1,y1], ..., [xN,yN]]
- Labels are the names given to the picture (e.g. "cover/my book", or "fridge corner/kitchen/my flat").
- matched_keypoints corresponds to the number of keypoints retrieved in the current frame.
- ratio represents the number of keypoints found for the object in the current frame divided by the number of keypoints found during the learning stage.
- boundary_points is a list of points coordinates in angle values representing the reprojection in the current image of the boundaries selected during the learning stage.
void load ()
load the database.ar1, ar2, ar3, ar4 and ar5 files that have to be on the robot in /home/nao/naoqi/share/naoqi/vision/visionrecognition/current.
These files can be created with the video monitor from Choregraphe. Check the green doc for explainations.
void setParam (const string& paramName, const AL::ALValue& paramValue)
Set vision recognition parameters.
Name of the parameter to be changed. Among ("resolution",[int])
Value(s) of the parameter to be changed.
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