| ARX 1.0 The next-generation open source augmented reality toolkit.

Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
ar.h File Reference

artoolkitX core routines. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <stdint.h>`
`#include <string.h>`
`#include <ARX/AR/config.h>`
`#include <ARX/AR/arConfig.h>`
`#include <ARX/ARUtil/log.h>`
`#include <ARX/AR/matrix.h>`
`#include <ARX/AR/icp.h>`
`#include <ARX/AR/param.h>`
`#include <ARX/AR/arImageProc.h>`
Include dependency graph for ar.h:

Go to the source code of this file.

## Classes
struct | AR2VideoTimestampT
| A structure to hold a timestamp in seconds and microseconds, with arbitrary epoch. More...
struct | AR2VideoBufferT
| A structure which carries information about a video frame retrieved by the video library. More...
struct | ARMarkerInfo2
| Captures detail of a trapezoidal region which is a candidate for marker detection. More...
struct | ARMarkerInfo
| Describes a detected trapezoidal area (a candidate for a marker match). More...
struct | ARTrackingHistory
| (description) More...
struct | ARLabelInfo
| (description) More...
struct | ARPattHandle
| A structure which holds descriptions of trained patterns for template matching. More...
struct | ARPattRectInfo
| Defines a pattern rectangle as a sub-portion of a marker image. More...
struct | ARHandle
| Structure holding state of an instance of the square marker tracker. More...
struct | AR3DHandle
| Structure holding state of an instance of the monocular pose estimator. More...
struct | AR3DStereoHandle
| Structure holding state of an instance of the stereo pose estimator. More...

## Macros
#define | arMalloc(V, T, S)
#define | arMallocClear(V, T, S)
#define | TRUE 1
#define | FALSE 0
#define | AR_EXTERN
#define | AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT 10
#define | AR_MATRIX_CODE_TYPE_SIZE_MASK 0x000000ff
| Mask value, bitwise-OR with matrix code type to find matrix code size.
#define | AR_MATRIX_CODE_TYPE_ECC_NONE 0x00000000
| No error detection or correction.
#define | AR_MATRIX_CODE_TYPE_ECC_PARITY 0x00000100
| Single-bit parity.
#define | AR_MATRIX_CODE_TYPE_ECC_HAMMING 0x00000200
| Hamming code with Hamming distance of 3.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___3 0x00000300
| BCH code with Hamming distance of 3.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___5 0x00000400
| BCH code with Hamming distance of 5.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___7 0x00000500
| BCH code with Hamming distance of 7.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___9 0x00000600
| BCH code with Hamming distance of 9.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___11 0x00000700
| BCH code with Hamming distance of 11.
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___19 0x00000b00
| BCH code with Hamming distance of 19.
#define | AR_TRANS_MAT_IDENTITY ICP_TRANS_MAT_IDENTITY
#define | ARPRINT(...) printf(__VA_ARGS__)
#define | ARPRINTE(...) fprintf(stderr, __VA_ARGS__)

## Typedefs
typedef char | ARInt8
typedef short | ARInt16
typedef int | ARInt32
typedef unsigned char | ARUint8
typedef unsigned short | ARUint16
typedef unsigned int | ARUint32
typedef float | ARfloat
typedef double | ARdouble

## Enumerations
enum | AR_LABELING_THRESH_MODE { AR_LABELING_THRESH_MODE_MANUAL = 0 , AR_LABELING_THRESH_MODE_AUTO_MEDIAN , AR_LABELING_THRESH_MODE_AUTO_OTSU , AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE , AR_LABELING_THRESH_MODE_AUTO_BRACKETING }
| Values controlling the labeling thresholding mode. More...
enum | AR_MARKER_INFO_CUTOFF_PHASE { AR_MARKER_INFO_CUTOFF_PHASE_NONE , AR_MARKER_INFO_CUTOFF_PHASE_PATTERN_EXTRACTION , AR_MARKER_INFO_CUTOFF_PHASE_MATCH_GENERIC , AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONTRAST , AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_NOT_FOUND , AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_EDC_FAIL , AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONFIDENCE , AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR , AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR_MULTI , AR_MARKER_INFO_CUTOFF_PHASE_HEURISTIC_TROUBLESOME_MATRIX_CODES }
| Result codes returned by arDetectMarker to report state of individual detected trapezoidal regions. More...
enum | AR_MATRIX_CODE_TYPE { AR_MATRIX_CODE_3x3 = 0x03 , AR_MATRIX_CODE_3x3_PARITY65 = 0x03 | AR_MATRIX_CODE_TYPE_ECC_PARITY , AR_MATRIX_CODE_3x3_HAMMING63 = 0x03 | AR_MATRIX_CODE_TYPE_ECC_HAMMING , AR_MATRIX_CODE_4x4 = 0x04 , AR_MATRIX_CODE_4x4_BCH_13_9_3 = 0x04 | AR_MATRIX_CODE_TYPE_ECC_BCH___3 , AR_MATRIX_CODE_4x4_BCH_13_5_5 = 0x04 | AR_MATRIX_CODE_TYPE_ECC_BCH___5 , AR_MATRIX_CODE_5x5_BCH_22_12_5 = 0x05 | AR_MATRIX_CODE_TYPE_ECC_BCH___5 , AR_MATRIX_CODE_5x5_BCH_22_7_7 = 0x05 | AR_MATRIX_CODE_TYPE_ECC_BCH___7 , AR_MATRIX_CODE_5x5 = 0x05 , AR_MATRIX_CODE_6x6 = 0x06 , AR_MATRIX_CODE_GLOBAL_ID = 0x0e | AR_MATRIX_CODE_TYPE_ECC_BCH___19 }
| Values specifying the type of matrix code in use. More...
enum | AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR { AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_BEST = 0 , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_CWD , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_SUPPLIED_PATH , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_EXECUTABLE_DIR , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_BUNDLE_RESOURCES_DIR , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_USER_ROOT , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_DATA_DIR , AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_TMP_DIR }
| Options for controlling the behavior of arUtilGetResourcesDirectoryPath and arUtilChangeToResourcesDirectory. More...

