![]() |
ARX
1.0
The next-generation open source augmented reality toolkit.
|
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>
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. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_NONE 0x00000000 |
No error detection or correction. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_PARITY 0x00000100 |
Single-bit parity. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_HAMMING 0x00000200 |
Hamming code with Hamming distance of 3. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___3 0x00000300 |
BCH code with Hamming distance of 3. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___5 0x00000400 |
BCH code with Hamming distance of 5. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___7 0x00000500 |
BCH code with Hamming distance of 7. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___9 0x00000600 |
BCH code with Hamming distance of 9. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___11 0x00000700 |
BCH code with Hamming distance of 11. More... | |
#define | AR_MATRIX_CODE_TYPE_ECC_BCH___19 0x00000b00 |
BCH code with Hamming distance of 19. More... | |
#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 |
Functions | |
AR_EXTERN ARHandle * | arCreateHandle (ARParamLT *paramLT) |
Create a handle to hold settings for an artoolkitX tracker instance. More... | |
AR_EXTERN int | arDeleteHandle (ARHandle *handle) |
Delete a handle which holds settings for an artoolkitX tracker instance. More... | |
AR_EXTERN void | arSetDebugMode (ARHandle *handle, int mode) |
Enable or disable artoolkitX's debug mode. More... | |
AR_EXTERN int | arGetDebugMode (ARHandle *handle) |
Find out whether artoolkitX's debug mode is enabled. More... | |
AR_EXTERN void | arSetLabelingMode (ARHandle *handle, int mode) |
Select between detection of black markers and white markers. More... | |
AR_EXTERN int | arGetLabelingMode (ARHandle *handle) |
Enquire whether detection is looking for black markers or white markers. More... | |
AR_EXTERN void | arSetLabelingThresh (ARHandle *handle, int thresh) |
Set the labeling threshhold. More... | |
AR_EXTERN int | arGetLabelingThresh (ARHandle *handle) |
Get the current labeling threshold. More... | |
AR_EXTERN void | arSetLabelingThreshMode (ARHandle *handle, const AR_LABELING_THRESH_MODE mode) |
Set the labeling threshold mode (auto/manual). More... | |
AR_EXTERN AR_LABELING_THRESH_MODE | arGetLabelingThreshMode (const ARHandle *handle) |
Get the labeling threshold mode (auto/manual). More... | |
AR_EXTERN void | arSetLabelingThreshModeAutoInterval (ARHandle *handle, const int interval) |
Set the number of frames between auto-threshold calculations. More... | |
AR_EXTERN int | arGetLabelingThreshModeAutoInterval (const ARHandle *handle) |
Get the number of frames between auto-threshold calculations. More... | |
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. More... | |
AR_EXTERN int | arGetImageProcMode (ARHandle *handle) |
Get the image processing mode. More... | |
AR_EXTERN void | arSetPatternDetectionMode (ARHandle *handle, int mode) |
Set the pattern detection mode. More... | |
AR_EXTERN int | arGetPatternDetectionMode (ARHandle *handle) |
Get the pattern detection mode. More... | |
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. More... | |
AR_EXTERN AR_MATRIX_CODE_TYPE | arGetMatrixCodeType (ARHandle *handle) |
Get the size and ECC algorithm being used for matrix code (2D barcode) marker detection. More... | |
AR_EXTERN void | arSetMarkerExtractionMode (ARHandle *handle, int mode) |
Set the marker extraction mode. More... | |
AR_EXTERN int | arGetMarkerExtractionMode (ARHandle *handle) |
Get the marker extraction mode. More... | |
AR_EXTERN void | arSetBorderSize (ARHandle *handle, const ARdouble borderSize) |
Set the border size. More... | |
AR_EXTERN ARdouble | arGetBorderSize (ARHandle *handle) |
Get the border size. More... | |
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. More... | |
AR_EXTERN ARdouble | arGetPattRatio (ARHandle *handle) |
Get the width/height of the marker pattern space, as a proportion of marker width/height. More... | |
AR_EXTERN void | arSetPixelFormat (ARHandle *handle, AR_PIXEL_FORMAT pixFormat) |
Set the expected pixel format for video frames being passed to arDetectMarker. More... | |
AR_EXTERN AR_PIXEL_FORMAT | arGetPixelFormat (ARHandle *handle) |
Get the expected pixel format for video frames being passed to arDetectMarker. More... | |
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. More... | |
AR_EXTERN int | arGetCornerRefinementMode (ARHandle *handle) |
Find out whether square tracking subpixel corner refinement is enabled. More... | |
AR_EXTERN int | arDetectMarker (ARHandle *arHandle, AR2VideoBufferT *frame) |
Detect markers in a video frame. More... | |
AR_EXTERN int | arGetMarkerNum (ARHandle *arHandle) |
Get the number of markers detected in a video frame. More... | |
AR_EXTERN ARMarkerInfo * | arGetMarker (ARHandle *arHandle) |
Get information on the markers detected in a video frame. More... | |
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. More... | |
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. More... | |
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. More... | |
AR_EXTERN int | arPattDeleteHandle (ARPattHandle *pattHandle) |
Free all loaded patterns and pattern handle. More... | |
AR_EXTERN int | arPattLoad (ARPattHandle *pattHandle, const char *filename) |
Load a pattern file into a pattern handle. More... | |
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. More... | |
AR_EXTERN int | arPattFree (ARPattHandle *pattHandle, int patno) |
Frees (unloads) a pattern file from memory. More... | |
AR_EXTERN int | arPattActivate (ARPattHandle *pattHandle, int patno) |
Activate a previously deactivated pattern. More... | |
AR_EXTERN int | arPattDeactivate (ARPattHandle *pattHandle, int patno) |
Deactivate a previously activated pattern. More... | |
AR_EXTERN int | arPattAttach (ARHandle *arHandle, ARPattHandle *pattHandle) |
Associate a set of patterns with an ARHandle. More... | |
AR_EXTERN int | arPattDetach (ARHandle *arHandle) |
Reset an ARHandle to no pattern association. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
AR_EXTERN AR3DHandle * | ar3DCreateHandle (const ARParam *arParam) |
Create handle used for 3D calculation from calibrated camera parameters. More... | |
AR_EXTERN AR3DHandle * | ar3DCreateHandle2 (const ARdouble cpara[3][4]) |
Create handle used for 3D calculation from an intrinsic parameters matrix. More... | |
AR_EXTERN int | ar3DDeleteHandle (AR3DHandle **handle) |
Delete handle used for 3D calculation. More... | |
AR_EXTERN int | ar3DChangeCpara (AR3DHandle *handle, const ARdouble cpara[3][4]) |
(description) More... | |
AR_EXTERN int | ar3DChangeMaxLoopCount (AR3DHandle *handle, int maxLoopCount) |
(description) More... | |
AR_EXTERN int | ar3DChangeLoopBreakThresh (AR3DHandle *handle, ARdouble loopBreakThresh) |
(description) More... | |
AR_EXTERN int | ar3DChangeLoopBreakThreshRatio (AR3DHandle *handle, ARdouble loopBreakThreshRatio) |
(description) More... | |
AR_EXTERN ARdouble | arGetTransMatSquare (AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble width, ARdouble conv[3][4]) |
(description) More... | |
AR_EXTERN ARdouble | arGetTransMatSquareCont (AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble initConv[3][4], ARdouble width, ARdouble conv[3][4]) |
(description) More... | |
AR_EXTERN ARdouble | arGetTransMat (AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4]) |
(description) More... | |
AR_EXTERN ARdouble | arGetTransMatRobust (AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4]) |
(description) More... | |
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. More... | |
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. More... | |
AR_EXTERN const char * | arUtilGetPixelFormatName (const AR_PIXEL_FORMAT arPixelFormat) |
Get a string holding a descriptive name for a given pixel format enumeration. More... | |
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. More... | |
AR_EXTERN char * | arUtilGetFileExtensionFromPath (const char *path, const int convertToLowercase) |
Get file extension from a path. More... | |
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. More... | |
AR_EXTERN char * | arUtilGetResourcesDirectoryPath (AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior) |
Get the path to the resources directory using the specified behavior. More... | |
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. More... | |
AR_EXTERN int | arUtilChangeToResourcesDirectory (AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, const char *path) |
Change to the resources directory using the specified behavior. More... | |
AR_EXTERN void | arUtilPrintTransMat (const ARdouble trans[3][4]) |
Prints a transformation matrix via ARPRINT(...). More... | |
AR_EXTERN void | arUtilPrintMtx16 (const ARdouble mtx16[16]) |
Prints a 4x4 row-major matrix via ARPRINT(...). More... | |
Variables | |
AR_EXTERN const char * | arMarkerInfoCutoffPhaseDescriptions [AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT] |
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>.
#define AR_EXTERN |
#define AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT 10 |
#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_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_HAMMING 0x00000200 |
Hamming code with Hamming distance of 3.
#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_SIZE_MASK 0x000000ff |
Mask value, bitwise-OR with matrix code type to find matrix code size.
#define AR_TRANS_MAT_IDENTITY ICP_TRANS_MAT_IDENTITY |
#define arMalloc | ( | V, | |
T, | |||
S | |||
) |
#define arMallocClear | ( | V, | |
T, | |||
S | |||
) |
#define ARPRINT | ( | ... | ) | printf(__VA_ARGS__) |
#define ARPRINTE | ( | ... | ) | fprintf(stderr, __VA_ARGS__) |
#define FALSE 0 |
#define TRUE 1 |
typedef double ARdouble |
typedef float ARfloat |
typedef short ARInt16 |
typedef int ARInt32 |
typedef char ARInt8 |
typedef unsigned short ARUint16 |
typedef unsigned int ARUint32 |
typedef unsigned char ARUint8 |
Values controlling the labeling thresholding mode.
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.
enum AR_MATRIX_CODE_TYPE |
Values specifying the type of matrix code in use.
Options for controlling the behavior of arUtilGetResourcesDirectoryPath and arUtilChangeToResourcesDirectory.
AR_EXTERN int ar3DChangeCpara | ( | AR3DHandle * | handle, |
const ARdouble | cpara[3][4] | ||
) |
(description)
(description)
handle | (description) |
cpara | (description) |
AR_EXTERN int ar3DChangeLoopBreakThresh | ( | AR3DHandle * | handle, |
ARdouble | loopBreakThresh | ||
) |
(description)
(description)
handle | (description) |
loopBreakThresh | (description) |
AR_EXTERN int ar3DChangeLoopBreakThreshRatio | ( | AR3DHandle * | handle, |
ARdouble | loopBreakThreshRatio | ||
) |
(description)
(description)
handle | (description) |
loopBreakThreshRatio | (description) |
AR_EXTERN int ar3DChangeMaxLoopCount | ( | AR3DHandle * | handle, |
int | maxLoopCount | ||
) |
(description)
(description)
handle | (description) |
maxLoopCount | (description) |
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).
arParam | (description) |
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).
cpara | (description) |
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().
handle | A pointer to the 3D handle. On success, the contents of this location will be set to NULL. |
AR_EXTERN int ar3DStereoChangeCpara | ( | AR3DStereoHandle * | handle, |
ARdouble | cparaL[3][4], | ||
ARdouble | cparaR[3][4] | ||
) |
AR_EXTERN int ar3DStereoChangeLoopBreakThresh | ( | AR3DStereoHandle * | handle, |
ARdouble | loopBreakThresh | ||
) |
AR_EXTERN int ar3DStereoChangeLoopBreakThreshRatio | ( | AR3DStereoHandle * | handle, |
ARdouble | loopBreakThreshRatio | ||
) |
AR_EXTERN int ar3DStereoChangeMaxLoopCount | ( | AR3DStereoHandle * | handle, |
int | maxLoopCount | ||
) |
AR_EXTERN int ar3DStereoChangeTransMat | ( | AR3DStereoHandle * | handle, |
ARdouble | transL[3][4], | ||
ARdouble | transR[3][4] | ||
) |
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".
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 | ) |
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.
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(¶m, 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. |
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.
handle | The handle to delete, as created by arCreateHandle(); |
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.
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. |
AR_EXTERN int arDetectMarker2 | ( | int | xsize, |
int | ysize, | ||
ARLabelInfo * | labelInfo, | ||
int | imageProcMode, | ||
int | areaMax, | ||
int | areaMin, | ||
ARdouble | squareFitThresh, | ||
ARMarkerInfo2 * | markerInfo2, | ||
int * | marker2_num | ||
) |
Get the border size.
N.B. Deprecated in favour of arGetPattRatio(), but retained for backwards compatibility.
handle | An ARHandle referring to the current AR tracker to be queried for its border size. |
AR_EXTERN int arGetContour | ( | AR_LABELING_LABEL_TYPE * | lImage, |
int | xsize, | ||
int | ysize, | ||
int * | label_ref, | ||
int | label, | ||
int | clip[4], | ||
ARMarkerInfo2 * | marker_info2 | ||
) |
Find out whether square tracking subpixel corner refinement is enabled.
See arSetCornerRefinementMode() for more info.
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
Find out whether artoolkitX's debug mode is enabled.
See arSetDebugMode() for more info.
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
Get the image processing mode.
See arSetImageProcMode() for a complete description.
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
Enquire whether detection is looking for black markers or white markers.
See discussion for arSetLabelingMode.
handle | An ARHandle referring to the current AR tracker to be queried for its labeling mode. |
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.
handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold value. |
AR_EXTERN AR_LABELING_THRESH_MODE arGetLabelingThreshMode | ( | const ARHandle * | handle | ) |
Get the labeling threshold mode (auto/manual).
handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold value. |
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.
handle | An ARHandle referring to the current AR tracker to be queried for its labeling threshold auto interval value. |
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 ARMarkerInfo * arGetMarker | ( | ARHandle * | arHandle | ) |
Get information on the markers detected in a video frame.
arHandle | Handle upon which arDetectMarker has been called. |
Get the marker extraction mode.
(description)
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
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.
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. |
Get the number of markers detected in a video frame.
arHandle | Handle upon which arDetectMarker has been called. |
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().
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
Get the pattern detection mode.
See arSetPatternDetectionMode() for a complete description.
handle | An ARHandle referring to the current AR tracker to be queried for its mode. |
Get the width/height of the marker pattern space, as a proportion of marker width/height.
N.B. Supercedes arGetBorderSize().
handle | An ARHandle referring to the current AR tracker to be queried. |
Get the expected pixel format for video frames being passed to arDetectMarker.
See discussion for arSetPixelFormat().
handle | Handle to AR settings structure from which to retrieve the pixel format. |
AR_EXTERN int arGetStereoMatching | ( | AR3DStereoHandle * | handle, |
ARdouble | pos2dL[2], | ||
ARdouble | pos2dR[2], | ||
ARdouble | pos3d[3] | ||
) |
AR_EXTERN ARdouble arGetStereoMatchingError | ( | AR3DStereoHandle * | handle, |
ARdouble | pos2dL[2], | ||
ARdouble | pos2dR[2] | ||
) |
AR_EXTERN ARdouble arGetStereoMatchingErrorSquare | ( | AR3DStereoHandle * | handle, |
ARMarkerInfo * | marker_infoL, | ||
ARMarkerInfo * | marker_infoR | ||
) |
AR_EXTERN ARdouble arGetTransMat | ( | AR3DHandle * | handle, |
ARdouble | initConv[3][4], | ||
ARdouble | pos2d[][2], | ||
ARdouble | pos3d[][3], | ||
int | num, | ||
ARdouble | conv[3][4] | ||
) |
(description)
(description)
handle | (description) |
initConv | (description) |
pos2d | (description) |
pos3d | (description) |
num | (description) |
conv | (description) |
AR_EXTERN ARdouble arGetTransMatRobust | ( | AR3DHandle * | handle, |
ARdouble | initConv[3][4], | ||
ARdouble | pos2d[][2], | ||
ARdouble | pos3d[][3], | ||
int | num, | ||
ARdouble | conv[3][4] | ||
) |
(description)
(description)
handle | (description) |
initConv | (description) |
pos2d | (description) |
pos3d | (description) |
num | (description) |
conv | (description) |
AR_EXTERN ARdouble arGetTransMatSquare | ( | AR3DHandle * | handle, |
ARMarkerInfo * | marker_info, | ||
ARdouble | width, | ||
ARdouble | conv[3][4] | ||
) |
(description)
(description)
handle | (description) |
marker_info | (description) |
width | (description) |
conv | (description) |
AR_EXTERN ARdouble arGetTransMatSquareCont | ( | AR3DHandle * | handle, |
ARMarkerInfo * | marker_info, | ||
ARdouble | initConv[3][4], | ||
ARdouble | width, | ||
ARdouble | conv[3][4] | ||
) |
(description)
(description)
handle | (description) |
marker_info | (description) |
initConv | (description) |
width | (description) |
conv | (description) |
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 arGetTransMatSquareStereo | ( | AR3DStereoHandle * | handle, |
ARMarkerInfo * | marker_infoL, | ||
ARMarkerInfo * | marker_infoR, | ||
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] | ||
) |
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.
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. |
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 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.
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. |
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.
arHandle | (description) |
pattHandle | (description) |
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.
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.
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().
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().
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.
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. |
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.
pattHandle | The handle to free. |
Reset an ARHandle to no pattern association.
See arPattAttach() for more information.
arHandle | (description) |
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.
pattHandle | The pattern handle to unload from. |
patno | The index into the pattern handle's array of patterns to the pattern to be unloaded. |
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 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.
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. |
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.
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. |
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 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.
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. |
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.
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. |
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.
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. |
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.
This function is used by the make_patt utility. See the sourcecode to mk_patt for usage.
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) |
Set the border size.
N.B. Deprecated in favour of arSetPattRatio(), but retained for backwards compatibility.
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. |
Enable or disable square tracking subpixel corner refinement.
If compiled with OpenCV available, the square tracker allows marker corner locations to be subpixel-refined.
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. |
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.
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. |
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.
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. |
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.
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. |
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.
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). |
AR_EXTERN void arSetLabelingThreshAutoAdaptiveBias | ( | ARHandle * | handle, |
const int | labelingThreshAutoAdaptiveBias | ||
) |
AR_EXTERN void arSetLabelingThreshAutoAdaptiveKernelSize | ( | ARHandle * | handle, |
const int | labelingThreshAutoAdaptiveKernelSize | ||
) |
AR_EXTERN void arSetLabelingThreshMode | ( | ARHandle * | handle, |
const AR_LABELING_THRESH_MODE | mode | ||
) |
Set the labeling threshold mode (auto/manual).
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 |
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.
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. |
Set the marker extraction mode.
(description)
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. |
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.
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. |
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.
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. |
Set the width/height of the marker pattern space, as a proportion of marker width/height.
N.B. Supercedes arSetBorderSize().
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. |
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.
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. |
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.
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. |
AR_EXTERN int arUtilDivideExt | ( | const char * | filename, |
char * | s1, | ||
char * | s2 | ||
) |
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.
behavior | See AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR type for allowed values. |
AR_EXTERN char * arUtilGetDirectoryNameFromPath | ( | char * | dir, |
const char * | path, | ||
const size_t | n, | ||
const int | addSeparator | ||
) |
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.
path | Full or partial pathname. |
convertToLowercase | If convertToLowercase is TRUE, uppercase ASCII characters in the basename will be converted to lowercase. |
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.
path | Full or partial pathname. |
convertToLowercase | If convertToLowercase is TRUE, uppercase ASCII characters in the extension will be converted to lowercase. |
AR_EXTERN const char * arUtilGetFileNameFromPath | ( | const char * | path | ) |
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.
path | Full or partial pathname. On Windows, both partial pathnames, full pathnames including the drive letter, or UNC pathnames (beginning with "\\" are all OK. |
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.
arPixelFormat | Enumerated pixel format number for which to retrieve a name. |
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.
arPixelFormat | The pixel type whose size is to be measured. |
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.
behavior | See AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR type for allowed values. |
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] | ||
) |
Prints a 4x4 row-major matrix via ARPRINT(...).
mtx16 | The matrix to print. |
Prints a transformation matrix via ARPRINT(...).
trans | The transformation matrix to print. |
AR_EXTERN int arUtilRemoveExt | ( | char * | filename | ) |
AR_EXTERN int arUtilReplaceExt | ( | char * | filename, |
int | n, | ||
char * | ext | ||
) |
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[] | ||
) |
|
extern |