arUtil.c File Reference

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <sys/time.h>
#include <AR/param.h>
#include <AR/matrix.h>
#include <AR/ar.h>
Include dependency graph for arUtil.c:

Go to the source code of this file.

Functions

int arGetLine (int x_coord[], int y_coord[], int coord_num, int vertex[], double line[4][3], double v[4][2])
 estimate a line from a list of point.
static int arGetLine2 (int x_coord[], int y_coord[], int coord_num, int vertex[], double line[4][3], double v[4][2], double *dist_factor)
ARUint32 arGetVersion (char **versionStringRef)
 Get the ARToolKit version information in numberic and string format.
int arInitCparam (ARParam *param)
 initialize camera parameters.
int arsGetLine (int x_coord[], int y_coord[], int coord_num, int vertex[], double line[4][3], double v[4][2], int LorR)
int arsInitCparam (ARSParam *sparam)
int arUtilMat2QuatPos (double m[3][4], double q[4], double p[3])
 extract a quaternion/position of matrix.
int arUtilMatInv (double s[3][4], double d[3][4])
 Inverse a non-square matrix.
int arUtilMatMul (double s1[3][4], double s2[3][4], double d[3][4])
 Multiplication of two matrix.
int arUtilQuatPos2Mat (double q[4], double p[3], double m[3][4])
 create a matrix with a quaternion/position.
void arUtilSleep (int msec)
 sleep the actual thread.
double arUtilTimer (void)
 get the time with the ARToolkit timer.
void arUtilTimerReset (void)
 reset the internal timer of ARToolkit.

Variables

int arDebug = 0
 activate artoolkit debug mode
int arFittingMode = DEFAULT_FITTING_MODE
 fitting display mode use by ARToolkit.
ARUint8arImage = NULL
 internal image
ARUint8arImageL = NULL
int arImageProcMode = DEFAULT_IMAGE_PROC_MODE
 define the image size mode for marker detection.
ARUint8arImageR = NULL
int arImXsize
 internal image size in width.
int arImYsize
 internal image size in heigth
int arMatchingPCAMode = DEFAULT_MATCHING_PCA_MODE
 XXXBK.
ARParam arParam
 internal intrinsic camera parameter
double arsMatR2L [3][4]
ARSParam arsParam
int arTemplateMatchingMode = DEFAULT_TEMPLATE_MATCHING_MODE
 XXXBK.
static int sms
static int ss

Function Documentation

int arGetLine ( int  x_coord[],
int  y_coord[],
int  coord_num,
int  vertex[],
double  line[4][3],
double  v[4][2] 
)

estimate a line from a list of point.

Compute a linear regression from a list of point.

Parameters:
x_coord X coordinate of points
y_coord Y coordinate of points
coord_num number of points
vertex XXXBK
line XXXBK
v XXXBK
Returns:
XXXBK

Definition at line 86 of file arUtil.c.

static int arGetLine2 ( int  x_coord[],
int  y_coord[],
int  coord_num,
int  vertex[],
double  line[4][3],
double  v[4][2],
double *  dist_factor 
) [static]

Definition at line 101 of file arUtil.c.

ARUint32 arGetVersion ( char **  versionStringRef  ) 

Get the ARToolKit version information in numberic and string format.

As of version 2.72, ARToolKit now allows querying of the version number of the toolkit available at runtime. It is highly recommended that any calling program that depends on features in a certain ARToolKit version, check at runtime that it is linked to a version of ARToolKit that can supply those features. It is NOT sufficient to check the ARToolKit SDK header versions, since with ARToolKit implemented in dynamically-loaded libraries, there is no guarantee that the version of ARToolKit installed on the machine at run-time will as recent as the version of the ARToolKit SDK which the host program was compiled against. The version information is reported in binary-coded decimal format, and optionally in an ASCII string. See the config.h header for more discussion of the definition of major, minor, tiny and build version numbers.

Parameters:
versionStringRef If non-NULL, the location pointed to will be filled with a pointer to a string containing the version information. Fields in the version string are separated by spaces. As of version 2.72.0, there is only one field implemented, and this field contains the major, minor and tiny version numbers in dotted-decimal format. The string is guaranteed to contain at least this field in all future versions of the toolkit. Later versions of the toolkit may add other fields to this string to report other types of version information. The storage for the string is malloc'ed inside the function. The caller is responsible for free'ing the string.
Returns:
Returns the full version number of the ARToolKit in binary coded decimal (BCD) format. BCD format allows simple tests of version number in the caller e.g. if ((arGetVersion(NULL) >> 16) > 0x0272) printf("This release is later than 2.72\n"); The major version number is encoded in the most-significant byte (bits 31-24), the minor version number in the second-most-significant byte (bits 23-16), the tiny version number in the third-most-significant byte (bits 15-8), and the build version number in the least-significant byte (bits 7-0).

Definition at line 40 of file arUtil.c.

int arInitCparam ( ARParam param  ) 

initialize camera parameters.

set the camera parameters specified in the camera parameters structure *param to static memory in the AR library. These camera parameters are typically read from a data file at program startup. In the video-see through AR applications, the default camera parameters are sufficient, no camera calibration is needed.

Parameters:
param the camera parameter structure
Returns:
always 0

Definition at line 66 of file arUtil.c.

int arsGetLine ( int  x_coord[],
int  y_coord[],
int  coord_num,
int  vertex[],
double  line[4][3],
double  v[4][2],
int  LorR 
)

