ALVisualCompass API

NAOqi Vision - Overview | API

Namespace : AL

#include <alproxies/alvisualcompassproxy.h>

Method list

class ALVisualCompassProxy

Events lists

Methods

void ALVisualCompassProxy::enableReferenceRefresh(const bool& refresh)

Determines if the reference image is taken again at subscribe or not. If not, the reference image is not reset at next subscribe.

Parameters:
  • refresh – true / false.
AL::ALValue ALVisualCompassProxy::getCurrentImage()

Returns an AL::ALValue containing the current image used to compute the deviation.

Returns:AL::ALValue formatted like the output of ALVideoDeviceProxy::getImageRemote().
AL::ALValue ALVisualCompassProxy::getMatchingQuality()

Returns the reliability of the matching and the compass deviation computations. It gives both the number of matches and the percentage of inliers for the model. The number of matches must be at least greater than 4 and the percentage over 50% for the matching to be significant.

Returns:Quality with the following format:
  • quality[0]: float. Percentage of model inliers amongst matched keypoints. Between 0.0f and 1.0f, must be over 0.5f to be significant.
  • quality[1]: int. Number of keypoints that were matched.
AL::ALValue ALVisualCompassProxy::getReferenceImage()

Returns an AL::ALValue containing the image used as a reference.

Returns:AL::ALValue formatted like the output of ALVideoDeviceProxy::getImageRemote().
int ALVisualCompassProxy::getReferenceQuality()

Returns the number of reference keypoints which were extracted from the reference image.

Returns:Number of reference keypoints.

Events

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

Note

The full name of this event is VisualCompass/Deviation in ALMemory

Raised each time the deviation of the current image from the compass is computed. The event is formatted as follows:

VisualCompass/Deviation = [
DeviationInfo,
RobotPosition,
TimeStamp
]

DeviationInfo contains the deviation along Z axis (theta angle for the robot pose) and Y axis.

DeviationInfo = [
  YAxisDeviation,
  ZAxisDeviation,
]

RobotPosition contains the robot position in WORLD_SPACE when the image was taken.

RobotPosition = [
  X,
  Y,
  Theta
]

TimeStamp: this field is the time stamp of the image that was used to compute the deviation.

TimeStamp =
[
  TimeStamp_Seconds,
  Timestamp_Microseconds
]
Event: "Match"
callback(std::string eventName, AL::ALValue value, std::string subscriberIdentifier)

Note

The full name of this event is VisualCompass/Match in ALMemory.

Raised each time the deviation of the current image from the compass is computed. The event is formatted as follows:

VisualCompass/Match =
[
  ReferenceKeypoints,
  CurrentKeypoints,
  Matches,
  Inliers
]

ReferenceKeypoints is the list of keypoints extracted from the reference image. CurrentKeypoints is the list of keypoints extracted from the current processed image. Both are a list of Keypoint where:

Keypoint =
[
  [X, Y],
  Size,
  Angle,
  Response,
  Octave
]

X and Y are the coordinates of the center of the keypoints in image coordinates, Size is the size of the keypoint, Angle is the keypoint orientation, Response is the keypoint strength, and Octave is the keypoint scale.

Matches is the list of the matches between the keypoints. Each Match is:

Match =
[
  ReferenceIndex,
  CurrentIndex,
  Distance
]

ReferenceIndex is the index of the matched keypoint in the reference list, CurrentIndex is the index of the matched keypoint in the current list, and Distance is the distance between the two keypoints.

Inliers is the list of the match indexes for each direction (Y and Z axis) which correspond to inliers for the Ransac: these are the indexes of the coherent matches used to compute the deviation.

Inliers =
[
   InliersWy = [Idx0, Idx1, ...],
   InliersWz = [Idx0, Idx1, ...]
]