param
IntroductionARToolKit functions for handling calibrated camera parameters. Functions
arParamClearCreate a camera parameter structure representing an idealised lens. int arParamClear( ARParam *param, int xsize, int ysize, int dist_function_version ); Parameters
Return Value0 if the function completed successfully, or -1 in case of error. DiscussionThis function creates a camera parameter structure representing an idealised lens, that is, a lens with a symmetrical perspective projection and no distortion. This idealised lens is useful in cases where you wish to match the lens model of an OpenGL camera with the same window dimensions. arParamIdeal2ObservUse lens distortion parameters to convert idealised (zero-distortion) window coordinates to observed (distorted) coordinates. int arParamIdeal2Observ( const ARdouble dist_factor[AR_DIST_FACTOR_NUM_MAX], const ARdouble ix, const ARdouble iy, ARdouble *ox, ARdouble *oy, const int dist_function_version ); Parameters
Return Value0 in case of function success, or -1 if an error occured. At present the only error possible is an invalid value of dist_function_version. DiscussionSee function arParamObserv2Ideal() 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. See Also arParamIdeal2ObservLTfUse a lookup-table camera parameter to convert idealised (zero-distortion) window coordinates to observed (distorted) coordinates. int arParamIdeal2ObservLTf( const ARParamLTf *paramLTf, const float ix, const float iy, float *ox, float *oy); Parameters
Return Value0 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. DiscussionSee 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. See Also arParamLoadLoad lens parameters from a file. int arParamLoad( const char *filename, int num, ARParam *param, ...); ParametersReturn Value0 if successful, or -1 if an error occured. DiscussionSee the discussion under ARParam for more info. See Also arParamLoadFromBufferLoad lens parameters from a buffer. int arParamLoadFromBuffer( const void *buffer, size_t bufsize, ARParam *param); ParametersReturn Value0 if successful, or -1 if an error occured. DiscussionSee the discussion under ARParam for more info. See Also arParamLTCreateAllocate and calculate a lookup-table camera parameter from a standard camera parameter. ARParamLT *arParamLTCreate( ARParam *param, int offset ); Parameters
Return ValueA 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. DiscussionA lookup-table based camera parameter offers significant performance savings in certain ARToolKit 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. See Also arParamLTFreeDispose of a memory allocated to a lookup-table camera parameter. int arParamLTFree( ARParamLT **paramLT_p ); ParametersReturn Value-1 if an error occurred, or 0 in the case of no error. See Also arParamObserv2IdealUse lens distortion parameters to convert observed (distorted) window coordinates to idealised (zero-distortion) coordinates. int arParamObserv2Ideal( const ARdouble dist_factor[AR_DIST_FACTOR_NUM_MAX], const ARdouble ox, const ARdouble oy, ARdouble *ix, ARdouble *iy, const int dist_function_version ); Parameters
Return Value0 in case of function success, or -1 if an error occured. At present the only error possible is an invalid value of dist_function_version. DiscussionThis function is used by ARToolKit 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. ARToolKit 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. See Also arParamObserv2IdealLTfUse a lookup-table camera parameter to convert observed (distorted) window coordinates to idealised (zero-distortion) coordinates. int arParamObserv2IdealLTf( const ARParamLTf *paramLTf, const float ox, const float oy, float *ix, float *iy); Parameters
Return Value0 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. DiscussionThis function is used by ARToolKit 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. ARToolKit 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. See Also arParamSaveSave lens parameters to a file. int arParamSave( const char *filename, const int num, const ARParam *param, ...); ParametersReturn Value0 if successful, or -1 if an error occured. DiscussionSee the discussion under ARParam for more info. See Also Typedefs
ARParamStructure holding camera parameters, including image size, projection matrix and lens distortion parameters. typedef struct { int xsize; int ysize; ARdouble mat[3][4]; ARdouble dist_factor[AR_DIST_FACTOR_NUM_MAX]; int dist_function_version; // Must be last field in structure (as will not be written to disk). } ARParam; Fields
DiscussionARToolKit's tracking depends on accurate knowledge of the properties of the imaging system used to acquire input images. This structure holds the properties of an imaging system for internal use in ARToolKit. This information is used throughout the entire ARToolKit pipeline, including knowing the size of images being returned by the video library, marker detection and pose estimation, and warping of camera images for video-see-through registration. See Also ARParamLTStructure holding camera parameters, in lookup table form. typedef struct { ARParam param; ARParamLTf paramLTf; //ARParamLTi paramLTi; } ARParamLT; FieldsDiscussionARToolKit's tracking depends on accurate knowledge of the properties of the imaging system used to acquire input images. This structure holds the properties of an imaging system for internal use in ARToolKit. This information is used throughout the entire ARToolKit pipeline, including knowing the size of images being returned by the video library, marker detection and pose estimation, and warping of camera images for video-see-through registration. This version of the structure contains a pre-calculated lookup table of values covering the camera image width and height, plus a padded border. Macro Definitions
AR_DIST_FACTOR_NUM_MAXMaximum number of values in a distortion factor array. #define AR_DIST_FACTOR_NUM_MAX 9 DiscussionSee function arParamObserv2Ideal() for discussion. AR_DIST_FUNCTION_VERSION_DEFAULTDefault version for functions accepting a "distortion function version" parameter. #define AR_DIST_FUNCTION_VERSION_DEFAULT 4 DiscussionSee function arParamObserv2Ideal() for discussion. AR_DIST_FUNCTION_VERSION_MAXMaximum version allowable for functions accepting a "distortion function version" parameter. #define AR_DIST_FUNCTION_VERSION_MAX 4 DiscussionSee function arParamObserv2Ideal() for discussion. AR_PARAM_LT_DEFAULT_OFFSETDefault padding added around a lookup-table based camera parameter. #define AR_PARAM_LT_DEFAULT_OFFSET 15 DiscussionSee function arParamLTCreate() for discussion. |