MtData Class Reference

#include <lib_motiontracker.h>

Detailed Description

Represents a single frame of a single track.

Contains image position information which can be queried as normalized coordinates, pixel coordinates, or corresponding camera ray direction.

Public Member Functions

Vector GetNormalisedPosition () const
 
Vector GetPixelPosition (MtFootageData *sdkFh, Bool originalRes) const
 
Vector GetCameraSpaceDirection (Float focalLength, Float sensorWidth) const
 

Static Public Member Functions

static MtDataAlloc ()
 
static void Free (MtData *&p)
 

Private Member Functions

 MtData ()
 
 ~MtData ()
 

Constructor & Destructor Documentation

◆ MtData()

MtData ( )
private

◆ ~MtData()

~MtData ( )
private

Member Function Documentation

◆ GetNormalisedPosition()

Vector GetNormalisedPosition ( ) const

Retrieves the track position in normalized coordinates.

Returns
The track position:
  • Vector::x is in range -0.5 to +0.5 from left to right of image.
  • Vector::y is in range -0.5/aspect to +0.5/aspect from top to bottom of image, where aspect is the image aspect ratio.

◆ GetPixelPosition()

Vector GetPixelPosition ( MtFootageData sdkFh,
Bool  originalRes 
) const

Retrieves the track position in footage pixel coordinates.

Parameters
[in]sdkFhThe footage object, used to define resolution and aspect ratio. The caller owns the pointed MtFootageData.
[in]originalResIf true, the returned pixel coordinates are for the original footage. If false, the returned pixel coordinates are for the downsampled footage.
Returns
The track position.

◆ GetCameraSpaceDirection()

Vector GetCameraSpaceDirection ( Float  focalLength,
Float  sensorWidth 
) const

Generates a ray in camera space corresponding to the position of the track.

Note
If parameters are taken from the reconstructed camera then this generates a camera space ray corresponding to the position of the track.
Parameters
[in]focalLengthThe focal length to use for the camera (in mm).
[in]sensorWidthThe sensor width to use for the camera (in mm).
Returns
The ray in camera space corresponding to the position of the track.

◆ Alloc()

static MtData* Alloc ( )
static

Internal.

◆ Free()

static void Free ( MtData *&  p)
static

Destructs MtDatas allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in,out]pThe MtData to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.