C++ Java Unity
C++ Reference
EyewearUserCalibrator Class Referenceabstract

Detailed Description

A class for creating custom user calibration procedures for see-through eyewear. (DEPRECATED)

Deprecated:
This class has been deprecated. It will be removed in an upcoming Vuforia release.

Users of optical see-through eyewear devices need to perform a calibration to determine how to project an augmentation such that it will appear registered with the real world. Such calibration is user- and device-specific.

Vuforia provides a default calibration, but for the best possible AR experience, it is recommended that the user calibrate Vuforia for their own eyes and device.

If the eyewear device supports stereo output, the calibration needs to be carried out on each eye.

The units of measurement throughout calibration is meters. The calibration image target used should have its size specified in meters when initializing this object. The size passed to init() must match both the size specified in the dataset for the target and the printed size of the target.

Inheritance diagram for EyewearUserCalibrator:
NonCopyable

Public Types

enum  CONSISTENCY {
  NONE = 0,
  BAD = 1,
  OK = 2,
  GOOD = 3,
  CONSISTENCY_LEN = 4
}
 

Public Member Functions

virtual bool init (size_t surfaceWidth, size_t surfaceHeight, float targetWidth, float targetHeight)=0
 Initialize the eyewear calibrator. More...
 
virtual float getMinScaleHint () const =0
 Get a hint as to the minimum size to render a calibration shape. More...
 
virtual float getMaxScaleHint () const =0
 Get a hint as to the maximum size to render a calibration shape. More...
 
virtual float getDrawingAspectRatio (size_t surfaceWidth, size_t surfaceHeight) const =0
 Get the aspect ratio that should be used to draw a calibration shape. More...
 
virtual bool isStereoStretched () const =0
 Check whether this device stretches the display to create a stereoscopic effect. More...
 
virtual bool getProjectionMatrix (EyewearCalibrationReading readings[], int numReadings, Matrix34F &cameraToEyePose, Matrix34F &eyeProjection)=0
 Calculate an eyewear calibration for a single eye. More...
 
virtual CONSISTENCY getProjectionMatrices (EyewearCalibrationReading leftReadings[], int numLeftReadings, EyewearCalibrationReading rightReadings[], int numRightReadings, Matrix34F &leftCameraToEyePose, Matrix34F &leftEyeProjection, Matrix34F &rightCameraToEyePose, Matrix34F &rightEyeProjection)=0
 Calculate an eyewear calibration for both eyes. More...
 

Member Enumeration Documentation

A measure of the consistency of the data supplied by the user to the calibrator.

Enumerator
NONE 

There is no consistency data available, for example if only calibration data for one eye has been supplied or the calibrator has not been initialized

BAD 

The consistency is bad and the calibration is unlikely to result in a good user experience : the user should perform the calibration again

OK 

The calibration is likely usable but the user should review the result and we suggest that they should perform the calibration again.

GOOD 

The calibration data is consistent and although this is no guarantee of a good calibration it is a strong indicator

CONSISTENCY_LEN 

Member Function Documentation

virtual bool init ( size_t  surfaceWidth,
size_t  surfaceHeight,
float  targetWidth,
float  targetHeight 
)
pure virtual

Initialize the eyewear calibrator.

This method must be called before any other members of this class.

Parameters
surfaceWidthThe width (in pixels) of the rendering surface that the calibration is running in.
surfaceHeightThe height (in pixels) of the rendering surface that the calibration is running in.
targetWidthThe width (in meters) of the image target being used.
targetHeightThe height (in meters) of the image target being used.
Returns
true if initialization is successful, false otherwise (check application logs for failure details).
virtual float getMinScaleHint ( ) const
pure virtual

Get a hint as to the minimum size to render a calibration shape.

The smaller a calibration shape is drawn, the further the user needs to stand away from a target during calibration. The minimum size is device specific and this method provides a hint as to the minimum practical scale.