Definition at line 92 of file arUtil.c.

int arsInitCparam ( ARSParam sparam  ) 

Definition at line 75 of file arUtil.c.

int arUtilMat2QuatPos ( double  m[3][4],
double  q[4],
double  p[3] 
)

extract a quaternion/position of matrix.

Extract a rotation (quaternion format) and a position (vector format) from a transformation matrix. The precondition is an euclidian matrix.

Parameters:
m source matrix
q a rotation represented by a quaternion.
p a translation represented by a vector.
Returns:
0 if the extraction success, -1 otherwise (quaternion not normalize)

Definition at line 191 of file arUtil.c.

int arUtilMatInv ( double  s[3][4],
double  d[3][4] 
)

Inverse a non-square matrix.

Inverse a matrix in a non homogeneous format. The matrix need to be euclidian.

Parameters:
s matrix input
d resulted inverse matrix.
Returns:
0 if the inversion success, -1 otherwise
Remarks:
input matrix can be also output matrix

Definition at line 167 of file arUtil.c.

int arUtilMatMul ( double  s1[3][4],
double  s2[3][4],
double  d[3][4] 
)

Multiplication of two matrix.

This procedure do a multiplication matrix between s1 and s2 and return the result in d : d=s1*s2. The precondition is the output matrix need to be different of input matrix. The precondition is euclidian matrix.

Parameters:
s1 first matrix.
s2 second matrix.
d resulted multiplication matrix.
Returns:
0 if the multiplication success, -1 otherwise

Definition at line 151 of file arUtil.c.

int arUtilQuatPos2Mat ( double  q[4],
double  p[3],
double  m[3][4] 
)

create a matrix with a quaternion/position.

Create a transformation matrix from a quaternion rotation and a vector translation.

Parameters:
q a rotation represented by a quaternion.
p a translation represented by a vector.
m destination matrix
Returns:
always 0

Definition at line 211 of file arUtil.c.

void arUtilSleep ( int  msec  ) 

sleep the actual thread.

Sleep the actual thread.

Parameters:
msec time to sleep (in millisecond)

Definition at line 301 of file arUtil.c.

double arUtilTimer ( void   ) 

get the time with the ARToolkit timer.

Give the time elapsed since the reset of the timer.

Returns:
elapsed time (in milliseconds)

Definition at line 251 of file arUtil.c.

void arUtilTimerReset ( void   ) 

reset the internal timer of ARToolkit.

Reset the internal timer used by ARToolKit. timer measurement (with arUtilTimer()).

Definition at line 280 of file arUtil.c.


Variable Documentation

int arDebug = 0

activate artoolkit debug mode

control debug informations in ARToolKit. the possible values are:

  • 0: not in debug mode
  • 1: in debug mode by default: 0

Definition at line 26 of file arUtil.c.

int arFittingMode = DEFAULT_FITTING_MODE

fitting display mode use by ARToolkit.

Correction mode for the distorsion of the camera. You can enable a correction with a texture mapping. the possible values are:

  • AR_FITTING_TO_INPUT: input image
  • AR_FITTING_TO_IDEAL: compensated image by default: DEFAULT_FITTING_MODE in config.h

Definition at line 28 of file arUtil.c.

ARUint8* arImage = NULL

internal image

internal image used. (access only for debugging ARToolKit) by default: NULL

Definition at line 27 of file arUtil.c.

ARUint8* arImageL = NULL

Definition at line 35 of file arUtil.c.

int arImageProcMode = DEFAULT_IMAGE_PROC_MODE

define the image size mode for marker detection.

Video image size for marker detection. This control if all the image is analyzed the possible values are :

  • AR_IMAGE_PROC_IN_FULL: full image uses.
  • AR_IMAGE_PROC_IN_HALF: half image uses. by default: DEFAULT_IMAGE_PROC_MODE in config.h

Definition at line 29 of file arUtil.c.

ARUint8* arImageR = NULL

Definition at line 36 of file arUtil.c.

int arImXsize

internal image size in width.

internal image size in width (generally initialize in arInitCparam)

Definition at line 31 of file arUtil.c.

int arImYsize

internal image size in heigth

internal image size in heigth (generally initialize in arInitCparam)

Definition at line 31 of file arUtil.c.

int arMatchingPCAMode = DEFAULT_MATCHING_PCA_MODE

XXXBK.

XXXBK the possible values are : -AR_MATCHING_WITHOUT_PCA: without PCA -AR_MATCHING_WITH_PCA: with PCA by default: DEFAULT_MATCHING_PCA_MODE in config.h

Definition at line 33 of file arUtil.c.

internal intrinsic camera parameter

internal variable for camera intrinsic parameters

Definition at line 30 of file arUtil.c.

double arsMatR2L[3][4]

Definition at line 38 of file arUtil.c.

Definition at line 37 of file arUtil.c.

int arTemplateMatchingMode = DEFAULT_TEMPLATE_MATCHING_MODE

XXXBK.

XXXBK the possible values are : AR_TEMPLATE_MATCHING_COLOR: Color Template AR_TEMPLATE_MATCHING_BW: BW Template by default: DEFAULT_TEMPLATE_MATCHING_MODE in config.h

Definition at line 32 of file arUtil.c.

int sms [static]

Definition at line 249 of file arUtil.c.

int ss [static]

Definition at line 249 of file arUtil.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines


artoolkit
Author(s): Gautier Dumonteil
autogenerated on Fri Jan 11 10:05:46 2013