![]() |
KudanCV
|
The Kudan markerless tracker, which tracks the content of an image stream and gives a 3D pose for each frame. More...
#include <KudanCV.h>
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) |
| KudanCameraParameters & | getCameraParameters () |
| KudanMatrix3 | getCameraMatrix () |
| KudanMatrix4 | getProjectionMatrix (float nearPlane, float farPlane) |
| void | setApiKey (std::string apiKey) |
The Kudan markerless tracker, which tracks the content of an image stream and gives a 3D pose for each frame.
| KudanArbiTracker | ( | ) |
Default constructor that calls initialise()
| ~KudanArbiTracker | ( | ) |
Destructor which de-initialises the tracker
| KudanMatrix3 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
| KudanException | is thrown if the parameters have not been set |
| KudanCameraParameters& getCameraParameters | ( | ) |
Get a (reference to) the camera parameters set on the tracker.
| KudanQuaternion getOrientation | ( | ) |
Get the pose of the tracked coordinate frame. This is the orientation of the tracked frame, about its centre
| KudanVector3 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
| KudanMatrix4 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.
| nearPlane,farPlane | The clipping planes to be used for rendering (not part of the camera parameters). |
| KudanException | is thrown if the parameters have not been set |
| bool hasCameraCalibration | ( | ) |
Queries if a calibration has been set
| bool isTracking | ( | ) |
Indicates whether tracking is currently happening
| bool 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.
| image | 8bpp greyscale image data. |
| width,height | size of the image data matrix |
| channels | number of channels in the image (mono, colour, colour+alpha) |
| padding | the number of bytes to ignore at the end of each line |
| requireFlip | some devices provide the image upside down (rotation of 180 degrees). This flips the image (in both axes) before processing |
| KudanException | is thrown if there is no calibration data or an empty image. |
| void setApiKey | ( | std::string | apiKey | ) |
A valid API key needs to be set before calling processFrame.
| apiKey | a valid key can only be acquired from Kudan. |
| void setCameraParameters | ( | KudanCameraParameters & | cameraParameters | ) |
Sets the camera parameters using given camera parameters
| cameraParameters | Object of KudanCameraParameters which defines the camera intrinsics and image size |
| KudanException | is thrown if the parameters are invalid |
| void 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
| sensedOrientation | An orientation represented by a quaternion |
| void start | ( | KudanVector3 | startPosition, |
| KudanQuaternion | startOrientation | ||
| ) |
Start the tracker. The tracker is started at the given pose (specified as position and orientation).
| startPosition | Starting position in 3D of the tracker coordinate frame with respect to the camera origin |
| startOrientation | Starting otientation (about its own centre) of the tracker coordinate frame |
| void start | ( | KudanMatrix4 | startTransform | ) |
Start the tracker. The tracker is started at the given pose (specified as a 4x4 transformation matrix).
| startTransform | A 4x4 matrix representing the initial pose of the tracker coordinate frame with repsect to the camera |
| void stop | ( | ) |
Stop tracking