Returns
the minimum scale to use for the calibration shape, in the range 0.0 - 1.0
virtual float getMaxScaleHint ( ) const
pure virtual

Get a hint as to the maximum size to render a calibration shape.

The larger a calibration shape is drawn, the closer the shape will be to the sides of the display. Some eyewear devices have distortion towards the edges of the display.

The maximum size is device specific and this method provides a hint as to the maximum practical scale.

Returns
the maximum scale to use for the calibration shape, in the range 0.0 - 1.0
virtual float getDrawingAspectRatio ( size_t  surfaceWidth,
size_t  surfaceHeight 
) const
pure virtual

Get the aspect ratio that should be used to draw a calibration shape.

Some eyewear devices introduce rendering distortion, for example horizontal or vertical stretching. The value returned by this method should be used to draw calibration shapes that closely match the aspect ratio of the real-world calibration target.

Parameters
surfaceWidthThe width (in pixels) of the rendering surface.
surfaceHeightThe height (in pixels) of the rendering surface.
Returns
the corrected aspect ratio for calibration shapes.
virtual bool isStereoStretched ( ) const
pure virtual

Check whether this device stretches the display to create a stereoscopic effect.

When a device enters 3D it may join the displays together to create one big display. On some devices, the reported resolution is unchanged - and the display is effectively stretched. This flag allows the app to identify this situation in order to compensate when rendering.

Returns
true if the display is stretched, otherwise false.
virtual bool getProjectionMatrix ( EyewearCalibrationReading  readings[],
int  numReadings,
Matrix34F cameraToEyePose,
Matrix34F eyeProjection 
)
pure virtual

Calculate an eyewear calibration for a single eye.

Calculates and returns a calibration for a single eye from a set of readings.

This takes an input array of EyewearCalibrationReading objects, which represent the user's perception of a Vuforia target from particular locations.

It passes back the calculated 'cameraToEyePose' and 'eyeProjection' matrices. These matrices are suitable for use in Eyewear Calibration Profiles.

init() must have been called before using this function.

Note
On stereo devices, it is recommended to use getProjectionMatrices() instead, which calibrates both eyes simultaneously and returns a measure of consistency.
Parameters
readingsAn array of calibration readings
numReadingsThe number of calibration readings
cameraToEyePoseCalculated cameraToEyePose matrix
eyeProjectionCalculated eyeProjection matrix
Returns
true if the call is successful, otherwise false.
virtual CONSISTENCY getProjectionMatrices ( EyewearCalibrationReading  leftReadings[],
int  numLeftReadings,
EyewearCalibrationReading  rightReadings[],
int  numRightReadings,
Matrix34F leftCameraToEyePose,
Matrix34F leftEyeProjection,
Matrix34F rightCameraToEyePose,
Matrix34F rightEyeProjection 
)
pure virtual

Calculate an eyewear calibration for both eyes.

Calculates and returns a calibration for both eyes from a set of readings.

This takes an input array of EyewearCalibrationReading objects for each eye, which represent the user's perception of a Vuforia target from particular locations.

It passes back the calculated 'cameraToEyePose' and 'eyeProjection' matrices for each eye. These matrices are suitable for use in Eyewear Calibration Profiles.

The return value represents the consistency of the calibration between the two eyes. A more consistent calibration is likely to result in augmentations that converge and sit correctly on the desired real-world location. This will result in a more comfortable experience for the user.

init() must have been called before using this function.

Parameters
leftReadingsAn array of calibration readings for the left eye
numLeftReadingsThe number of calibration readings for the left eye
rightReadingsAn array of calibration readings for the right eye
numRightReadingsThe number of calibration readings for the right eye
leftCameraToEyePoseCalculated cameraToEyePose matrix for the left eye
leftEyeProjectionCalculated eyeProjection matrix for the left eye
rightCameraToEyePoseCalculated cameraToEyePose matrix for the right eye
rightEyeProjectionCalculated eyeProjection matrix for the right eye
Returns
A CONSISTENCY value