![]() |
ARX
1.0
The next-generation open source augmented reality toolkit.
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ARX/AR/ar.h>
#include <ARX/AR/param.h>
Functions | |
int | arParamLTSave (char *filename, char *ext, ARParamLT *paramLT) |
ARParamLT * | arParamLTLoad (char *filename, char *ext) |
ARParamLT * | arParamLTCreate (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... | |
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.
paramLTf | A 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(). |
ix | Input idealised normalised window coordinate x axis value. |
iy | Input idealised normalised window coordinate y axis value. |
ox | Pointer to ARdouble, which on return will hold the observed normalised window coordinate x axis value. |
oy | Pointer to ARdouble, which on return will hold the observed normalised window coordinate y axis value. |
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.
param | A 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. |
offset | An 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. |
int arParamLTFree | ( | ARParamLT ** | paramLT_p | ) |
Dispose of a memory allocated to a lookup-table camera parameter.
paramLT_p | Pointer to a pointer to the paramLT structure to be disposed of. On return, the location pointed to will be set to NULL. |
ARParamLT * arParamLTLoad | ( | char * | filename, |
char * | ext | ||
) |
int arParamLTSave | ( | char * | filename, |
char * | ext, | ||
ARParamLT * | paramLT | ||
) |
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.
paramLTf | A 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(). |
ix | Input observed normalised window coordinate x axis value. |
iy | Input observed normalised window coordinate y axis value. |
ox | Pointer to ARdouble, which on return will hold the idealised normalised window coordinate x axis value. |
oy | Pointer to ARdouble, which on return will hold the idealised normalised window coordinate y axis value. |