## Functions
AR_EXTERN ARHandle * | arCreateHandle (ARParamLT *paramLT)
| Create a handle to hold settings for an artoolkitX tracker instance.
AR_EXTERN int | arDeleteHandle (ARHandle *handle)
| Delete a handle which holds settings for an artoolkitX tracker instance.
AR_EXTERN void | arSetDebugMode (ARHandle *handle, int mode)
| Enable or disable artoolkitX's debug mode.
AR_EXTERN int | arGetDebugMode (ARHandle *handle)
| Find out whether artoolkitX's debug mode is enabled.
AR_EXTERN void | arSetLabelingMode (ARHandle *handle, int mode)
| Select between detection of black markers and white markers.
AR_EXTERN int | arGetLabelingMode (ARHandle *handle)
| Enquire whether detection is looking for black markers or white markers.
AR_EXTERN void | arSetLabelingThresh (ARHandle *handle, int thresh)
| Set the labeling threshhold.
AR_EXTERN int | arGetLabelingThresh (ARHandle *handle)
| Get the current labeling threshold.
AR_EXTERN void | arSetLabelingThreshMode (ARHandle *handle, const AR_LABELING_THRESH_MODE mode)
| Set the labeling threshold mode (auto/manual).
AR_EXTERN AR_LABELING_THRESH_MODE | arGetLabelingThreshMode (const ARHandle *handle)
| Get the labeling threshold mode (auto/manual).
AR_EXTERN void | arSetLabelingThreshModeAutoInterval (ARHandle *handle, const int interval)
| Set the number of frames between auto-threshold calculations.
AR_EXTERN int | arGetLabelingThreshModeAutoInterval (const ARHandle *handle)
| Get the number of frames between auto-threshold calculations.
AR_EXTERN void | arSetLabelingThreshAutoAdaptiveKernelSize (ARHandle *handle, const int labelingThreshAutoAdaptiveKernelSize)
AR_EXTERN int | arGetLabelingThreshAutoAdaptiveKernelSize (ARHandle *handle)
AR_EXTERN void | arSetLabelingThreshAutoAdaptiveBias (ARHandle *handle, const int labelingThreshAutoAdaptiveBias)
AR_EXTERN int | arGetLabelingThreshAutoAdaptiveBias (ARHandle *handle)
AR_EXTERN void | arSetImageProcMode (ARHandle *handle, int mode)
| Set the image processing mode.
AR_EXTERN int | arGetImageProcMode (ARHandle *handle)
| Get the image processing mode.
AR_EXTERN void | arSetPatternDetectionMode (ARHandle *handle, int mode)
| Set the pattern detection mode.
AR_EXTERN int | arGetPatternDetectionMode (ARHandle *handle)
| Get the pattern detection mode.
AR_EXTERN void | arSetMatrixCodeType (ARHandle *handle, const AR_MATRIX_CODE_TYPE type)
| Set the size and ECC algorithm to be used for matrix code (2D barcode) marker detection.
AR_EXTERN AR_MATRIX_CODE_TYPE | arGetMatrixCodeType (ARHandle *handle)
| Get the size and ECC algorithm being used for matrix code (2D barcode) marker detection.
AR_EXTERN void | arSetMarkerExtractionMode (ARHandle *handle, int mode)
| Set the marker extraction mode.
AR_EXTERN int | arGetMarkerExtractionMode (ARHandle *handle)
| Get the marker extraction mode.
AR_EXTERN void | arSetBorderSize (ARHandle *handle, const ARdouble borderSize)
| Set the border size.
AR_EXTERN ARdouble | arGetBorderSize (ARHandle *handle)
| Get the border size.
AR_EXTERN void | arSetPattRatio (ARHandle *handle, const ARdouble pattRatio)
| Set the width/height of the marker pattern space, as a proportion of marker width/height.
AR_EXTERN ARdouble | arGetPattRatio (ARHandle *handle)
| Get the width/height of the marker pattern space, as a proportion of marker width/height.
AR_EXTERN void | arSetPixelFormat (ARHandle *handle, AR_PIXEL_FORMAT pixFormat)
| Set the expected pixel format for video frames being passed to arDetectMarker.
AR_EXTERN AR_PIXEL_FORMAT | arGetPixelFormat (ARHandle *handle)
| Get the expected pixel format for video frames being passed to arDetectMarker.
AR_EXTERN void | arSetAreaMax (ARHandle *handle, const ARdouble areaMax)
AR_EXTERN ARdouble | arGetAreaMax (ARHandle *handle)
AR_EXTERN void | arSetAreaMin (ARHandle *handle, const ARdouble areaMin)
AR_EXTERN ARdouble | arGetAreaMin (ARHandle *handle)
AR_EXTERN void | arSetSquareFitThresh (ARHandle *handle, const ARdouble squareFitThresh)
AR_EXTERN ARdouble | arGetSquareFitThresh (ARHandle *handle)
AR_EXTERN void | arSetCornerRefinementMode (ARHandle *handle, int mode)
| Enable or disable square tracking subpixel corner refinement.
AR_EXTERN int | arGetCornerRefinementMode (ARHandle *handle)
| Find out whether square tracking subpixel corner refinement is enabled.
AR_EXTERN int | arDetectMarker (ARHandle *arHandle, AR2VideoBufferT *frame)
| Detect markers in a video frame.
AR_EXTERN int | arGetMarkerNum (ARHandle *arHandle)
| Get the number of markers detected in a video frame.
AR_EXTERN ARMarkerInfo * | arGetMarker (ARHandle *arHandle)
| Get information on the markers detected in a video frame.
AR_EXTERN int | arLabeling (ARUint8 *imageLuma, int xsize, int ysize, int debugMode, int labelingMode, int labelingThresh, int imageProcMode, ARLabelInfo *labelInfo, ARUint8 *image_thresh)
AR_EXTERN int | arDetectMarker2 (int xsize, int ysize, ARLabelInfo *labelInfo, int imageProcMode, int areaMax, int areaMin, ARdouble squareFitThresh, ARMarkerInfo2 *markerInfo2, int *marker2_num)
AR_EXTERN int | arGetMarkerInfo (ARUint8 *image, int xsize, int ysize, int pixelFormat, ARMarkerInfo2 *markerInfo2, int marker2_num, ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARParamLTf *arParamLTf, ARdouble pattRatio, ARMarkerInfo *markerInfo, int *marker_num, const AR_MATRIX_CODE_TYPE matrixCodeType)
| Examine a set of detected squares for match with known markers.
AR_EXTERN int | arGetContour (AR_LABELING_LABEL_TYPE *lImage, int xsize, int ysize, int *label_ref, int label, int clip[4], ARMarkerInfo2 *marker_info2)
AR_EXTERN int | arGetLine (int x_coord[], int y_coord[], int coord_num, int vertex[], ARParamLTf *paramLTf, ARdouble line[4][3], ARdouble v[4][2])
AR_EXTERN ARPattHandle * | arPattCreateHandle (void)
| Allocate a pattern handle.
AR_EXTERN ARPattHandle * | arPattCreateHandle2 (const int pattSize, const int patternCountMax)
| Allocate a pattern handle and set pattern template size and maximum number of patterns loadable.
AR_EXTERN int | arPattDeleteHandle (ARPattHandle *pattHandle)
| Free all loaded patterns and pattern handle.
AR_EXTERN int | arPattLoad (ARPattHandle *pattHandle, const char *filename)
| Load a pattern file into a pattern handle.
AR_EXTERN int | arPattLoadFromBuffer (ARPattHandle *pattHandle, const char *buffer)
AR_EXTERN int | arPattSave (ARUint8 *image, int xsize, int ysize, int pixelFormat, ARParamLTf *paramLTf, int imageProcMode, ARMarkerInfo *marker_info, ARdouble pattRatio, int pattSize, const char *filename)
| Save a pattern to a pattern file.
AR_EXTERN int | arPattFree (ARPattHandle *pattHandle, int patno)
| Frees (unloads) a pattern file from memory.
AR_EXTERN int | arPattActivate (ARPattHandle *pattHandle, int patno)
| Activate a previously deactivated pattern.
AR_EXTERN int | arPattDeactivate (ARPattHandle *pattHandle, int patno)
| Deactivate a previously activated pattern.
AR_EXTERN int | arPattAttach (ARHandle *arHandle, ARPattHandle *pattHandle)
| Associate a set of patterns with an ARHandle.
AR_EXTERN int | arPattDetach (ARHandle *arHandle)
| Reset an ARHandle to no pattern association.
AR_EXTERN int | arPattGetID (ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, int *x_coord, int *y_coord, int *vertex, ARdouble pattRatio, int *code, int *dir, ARdouble *cf, const AR_MATRIX_CODE_TYPE matrixCodeType)
AR_EXTERN int | arPattGetImage (int imageProcMode, int pattDetectMode, int patt_size, int sample_size, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, int *x_coord, int *y_coord, int *vertex, ARdouble pattRatio, ARUint8 *ext_patt)
AR_EXTERN int | arPattGetID2 (ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf, ARdouble vertex[4][2], ARdouble pattRatio, int *codePatt, int *dirPatt, ARdouble *cfPatt, int *codeMatrix, int *dirMatrix, ARdouble *cfMatrix, const AR_MATRIX_CODE_TYPE matrixCodeType)
| Match the interior of a detected square against known patterns.
AR_EXTERN int | arPattGetIDGlobal (ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf, ARdouble vertex[4][2], ARdouble pattRatio, int *codePatt, int *dirPatt, ARdouble *cfPatt, int *codeMatrix, int *dirMatrix, ARdouble *cfMatrix, const AR_MATRIX_CODE_TYPE matrixCodeType, int *errorCorrected, uint64_t *codeGlobalID_p)
| Match the interior of a detected square against known patterns with variable border width.
AR_EXTERN int | arPattGetImage2 (int imageProcMode, int pattDetectMode, int patt_size, int sample_size, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf, ARdouble vertex[4][2], ARdouble pattRatio, ARUint8 *ext_patt)
| Extract the image (i.e. locate and unwarp) of the pattern-space portion of a detected square.
AR_EXTERN int | arPattGetImage3 (ARHandle *arHandle, int markerNo, ARUint8 *image, ARPattRectInfo *rect, int xsize, int ysize, int overSampleScale, ARUint8 *outImage)
| Extract the image (i.e. locate and unwarp) of an arbitrary portion of a detected square.
AR_EXTERN AR3DHandle * | ar3DCreateHandle (const ARParam *arParam)
| Create handle used for 3D calculation from calibrated camera parameters.
AR_EXTERN AR3DHandle * | ar3DCreateHandle2 (const ARdouble cpara[3][4])
| Create handle used for 3D calculation from an intrinsic parameters matrix.
AR_EXTERN int | ar3DDeleteHandle (AR3DHandle **handle)
| Delete handle used for 3D calculation.
AR_EXTERN int | ar3DChangeCpara (AR3DHandle *handle, const ARdouble cpara[3][4])
| (description)
AR_EXTERN int | ar3DChangeMaxLoopCount (AR3DHandle *handle, int maxLoopCount)
| (description)
AR_EXTERN int | ar3DChangeLoopBreakThresh (AR3DHandle *handle, ARdouble loopBreakThresh)
| (description)
AR_EXTERN int | ar3DChangeLoopBreakThreshRatio (AR3DHandle *handle, ARdouble loopBreakThreshRatio)
| (description)
AR_EXTERN ARdouble | arGetTransMatSquare (AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble width, ARdouble conv[3][4])
| (description)
AR_EXTERN ARdouble | arGetTransMatSquareCont (AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble initConv[3][4], ARdouble width, ARdouble conv[3][4])
| (description)
AR_EXTERN ARdouble | arGetTransMat (AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4])
| (description)
AR_EXTERN ARdouble | arGetTransMatRobust (AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4])
| (description)
AR_EXTERN AR3DStereoHandle * | ar3DStereoCreateHandle (const ARParam *arParamL, const ARParam *arParamR, const ARdouble transL[3][4], const ARdouble transR[3][4])
AR_EXTERN AR3DStereoHandle * | ar3DStereoCreateHandle2 (const ARdouble cparaL[3][4], const ARdouble cparaR[3][4], const ARdouble transL[3][4], const ARdouble transR[3][4])
AR_EXTERN int | ar3DStereoDeleteHandle (AR3DStereoHandle **handle)
AR_EXTERN int | ar3DStereoChangeMaxLoopCount (AR3DStereoHandle *handle, int maxLoopCount)
AR_EXTERN int | ar3DStereoChangeLoopBreakThresh (AR3DStereoHandle *handle, ARdouble loopBreakThresh)
AR_EXTERN int | ar3DStereoChangeLoopBreakThreshRatio (AR3DStereoHandle *handle, ARdouble loopBreakThreshRatio)
AR_EXTERN int | ar3DStereoChangeCpara (AR3DStereoHandle *handle, ARdouble cparaL[3][4], ARdouble cparaR[3][4])
AR_EXTERN int | ar3DStereoChangeTransMat (AR3DStereoHandle *handle, ARdouble transL[3][4], ARdouble transR[3][4])
AR_EXTERN ARdouble | arGetTransMatSquareStereo (AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR, ARdouble width, ARdouble conv[3][4])
AR_EXTERN ARdouble | arGetTransMatSquareContStereo (AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR, ARdouble prev_conv[3][4], ARdouble width, ARdouble conv[3][4])
AR_EXTERN ARdouble | arGetTransMatStereo (AR3DStereoHandle *handle, ARdouble initConv[3][4], ARdouble pos2dL[][2], ARdouble pos3dL[][3], int numL, ARdouble pos2dR[][2], ARdouble pos3dR[][3], int numR, ARdouble conv[3][4])
AR_EXTERN ARdouble | arGetTransMatStereoRobust (AR3DStereoHandle *handle, ARdouble initConv[3][4], ARdouble pos2dL[][2], ARdouble pos3dL[][3], int numL, ARdouble pos2dR[][2], ARdouble pos3dR[][3], int numR, ARdouble conv[3][4])
AR_EXTERN ARdouble | arGetStereoMatchingErrorSquare (AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR)
AR_EXTERN ARdouble | arGetStereoMatchingError (AR3DStereoHandle *handle, ARdouble pos2dL[2], ARdouble pos2dR[2])
AR_EXTERN int | arGetStereoMatching (AR3DStereoHandle *handle, ARdouble pos2dL[2], ARdouble pos2dR[2], ARdouble pos3d[3])
AR_EXTERN ARUint32 | arGetVersion (char **versionStringRef)
| Get the artoolkitX version information in numberic and string format.
AR_EXTERN int | arUtilMatInv (const ARdouble s[3][4], ARdouble d[3][4])
AR_EXTERN int | arUtilMatMul (const ARdouble s1[3][4], const ARdouble s2[3][4], ARdouble d[3][4])
AR_EXTERN int | arUtilMatInvf (const float s[3][4], float d[3][4])
AR_EXTERN int | arUtilMatMulf (const float s1[3][4], const float s2[3][4], float d[3][4])
AR_EXTERN int | arUtilMatMuldff (const ARdouble s1[3][4], const float s2[3][4], float d[3][4])
AR_EXTERN int | arUtilMat2QuatPos (const ARdouble m[3][4], ARdouble q[4], ARdouble p[3])
AR_EXTERN int | arUtilQuatPos2Mat (const ARdouble q[4], const ARdouble p[3], ARdouble m[3][4])
AR_EXTERN int | arUtilQuatNorm (ARdouble q[4])
AR_EXTERN int | arUtilReplaceExt (char *filename, int n, char *ext)
AR_EXTERN int | arUtilRemoveExt (char *filename)
AR_EXTERN int | arUtilDivideExt (const char *filename, char *s1, char *s2)
AR_EXTERN int | arUtilGetSquareCenter (ARdouble vertex[4][2], ARdouble *x, ARdouble *y)
AR_EXTERN int | arUtilSortLabel (int mask[], int m, int n, ARdouble pos[][2], int area[], int label_num, int l1, int x1, int y1, int l2, int x2, int y2, int label[])
AR_EXTERN int | arUtilGetPixelSize (const AR_PIXEL_FORMAT arPixelFormat)
| Get the size in bytes of a single pixel for a given pixel format.
AR_EXTERN const char * | arUtilGetPixelFormatName (const AR_PIXEL_FORMAT arPixelFormat)
| Get a string holding a descriptive name for a given pixel format enumeration.
AR_EXTERN const char * | arUtilGetFileNameFromPath (const char *path)
AR_EXTERN char * | arUtilGetFileBasenameFromPath (const char *path, const int convertToLowercase)
| Get file base name from a path.
AR_EXTERN char * | arUtilGetFileExtensionFromPath (const char *path, const int convertToLowercase)
| Get file extension from a path.
AR_EXTERN char * | arUtilGetDirectoryNameFromPath (char *dir, const char *path, const size_t n, const int addSeparator)
AR_EXTERN char * | arUtilGetFileURI (const char *path)
| Get a path as a file URI.
AR_EXTERN char * | arUtilGetResourcesDirectoryPath (AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior)
| Get the path to the resources directory using the specified behavior.
AR_EXTERN char * | arUtilGetAndCreateResourcesDirectoryPath (AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior)
| Get the path to the resources directory using the specified behavior, creating the path if it doesn't already exist.
AR_EXTERN int | arUtilChangeToResourcesDirectory (AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, const char *path)
| Change to the resources directory using the specified behavior.
AR_EXTERN void | arUtilPrintTransMat (const ARdouble trans[3][4])
| Prints a transformation matrix via ARPRINT(...).
AR_EXTERN void | arUtilPrintMtx16 (const ARdouble mtx16[16])
| Prints a 4x4 row-major matrix via ARPRINT(...).

