ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Classes | Macros | Functions
arFilterTransMat.c File Reference
#include <ARX/AR/arFilterTransMat.h>
Include dependency graph for arFilterTransMat.c:

Classes

struct  _ARFilterTransMatInfo
 

Macros

#define MAX(x, y)   (x > y ? x : y)
 
#define MIN(x, y)   (x < y ? x : y)
 
#define CLAMP(x, r1, r2)   (MIN(MAX(x,r1),r2))
 

Functions

ARFilterTransMatInfoarFilterTransMatInit (const ARdouble sampleRate, const ARdouble cutoffFreq)
 Initialise a filter for a single transformation matrix (pose estimate).
 
int arFilterTransMatSetParams (ARFilterTransMatInfo *ftmi, const ARdouble sampleRate, const ARdouble cutoffFreq)
 Set the filter parameters.
 
int arFilterTransMat (ARFilterTransMatInfo *ftmi, ARdouble m[3][4], const int reset)
 Filters the supplied pose estimate transformation matrix in-place.
 
void arFilterTransMatFinal (ARFilterTransMatInfo *ftmi)
 Finalise a filter.
 

Macro Definition Documentation

◆ CLAMP

#define CLAMP (   x,
  r1,
  r2 
)    (MIN(MAX(x,r1),r2))

◆ MAX

#define MAX (   x,
 
)    (x > y ? x : y)

◆ MIN

#define MIN (   x,
 
)    (x < y ? x : y)

Function Documentation

◆ arFilterTransMat()

int arFilterTransMat ( ARFilterTransMatInfo ftmi,
ARdouble  m[3][4],
const int  reset 
)

Filters the supplied pose estimate transformation matrix in-place.

This performs the filter function for a single transformation matrix.

Parameters
ftmiFilter settings to be used with this transformation matrix.
mTransformation matrix representing the current pose estimate.
resetIf a discontinuity in transformation matrix pose estimates has occured (e.g. when a marker is first acquired, or is reacquired after a period of not being visible) the filter initial state or "memory" should be set to the same value as the current sample by setting this parameter to 1. If transformation matrix pose estimates have occured continuously, set this parameter to 0.
Returns
0 No error.
-1 Invalid parameter.
-2 Invalid transformation matrix.
Here is the call graph for this function:

◆ arFilterTransMatFinal()

void arFilterTransMatFinal ( ARFilterTransMatInfo ftmi)

Finalise a filter.

When all filter use has completed, this function should be called to dispose of the filter structure.

Parameters
ftmiFilter settings to dispose of.

◆ arFilterTransMatInit()

ARFilterTransMatInfo * arFilterTransMatInit ( const ARdouble  sampleRate,
const ARdouble  cutoffFreq 
)

Initialise a filter for a single transformation matrix (pose estimate).

In order to filter a pose estimate, this function should be called to setup filter data structures.

Each ARFilterTransMatInfo structure should be used only with a single transformation matrix. For example, if you have 5 pose estimates to filter, you would call this function 5 times, once for each pose, and keep the pose data and filter data paired.

The structure produced should be passed to other filter functions dealing with the same transformation matrix.

Parameters
sampleRateThis value partially determines the filter properties. It should be as close as possible to the rate at which pose estimates arrive, which is usually the camera frame rate. If you are unsure what value to use, use the constant AR_FILTER_TRANS_MAT_SAMPLE_RATE_DEFAULT. This value may not be 0.0.
cutoffFreqThis value partially determines the filter properties. It should be as close as possible to the rate above which you do not wish changes to the incoming transformation matrix pose estimate to be observed. This would usually be the maximum rate at which you imagine to-and-fro rotiational or positional motion of a marker to occur. If you are unsure what value to use, use the constant AR_FILTER_TRANS_MAT_CUTOFF_FREQ_DEFAULT. This value may not be 0.0.
Returns
Pointer to an ARFilterTransMatInfo structure, which should be passed to other filter functions dealing with the same transformation matrix, or NULL in case of error.
Here is the call graph for this function:

◆ arFilterTransMatSetParams()

int arFilterTransMatSetParams ( ARFilterTransMatInfo ftmi,
const ARdouble  sampleRate,
const ARdouble  cutoffFreq 
)

Set the filter parameters.

This convenience function allows adjustment of the initial filter parameters.

Parameters
ftmiFilter settings of which the parameters should be set.
sampleRateThis value partially determines the filter properties. It should be as close as possible to the rate at which pose estimates arrive, which is usually the camera frame rate. If you are unsure what value to use, use the constant AR_FILTER_TRANS_MAT_SAMPLE_RATE_DEFAULT. This value may not be 0.0.
cutoffFreqThis value partially determines the filter properties. It should be as close as possible to the rate above which you do not wish changes to the incoming transformation matrix pose estimate to be observed. This would usually be the maximum rate at which you imagine to-and-fro rotiational or positional motion of a marker to occur. If you are unsure what value to use, use the constant AR_FILTER_TRANS_MAT_CUTOFF_FREQ_DEFAULT. This value may not be 0.0.
Returns
0 The filter parameters were set without error.
-1 Invalid parameter.
-2 One of the parameters was 0.0.