ARX  1.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
Functions
paramLT.c File Reference
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ARX/AR/ar.h>
#include <ARX/AR/param.h>
Include dependency graph for paramLT.c:

Functions

int arParamLTSave (char *filename, char *ext, ARParamLT *paramLT)
 
ARParamLTarParamLTLoad (char *filename, char *ext)
 
ARParamLTarParamLTCreate (ARParam *param, int offset)
 Allocate and calculate a lookup-table camera parameter from a standard camera parameter. More...
 
int arParamLTFree (ARParamLT **paramLT_p)
 Dispose of a memory allocated to a lookup-table camera parameter. More...
 
int arParamIdeal2ObservLTf (const ARParamLTf *paramLTf, const float ix, const float iy, float *ox, float *oy)
 Use a lookup-table camera parameter to convert idealised (zero-distortion) window coordinates to observed (distorted) coordinates. More...
 
int arParamObserv2IdealLTf (const ARParamLTf *paramLTf, const float ox, const float oy, float *ix, float *iy)
 Use a lookup-table camera parameter to convert observed (distorted) window coordinates to idealised (zero-distortion) coordinates. More...
 

Function Documentation

◆ arParamIdeal2ObservLTf()

int arParamIdeal2ObservLTf ( const ARParamLTf paramLTf,
const float  ix,
const float  iy,
float *  ox,
float *  oy 
)

Use a lookup-table camera parameter to convert idealised (zero-distortion) window coordinates to observed (distorted) coordinates.

See function arParamObserv2IdealLTf() for full discussion.

This function is the output function of the pair. It's inputs are idealised coordinates, e.g. taken from OpenGL. The outputs are the location where in a distorted image where the same point would lie.

Parameters
paramLTfA lookup-table based version of the lens distortion parameters. These values are generated as part of the camera calibration process in artoolkitX, and converted to a lookup table by arParamLTCreate().
ixInput idealised normalised window coordinate x axis value.
iyInput idealised normalised window coordinate y axis value.
oxPointer to ARdouble, which on return will hold the observed normalised window coordinate x axis value.
oyPointer to ARdouble, which on return will hold the observed normalised window coordinate y axis value.
Returns
0 in case of function success, or -1 if an error occured. One possible error condition is the case where the input portion of the pair is outside the range of coordinates covered by the lookup table.
See also
arParamLTCreate
arParamIdeal2Observ
arParamObserv2IdealLTf

◆ arParamLTCreate()

ARParamLT * arParamLTCreate ( ARParam param,
int  offset 
)

Allocate and calculate a lookup-table camera parameter from a standard camera parameter.

A lookup-table based camera parameter offers significant performance savings in certain artoolkitX operations (including unwarping of pattern spaces) compared to use of the standard camera parameter.

The original ARParam camera parameters structure is copied into the ARParamLT structure, and is available as paramLT->param.

Parameters
paramA pointer to an ARParam structure from which the lookup table will be generaeted. This ARParam structure will be copied, and the original may be disposed of.
offsetAn integer value which specifies how much the lookup table values will be padded around the original camera parameters size. Normally, the default value AR_PARAM_LT_DEFAULT_OFFSET (defined elsewhere in this header) should be used. However, when using a camera with a large amount of lens distortion, a higher value may be required to cope with the corners or sides of the camera image frame.
Returns
A pointer to a newly-allocated ARParamLT structure, or NULL if an error occurred. Once the ARParamLT is no longer needed, it should be disposed of by calling arParamLTFree() on it.
See also
arParamLTFree
Here is the call graph for this function:

◆ arParamLTFree()

int arParamLTFree ( ARParamLT **  paramLT_p)

Dispose of a memory allocated to a lookup-table camera parameter.

Parameters
paramLT_pPointer to a pointer to the paramLT structure to be disposed of. On return, the location pointed to will be set to NULL.
Returns
-1 if an error occurred, or 0 in the case of no error.
See also
arParamLTCreate

◆ arParamLTLoad()

ARParamLT * arParamLTLoad ( char *  filename,
char *  ext 
)

◆ arParamLTSave()

int arParamLTSave ( char *  filename,
char *  ext,
ARParamLT paramLT 
)

◆ arParamObserv2IdealLTf()

int arParamObserv2IdealLTf ( const ARParamLTf paramLTf,
const float  ox,
const float  oy,
float *  ix,
float *  iy 
)

Use a lookup-table camera parameter to convert observed (distorted) window coordinates to idealised (zero-distortion) coordinates.

This function is used by artoolkitX to convert for the the effects of lens distortion in images which have been acquired from lens-based optical systems. All lenses introduce some amount of lens distortion. artoolkitX includes calibration utilities to measure the centre of distortion and the radial distortion factors in the x and y dimensions. This calibration information is saved as part of the camera parameters.

This function is one of a pair of functions which convert between OBSERVED window coordinates (i.e. the location of a known reference point, as measured in the x-y viewing plane of an image containing lens distortion) and IDEALISED coordinates (i.e. the location of the same reference point as measured in an image containing no radial distortion, e.g. an image rendered using OpenGL's viewing model.)

This function is the input function of the pair. It's inputs are distorted coordinates, e.g. taken from an image acquired from a camera The outputs are the location where in an idealised image (e.g. generated with OpenGL) where the same point would lie.

Parameters
paramLTfA lookup-table based version of the lens distortion parameters. These values are generated as part of the camera calibration process in artoolkitX, and converted to a lookup table by arParamLTCreate().
ixInput observed normalised window coordinate x axis value.
iyInput observed normalised window coordinate y axis value.
oxPointer to ARdouble, which on return will hold the idealised normalised window coordinate x axis value.
oyPointer to ARdouble, which on return will hold the idealised normalised window coordinate y axis value.
Returns
0 in case of function success, or -1 if an error occured. One possible error condition is the case where the input portion of the pair is outside the range of coordinates covered by the lookup table.
See also
arParamObserv2Ideal
arParamIdeal2ObservLTf