## Variables
AR_EXTERN const char * | arMarkerInfoCutoffPhaseDescriptions [AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT]

## Detailed Description

artoolkitX core routines.

This header declares essential types and API for the entire artoolkitX SDK.

For compile-time per-machine configuration, see <AR/config.h>. For compile-time artoolkitX configuration, see <AR/arConfig.h>.

Copyright
  2015-2016 Daqri, LLC.

## Macro Definition Documentation

## ◆ AR_EXTERN

#define AR_EXTERN

## ◆ AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT

#define AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT 10

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___11

#define AR_MATRIX_CODE_TYPE_ECC_BCH___11 0x00000700

BCH code with Hamming distance of 11.

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___19

#define AR_MATRIX_CODE_TYPE_ECC_BCH___19 0x00000b00

BCH code with Hamming distance of 19.

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___3

#define AR_MATRIX_CODE_TYPE_ECC_BCH___3 0x00000300

BCH code with Hamming distance of 3.

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___5

#define AR_MATRIX_CODE_TYPE_ECC_BCH___5 0x00000400

BCH code with Hamming distance of 5.

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___7

#define AR_MATRIX_CODE_TYPE_ECC_BCH___7 0x00000500

BCH code with Hamming distance of 7.

## ◆ AR_MATRIX_CODE_TYPE_ECC_BCH___9

#define AR_MATRIX_CODE_TYPE_ECC_BCH___9 0x00000600

BCH code with Hamming distance of 9.

## ◆ AR_MATRIX_CODE_TYPE_ECC_HAMMING

#define AR_MATRIX_CODE_TYPE_ECC_HAMMING 0x00000200

Hamming code with Hamming distance of 3.

## ◆ AR_MATRIX_CODE_TYPE_ECC_NONE

#define AR_MATRIX_CODE_TYPE_ECC_NONE 0x00000000

No error detection or correction.

## ◆ AR_MATRIX_CODE_TYPE_ECC_PARITY

#define AR_MATRIX_CODE_TYPE_ECC_PARITY 0x00000100

Single-bit parity.

## ◆ AR_MATRIX_CODE_TYPE_SIZE_MASK

#define AR_MATRIX_CODE_TYPE_SIZE_MASK 0x000000ff

Mask value, bitwise-OR with matrix code type to find matrix code size.

## ◆ AR_TRANS_MAT_IDENTITY

#define AR_TRANS_MAT_IDENTITY ICP_TRANS_MAT_IDENTITY

## ◆ arMalloc

#define arMalloc | ( |  | V,
|  |  | T,
|  |  | S
| ) |  |

Value:
{ if( ((V) = (T *)malloc( sizeof(T) * (S) )) == NULL ) \
{ARLOGe("Out of memory!!\n"); exit(1);} }
ARLOGe
#define ARLOGe(...)
Definition: log.h:141

## ◆ arMallocClear

#define arMallocClear | ( |  | V,
|  |  | T,
|  |  | S
| ) |  |

Value:
{ if( ((V) = (T *)calloc( (S), sizeof(T) )) == NULL ) \
{ARLOGe("Out of memory!!\n"); exit(1);} }

## ◆ ARPRINT

#define ARPRINT | ( |  | ... | ) | printf(__VA_ARGS__)

## ◆ ARPRINTE

#define ARPRINTE | ( |  | ... | ) | fprintf(stderr, __VA_ARGS__)

## ◆ FALSE

#define FALSE 0

## ◆ TRUE

#define TRUE 1

## Typedef Documentation

## ◆ ARdouble

typedef double ARdouble

## ◆ ARfloat

typedef float ARfloat

## ◆ ARInt16

typedef short ARInt16

## ◆ ARInt32

typedef int ARInt32

## ◆ ARInt8

typedef char ARInt8

## ◆ ARUint16

typedef unsigned short ARUint16

## ◆ ARUint32

typedef unsigned int ARUint32

## ◆ ARUint8

typedef unsigned char ARUint8

## Enumeration Type Documentation

## ◆ AR_LABELING_THRESH_MODE

enum AR_LABELING_THRESH_MODE

Values controlling the labeling thresholding mode.

Enumerator
AR_LABELING_THRESH_MODE_MANUAL | Manual threshold selection via arSetLabelingThresh.
AR_LABELING_THRESH_MODE_AUTO_MEDIAN | Automatic threshold selection via full-image histogram median.
AR_LABELING_THRESH_MODE_AUTO_OTSU | Automatic threshold selection via Otsu's method for foreground/background selection.
AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE | Adaptive thresholding.
AR_LABELING_THRESH_MODE_AUTO_BRACKETING | Automatic threshold selection via heuristic-based exposure bracketing.

## ◆ AR_MARKER_INFO_CUTOFF_PHASE

enum AR_MARKER_INFO_CUTOFF_PHASE

Result codes returned by arDetectMarker to report state of individual detected trapezoidal regions.

When detecting markers, all trapezoidal regions in the incoming image are considered for marker matching. Various heuristics are used to reject regions judged to be non-markers. The code will, as far as possible, report rejection by placing one of these constants into the ARMarkerInfo.cutoffPhase field of regions rejected during the arDetectMarker() call. Note that the ARMarkerInfo.id of such rejected regions will be -1.

Enumerator
AR_MARKER_INFO_CUTOFF_PHASE_NONE | Marker OK.
AR_MARKER_INFO_CUTOFF_PHASE_PATTERN_EXTRACTION | Failure during pattern extraction.
AR_MARKER_INFO_CUTOFF_PHASE_MATCH_GENERIC | Generic error during matching phase.
AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONTRAST | Insufficient contrast during matching.
AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_NOT_FOUND | Barcode matching could not find correct barcode locator pattern.
AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_EDC_FAIL | Barcode matching error detection/correction found unrecoverable error.
AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONFIDENCE | Matching confidence cutoff value not reached.
AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR | Maximum allowable pose error exceeded.
AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR_MULTI | Multi-marker pose error value exceeded.
AR_MARKER_INFO_CUTOFF_PHASE_HEURISTIC_TROUBLESOME_MATRIX_CODES | Heuristic-based rejection of troublesome matrix code which is often generated in error.

## ◆ AR_MATRIX_CODE_TYPE

enum AR_MATRIX_CODE_TYPE

Values specifying the type of matrix code in use.

Enumerator
AR_MATRIX_CODE_3x3 | Matrix code in range 0-63.
AR_MATRIX_CODE_3x3_PARITY65 | Matrix code in range 0-31.
AR_MATRIX_CODE_3x3_HAMMING63 | Matrix code in range 0-7.
AR_MATRIX_CODE_4x4 | Matrix code in range 0-8191.
AR_MATRIX_CODE_4x4_BCH_13_9_3 | Matrix code in range 0-511.
AR_MATRIX_CODE_4x4_BCH_13_5_5 | Matrix code in range 0-31.
AR_MATRIX_CODE_5x5_BCH_22_12_5 | Matrix code in range 0-4095.
AR_MATRIX_CODE_5x5_BCH_22_7_7 | Matrix code in range 0-127.
AR_MATRIX_CODE_5x5 | Matrix code in range 0-4194303.
AR_MATRIX_CODE_6x6 | Matrix code in range 0-8589934591.
AR_MATRIX_CODE_GLOBAL_ID |

## ◆ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR

enum AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR

Options for controlling the behavior of arUtilGetResourcesDirectoryPath and arUtilChangeToResourcesDirectory.

See also
  arUtilGetResourcesDirectoryPath
  arUtilChangeToResourcesDirectory

Enumerator
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_BEST | Use a platform-dependent recommended-best option. Note the this behavior is subject to change in future versions of artoolkitX. At present, on macOS and iOS, this will change to the Apple-provided resources directory inside the application bundle. At present, on other platforms, this will change to the same directory as the executable.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_CWD | Use the current working directory. For arUtilChangeToResourcesDirectory, this will leave the current working directory unchanged.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_SUPPLIED_PATH | Change to the working directory specified.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_EXECUTABLE_DIR | Change to the same directory as the executable. On OS X and iOS, this corresponds to the directory of the binary executable inside the app bundle, not the directory containing the app bundle.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_BUNDLE_RESOURCES_DIR | Change to the resources directory. On macOS and iOS, this is the Resources directory inside the application bundle. On Linux, this is a directory formed by taking the path to the directory containing the executable, appending "/../share" to it, and then pointing to a subdirectory under this path with the same name as the executable. Note that the existence of this path is not guaranteed. E.g. for an executable at path '/usr/bin/myapp' the returned path will be '/usr/bin/../share/myapp'.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_USER_ROOT | Change to the root of the implementation-dependent user-writable root. On iOS and sandboxed macOS, this is equivalent to the root of the application sandbox. On Linux and non-sandboxed macOS, this is equivalent to the "~" user home. On Android, this is the root of the "external" storage (e.g. an SD card). On Windows, this is the user home directory, typically "C:\Documents and Settings\USERNAME" or "C:\Users\USERNAME". On Windows UWP
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR | Change to a writable cache directory, i.e. a directory which is not normally shown to the user, in which files which may be subject to deletion by the system or the user. On Android, this is the applications's (internal) cache directory, and a valid instance of Android/Context must be passed in the instanceofAndroidContext parameter.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_DATA_DIR | Change to a writable data directory, i.e. a directory which is not normally shown to the user, but in which files are retained permanently. On Android, this is the applications's (internal) files directory, and a valid instance of Android/Context must be passed in the instanceofAndroidContext parameter.
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_TMP_DIR | Change to a writable temporary directory, i.e. a directory which is not normally shown to the user, and from which files may be deleted at the end of program execution. On Android, this is the applications's (internal) cache directory, and a valid instance of Android/Context must be passed in the instanceofAndroidContext parameter.

## Function Documentation

## ◆ ar3DChangeCpara()

