KudanCV
KudanArbiTracker Class Reference

The Kudan markerless tracker, which tracks the content of an image stream and gives a 3D pose for each frame. More...

#include <KudanCV.h>

Classes

class  Private
 

Public Member Functions

 KudanArbiTracker ()
 
 ~KudanArbiTracker ()
 
void start (KudanVector3 startPosition, KudanQuaternion startOrientation)
 
void start (KudanMatrix4 startTransform)
 
void stop ()
 
bool processFrame (const unsigned char *image, int width, int height, int channels, int padding, bool requireFlip)
 
KudanVector3 getPosition ()
 
KudanQuaternion getOrientation ()
 
void setSensedOrientation (KudanQuaternion sensedOrientation)
 
bool isTracking ()
 
bool hasCameraCalibration ()
 
void setCameraParameters (KudanCameraParameters &cameraParameters)
 
KudanCameraParametersgetCameraParameters ()
 
KudanMatrix3 getCameraMatrix ()
 
KudanMatrix4 getProjectionMatrix (float nearPlane, float farPlane)
 
void setApiKey (std::string apiKey)
 

Detailed Description

The Kudan markerless tracker, which tracks the content of an image stream and gives a 3D pose for each frame.

Constructor & Destructor Documentation

◆ KudanArbiTracker()

KudanArbiTracker::KudanArbiTracker ( )

Default constructor that calls initialise()

◆ ~KudanArbiTracker()

KudanArbiTracker::~KudanArbiTracker ( )

Destructor which de-initialises the tracker

Member Function Documentation

◆ getCameraMatrix()

KudanMatrix3 KudanArbiTracker::getCameraMatrix ( )

Get the calibration matrix for this camera, derived from the intrinsic parameters. This is a 3x3 matrix represented as the float array within a KudanMatrix3

Returns
A KudanMatrix3 representing the intrinsic parameters
Exceptions
KudanExceptionis thrown if the parameters have not been set

◆ getCameraParameters()

KudanCameraParameters & KudanArbiTracker::getCameraParameters ( )

Get a (reference to) the camera parameters set on the tracker.

Returns
A reference to a KudanCameraParameters object. Altering this will change the one stored in the tracker

◆ getOrientation()

KudanQuaternion KudanArbiTracker::getOrientation ( )

Get the pose of the tracked coordinate frame. This is the orientation of the tracked frame, about its centre

Returns
a KudanQuaternion which represents a 4D quaternion (x, y, z, w)

◆ getPosition()

KudanVector3 KudanArbiTracker::getPosition ( )

Get the pose of the tracked coordinate frame. This is the position of the centre of the tracked frame with respect to the camera centre

Returns
A KudanVector3 which represents a 3D point (x, y, z)

◆ getProjectionMatrix()

KudanMatrix4 KudanArbiTracker::getProjectionMatrix ( float  nearPlane,
float  farPlane 
)

Get the projection matrix for this camera. This is derived from the intrinsic parameters and the given clipping planes. This is a 4x4 matrix represented as the float array within a KudanMatrix.

Parameters
nearPlane,farPlaneThe clipping planes to be used for rendering (not part of the camera parameters).
Returns
A KudanMatrix representing the intrinsic parameters plus clipping planes.
Exceptions
KudanExceptionis thrown if the parameters have not been set

◆ hasCameraCalibration()

bool KudanArbiTracker::hasCameraCalibration ( )

Queries if a calibration has been set

Returns
A boolean indicating if calibration data are available.

◆ isTracking()

bool KudanArbiTracker::isTracking ( )

Indicates whether tracking is currently happening

Returns
A boolean, true iff tracking is running

◆ processFrame()

bool KudanArbiTracker::processFrame ( const unsigned char *  image,
int  width,
int  height,
int  channels,
int  padding,
bool  requireFlip 
)

Process a new frame. If tracking is successful, the position and orientation are updated to the new pose for this frame. This will fail (return false) if a valid license is not set, or if ArbiTrack is not available for the current platform.

Parameters
image8bpp greyscale image data.
width,heightsize of the image data matrix
channelsnumber of channels in the image (mono, colour, colour+alpha)
paddingthe number of bytes to ignore at the end of each line
requireFlipsome devices provide the image upside down (rotation of 180 degrees). This flips the image (in both axes) before processing
Returns
A boolean indicating whether tracking happened (true) or not (false)
Exceptions
KudanExceptionis thrown if there is no calibration data or an empty image.

◆ setApiKey()

void KudanArbiTracker::setApiKey ( std::string  apiKey)

A valid API key needs to be set before calling processFrame.

Parameters
apiKeya valid key can only be acquired from Kudan.

◆ setCameraParameters()

void KudanArbiTracker::setCameraParameters ( KudanCameraParameters cameraParameters)

Sets the camera parameters using given camera parameters

Parameters
cameraParametersObject of KudanCameraParameters which defines the camera intrinsics and image size
Exceptions
KudanExceptionis thrown if the parameters are invalid

◆ setSensedOrientation()

void KudanArbiTracker::setSensedOrientation ( KudanQuaternion  sensedOrientation)

Arbitrack requires that an orientation estimate be provided from some external sensor (e.g. gyroscope, IMU). Without this, Arbitrack will always return the identity rotation. This must be called BEFORE calling processFrame for a given frame Use this function to set the orientation value which will be fused with the image based tracking

Parameters
sensedOrientationAn orientation represented by a quaternion

◆ start() [1/2]

void KudanArbiTracker::start ( KudanMatrix4  startTransform)

Start the tracker. The tracker is started at the given pose (specified as a 4x4 transformation matrix).

Parameters
startTransformA 4x4 matrix representing the initial pose of the tracker coordinate frame with repsect to the camera

◆ start() [2/2]

void KudanArbiTracker::start ( KudanVector3  startPosition,
KudanQuaternion  startOrientation 
)

Start the tracker. The tracker is started at the given pose (specified as position and orientation).

Parameters
startPositionStarting position in 3D of the tracker coordinate frame with respect to the camera origin
startOrientationStarting otientation (about its own centre) of the tracker coordinate frame

◆ stop()

void KudanArbiTracker::stop ( )

Stop tracking


The documentation for this class was generated from the following files: