ALVisionRecognition API

NAOqi Vision - Overview | API | Tutorial


Namespace : AL

#include <alproxies/alvisionrecognitionproxy.h>

Method list

As any module, this module inherits methods from ALModule API. It also has the following specific methods:

class ALVisionRecognitionProxy

Event list

Methods

int ALVisionRecognitionProxy::changeDatabase(const std::string& databasePath, const std::string& databaseName)

By default the database is composed of several files with the same name “database” and different extensions. It is located on the robot in “/home/nao/naoqi/share/naoqi/vision/visionrecognition/current/” folder (1.10 SDK and below) or “/home/nao/.local/share/naoqi/vision/visionrecognition/current/” folder (1.12 SDK and higher). This method allows to choose another database by providing its name and folder (how to create a database).

Parameters:
  • databasePath – Absolute path of the database on the robot, or “” to set default path.
  • databaseName – Name of the database (without extension), or “” to set default database name.
Returns:

True if success.

void ALVisionRecognitionProxy::setParam(const std::string& paramName, const AL::ALValue& paramValue)

For advanced users: set vision recognition parameters.

Parameters:
  • paramName – Name of the parameter to be changed among “resolution” (default is QVGA), “scoreThreshold” (default is 0.04).
  • paramValue – Value of the parameter to be changed.
void ALVisionRecognitionProxy::subscribe(const std::string& name)

Subscribes to ALVisionRecognition. This causes the module to start writing information to ALMemory in “PictureDetected”. This can be accessed in ALMemory using ALMemoryProxy::getData().

Parameters:
  • name – Name to identify the subscriber
void ALVisionRecognitionProxy::unsubscribe(const std::string& name)

Unsubscribes from ALVisionRecognition. This causes the module to stop writing information to ALMemory in “PictureDetected”.

Parameters:

Events

Event: "PictureDetected"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)

Raised when a visual pattern previously learned is recognized.

Parameters:
  • eventName (std::string) – “PictureDetected”
  • value – Informations related to the detected picture. Please refer to ALVisionRecognition for details.
  • subscriberIdentifier (std::string) –