AR_EXTERN int ar3DChangeCpara | ( | AR3DHandle * | handle,
|  | const ARdouble | cpara[3][4]
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  cpara | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ ar3DChangeLoopBreakThresh()

AR_EXTERN int ar3DChangeLoopBreakThresh | ( | AR3DHandle * | handle,
|  | ARdouble | loopBreakThresh
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  loopBreakThresh | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ ar3DChangeLoopBreakThreshRatio()

AR_EXTERN int ar3DChangeLoopBreakThreshRatio | ( | AR3DHandle * | handle,
|  | ARdouble | loopBreakThreshRatio
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  loopBreakThreshRatio | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ ar3DChangeMaxLoopCount()

AR_EXTERN int ar3DChangeMaxLoopCount | ( | AR3DHandle * | handle,
|  | int | maxLoopCount
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  maxLoopCount | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ ar3DCreateHandle()

AR_EXTERN AR3DHandle * ar3DCreateHandle | ( | const ARParam * | arParam | ) |

Create handle used for 3D calculation from calibrated camera parameters.

@functiongroup "3D calculation".

An AR3DHandle holds data structures used in calculating the 3D pose of a marker from the 2D location of its corners (i.e. pose estimation).

Parameters

  arParam | (description)

Returns
  The handle. When no more ar3D*() functions need be called, the handle should be deleted by calling ar3DDeleteHandle().

See also
  ar3DCreateHandle2
  ar3DDeleteHandle

Here is the call graph for this function:

## ◆ ar3DCreateHandle2()

AR_EXTERN AR3DHandle * ar3DCreateHandle2 | ( | const ARdouble | cpara[3][4] | ) |

Create handle used for 3D calculation from an intrinsic parameters matrix.

An AR3DHandle holds data structures used in calculating the 3D pose of a marker from the 2D location of its corners (i.e. pose estimation).

Parameters

  cpara | (description)

Returns
  The handle. When no more ar3D*() functions need be called, the handle should be deleted by calling ar3DDeleteHandle().

See also
  ar3DCreateHandle
  ar3DDeleteHandle

Here is the call graph for this function:

## ◆ ar3DDeleteHandle()

AR_EXTERN int ar3DDeleteHandle | ( | AR3DHandle ** | handle | ) |

Delete handle used for 3D calculation.

When no more ar3D*() functions need be called, the handle should be deleted by calling ar3DDeleteHandle().

Parameters

  handle | A pointer to the 3D handle. On success, the contents of this location will be set to NULL.

Returns
  0 if the handle was successfully deleted, -1 otherwise.

See also
  ar3DDeleteHandle

Here is the call graph for this function:

## ◆ ar3DStereoChangeCpara()

AR_EXTERN int ar3DStereoChangeCpara | ( | AR3DStereoHandle * | handle,
|  | ARdouble | cparaL[3][4],
|  | ARdouble | cparaR[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoChangeLoopBreakThresh()

AR_EXTERN int ar3DStereoChangeLoopBreakThresh | ( | AR3DStereoHandle * | handle,
|  | ARdouble | loopBreakThresh
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoChangeLoopBreakThreshRatio()

AR_EXTERN int ar3DStereoChangeLoopBreakThreshRatio | ( | AR3DStereoHandle * | handle,
|  | ARdouble | loopBreakThreshRatio
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoChangeMaxLoopCount()

AR_EXTERN int ar3DStereoChangeMaxLoopCount | ( | AR3DStereoHandle * | handle,
|  | int | maxLoopCount
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoChangeTransMat()

AR_EXTERN int ar3DStereoChangeTransMat | ( | AR3DStereoHandle * | handle,
|  | ARdouble | transL[3][4],
|  | ARdouble | transR[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoCreateHandle()

AR_EXTERN AR3DStereoHandle * ar3DStereoCreateHandle | ( | const ARParam * | arParamL,
|  | const ARParam * | arParamR,
|  | const ARdouble | transL[3][4],
|  | const ARdouble | transR[3][4]
| ) |  |

@functiongroup "3D calculation by Stereo".

Here is the call graph for this function:

## ◆ ar3DStereoCreateHandle2()

AR_EXTERN AR3DStereoHandle * ar3DStereoCreateHandle2 | ( | const ARdouble | cparaL[3][4],
|  | const ARdouble | cparaR[3][4],
|  | const ARdouble | transL[3][4],
|  | const ARdouble | transR[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ ar3DStereoDeleteHandle()

AR_EXTERN int ar3DStereoDeleteHandle | ( | AR3DStereoHandle ** | handle | ) |

Here is the call graph for this function:

## ◆ arCreateHandle()

AR_EXTERN ARHandle * arCreateHandle | ( | ARParamLT * | paramLT | ) |

Create a handle to hold settings for an artoolkitX tracker instance.

@functiongroup "Square detection".

ARHandle is the primary structure holding the settings for a single artoolkitX square marker tracking instance. Settings include expected video stream image size and pixel format, tracking modes, loaded markers and more.

Expected video stream image size is taken directly from the supplied ARParamLT structure's xsize and ysize fields. Video stream image pixel format must be set by a subsequent call to arSetPixelFormat() to set the correct format.

After creation of the ARHandle, tracking settings should be set via appropriate calls to other arSet*() functions.

The ARHandle should be disposed of via a call to arDeleteHandle when tracking with this instance is complete.

Parameters

  paramLT | The created handle will hold a pointer to the calibrated camera parameters specified by this parameter. This parameter uses the new lookup-table based form of the camera parameters introduced in ARToolKit v5. An ARParamLT structure may be created from an ARParam structure via the call: `ARParamLT *paramLT = arParamLTCreate(&param, AR_PARAM_LT_DEFAULT_OFFSET);` Note that the pointer is only copied, and so the ARParamLT structure must remain valid until the ARHandle is disposed of by calling arDeleteHandle.

Returns
  An ARHandle which should be passed to other functions which deal with the operations of the artoolkitX tracker.

See also
  arSetPixelFormat
  arDeleteHandle

Here is the call graph for this function:

## ◆ arDeleteHandle()

AR_EXTERN int arDeleteHandle | ( | ARHandle * | handle | ) |

Delete a handle which holds settings for an artoolkitX tracker instance.

The calibrated camera parameters pointed to by the handle are NOT deleted by this operation.

Parameters

  handle | The handle to delete, as created by arCreateHandle();

Returns
  0 if no error occured.

See also
  arCreateHandle

Here is the call graph for this function:

## ◆ arDetectMarker()

AR_EXTERN int arDetectMarker | ( | ARHandle * | arHandle,
|  | AR2VideoBufferT * | frame
| ) |  |

Detect markers in a video frame.

This is the core artoolkitX marker detection function. It calls through to a set of internal functions to perform the key marker detection steps of binarization and labelling, contour extraction, and template matching and/or matrix code extraction.

Typically, the resulting set of detected markers is retrieved by calling arGetMarkerNum to get the number of markers detected and arGetMarker to get an array of ARMarkerInfo structures with information on each detected marker, followed by a step in which detected markers are possibly examined for some measure of goodness of match (e.g. by examining the match confidence value) and pose extraction.

Parameters

  arHandle | Handle to initialised settings, including camera parameters, incoming video image size and pixel format, markers, detection modes and other information.
  frame | Pointer to an AR2VideoBufferT structure which contains the pixel data for the image frame which is to be processed for marker detection. The format of pixels in the frame is specified by arSetPixelFormat(). The width and height of the image are specified by the xsize and ysize parameters of the camera parameters held in arHandle.

Returns
  0 if the function proceeded without error, or a value less than 0 in case of error. A result of 0 does not however, imply any markers were detected.

See also
  arCreateHandle
  arGetMarkerNum
  arGetMarker

Here is the call graph for this function:

## ◆ arDetectMarker2()

AR_EXTERN int arDetectMarker2 | ( | int | xsize,
|  | int | ysize,
|  | ARLabelInfo * | labelInfo,
|  | int | imageProcMode,
|  | int | areaMax,
|  | int | areaMin,
|  | ARdouble | squareFitThresh,
|  | ARMarkerInfo2 * | markerInfo2,
|  | int * | marker2_num
| ) |  |

Here is the call graph for this function:

## ◆ arGetAreaMax()

AR_EXTERN ARdouble arGetAreaMax | ( | ARHandle * | handle | ) |

## ◆ arGetAreaMin()

AR_EXTERN ARdouble arGetAreaMin | ( | ARHandle * | handle | ) |

## ◆ arGetBorderSize()

AR_EXTERN ARdouble arGetBorderSize | ( | ARHandle * | handle | ) |

Get the border size.

N.B. Deprecated in favour of arGetPattRatio(), but retained for backwards compatibility.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its border size.

Returns
  Value representing the border size. The default border size for newly-created ARHandle structures is AR_BORDER_SIZE_DEFAULT.

See also
  arSetBorderSize

## ◆ arGetContour()

AR_EXTERN int arGetContour | ( | AR_LABELING_LABEL_TYPE * | lImage,
|  | int | xsize,
|  | int | ysize,
|  | int * | label_ref,
|  | int | label,
|  | int | clip[4],
|  | ARMarkerInfo2 * | marker_info2
| ) |  |

## ◆ arGetCornerRefinementMode()

AR_EXTERN int arGetCornerRefinementMode | ( | ARHandle * | handle | ) |

Find out whether square tracking subpixel corner refinement is enabled.

See arSetCornerRefinementMode() for more info.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  Value representing the mode.

See also
  arSetCornerRefinementMode

## ◆ arGetDebugMode()

AR_EXTERN int arGetDebugMode | ( | ARHandle * | handle | ) |

Find out whether artoolkitX's debug mode is enabled.

See arSetDebugMode() for more info.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  Value representing the mode.

See also
  arSetDebugMode

## ◆ arGetImageProcMode()

AR_EXTERN int arGetImageProcMode | ( | ARHandle * | handle | ) |

Get the image processing mode.

See arSetImageProcMode() for a complete description.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  Value representing the current image processing mode.

See also
  arSetImageProcMode

## ◆ arGetLabelingMode()

AR_EXTERN int arGetLabelingMode | ( | ARHandle * | handle | ) |

Enquire whether detection is looking for black markers or white markers.

See discussion for arSetLabelingMode.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its labeling mode.

Returns
  Value representing the mode.

See also
  arSetLabelingMode

## ◆ arGetLabelingThresh()

AR_EXTERN int arGetLabelingThresh | ( | ARHandle * | handle | ) |

Get the current labeling threshold.

This function queries the current labeling threshold. For, AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, and AR_LABELING_THRESH_MODE_AUTO_BRACKETING the threshold value is only valid until the next auto-update.

The current threshold mode is not affected by this call.

The threshold value is not relevant if threshold mode is AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold value.

Returns
  Value of the labeling threshhold. An integer in the range [0,255] (inclusive)

See also
  arSetLabelingThresh

## ◆ arGetLabelingThreshAutoAdaptiveBias()

AR_EXTERN int arGetLabelingThreshAutoAdaptiveBias | ( | ARHandle * | handle | ) |

## ◆ arGetLabelingThreshAutoAdaptiveKernelSize()

AR_EXTERN int arGetLabelingThreshAutoAdaptiveKernelSize | ( | ARHandle * | handle | ) |

## ◆ arGetLabelingThreshMode()

AR_EXTERN AR_LABELING_THRESH_MODE arGetLabelingThreshMode | ( | const ARHandle * | handle | ) |

Get the labeling threshold mode (auto/manual).

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold value.

Returns
  Value of the labeling threshold mode, one of: AR_LABELING_THRESH_MODE_MANUAL, AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE, AR_LABELING_THRESH_MODE_AUTO_BRACKETING

See also
  arSetLabelingThresh
  arSetLabelingThreshMode

## ◆ arGetLabelingThreshModeAutoInterval()

AR_EXTERN int arGetLabelingThreshModeAutoInterval | ( | const ARHandle * | handle | ) |

Get the number of frames between auto-threshold calculations.

This is the number of frames BETWEEN calculations, meaning that the calculation occurs every (interval + 1) frames.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold auto interval value.

Returns
  Value of the labeling threshhold auto interval. An integer in the range [0,INT_MAX] (inclusive)

See also
  arSetLabelingThreshModeAutoInterval

## ◆ arGetLine()

AR_EXTERN int arGetLine | ( | int | x_coord[],
|  | int | y_coord[],
|  | int | coord_num,
|  | int | vertex[],
|  | ARParamLTf * | paramLTf,
|  | ARdouble | line[4][3],
|  | ARdouble | v[4][2]
| ) |  |

Here is the call graph for this function:

## ◆ arGetMarker()

AR_EXTERN ARMarkerInfo * arGetMarker | ( | ARHandle * | arHandle | ) |

Get information on the markers detected in a video frame.

Returns
  An array (of length arGetMarkerNum(arHandle)) of ARMarkerInfo structs. A better name for this function would be arGetDetectedMarkerInfo, but the current name lives on for historical reasons.

Parameters

  arHandle | Handle upon which arDetectMarker has been called.

See also
  arGetMarkerNum
  ARMarkerInfo
  arDetectMarker

## ◆ arGetMarkerExtractionMode()

AR_EXTERN int arGetMarkerExtractionMode | ( | ARHandle * | handle | ) |

Get the marker extraction mode.

(description)

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  The value representing the mode.

See also
  arSetMarkerExtractionMode

## ◆ arGetMarkerInfo()

AR_EXTERN int arGetMarkerInfo | ( | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | int | pixelFormat,
|  | ARMarkerInfo2 * | markerInfo2,
|  | int | marker2_num,
|  | ARPattHandle * | pattHandle,
|  | int | imageProcMode,
|  | int | pattDetectMode,
|  | ARParamLTf * | arParamLTf,
|  | ARdouble | pattRatio,
|  | ARMarkerInfo * | markerInfo,
|  | int * | marker_num,
|  | const AR_MATRIX_CODE_TYPE | matrixCodeType
| ) |  |

Examine a set of detected squares for match with known markers.

Performs the intermediate marker-detection stage of taking detected squares in a processed image, and matching the interior of these squares against known marker templates, or extracting matrix codes from the interior of the square.

Parameters

  image | Image in which squares were detected.
  xsize | Horizontal dimension of image, in pixels.
  ysize | Vertical dimension of image, in pixels.
  pixelFormat | Format of pixels in image. See <AR/config.h> for values.
  markerInfo2 | Pointer to an array of ARMarkerInfo2 structures holding information on detected squares which are candidates for marker matching.
  marker2_num | Size of markerInfo2 array.
  pattHandle | Handle to loaded patterns for template matching against detected squares.
  imageProcMode | Indicates whether square detection was performed treating the image as a frame or a field.
  pattDetectMode | Whether to perform color/mono template matching, matrix code detection, or both.
  arParamLTf | Lookup table for the camera parameters for the optical source from which the image was acquired. See arParamLTCreate.
  pattRatio | A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pattern. In earlier versions, this value was fixed at 0.5.
  markerInfo | Output: Pointer to an array of ARMarkerInfo structures holding information on successful matches.
  marker_num | Output: Size of markerInfo array.
  matrixCodeType | When matrix code pattern detection mode is active, indicates the type of matrix code to detect.

Returns
  0 in case of no error, or -1 otherwise.

See also
  arParamLTCreate

Here is the call graph for this function:

## ◆ arGetMarkerNum()

AR_EXTERN int arGetMarkerNum | ( | ARHandle * | arHandle | ) |

Get the number of markers detected in a video frame.

Returns
  The number of detected markers in the most recent image passed to arDetectMarker. Note that this is actually a count, not an index. A better name for this function would be arGetDetectedMarkerCount, but the current name lives on for historical reasons.

Parameters

  arHandle | Handle upon which arDetectMarker has been called.

See also
  arGetMarker
  ARMarkerInfo
  arDetectMarker

## ◆ arGetMatrixCodeType()

AR_EXTERN AR_MATRIX_CODE_TYPE arGetMatrixCodeType | ( | ARHandle * | handle | ) |

Get the size and ECC algorithm being used for matrix code (2D barcode) marker detection.

See the description for arSetMatrixCodeType().

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  The value representing the mode.

See also
  arGetPatternDetectionMode
  arSetMatrixCodeType

## ◆ arGetPatternDetectionMode()

AR_EXTERN int arGetPatternDetectionMode | ( | ARHandle * | handle | ) |

Get the pattern detection mode.

See arSetPatternDetectionMode() for a complete description.

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its mode.

Returns
  Value representing the mode.

See also
  arGetPatternDetectionMode

## ◆ arGetPattRatio()

AR_EXTERN ARdouble arGetPattRatio | ( | ARHandle * | handle | ) |

Get the width/height of the marker pattern space, as a proportion of marker width/height.

N.B. Supercedes arGetBorderSize().

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried.

Returns
  Value representing the width/height of the marker pattern space, as a proportion of marker width/height. The default border size for newly-created ARHandle structures is AR_PATT_RATIO.

See also
  arSetPattRatio

## ◆ arGetPixelFormat()

AR_EXTERN AR_PIXEL_FORMAT arGetPixelFormat | ( | ARHandle * | handle | ) |

Get the expected pixel format for video frames being passed to arDetectMarker.

See discussion for arSetPixelFormat().

Parameters

  handle | Handle to AR settings structure from which to retrieve the pixel format.

Returns
  Value representing the format of pixels being processed by the artoolkitX detection routines. See AR_PIXEL_FORMAT reference for more information.

See also
  arSetPixelFormat
  arCreateHandle
  arDetectMarker

## ◆ arGetSquareFitThresh()

AR_EXTERN ARdouble arGetSquareFitThresh | ( | ARHandle * | handle | ) |

## ◆ arGetStereoMatching()

AR_EXTERN int arGetStereoMatching | ( | AR3DStereoHandle * | handle,
|  | ARdouble | pos2dL[2],
|  | ARdouble | pos2dR[2],
|  | ARdouble | pos3d[3]
| ) |  |

Here is the call graph for this function:

## ◆ arGetStereoMatchingError()

AR_EXTERN ARdouble arGetStereoMatchingError | ( | AR3DStereoHandle * | handle,
|  | ARdouble | pos2dL[2],
|  | ARdouble | pos2dR[2]
| ) |  |

Here is the call graph for this function:

## ◆ arGetStereoMatchingErrorSquare()

AR_EXTERN ARdouble arGetStereoMatchingErrorSquare | ( | AR3DStereoHandle * | handle,
|  | ARMarkerInfo * | marker_infoL,
|  | ARMarkerInfo * | marker_infoR
| ) |  |

Here is the call graph for this function:

## ◆ arGetTransMat()

AR_EXTERN ARdouble arGetTransMat | ( | AR3DHandle * | handle,
|  | ARdouble | initConv[3][4],
|  | ARdouble | pos2d[][2],
|  | ARdouble | pos3d[][3],
|  | int | num,
|  | ARdouble | conv[3][4]
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  initConv | (description)
  pos2d | (description)
  pos3d | (description)
  num | (description)
  conv | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ arGetTransMatRobust()

AR_EXTERN ARdouble arGetTransMatRobust | ( | AR3DHandle * | handle,
|  | ARdouble | initConv[3][4],
|  | ARdouble | pos2d[][2],
|  | ARdouble | pos3d[][3],
|  | int | num,
|  | ARdouble | conv[3][4]
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  initConv | (description)
  pos2d | (description)
  pos3d | (description)
  num | (description)
  conv | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ arGetTransMatSquare()

AR_EXTERN ARdouble arGetTransMatSquare | ( | AR3DHandle * | handle,
|  | ARMarkerInfo * | marker_info,
|  | ARdouble | width,
|  | ARdouble | conv[3][4]
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  marker_info | (description)
  width | (description)
  conv | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ arGetTransMatSquareCont()

AR_EXTERN ARdouble arGetTransMatSquareCont | ( | AR3DHandle * | handle,
|  | ARMarkerInfo * | marker_info,
|  | ARdouble | initConv[3][4],
|  | ARdouble | width,
|  | ARdouble | conv[3][4]
| ) |  |

(description)

(description)

Parameters

  handle | (description)
  marker_info | (description)
  initConv | (description)
  width | (description)
  conv | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ arGetTransMatSquareContStereo()

AR_EXTERN ARdouble arGetTransMatSquareContStereo | ( | AR3DStereoHandle * | handle,
|  | ARMarkerInfo * | marker_infoL,
|  | ARMarkerInfo * | marker_infoR,
|  | ARdouble | prev_conv[3][4],
|  | ARdouble | width,
|  | ARdouble | conv[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arGetTransMatSquareStereo()

AR_EXTERN ARdouble arGetTransMatSquareStereo | ( | AR3DStereoHandle * | handle,
|  | ARMarkerInfo * | marker_infoL,
|  | ARMarkerInfo * | marker_infoR,
|  | ARdouble | width,
|  | ARdouble | conv[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arGetTransMatStereo()

AR_EXTERN ARdouble arGetTransMatStereo | ( | AR3DStereoHandle * | handle,
|  | ARdouble | initConv[3][4],
|  | ARdouble | pos2dL[][2],
|  | ARdouble | pos3dL[][3],
|  | int | numL,
|  | ARdouble | pos2dR[][2],
|  | ARdouble | pos3dR[][3],
|  | int | numR,
|  | ARdouble | conv[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arGetTransMatStereoRobust()

AR_EXTERN ARdouble arGetTransMatStereoRobust | ( | AR3DStereoHandle * | handle,
|  | ARdouble | initConv[3][4],
|  | ARdouble | pos2dL[][2],
|  | ARdouble | pos3dL[][3],
|  | int | numL,
|  | ARdouble | pos2dR[][2],
|  | ARdouble | pos3dR[][3],
|  | int | numR,
|  | ARdouble | conv[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arGetVersion()

AR_EXTERN ARUint32 arGetVersion | ( | char ** | versionStringRef | ) |

Get the artoolkitX version information in numberic and string format.

@functiongroup "Utility".

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 artoolkitX version, check at runtime that it is linked to a version of artoolkitX that can supply those features. It is NOT sufficient to check the artoolkitX SDK header versions, since with artoolkitX implemented in dynamically-loaded libraries, there is no guarantee that the version of artoolkitX installed on the machine at run-time will be as recent as the version of the artoolkitX SDK which the host program was compiled against.

The version information is reported in binary-coded decimal format, and optionally in an ASCII string.

A increase in the major version number indicates the removal of functionality previously provided in the API. An increase in the minor version number indicates that new functionality has been added. A change in the tiny version number indicates changes (e.g. bug fixes) which do not affect the API. See the comments in 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 artoolkitX 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).

## ◆ arLabeling()

AR_EXTERN int arLabeling | ( | ARUint8 * | imageLuma,
|  | int | xsize,
|  | int | ysize,
|  | int | debugMode,
|  | int | labelingMode,
|  | int | labelingThresh,
|  | int | imageProcMode,
|  | ARLabelInfo * | labelInfo,
|  | ARUint8 * | image_thresh
| ) |  |

Here is the call graph for this function:

## ◆ arPattActivate()

AR_EXTERN int arPattActivate | ( | ARPattHandle * | pattHandle,
|  | int | patno
| ) |  |

Activate a previously deactivated pattern.

When a pattern is activated, is becomes available for recognition in a scene. This is the default state for a loaded pattern.

Parameters

  pattHandle | The handle holding the loaded pattern which is to be reactivated.
  patno | The index into the pattern handle's array of patterns to the pattern to be reactivated.

Returns
  0 on success, or -1 if the pattern was already activated or no pattern was loaded.

See also
  arPattDeactivate

## ◆ arPattAttach()

AR_EXTERN int arPattAttach | ( | ARHandle * | arHandle,
|  | ARPattHandle * | pattHandle
| ) |  |

Associate a set of patterns with an ARHandle.

Associating a set of patterns with an ARHandle makes the patterns the set which will be searched when marker identification is performed on an image associated with the same ARHandle.

Parameters

  arHandle | (description)
  pattHandle | (description)

See also
  arPattDetach

Returns
  Returns 0 in the case of success, or -1 if the specified ARHandle already has an ARPattHandle attached, or if arHandle is NULL.

## ◆ arPattCreateHandle()

AR_EXTERN ARPattHandle * arPattCreateHandle | ( | void |  | ) |

Allocate a pattern handle.

@functiongroup "Pattern identification".

Allocates an empty pattern handle, into which patterns can be loaded by calling arPattLoad(). When the pattern handle is no longer needed, it should be freed by calling arPattDeleteHandle().

Note that a pattern handle is NOT required when using only matrix- code (2D barcode) markers.

See also
  arPattLoad
  arPattDeleteHandle

Returns
  The created pattern handle, or NULL in case of error.

Here is the call graph for this function:

## ◆ arPattCreateHandle2()

AR_EXTERN ARPattHandle * arPattCreateHandle2 | ( | const int | pattSize,
|  | const int | patternCountMax
| ) |  |

Allocate a pattern handle and set pattern template size and maximum number of patterns loadable.

Allocates an empty pattern handle, into which patterns can be loaded by calling arPattLoad(). When the pattern handle is no longer needed, it should be freed by calling arPattDeleteHandle().

Note that a pattern handle is NOT required when using only matrix- code (2D barcode) markers.

Parameters

  pattSize | For any square template (pattern) markers, the number of rows and columns in the template. May not be less than 16 or more than AR_PATT_SIZE1_MAX.

Pass AR_PATT_SIZE1 for the same behaviour as arPattCreateHandle().

Parameters

  patternCountMax | For any square template (pattern) markers, the maximum number of markers that may be loaded for a single matching pass. Must be > 0.

Pass AR_PATT_NUM_MAX for the same behaviour as arPattCreateHandle().

See also
  arPattLoad
  arPattDeleteHandle

Returns
  The created pattern handle, or NULL in case of error.

## ◆ arPattDeactivate()

AR_EXTERN int arPattDeactivate | ( | ARPattHandle * | pattHandle,
|  | int | patno
| ) |  |

Deactivate a previously activated pattern.

When a pattern is activated, is becomes unavailable for recognition in a scene. Deactivating unused patterns can speed up recognition time and accuracy when there are multiple patterns in a scene, and it is also useful for controlling interactivity in a scene.

Parameters

  pattHandle | The handle holding the loaded pattern which is to be deactivated.
  patno | The index into the pattern handle's array of patterns to the pattern to be deactivated.

Returns
  0 on success, or -1 if the pattern was already deactivated or no pattern was loaded.

See also
  arPattActivate

## ◆ arPattDeleteHandle()

AR_EXTERN int arPattDeleteHandle | ( | ARPattHandle * | pattHandle | ) |

Free all loaded patterns and pattern handle.

Frees a pattern handle, freeing (unloading) any patterns loaded into the handle in the process.

Parameters

  pattHandle | The handle to free.

Returns
  0 on success, or -1 if trying to free a NULL handle.

Here is the call graph for this function:

## ◆ arPattDetach()

AR_EXTERN int arPattDetach | ( | ARHandle * | arHandle | ) |

Reset an ARHandle to no pattern association.

See arPattAttach() for more information.

Parameters

  arHandle | (description)

See also
  arPattAttach

Returns
  Returns 0 in the case of success, or -1 if the specified ARHandle has no ARPattHandle attached, or if arHandle is NULL.

## ◆ arPattFree()

AR_EXTERN int arPattFree | ( | ARPattHandle * | pattHandle,
|  | int | patno
| ) |  |

Frees (unloads) a pattern file from memory.

Unloads a pattern from a pattern handle, freeing that slot for another pattern to be loaded, if necessary.

Parameters

  pattHandle | The pattern handle to unload from.
  patno | The index into the pattern handle's array of patterns to the pattern to be unloaded.

Returns
  0 if the pattern was successfully unloaded, or -1 if there was no pattern loaded.

See also
  arPattLoad

## ◆ arPattGetID()

AR_EXTERN int arPattGetID | ( | ARPattHandle * | pattHandle,
|  | int | imageProcMode,
|  | int | pattDetectMode,
|  | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | AR_PIXEL_FORMAT | pixelFormat,
|  | int * | x_coord,
|  | int * | y_coord,
|  | int * | vertex,
|  | ARdouble | pattRatio,
|  | int * | code,
|  | int * | dir,
|  | ARdouble * | cf,
|  | const AR_MATRIX_CODE_TYPE | matrixCodeType
| ) |  |

Here is the call graph for this function:

## ◆ arPattGetID2()

AR_EXTERN int arPattGetID2 | ( | ARPattHandle * | pattHandle,
|  | int | imageProcMode,
|  | int | pattDetectMode,
|  | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | AR_PIXEL_FORMAT | pixelFormat,
|  | ARParamLTf * | arParamLTf,
|  | ARdouble | vertex[4][2],
|  | ARdouble | pattRatio,
|  | int * | codePatt,
|  | int * | dirPatt,
|  | ARdouble * | cfPatt,
|  | int * | codeMatrix,
|  | int * | dirMatrix,
|  | ARdouble * | cfMatrix,
|  | const AR_MATRIX_CODE_TYPE | matrixCodeType
| ) |  |

Match the interior of a detected square against known patterns.

Parameters

  pattHandle | Handle contained details of known patterns, i.e. loaded templates, or valid barcode IDs.
  imageProcMode | See discussion of arSetImageProcMode().
  pattDetectMode | See discussion of arSetPatternDetectionMode().
  image | Pointer to packed raw image data.
  xsize | Horizontal pixel dimension of raw image data.
  ysize | Vertical pixel dimension of raw image data.
  pixelFormat | Pixel format of raw image data.
  arParamLTf | Lookup table for the camera parameters for the optical source from which the image was acquired. See arParamLTCreate.
  vertex | 4x2 array of points which correspond to the x and y locations of the corners of the detected marker square.
  pattRatio | A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pattern. In earlier versions, this value was fixed at 0.5.
  codePatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the ID of the pattern from pattHandle, or -1 if not identified.
  dirPatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the direction (up, right, down, left) of the pattern from pattHandle.
  cfPatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the confidence factor of the match (range [0.0 - 1.0]).
  codeMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the ID of the pattern, or -1 if not identified.
  dirMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the direction (up, right, down, left) of the pattern.
  cfMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the confidence factor of the match (range [0.0 - 1.0]).
  matrixCodeType | When matrix code pattern detection mode is active, indicates the type of matrix code to detect.

Returns
  0 if the function was able to correctly match, or -1 in case of error or no match.

See also
  arParamLTCreate

Here is the call graph for this function:

## ◆ arPattGetIDGlobal()

AR_EXTERN int arPattGetIDGlobal | ( | ARPattHandle * | pattHandle,
|  | int | imageProcMode,
|  | int | pattDetectMode,
|  | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | AR_PIXEL_FORMAT | pixelFormat,
|  | ARParamLTf * | arParamLTf,
|  | ARdouble | vertex[4][2],
|  | ARdouble | pattRatio,
|  | int * | codePatt,
|  | int * | dirPatt,
|  | ARdouble * | cfPatt,
|  | int * | codeMatrix,
|  | int * | dirMatrix,
|  | ARdouble * | cfMatrix,
|  | const AR_MATRIX_CODE_TYPE | matrixCodeType,
|  | int * | errorCorrected,
|  | uint64_t * | codeGlobalID_p
| ) |  |

Match the interior of a detected square against known patterns with variable border width.

Parameters

  pattHandle | Handle contained details of known patterns, i.e. loaded templates, or valid barcode IDs.
  imageProcMode | See discussion of arSetImageProcMode().
  pattDetectMode | See discussion of arSetPatternDetectionMode().
  image | Pointer to packed raw image data.
  xsize | Horizontal pixel dimension of raw image data.
  ysize | Vertical pixel dimension of raw image data.
  pixelFormat | Pixel format of raw image data.
  arParamLTf | Lookup table for the camera parameters for the optical source from which the image was acquired. See arParamLTCreate.
  vertex | 4x2 array of points which correspond to the x and y locations of the corners of the detected marker square.
  pattRatio | A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pattern. In earlier versions, this value was fixed at 0.5.
  codePatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the ID of the pattern from pattHandle, or -1 if not identified.
  dirPatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the direction (up, right, down, left) of the pattern from pattHandle.
  cfPatt | Where the pattern matching mode includes template (picture) matching, and a valid template is matched, the confidence factor of the match (range [0.0 - 1.0]).
  codeMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the ID of the pattern, or -1 if not identified.
  dirMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the direction (up, right, down, left) of the pattern.
  cfMatrix | Where the pattern matching mode includes matrix (barcode) matching, and a valid matrix is matched, the confidence factor of the match (range [0.0 - 1.0]).
  matrixCodeType | When matrix code pattern detection mode is active, indicates the type of matrix code to detect.
  errorCorrected | Pointer to an integer which will be filled out with the number of errors detected and corrected during marker identification, or NULL if this information is not required.
  codeGlobalID_p | Pointer to uint64_t which will be filled out with the global ID, or NULL if this value is not required.

Returns
  0 if the function was able to correctly match, or -1 in case of error or no match.

See also
  arParamLTCreate

Here is the call graph for this function:

## ◆ arPattGetImage()

AR_EXTERN int arPattGetImage | ( | int | imageProcMode,
|  | int | pattDetectMode,
|  | int | patt_size,
|  | int | sample_size,
|  | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | AR_PIXEL_FORMAT | pixelFormat,
|  | int * | x_coord,
|  | int * | y_coord,
|  | int * | vertex,
|  | ARdouble | pattRatio,
|  | ARUint8 * | ext_patt
| ) |  |

## ◆ arPattGetImage2()

AR_EXTERN int arPattGetImage2 | ( | int | imageProcMode,
|  | int | pattDetectMode,
|  | int | patt_size,
|  | int | sample_size,
|  | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | AR_PIXEL_FORMAT | pixelFormat,
|  | ARParamLTf * | arParamLTf,
|  | ARdouble | vertex[4][2],
|  | ARdouble | pattRatio,
|  | ARUint8 * | ext_patt
| ) |  |

Extract the image (i.e. locate and unwarp) of the pattern-space portion of a detected square.

Parameters

  imageProcMode | See discussion of arSetImageProcMode().
  pattDetectMode | See discussion of arSetPatternDetectionMode().
  patt_size | The number of horizontal and vertical units to subdivide the pattern-space into.
  sample_size | At present, must always be the square of patt_size.
  image | Pointer to packed raw image data.
  xsize | Horizontal pixel dimension of raw image data.
  ysize | Vertical pixel dimension of raw image data.
  pixelFormat | Pixel format of raw image data.
  arParamLTf | Lookup table for the camera parameters for the optical source from which the image was acquired. See arParamLTCreate.
  vertex | 4x2 array of points which correspond to the x and y locations of the corners of the detected marker square.
  pattRatio | A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pattern. In earlier versions, this value was fixed at 0.5.
  ext_patt | Pointer to an array of appropriate size (i.e. patt_size*patt_size*3), which will be filled with the extracted image. Where a colour image is available, it will be supplied in BGR byte order.

Returns
  0 if the function was able to correctly get the image, or -1 in case of error or no match.

See also
  arParamLTCreate

Here is the call graph for this function:

## ◆ arPattGetImage3()

AR_EXTERN int arPattGetImage3 | ( | ARHandle * | arHandle,
|  | int | markerNo,
|  | ARUint8 * | image,
|  | ARPattRectInfo * | rect,
|  | int | xsize,
|  | int | ysize,
|  | int | overSampleScale,
|  | ARUint8 * | outImage
| ) |  |

Extract the image (i.e. locate and unwarp) of an arbitrary portion of a detected square.

Use this function to obtain an image of the marker pattern space for display to the user.

Parameters

  arHandle | The ARHandle structure associated with the current tracking data.
  markerNo | The marker number (in range 0 to arHandle->marker_num - 1, inclusive) from which to extract the pattern.
  image | The source video image.
  rect | Pointer to an ARPattRectInfo structure which defines the portion of the marker image to extract.
  xsize | Width of the output image, in pixels.
  ysize | Height of the output image, in pixels.
  overSampleScale | Number of samples to acquire per destination pixel, e.g. 2.
  outImage | Pointer to a buffer, at least xsize*ysize*arUtilGetPixelSize(arHandle->arPixelFormat) bytes in size, which will be filled out with the marker image.

Returns
  0 if the function was able to correctly get the image, or -1 in case of error or no match.

See also
  ARPattRectInfo

Here is the call graph for this function:

## ◆ arPattLoad()

AR_EXTERN int arPattLoad | ( | ARPattHandle * | pattHandle,
|  | const char * | filename
| ) |  |

Load a pattern file into a pattern handle.

This function loads a pattern template from a file on disk, and attaches it to the given ARPattHandle so making it available for future pattern-matching. Additional patterns can be loaded by calling again with the same ARPattHandle (however no more than AR_PATT_NUM_MAX patterns can be attached to a single ARPattHandle). Patterns are initially loaded in an active state.

Note that matrix-code (2D barcode) markers do not have any associated pattern file and do not need to be loaded.

Parameters

  pattHandle | Pattern handle, as generated by arPattCreateHandle(), into which the pattern file infomation will be loaded.
  filename | Pathname of pattern file to load. The pattern file is typically generated by the make_patt program. The pathname is relative to the current working directory, which is operating system- specific.

See also
  arPattCreateHandle
  arPattActivate
  arPattDeactivate
  arPattFree

Returns
  Returns the index number of the loaded pattern, in the range [0, AR_PATT_NUM_MAX - 1], or -1 if the pattern could not be loaded because the maximum number of patterns (AR_PATT_NUM_MAX) has already been loaded already into this handle.

Here is the call graph for this function:

## ◆ arPattLoadFromBuffer()

AR_EXTERN int arPattLoadFromBuffer | ( | ARPattHandle * | pattHandle,
|  | const char * | buffer
| ) |  |

## ◆ arPattSave()

AR_EXTERN int arPattSave | ( | ARUint8 * | image,
|  | int | xsize,
|  | int | ysize,
|  | int | pixelFormat,
|  | ARParamLTf * | paramLTf,
|  | int | imageProcMode,
|  | ARMarkerInfo * | marker_info,
|  | ARdouble | pattRatio,
|  | int | pattSize,
|  | const char * | filename
| ) |  |

Save a pattern to a pattern file.

This function is used by the make_patt utility. See the sourcecode to mk_patt for usage.

Parameters

  image | (description)
  xsize | (description)
  ysize | (description)
  pixelFormat | (description)
  paramLTf | (description)
  imageProcMode | (description)
  marker_info | (description)
  pattRatio | A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pattern. In earlier versions, this value was fixed at 0.5.
  pattSize | The number of rows and columns to create in the pattern. Normally AR_PATT_SIZE1.
  filename | (description)

Returns
  (description)

Here is the call graph for this function:

## ◆ arSetAreaMax()

AR_EXTERN void arSetAreaMax | ( | ARHandle * | handle,
|  | const ARdouble | areaMax
| ) |  |

## ◆ arSetAreaMin()

AR_EXTERN void arSetAreaMin | ( | ARHandle * | handle,
|  | const ARdouble | areaMin
| ) |  |

## ◆ arSetBorderSize()

AR_EXTERN void arSetBorderSize | ( | ARHandle * | handle,
|  | const ARdouble | borderSize
| ) |  |

Set the border size.

N.B. Deprecated in favour of arSetPattRatio(), but retained for backwards compatibility.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its border size set.
  borderSize | The border size. To set the default, pass (1.0 - 2*AR_PATT_RATIO). If compatibility with ARToolKit verions 1.0 through 4.4 is required, this value must be 0.25.

See also
  arGetBorderSize

## ◆ arSetCornerRefinementMode()

AR_EXTERN void arSetCornerRefinementMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Enable or disable square tracking subpixel corner refinement.

If compiled with OpenCV available, the square tracker allows marker corner locations to be subpixel-refined.

Parameters

  handle | Handle to settings structure in which to enable or disable subpixel corner refinement.
  mode | Options for this field are: AR_CORNER_REFINEMENT_DISABLE AR_CORNER_REFINEMENT_ENSABLE The default mode is AR_CORNER_REFINEMENT_DISABLE.

See also
  arGetCornerRefinementMode

## ◆ arSetDebugMode()

AR_EXTERN void arSetDebugMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Enable or disable artoolkitX's debug mode.

In debug mode, artoolkitX offers additional error reporting. Use this function to enable or disable debug mode at runtime.

Additionally, in debug mode, artoolkitX creates a mono (8-bit grayscale) image of the thresholded video input, and makes this available through the field ARHandle->labelInfo.bwImage.

Parameters

  handle | An ARHandle referring to the current AR tracker in which debug mode is to be set.
  mode | Options for this field are: AR_DEBUG_DISABLE AR_DEBUG_ENABLE The default mode is AR_DEBUG_DISABLE.

See also
  arGetDebugMode

## ◆ arSetImageProcMode()

AR_EXTERN void arSetImageProcMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Set the image processing mode.

When ARthe image processing mode is AR_IMAGE_PROC_FRAME_IMAGE, artoolkitX processes all pixels in each incoming image to locate markers. When the mode is AR_IMAGE_PROC_FIELD_IMAGE, artoolkitX processes pixels in only every second pixel row and column. This is useful both for handling images from interlaced video sources (where alternate lines are assembled from alternate fields and thus have one field time-difference, resulting in a "comb" effect) such as Digital Video cameras. The effective reduction by 75% in the pixels processed also has utility in accelerating tracking by effectively reducing the image size to one quarter size, at the cost of pose accuraccy.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its mode set.
  mode | Options for this field are: AR_IMAGE_PROC_FRAME_IMAGE AR_IMAGE_PROC_FIELD_IMAGE The default mode is AR_IMAGE_PROC_FRAME_IMAGE.

See also
  arGetImageProcMode

## ◆ arSetLabelingMode()

AR_EXTERN void arSetLabelingMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Select between detection of black markers and white markers.

artoolkitX's labelling algorithm can work with both black-bordered markers on a white background (AR_LABELING_BLACK_REGION) or white-bordered markers on a black background (AR_LABELING_WHITE_REGION). This function allows you to specify the type of markers to look for. Note that this does not affect the pattern-detection algorith which works on the interior of the marker.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its labeling mode set.
  mode | Options for this field are: AR_LABELING_WHITE_REGION AR_LABELING_BLACK_REGION The default mode is AR_LABELING_BLACK_REGION.

See also
  arGetLabelingMode

## ◆ arSetLabelingThresh()

AR_EXTERN void arSetLabelingThresh | ( | ARHandle * | handle,
|  | int | thresh
| ) |  |

Set the labeling threshhold.

This function forces sets the threshold value. The default value is AR_DEFAULT_LABELING_THRESH which is 100, unless edited in arConfig.h.

The current threshold mode is not affected by this call. Typically, this function is used when labeling threshold mode is AR_LABELING_THRESH_MODE_MANUAL.

The threshold value is not relevant if threshold mode is AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE.

Background: The labeling threshold is the value which the AR library uses to differentiate between black and white portions of an artoolkitX marker. Since the actual brightness, contrast, and gamma of incoming images can vary signficantly between different cameras and lighting conditions, this value typically needs to be adjusted dynamically to a suitable midpoint between the observed values for black and white portions of the markers in the image.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its labeling threshold value set.
  thresh | An integer in the range [0,255] (inclusive).

See also
  arGetLabelingThresh

## ◆ arSetLabelingThreshAutoAdaptiveBias()

AR_EXTERN void arSetLabelingThreshAutoAdaptiveBias | ( | ARHandle * | handle,
|  | const int | labelingThreshAutoAdaptiveBias
| ) |  |

## ◆ arSetLabelingThreshAutoAdaptiveKernelSize()

AR_EXTERN void arSetLabelingThreshAutoAdaptiveKernelSize | ( | ARHandle * | handle,
|  | const int | labelingThreshAutoAdaptiveKernelSize
| ) |  |

## ◆ arSetLabelingThreshMode()

AR_EXTERN void arSetLabelingThreshMode | ( | ARHandle * | handle,
|  | const AR_LABELING_THRESH_MODE | mode
| ) |  |

Set the labeling threshold mode (auto/manual).

Parameters

  handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold mode.
  mode | An integer specifying the mode. One of: AR_LABELING_THRESH_MODE_MANUAL, AR_LABELING_THRESH_MODE_AUTO_MEDIAN, AR_LABELING_THRESH_MODE_AUTO_OTSU, AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE, AR_LABELING_THRESH_MODE_AUTO_BRACKETING

Returns
  0 if no error occured.

See also
  arSetLabelingThresh
  arGetLabelingThreshMode

Here is the call graph for this function:

## ◆ arSetLabelingThreshModeAutoInterval()

AR_EXTERN void arSetLabelingThreshModeAutoInterval | ( | ARHandle * | handle,
|  | const int | interval
| ) |  |

Set the number of frames between auto-threshold calculations.

This is the number of frames BETWEEN calculations, meaning that the calculation occurs every (interval + 1) frames.

Parameters

  handle | An ARHandle referring to the current AR tracker for which the labeling threshold auto interval will be set.
  interval | The interval, specifying the number of frames between automatic updates to the threshold. An integer in the range [0,INT_MAX] (inclusive). Default value is AR_LABELING_THRESH_AUTO_INTERVAL_DEFAULT.

See also
  arGetLabelingThreshModeAutoInterval

## ◆ arSetMarkerExtractionMode()

AR_EXTERN void arSetMarkerExtractionMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Set the marker extraction mode.

(description)

Parameters

  handle | An ARHandle referring to the current AR tracker to have its mode set.
  mode | Options for this field are: AR_USE_TRACKING_HISTORY AR_NOUSE_TRACKING_HISTORY AR_USE_TRACKING_HISTORY_V2 The default mode is AR_USE_TRACKING_HISTORY_V2.

See also
  arGetMarkerExtractionMode

## ◆ arSetMatrixCodeType()

AR_EXTERN void arSetMatrixCodeType | ( | ARHandle * | handle,
|  | const AR_MATRIX_CODE_TYPE | type
| ) |  |

Set the size and ECC algorithm to be used for matrix code (2D barcode) marker detection.

When matrix-code (2D barcode) marker detection is enabled (see arSetPatternDetectionMode) then the size of the barcode pattern and the type of error checking and correction (ECC) with which the markers were produced can be set via this function.

This setting is global to a given ARHandle; It is not possible to have two different matrix code types in use at once.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its mode set.
  type | The type of matrix code (2D barcode) in use. Options include: AR_MATRIX_CODE_3x3 AR_MATRIX_CODE_3x3_HAMMING63 AR_MATRIX_CODE_3x3_PARITY65 AR_MATRIX_CODE_4x4 AR_MATRIX_CODE_4x4_BCH_13_9_3 AR_MATRIX_CODE_4x4_BCH_13_5_5 AR_MATRIX_CODE_5x5_BCH_22_12_5 AR_MATRIX_CODE_5x5_BCH_22_7_7 The default mode is AR_MATRIX_CODE_3x3.

See also
  arSetPatternDetectionMode
  arGetMatrixCodeType

## ◆ arSetPatternDetectionMode()

AR_EXTERN void arSetPatternDetectionMode | ( | ARHandle * | handle,
|  | int | mode
| ) |  |

Set the pattern detection mode.

The pattern detection determines the method by which artoolkitX matches detected squares in the video image to marker templates and/or IDs. ARToolKit v4.x can match against pictorial "template" markers, whose pattern files are created with the mk_patt utility, in either colour or mono, and additionally can match against 2D-barcode-type "matrix" markers, which have an embedded marker ID. Two different two-pass modes are also available, in which a matrix-detection pass is made first, followed by a template-matching pass.

Parameters

  handle | An ARHandle referring to the current AR tracker to have its mode set.
  mode | Options for this field are: AR_TEMPLATE_MATCHING_COLOR AR_TEMPLATE_MATCHING_MONO AR_MATRIX_CODE_DETECTION AR_TEMPLATE_MATCHING_COLOR_AND_MATRIX AR_TEMPLATE_MATCHING_MONO_AND_MATRIX The default mode is AR_TEMPLATE_MATCHING_COLOR.

See also
  arGetPatternDetectionMode

## ◆ arSetPattRatio()

AR_EXTERN void arSetPattRatio | ( | ARHandle * | handle,
|  | const ARdouble | pattRatio
| ) |  |

Set the width/height of the marker pattern space, as a proportion of marker width/height.

N.B. Supercedes arSetBorderSize().

Parameters

  handle | An ARHandle referring to the current AR tracker to be modified.
  pattRatio | The the width/height of the marker pattern space, as a proportion of marker width/height. To set the default, pass AR_PATT_RATIO. If compatibility with ARToolKit verions 1.0 through 4.4 is required, this value must be 0.5.

See also
  arGetPattRatio

## ◆ arSetPixelFormat()

AR_EXTERN void arSetPixelFormat | ( | ARHandle * | handle,
|  | AR_PIXEL_FORMAT | pixFormat
| ) |  |

Set the expected pixel format for video frames being passed to arDetectMarker.

This function must be used at least once after creation of an ARHandle, to set the pixel format with which images will be passed to arDetectMarker(). If the pixel format of incoming video images changes, this function must be called again to update the value.

Parameters

  handle | Handle to settings structure in which to set the pixel format.
  pixFormat | Value representing the format of pixels to be processed by the artoolkitX detection routines. See AR_PIXEL_FORMAT reference for more information.

See also
  arGetPixelFormat
  arCreateHandle
  arDetectMarker

Here is the call graph for this function:

## ◆ arSetSquareFitThresh()

AR_EXTERN void arSetSquareFitThresh | ( | ARHandle * | handle,
|  | const ARdouble | squareFitThresh
| ) |  |

## ◆ arUtilChangeToResourcesDirectory()

AR_EXTERN int arUtilChangeToResourcesDirectory | ( | AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR | behavior,
|  | const char * | path
| ) |  |

Change to the resources directory using the specified behavior.

artoolkitX uses relative paths to locate several types of resources, including camera parameter files, pattern files, multimarker files and others. This function provides the convenience of setting the current process working directory to the appropriate value for your application.

On Android only, the function has an optional parameter 'instanceOfAndroidContext'. If behavior is AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR, this parameter must be an instance of a class derived from android/content/Context. In all other cases, pass NULL for this parameter.

Parameters

  behavior | See AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR type for allowed values.
  path | When behavior is AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_SUPPLIED_PATH, the path to change to (absolute or relative to current working directory). In all other cases, if this parameter is non-NULL, it will be taken as a subdirectory of the desired path and to which the working directory should be changed.

Returns
  -1 in the case of error, or 0 otherwise.

Since
  Not available on Windows Runtime (WinRT).

Here is the call graph for this function:

## ◆ arUtilDivideExt()

AR_EXTERN int arUtilDivideExt | ( | const char * | filename,
|  | char * | s1,
|  | char * | s2
| ) |  |

## ◆ arUtilGetAndCreateResourcesDirectoryPath()

AR_EXTERN char * arUtilGetAndCreateResourcesDirectoryPath | ( | AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR | behavior | ) |

Get the path to the resources directory using the specified behavior, creating the path if it doesn't already exist.

artoolkitX uses relative paths to locate several types of resources, including camera parameter files, pattern files, multimarker files and others. This function provides the convenience of finding an appropriate value for your application.

On Android only, the function has an optional parameter 'instanceOfAndroidContext'. If behavior is AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR, this parameter must be an instance of a class derived from android/content/Context. In all other cases, pass NULL for this parameter.

Parameters

  behavior | See AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR type for allowed values.

Returns
  NULL in the case of error, or the path otherwise. Must be free()d by the caller.

Here is the call graph for this function:

## ◆ arUtilGetDirectoryNameFromPath()

AR_EXTERN char * arUtilGetDirectoryNameFromPath | ( | char * | dir,
|  | const char * | path,
|  | const size_t | n,
|  | const int | addSeparator
| ) |  |

## ◆ arUtilGetFileBasenameFromPath()

AR_EXTERN char * arUtilGetFileBasenameFromPath | ( | const char * | path,
|  | const int | convertToLowercase
| ) |  |

Get file base name from a path.

Given a full or partial pathname passed in string path, returns a string with the base name portion of path, i.e. the text between the rightmost path separator and the the rightmost '.' character, if any. If the filename contains no '.', returns the filename.

Parameters

  path | Full or partial pathname.
  convertToLowercase | If convertToLowercase is TRUE, uppercase ASCII characters in the basename will be converted to lowercase.

Returns
  A string with the basename portion of path. NB: The returned string must be freed by the caller.

Here is the call graph for this function:

## ◆ arUtilGetFileExtensionFromPath()

AR_EXTERN char * arUtilGetFileExtensionFromPath | ( | const char * | path,
|  | const int | convertToLowercase
| ) |  |

Get file extension from a path.

Given a full or partial pathname passed in string path, returns a string with the extension portion of path, i.e. the text after the rightmost '.' character, if any. If the filename contains no '.', NULL is returned.

Parameters

  path | Full or partial pathname.
  convertToLowercase | If convertToLowercase is TRUE, uppercase ASCII characters in the extension will be converted to lowercase.

Returns
  A string with the extension portion of path. NB: The returned string must be freed by the caller.

Here is the call graph for this function:

## ◆ arUtilGetFileNameFromPath()

AR_EXTERN const char * arUtilGetFileNameFromPath | ( | const char * | path | ) |

## ◆ arUtilGetFileURI()

AR_EXTERN char * arUtilGetFileURI | ( | const char * | path | ) |

Get a path as a file URI.

Given a full or partial pathname passed in string path, returns a string with the file URI for that path.

Partial pathnames are handled by concatening with the process's current working directory.

Parameters

  path | Full or partial pathname.
      On Windows, both partial pathnames, full pathnames including
      the drive letter, or UNC pathnames (beginning with "\\" are
      all OK.

Returns
  A string with the the file URI for that path, or NULL in the case of error. NB: The returned string must be freed by the caller (by calling free() once its use is complete).

## ◆ arUtilGetPixelFormatName()

AR_EXTERN const char * arUtilGetPixelFormatName | ( | const AR_PIXEL_FORMAT | arPixelFormat | ) |

Get a string holding a descriptive name for a given pixel format enumeration.

On occasions it can be useful to display to the user the format of the pixels which artoolkitX is processing. This funtion converts a pixel-format number into a human-readable string description.

Parameters

  arPixelFormat | Enumerated pixel format number for which to retrieve a name.

Returns
  A constant c-string holding a descriptive name for the pixel format. The string returned matches the constants used in the definition of the type AR_PIXEL_FORMAT, e.g. "AR_PIXEL_FORMAT_RGB".

## ◆ arUtilGetPixelSize()

AR_EXTERN int arUtilGetPixelSize | ( | const AR_PIXEL_FORMAT | arPixelFormat | ) |

Get the size in bytes of a single pixel for a given pixel format.

Different pixel formats have different sizes in bytes, and therefore different storage requirements per row of pixels. Use this function to calculate the number of bytes required to store a single pixel of the given type.

Parameters

  arPixelFormat | The pixel type whose size is to be measured.

Returns
  Number of bytes required to store 1 pixel of the given type.

## ◆ arUtilGetResourcesDirectoryPath()

AR_EXTERN char * arUtilGetResourcesDirectoryPath | ( | AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR | behavior | ) |

Get the path to the resources directory using the specified behavior.

artoolkitX uses relative paths to locate several types of resources, including camera parameter files, pattern files, multimarker files and others. This function provides the convenience of finding an appropriate value for your application.

On Android only, the function has an optional parameter 'instanceOfAndroidContext'. If behavior is AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR, this parameter must be an instance of a class derived from android/content/Context. In all other cases, pass NULL for this parameter.

Parameters

  behavior | See AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR type for allowed values.

Returns
  NULL in the case of error, or the path otherwise. Must be free()d by the caller.

Here is the call graph for this function:

## ◆ arUtilGetSquareCenter()

AR_EXTERN int arUtilGetSquareCenter | ( | ARdouble | vertex[4][2],
|  | ARdouble * | x,
|  | ARdouble * | y
| ) |  |

## ◆ arUtilMat2QuatPos()

AR_EXTERN int arUtilMat2QuatPos | ( | const ARdouble | m[3][4],
|  | ARdouble | q[4],
|  | ARdouble | p[3]
| ) |  |

## ◆ arUtilMatInv()

AR_EXTERN int arUtilMatInv | ( | const ARdouble | s[3][4],
|  | ARdouble | d[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arUtilMatInvf()

AR_EXTERN int arUtilMatInvf | ( | const float | s[3][4],
|  | float | d[3][4]
| ) |  |

Here is the call graph for this function:

## ◆ arUtilMatMul()

AR_EXTERN int arUtilMatMul | ( | const ARdouble | s1[3][4],
|  | const ARdouble | s2[3][4],
|  | ARdouble | d[3][4]
| ) |  |

## ◆ arUtilMatMuldff()

AR_EXTERN int arUtilMatMuldff | ( | const ARdouble | s1[3][4],
|  | const float | s2[3][4],
|  | float | d[3][4]
| ) |  |

## ◆ arUtilMatMulf()

AR_EXTERN int arUtilMatMulf | ( | const float | s1[3][4],
|  | const float | s2[3][4],
|  | float | d[3][4]
| ) |  |

## ◆ arUtilPrintMtx16()

AR_EXTERN void arUtilPrintMtx16 | ( | const ARdouble | mtx16[16] | ) |

Prints a 4x4 row-major matrix via ARPRINT(...).

Parameters

  mtx16 | The matrix to print.

## ◆ arUtilPrintTransMat()

AR_EXTERN void arUtilPrintTransMat | ( | const ARdouble | trans[3][4] | ) |

Prints a transformation matrix via ARPRINT(...).

Parameters

  trans | The transformation matrix to print.

## ◆ arUtilQuatNorm()

AR_EXTERN int arUtilQuatNorm | ( | ARdouble | q[4] | ) |

## ◆ arUtilQuatPos2Mat()

AR_EXTERN int arUtilQuatPos2Mat | ( | const ARdouble | q[4],
|  | const ARdouble | p[3],
|  | ARdouble | m[3][4]
| ) |  |

## ◆ arUtilRemoveExt()

AR_EXTERN int arUtilRemoveExt | ( | char * | filename | ) |

## ◆ arUtilReplaceExt()

AR_EXTERN int arUtilReplaceExt | ( | char * | filename,
|  | int | n,
|  | char * | ext
| ) |  |

## ◆ arUtilSortLabel()

AR_EXTERN int arUtilSortLabel | ( | int | mask[],
|  | int | m,
|  | int | n,
|  | ARdouble | pos[][2],
|  | int | area[],
|  | int | label_num,
|  | int | l1,
|  | int | x1,
|  | int | y1,
|  | int | l2,
|  | int | x2,
|  | int | y2,
|  | int | label[]
| ) |  |

## Variable Documentation

## ◆ arMarkerInfoCutoffPhaseDescriptions

AR_EXTERN const char* arMarkerInfoCutoffPhaseDescriptions[AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT]
| extern