ARX  1.2.0
The next-generation open source augmented reality toolkit.
Loading...
Searching...
No Matches
ar.h
Go to the documentation of this file.
1/*
2 * ar.h
3 * artoolkitX
4 *
5 * This file is part of artoolkitX.
6 *
7 * artoolkitX is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * artoolkitX is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with artoolkitX. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * As a special exception, the copyright holders of this library give you
21 * permission to link this library with independent modules to produce an
22 * executable, regardless of the license terms of these independent modules, and to
23 * copy and distribute the resulting executable under terms of your choice,
24 * provided that you also meet, for each linked independent module, the terms and
25 * conditions of the license of that module. An independent module is a module
26 * which is neither derived from nor based on this library. If you modify this
27 * library, you may extend this exception to your version of the library, but you
28 * are not obligated to do so. If you do not wish to do so, delete this exception
29 * statement from your version.
30 *
31 * Copyright 2018 Realmax, Inc.
32 * Copyright 2015-2016 Daqri, LLC.
33 * Copyright 2002-2015 ARToolworks, Inc.
34 *
35 * Author(s): Hirokazu Kato, Philip Lamb
36 *
37 */
38/*******************************************************
39 *
40 * Author: Hirokazu Kato
41 *
43 *
44 * Revision: 4.01
45 * Date: 2003/11/07
46 *
47 *******************************************************/
48
60
61#ifndef AR_H
62#define AR_H
63
64#include <stdio.h>
65#include <stdlib.h>
66#include <stdint.h>
67#include <string.h>
68#include <ARX/AR/config.h>
69#include <ARX/AR/arConfig.h>
70#ifdef __ANDROID__
71# include <jni.h>
72# include <android/log.h>
73#endif
74#include <ARX/ARUtil/log.h>
75
76#ifdef __cplusplus
77extern "C" {
78#endif
79
80
81#define arMalloc(V,T,S) \
82{ if( ((V) = (T *)malloc( sizeof(T) * (S) )) == NULL ) \
83{ARLOGe("Out of memory!!\n"); exit(1);} }
84
85#define arMallocClear(V,T,S) \
86{ if( ((V) = (T *)calloc( (S), sizeof(T) )) == NULL ) \
87{ARLOGe("Out of memory!!\n"); exit(1);} }
88
89typedef char ARInt8;
90typedef short ARInt16;
91typedef int ARInt32;
92typedef unsigned char ARUint8;
93typedef unsigned short ARUint16;
94typedef unsigned int ARUint32;
95typedef float ARfloat;
96#ifdef ARDOUBLE_IS_FLOAT
97typedef float ARdouble;
98#else
99typedef double ARdouble;
100#endif
101
102#ifndef TRUE
103# define TRUE 1
104#endif
105#ifndef FALSE
106# define FALSE 0
107#endif
108
109#ifdef __cplusplus
110}
111#endif
112
113#include <ARX/AR/matrix.h>
114#include <ARX/AR/icp.h>
115
116#ifdef __cplusplus
117extern "C" {
118#endif
119
120#ifdef _WIN32
121# ifdef AR_STATIC
122# define AR_EXTERN
123# else
124# ifdef ARX_EXPORTS
125# define AR_EXTERN __declspec(dllexport)
126# else
127# define AR_EXTERN __declspec(dllimport)
128# endif
129# endif
130#else
131# define AR_EXTERN
132#endif
133
134/* --------------------------------------------------*/
135
139typedef struct {
140 uint64_t sec;
141 uint32_t usec;
143
156
167
179
201
202#define AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT 10
204
233
242
259
260/* --------------------------------------------------*/
261
268typedef struct {
271 int *pattf;
272 int **patt;
274 int **pattBW;
276 //ARdouble pattRatio; ///<
279
286typedef struct {
287 float topLeftX;
288 float topLeftY;
292
293/* --------------------------------------------------*/
294
295#ifdef __cplusplus
296}
297#endif
298
299#include <ARX/AR/param.h>
300#include <ARX/AR/arImageProc.h>
301
302#ifdef __cplusplus
303extern "C" {
304#endif
305
306#define AR_MATRIX_CODE_TYPE_SIZE_MASK 0x000000ff
307#define AR_MATRIX_CODE_TYPE_ECC_NONE 0x00000000
308#define AR_MATRIX_CODE_TYPE_ECC_PARITY 0x00000100
309#define AR_MATRIX_CODE_TYPE_ECC_HAMMING 0x00000200
310#define AR_MATRIX_CODE_TYPE_ECC_BCH___3 0x00000300
311#define AR_MATRIX_CODE_TYPE_ECC_BCH___5 0x00000400
312#define AR_MATRIX_CODE_TYPE_ECC_BCH___7 0x00000500
313#define AR_MATRIX_CODE_TYPE_ECC_BCH___9 0x00000600
314#define AR_MATRIX_CODE_TYPE_ECC_BCH___11 0x00000700
315#define AR_MATRIX_CODE_TYPE_ECC_BCH___19 0x00000b00
316
333
377
378
379/* --------------------------------------------------*/
380
385typedef struct {
387} AR3DHandle;
388
389#define AR_TRANS_MAT_IDENTITY ICP_TRANS_MAT_IDENTITY
390
398
399
400/***********************************/
401/* */
402/* For square detection */
403/* */
404/***********************************/
405
439
448AR_EXTERN int arDeleteHandle( ARHandle *handle );
449
467AR_EXTERN void arSetDebugMode(ARHandle *handle, int mode);
468
478
497AR_EXTERN void arSetLabelingMode(ARHandle *handle, int mode);
498
508
536AR_EXTERN void arSetLabelingThresh(ARHandle *handle, int thresh);
537
557
573
588
602AR_EXTERN void arSetLabelingThreshModeAutoInterval(ARHandle *handle, const int interval);
603
616
617AR_EXTERN void arSetLabelingThreshAutoAdaptiveKernelSize(ARHandle *handle, const int labelingThreshAutoAdaptiveKernelSize);
618
620
621AR_EXTERN void arSetLabelingThreshAutoAdaptiveBias(ARHandle *handle, const int labelingThreshAutoAdaptiveBias);
622
624
648AR_EXTERN void arSetImageProcMode(ARHandle *handle, int mode);
649
660
684AR_EXTERN void arSetPatternDetectionMode(ARHandle *handle, int mode);
685
696
721
731
744AR_EXTERN void arSetMarkerExtractionMode(ARHandle *handle, int mode);
745
754
766AR_EXTERN void arSetBorderSize(ARHandle *handle, const ARdouble borderSize);
767
779
790AR_EXTERN void arSetPattRatio(ARHandle *handle, const ARdouble pattRatio);
791
801
816AR_EXTERN void arSetPixelFormat(ARHandle *handle, AR_PIXEL_FORMAT pixFormat);
817
830AR_EXTERN AR_PIXEL_FORMAT arGetPixelFormat(ARHandle *handle);
831
832AR_EXTERN void arSetAreaMax(ARHandle *handle, const ARdouble areaMax);
833
835
836AR_EXTERN void arSetAreaMin(ARHandle *handle, const ARdouble areaMin);
837
839
840AR_EXTERN void arSetSquareFitThresh(ARHandle *handle, const ARdouble squareFitThresh);
841
843
856AR_EXTERN void arSetCornerRefinementMode(ARHandle *handle, int mode);
857
867
868
895AR_EXTERN int arDetectMarker(ARHandle *arHandle, AR2VideoBufferT *frame);
896
907AR_EXTERN int arGetMarkerNum( ARHandle *arHandle );
908
920
921/* ------------------------------ */
922
923AR_EXTERN int arLabeling( ARUint8 *imageLuma, int xsize, int ysize,
924 int debugMode, int labelingMode, int labelingThresh, int imageProcMode,
925 ARLabelInfo *labelInfo, ARUint8 *image_thresh );
926AR_EXTERN int arDetectMarker2( int xsize, int ysize, ARLabelInfo *labelInfo, int imageProcMode,
927 int areaMax, int areaMin, ARdouble squareFitThresh,
928 ARMarkerInfo2 *markerInfo2, int *marker2_num );
952AR_EXTERN int arGetMarkerInfo( ARUint8 *image, int xsize, int ysize, int pixelFormat,
953 ARMarkerInfo2 *markerInfo2, int marker2_num,
954 ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARParamLTf *arParamLTf, ARdouble pattRatio,
955 ARMarkerInfo *markerInfo, int *marker_num,
956 const AR_MATRIX_CODE_TYPE matrixCodeType );
957
958AR_EXTERN int arGetContour( AR_LABELING_LABEL_TYPE *lImage, int xsize, int ysize, int *label_ref, int label,
959 int clip[4], ARMarkerInfo2 *marker_info2 );
960AR_EXTERN int arGetLine( int x_coord[], int y_coord[], int coord_num, int vertex[], ARParamLTf *paramLTf,
961 ARdouble line[4][3], ARdouble v[4][2] );
962
963
964/***********************************/
965/* */
966/* For pattern identification */
967/* */
968/***********************************/
969
987
1009
1010AR_EXTERN ARPattHandle *arPattCreateHandle2(const int pattSize, const int patternCountMax);
1011
1020
1048AR_EXTERN int arPattLoad( ARPattHandle *pattHandle, const char *filename );
1049
1050AR_EXTERN int arPattLoadFromBuffer(ARPattHandle *pattHandle, const char *buffer);
1051
1068AR_EXTERN int arPattSave( ARUint8 *image, int xsize, int ysize, int pixelFormat, ARParamLTf *paramLTf,
1069 int imageProcMode, ARMarkerInfo *marker_info, ARdouble pattRatio, int pattSize, const char *filename );
1070
1082AR_EXTERN int arPattFree( ARPattHandle *pattHandle, int patno );
1083
1097AR_EXTERN int arPattActivate( ARPattHandle *pattHandle, int patno );
1098
1114AR_EXTERN int arPattDeactivate(ARPattHandle *pattHandle, int patno);
1115
1128AR_EXTERN int arPattAttach(ARHandle *arHandle, ARPattHandle *pattHandle);
1129
1138AR_EXTERN int arPattDetach(ARHandle *arHandle);
1139
1140//int arPattGetPattRatio( ARPattHandle *pattHandle, float *ratio );
1141//int arPattSetPattRatio( ARPattHandle *pattHandle, float ratio );
1142
1143/* ------------------------------ */
1144
1145#if !AR_DISABLE_NON_CORE_FNS
1146AR_EXTERN int arPattGetID( ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode,
1147 ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat,
1148 int *x_coord, int *y_coord, int *vertex, ARdouble pattRatio,
1149 int *code, int *dir, ARdouble *cf, const AR_MATRIX_CODE_TYPE matrixCodeType );
1150AR_EXTERN int arPattGetImage( int imageProcMode, int pattDetectMode, int patt_size, int sample_size,
1151 ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat,
1152 int *x_coord, int *y_coord, int *vertex, ARdouble pattRatio,
1153 ARUint8 *ext_patt );
1154
1177AR_EXTERN int arPattGetID2( ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode,
1178 ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf, ARdouble vertex[4][2], ARdouble pattRatio,
1179 int *codePatt, int *dirPatt, ARdouble *cfPatt, int *codeMatrix, int *dirMatrix, ARdouble *cfMatrix,
1180 const AR_MATRIX_CODE_TYPE matrixCodeType );
1181#endif // !AR_DISABLE_NON_CORE_FNS
1182
1207AR_EXTERN int arPattGetIDGlobal( ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode,
1208 ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf, ARdouble vertex[4][2], ARdouble pattRatio,
1209 int *codePatt, int *dirPatt, ARdouble *cfPatt, int *codeMatrix, int *dirMatrix, ARdouble *cfMatrix,
1210 const AR_MATRIX_CODE_TYPE matrixCodeType, int *errorCorrected, uint64_t *codeGlobalID_p );
1211
1229AR_EXTERN int arPattGetImage2( int imageProcMode, int pattDetectMode, int patt_size, int sample_size,
1230 ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *arParamLTf,
1231 ARdouble vertex[4][2], ARdouble pattRatio, ARUint8 *ext_patt );
1232
1247AR_EXTERN int arPattGetImage3( ARHandle *arHandle, int markerNo, ARUint8 *image, ARPattRectInfo *rect, int xsize, int ysize,
1248 int overSampleScale, ARUint8 *outImage );
1249
1250
1251/***********************************/
1252/* */
1253/* For 3D calculation */
1254/* */
1255/***********************************/
1256
1260
1273
1286
1295AR_EXTERN int ar3DDeleteHandle( AR3DHandle **handle );
1296
1304AR_EXTERN int ar3DChangeCpara( AR3DHandle *handle, const ARdouble cpara[3][4] );
1305
1313AR_EXTERN int ar3DChangeMaxLoopCount( AR3DHandle *handle, int maxLoopCount );
1314
1322AR_EXTERN int ar3DChangeLoopBreakThresh( AR3DHandle *handle, ARdouble loopBreakThresh );
1323
1331AR_EXTERN int ar3DChangeLoopBreakThreshRatio( AR3DHandle *handle, ARdouble loopBreakThreshRatio );
1332
1343 ARdouble width, ARdouble conv[3][4] );
1344
1356 ARdouble initConv[3][4],
1357 ARdouble width, ARdouble conv[3][4] );
1358
1370AR_EXTERN ARdouble arGetTransMat( AR3DHandle *handle, ARdouble initConv[3][4],
1371 ARdouble pos2d[][2], ARdouble pos3d[][3], int num,
1372 ARdouble conv[3][4] );
1373
1386 ARdouble pos2d[][2], ARdouble pos3d[][3], int num,
1387 ARdouble conv[3][4] );
1388
1389
1390/***********************************/
1391/* */
1392/* For 3D calculation by Stereo */
1393/* */
1394/***********************************/
1395
1399
1400AR_EXTERN AR3DStereoHandle *ar3DStereoCreateHandle(const ARParam *arParamL, const ARParam *arParamR, const ARdouble transL[3][4], const ARdouble transR[3][4]);
1401AR_EXTERN AR3DStereoHandle *ar3DStereoCreateHandle2(const ARdouble cparaL[3][4], const ARdouble cparaR[3][4], const ARdouble transL[3][4], const ARdouble transR[3][4]);
1403AR_EXTERN int ar3DStereoChangeMaxLoopCount( AR3DStereoHandle *handle, int maxLoopCount );
1405AR_EXTERN int ar3DStereoChangeLoopBreakThreshRatio( AR3DStereoHandle *handle, ARdouble loopBreakThreshRatio );
1406AR_EXTERN int ar3DStereoChangeCpara( AR3DStereoHandle *handle, ARdouble cparaL[3][4], ARdouble cparaR[3][4] );
1407AR_EXTERN int ar3DStereoChangeTransMat( AR3DStereoHandle *handle, ARdouble transL[3][4], ARdouble transR[3][4] );
1408
1410 ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR,
1411 ARdouble width, ARdouble conv[3][4] );
1413 ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR,
1414 ARdouble prev_conv[3][4],
1415 ARdouble width, ARdouble conv[3][4] );
1417 ARdouble pos2dL[][2], ARdouble pos3dL[][3], int numL,
1418 ARdouble pos2dR[][2], ARdouble pos3dR[][3], int numR,
1419 ARdouble conv[3][4] );
1421 ARdouble pos2dL[][2], ARdouble pos3dL[][3], int numL,
1422 ARdouble pos2dR[][2], ARdouble pos3dR[][3], int numR,
1423 ARdouble conv[3][4] );
1424
1426 ARMarkerInfo *marker_infoL,
1427 ARMarkerInfo *marker_infoR );
1429 ARdouble pos2dL[2], ARdouble pos2dR[2] );
1431 ARdouble pos2dL[2], ARdouble pos2dR[2], ARdouble pos3d[3] );
1432
1433
1434
1435/***********************************/
1436/* */
1437/* Utility */
1438/* */
1439/***********************************/
1440
1444
1492AR_EXTERN ARUint32 arGetVersion(char **versionStringRef);
1493
1494AR_EXTERN int arUtilMatInv( const ARdouble s[3][4], ARdouble d[3][4] );
1495AR_EXTERN int arUtilMatMul( const ARdouble s1[3][4], const ARdouble s2[3][4], ARdouble d[3][4] );
1496
1497#ifdef ARDOUBLE_IS_FLOAT
1498#define arUtilMatInvf arUtilMatInv
1499#define arUtilMatMulf arUtilMatMul
1500#define arUtilMatMuldff arUtilMatMul
1501#else
1502AR_EXTERN int arUtilMatInvf( const float s[3][4], float d[3][4] );
1503AR_EXTERN int arUtilMatMulf( const float s1[3][4], const float s2[3][4], float d[3][4] );
1504AR_EXTERN int arUtilMatMuldff( const ARdouble s1[3][4], const float s2[3][4], float d[3][4] );
1505#endif
1506AR_EXTERN int arUtilMat2QuatPos( const ARdouble m[3][4], ARdouble q[4], ARdouble p[3] );
1507AR_EXTERN int arUtilQuatPos2Mat( const ARdouble q[4], const ARdouble p[3], ARdouble m[3][4] );
1509
1510AR_EXTERN int arUtilReplaceExt( char *filename, int n, char *ext );
1511AR_EXTERN int arUtilRemoveExt ( char *filename );
1512AR_EXTERN int arUtilDivideExt ( const char *filename, char *s1, char *s2 );
1513
1514AR_EXTERN int arUtilGetSquareCenter( ARdouble vertex[4][2], ARdouble *x, ARdouble *y );
1515
1516AR_EXTERN int arUtilSortLabel( int mask[], int m, int n,
1517 ARdouble pos[][2], int area[], int label_num,
1518 int l1, int x1, int y1,
1519 int l2, int x2, int y2,
1520 int label[] );
1521
1532AR_EXTERN int arUtilGetPixelSize( const AR_PIXEL_FORMAT arPixelFormat );
1533
1545AR_EXTERN const char *arUtilGetPixelFormatName(const AR_PIXEL_FORMAT arPixelFormat);
1546
1547/*
1548 @brief Get the filename portion of a full pathname.
1549 @details
1550 Given a full or partial pathname passed in string path,
1551 returns a pointer to the first char of the filename
1552 portion of path.
1553 */
1554AR_EXTERN const char *arUtilGetFileNameFromPath(const char *path);
1555
1556
1571AR_EXTERN char *arUtilGetFileBasenameFromPath(const char *path, const int convertToLowercase);
1572
1586AR_EXTERN char *arUtilGetFileExtensionFromPath(const char *path, const int convertToLowercase);
1587
1588 /*
1589 @brief Get the directory portion of a full pathname.
1590 @details
1591 Given a full or partial pathname passed in string path,
1592 returns a string with the directory name portion of path.
1593 The string is placed into the buffer of size n pointed to by dir.
1594 If the string and its terminating null byte cannot be accomodated by the
1595 buffer, NULL is returned, otherwise dir is returned.
1596 The string is terminated by the directory separator if addSeparator != 0.
1597 */
1598AR_EXTERN char *arUtilGetDirectoryNameFromPath(char *dir, const char *path, const size_t n, const int addSeparator);
1599
1618AR_EXTERN char *arUtilGetFileURI(const char *path);
1619
1694
1695#ifdef ANDROID
1696jobject arUtilGetGlobalContext(void);
1697#endif
1698
1714#ifdef ANDROID
1715char *arUtilGetResourcesDirectoryPath(AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, jobject instanceOfAndroidContext);
1716#else
1718#endif
1719
1735#ifdef ANDROID
1736char *arUtilGetAndCreateResourcesDirectoryPath(AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, jobject instanceOfAndroidContext);
1737#else
1739#endif
1740
1741#ifndef _WINRT
1762#ifdef ANDROID
1763int arUtilChangeToResourcesDirectory(AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, const char *path, jobject instanceOfAndroidContext);
1764#else
1766#endif
1767#endif // !_WINRT
1768
1769#ifdef __ANDROID__
1770# define ARPRINT(...) __android_log_print(ANDROID_LOG_INFO, "artoolkitx", __VA_ARGS__)
1771# define ARPRINTE(...) __android_log_print(ANDROID_LOG_ERROR, "artoolkitx", __VA_ARGS__)
1772#else
1773# define ARPRINT(...) printf(__VA_ARGS__)
1774# define ARPRINTE(...) fprintf(stderr, __VA_ARGS__)
1775#endif
1776
1781AR_EXTERN void arUtilPrintTransMat(const ARdouble trans[3][4]);
1782
1787AR_EXTERN void arUtilPrintMtx16(const ARdouble mtx16[16]);
1788
1789#ifdef __cplusplus
1790}
1791#endif //#ifdef __cplusplus
1792
1793#endif //#ifndef AR_H
int ar3DChangeLoopBreakThreshRatio(AR3DHandle *handle, ARdouble loopBreakThreshRatio)
(description)
Definition ar3DCreateHandle.c:99
AR3DHandle * ar3DCreateHandle(const ARParam *arParam)
Create handle used for 3D calculation from calibrated camera parameters.
Definition ar3DCreateHandle.c:52
int ar3DChangeLoopBreakThresh(AR3DHandle *handle, ARdouble loopBreakThresh)
(description)
Definition ar3DCreateHandle.c:94
int ar3DStereoChangeLoopBreakThreshRatio(AR3DStereoHandle *handle, ARdouble loopBreakThreshRatio)
Definition ar3DCreateHandle.c:150
int ar3DDeleteHandle(AR3DHandle **handle)
Delete handle used for 3D calculation.
Definition ar3DCreateHandle.c:72
AR3DStereoHandle * ar3DStereoCreateHandle(const ARParam *arParamL, const ARParam *arParamR, const ARdouble transL[3][4], const ARdouble transR[3][4])
Definition ar3DCreateHandle.c:107
int ar3DChangeMaxLoopCount(AR3DHandle *handle, int maxLoopCount)
(description)
Definition ar3DCreateHandle.c:89
int ar3DStereoChangeMaxLoopCount(AR3DStereoHandle *handle, int maxLoopCount)
Definition ar3DCreateHandle.c:140
int ar3DStereoChangeTransMat(AR3DStereoHandle *handle, ARdouble transL[3][4], ARdouble transR[3][4])
Definition ar3DCreateHandle.c:162
int ar3DStereoChangeLoopBreakThresh(AR3DStereoHandle *handle, ARdouble loopBreakThresh)
Definition ar3DCreateHandle.c:145
int ar3DStereoChangeCpara(AR3DStereoHandle *handle, ARdouble cparaL[3][4], ARdouble cparaR[3][4])
Definition ar3DCreateHandle.c:155
AR3DHandle * ar3DCreateHandle2(const ARdouble cpara[3][4])
Create handle used for 3D calculation from an intrinsic parameters matrix.
Definition ar3DCreateHandle.c:57
AR3DStereoHandle * ar3DStereoCreateHandle2(const ARdouble cparaL[3][4], const ARdouble cparaR[3][4], const ARdouble transL[3][4], const ARdouble transR[3][4])
Definition ar3DCreateHandle.c:113
int ar3DChangeCpara(AR3DHandle *handle, const ARdouble cpara[3][4])
(description)
Definition ar3DCreateHandle.c:83
int ar3DStereoDeleteHandle(AR3DStereoHandle **handle)
Definition ar3DCreateHandle.c:129
ARdouble arGetStereoMatchingError(AR3DStereoHandle *handle, ARdouble pos2dL[2], ARdouble pos2dR[2])
Definition ar3DUtil.c:90
ARdouble arGetStereoMatchingErrorSquare(AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR)
Definition ar3DUtil.c:54
int arGetStereoMatching(AR3DStereoHandle *handle, ARdouble pos2dL[2], ARdouble pos2dR[2], ARdouble pos3d[3])
Definition ar3DUtil.c:178
unsigned char ARUint8
Definition ar.h:92
AR_MATRIX_CODE_TYPE
Values specifying the type of matrix code in use.
Definition ar.h:320
@ AR_MATRIX_CODE_5x5_BCH_22_12_5
Matrix code in range 0-4095.
Definition ar.h:327
@ AR_MATRIX_CODE_5x5_BCH_22_7_7
Matrix code in range 0-127.
Definition ar.h:328
@ AR_MATRIX_CODE_3x3_HAMMING63
Matrix code in range 0-7.
Definition ar.h:323
@ AR_MATRIX_CODE_4x4_BCH_13_9_3
Matrix code in range 0-511.
Definition ar.h:325
@ AR_MATRIX_CODE_5x5
Matrix code in range 0-4194303.
Definition ar.h:329
@ AR_MATRIX_CODE_3x3_PARITY65
Matrix code in range 0-31.
Definition ar.h:322
@ AR_MATRIX_CODE_6x6
Matrix code in range 0-8589934591.
Definition ar.h:330
@ AR_MATRIX_CODE_4x4_BCH_13_5_5
Matrix code in range 0-31.
Definition ar.h:326
@ AR_MATRIX_CODE_3x3
Matrix code in range 0-63.
Definition ar.h:321
@ AR_MATRIX_CODE_GLOBAL_ID
Definition ar.h:331
@ AR_MATRIX_CODE_4x4
Matrix code in range 0-8191.
Definition ar.h:324
float ARfloat
Definition ar.h:95
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[])
#define AR_MATRIX_CODE_TYPE_ECC_BCH___5
BCH code with Hamming distance of 5.
Definition ar.h:311
#define AR_MATRIX_CODE_TYPE_ECC_PARITY
Single-bit parity.
Definition ar.h:308
double ARdouble
Definition ar.h:99
short ARInt16
Definition ar.h:90
#define AR_MATRIX_CODE_TYPE_ECC_HAMMING
Hamming code with Hamming distance of 3.
Definition ar.h:309
AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR
Options for controlling the behavior of arUtilGetResourcesDirectoryPath and arUtilChangeToResourcesDi...
Definition ar.h:1625
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_BUNDLE_RESOURCES_DIR
Definition ar.h:1655
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_USER_ROOT
Definition ar.h:1666
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_BEST
Definition ar.h:1632
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_CACHE_DIR
Definition ar.h:1672
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_DATA_DIR
Definition ar.h:1678
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_CWD
Definition ar.h:1636
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_EXECUTABLE_DIR
Definition ar.h:1645
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_APP_EXTERNAL_DATA_DIR
Definition ar.h:1691
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_SUPPLIED_PATH
Definition ar.h:1640
@ AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR_USE_TMP_DIR
Definition ar.h:1684
char ARInt8
Definition ar.h:89
#define AR_MATRIX_CODE_TYPE_ECC_BCH___3
BCH code with Hamming distance of 3.
Definition ar.h:310
AR_LABELING_THRESH_MODE
Values controlling the labeling thresholding mode.
Definition ar.h:160
@ AR_LABELING_THRESH_MODE_MANUAL
Manual threshold selection via arSetLabelingThresh.
Definition ar.h:161
@ AR_LABELING_THRESH_MODE_AUTO_MEDIAN
Automatic threshold selection via full-image histogram median.
Definition ar.h:162
@ AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE
Adaptive thresholding.
Definition ar.h:164
@ AR_LABELING_THRESH_MODE_AUTO_BRACKETING
Automatic threshold selection via heuristic-based exposure bracketing.
Definition ar.h:165
@ AR_LABELING_THRESH_MODE_AUTO_OTSU
Automatic threshold selection via Otsu's method for foreground/background selection.
Definition ar.h:163
AR_MARKER_INFO_CUTOFF_PHASE
Result codes returned by arDetectMarker to report state of individual detected trapezoidal regions.
Definition ar.h:189
@ AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONFIDENCE
Matching confidence cutoff value not reached.
Definition ar.h:196
@ AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR_MULTI
Multi-marker pose error value exceeded.
Definition ar.h:198
@ AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONTRAST
Insufficient contrast during matching.
Definition ar.h:193
@ AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_EDC_FAIL
Barcode matching error detection/correction found unrecoverable error.
Definition ar.h:195
@ AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR
Maximum allowable pose error exceeded.
Definition ar.h:197
@ AR_MARKER_INFO_CUTOFF_PHASE_PATTERN_EXTRACTION
Failure during pattern extraction.
Definition ar.h:191
@ AR_MARKER_INFO_CUTOFF_PHASE_MATCH_GENERIC
Generic error during matching phase.
Definition ar.h:192
@ AR_MARKER_INFO_CUTOFF_PHASE_NONE
Marker OK.
Definition ar.h:190
@ AR_MARKER_INFO_CUTOFF_PHASE_HEURISTIC_TROUBLESOME_MATRIX_CODES
Heuristic-based rejection of troublesome matrix code which is often generated in error.
Definition ar.h:199
@ AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_NOT_FOUND
Barcode matching could not find correct barcode locator pattern.
Definition ar.h:194
int ARInt32
Definition ar.h:91
unsigned short ARUint16
Definition ar.h:93
unsigned int ARUint32
Definition ar.h:94
#define AR_EXTERN
Definition ar.h:131
#define AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT
Definition ar.h:202
#define AR_MATRIX_CODE_TYPE_ECC_BCH___19
BCH code with Hamming distance of 19.
Definition ar.h:315
#define AR_MATRIX_CODE_TYPE_ECC_BCH___7
BCH code with Hamming distance of 7.
Definition ar.h:312
#define AR_LABELING_LABEL_TYPE
Definition arConfig.h:111
#define AR_SQUARE_MAX
Definition arConfig.h:117
#define AR_CHAIN_MAX
Definition arConfig.h:119
#define AR_LABELING_WORK_SIZE
Definition arConfig.h:110
void arSetDebugMode(ARHandle *handle, int mode)
Enable or disable artoolkitX's debug mode.
Definition arCreateHandle.c:121
int arGetMarkerNum(ARHandle *handle)
Get the number of markers detected in a video frame.
Definition arCreateHandle.c:512
void arSetCornerRefinementMode(ARHandle *handle, int mode)
Enable or disable square tracking subpixel corner refinement.
Definition arCreateHandle.c:445
void arSetLabelingThreshAutoAdaptiveBias(ARHandle *handle, const int labelingThreshAutoAdaptiveBias)
Definition arCreateHandle.c:255
int arGetLabelingThreshModeAutoInterval(const ARHandle *handle)
Get the number of frames between auto-threshold calculations.
Definition arCreateHandle.c:269
void arSetImageProcMode(ARHandle *handle, int mode)
Set the image processing mode.
Definition arCreateHandle.c:276
int arGetCornerRefinementMode(ARHandle *handle)
Find out whether square tracking subpixel corner refinement is enabled.
Definition arCreateHandle.c:505
int arGetLabelingMode(ARHandle *handle)
Enquire whether detection is looking for black markers or white markers.
Definition arCreateHandle.c:160
AR_LABELING_THRESH_MODE arGetLabelingThreshMode(const ARHandle *handle)
Get the labeling threshold mode (auto/manual).
Definition arCreateHandle.c:224
ARdouble arGetAreaMax(ARHandle *handle)
Definition arCreateHandle.c:468
void arSetAreaMax(ARHandle *handle, const ARdouble areaMax)
Definition arCreateHandle.c:460
int arGetLabelingThresh(ARHandle *handle)
Get the current labeling threshold.
Definition arCreateHandle.c:176
ARdouble arGetBorderSize(ARHandle *handle)
Get the border size.
Definition arCreateHandle.c:368
void arSetMarkerExtractionMode(ARHandle *handle, int mode)
Set the marker extraction mode.
Definition arCreateHandle.c:337
ARdouble arGetSquareFitThresh(ARHandle *handle)
Definition arCreateHandle.c:498
int arGetDebugMode(ARHandle *handle)
Find out whether artoolkitX's debug mode is enabled.
Definition arCreateHandle.c:138
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.
Definition arCreateHandle.c:316
void arSetPattRatio(ARHandle *handle, const ARdouble pattRatio)
Set the width/height of the marker pattern space, as a proportion of marker width/height.
Definition arCreateHandle.c:375
void arSetLabelingThreshModeAutoInterval(ARHandle *handle, const int interval)
Set the number of frames between auto-threshold calculations.
Definition arCreateHandle.c:231
void arSetPatternDetectionMode(ARHandle *handle, int mode)
Set the pattern detection mode.
Definition arCreateHandle.c:298
int arGetMarkerExtractionMode(ARHandle *handle)
Get the marker extraction mode.
Definition arCreateHandle.c:353
int arGetLabelingThreshAutoAdaptiveKernelSize(ARHandle *handle)
Definition arCreateHandle.c:248
int arDeleteHandle(ARHandle *handle)
Delete a handle which holds settings for an artoolkitX tracker instance.
Definition arCreateHandle.c:102
int arGetPatternDetectionMode(ARHandle *handle)
Get the pattern detection mode.
Definition arCreateHandle.c:330
void arSetPixelFormat(ARHandle *handle, AR_PIXEL_FORMAT pixFormat)
Set the expected pixel format for video frames being passed to arDetectMarker.
Definition arCreateHandle.c:390
void arSetSquareFitThresh(ARHandle *handle, const ARdouble squareFitThresh)
Definition arCreateHandle.c:490
void arSetLabelingMode(ARHandle *handle, int mode)
Select between detection of black markers and white markers.
Definition arCreateHandle.c:145
void arSetLabelingThresh(ARHandle *handle, int thresh)
Set the labeling threshhold.
Definition arCreateHandle.c:167
void arSetAreaMin(ARHandle *handle, const ARdouble areaMin)
Definition arCreateHandle.c:475
void arSetBorderSize(ARHandle *handle, const ARdouble borderSize)
Set the border size.
Definition arCreateHandle.c:360
AR_MATRIX_CODE_TYPE arGetMatrixCodeType(ARHandle *handle)
Get the size and ECC algorithm being used for matrix code (2D barcode) marker detection.
Definition arCreateHandle.c:323
ARMarkerInfo * arGetMarker(ARHandle *handle)
Get information on the markers detected in a video frame.
Definition arCreateHandle.c:519
void arSetLabelingThreshAutoAdaptiveKernelSize(ARHandle *handle, const int labelingThreshAutoAdaptiveKernelSize)
Definition arCreateHandle.c:239
int arGetPixelFormat(ARHandle *handle)
Get the expected pixel format for video frames being passed to arDetectMarker.
Definition arCreateHandle.c:438
ARdouble arGetAreaMin(ARHandle *handle)
Definition arCreateHandle.c:483
ARdouble arGetPattRatio(ARHandle *handle)
Get the width/height of the marker pattern space, as a proportion of marker width/height.
Definition arCreateHandle.c:383
void arSetLabelingThreshMode(ARHandle *handle, const AR_LABELING_THRESH_MODE mode)
Set the labeling threshold mode (auto/manual).
Definition arCreateHandle.c:183
int arGetLabelingThreshAutoAdaptiveBias(ARHandle *handle)
Definition arCreateHandle.c:262
int arGetImageProcMode(ARHandle *handle)
Get the image processing mode.
Definition arCreateHandle.c:291
ARHandle * arCreateHandle(ARParamLT *paramLT)
Create a handle to hold settings for an artoolkitX tracker instance.
Definition arCreateHandle.c:53
int arGetContour(AR_LABELING_LABEL_TYPE *limage, int xsize, int ysize, int *label_ref, int label, int clip[4], ARMarkerInfo2 *marker_info2)
Definition arDetectMarker2.c:138
int arDetectMarker2(int xsize, int ysize, ARLabelInfo *labelInfo, int imageProcMode, int areaMax, int areaMin, ARdouble squareFitThresh, ARMarkerInfo2 *markerInfo2, int *marker2_num)
Definition arDetectMarker2.c:56
const char * arMarkerInfoCutoffPhaseDescriptions[AR_MARKER_INFO_CUTOFF_PHASE_DESCRIPTION_COUNT]
Definition arDetectMarker.c:47
int arDetectMarker(ARHandle *arHandle, AR2VideoBufferT *frame)
Detect markers in a video frame.
Definition arDetectMarker.c:62
int arGetLine(int x_coord[], int y_coord[], int coord_num, int vertex[], ARParamLTf *paramLTf, ARdouble line[4][3], ARdouble v[4][2])
Definition arGetLine.c:66
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.
Definition arGetMarkerInfo.c:51
ARdouble arGetTransMatSquareCont(AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble initConv[3][4], ARdouble width, ARdouble conv[3][4])
(description)
Definition arGetTransMat.c:101
ARdouble arGetTransMatSquare(AR3DHandle *handle, ARMarkerInfo *marker_info, ARdouble width, ARdouble conv[3][4])
(description)
Definition arGetTransMat.c:53
ARdouble arGetTransMatRobust(AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4])
(description)
Definition arGetTransMat.c:175
ARdouble arGetTransMat(AR3DHandle *handle, ARdouble initConv[3][4], ARdouble pos2d[][2], ARdouble pos3d[][3], int num, ARdouble conv[3][4])
(description)
Definition arGetTransMat.c:146
ARdouble arGetTransMatSquareContStereo(AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR, ARdouble prev_conv[3][4], ARdouble width, ARdouble conv[3][4])
Definition arGetTransMatStereo.c:153
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])
Definition arGetTransMatStereo.c:281
ARdouble arGetTransMatSquareStereo(AR3DStereoHandle *handle, ARMarkerInfo *marker_infoL, ARMarkerInfo *marker_infoR, ARdouble width, ARdouble conv[3][4])
Definition arGetTransMatStereo.c:55
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])
Definition arGetTransMatStereo.c:222
artoolkitX functions for 2D luminance image processing.
struct _ARImageProcInfo ARImageProcInfo
Definition arImageProc.h:80
int arLabeling(ARUint8 *imageLuma, int xsize, int ysize, int debugMode, int labelingMode, int labelingThresh, int imageProcMode, ARLabelInfo *labelInfo, ARUint8 *image_thresh)
Definition arLabeling.c:55
int arPattAttach(ARHandle *arHandle, ARPattHandle *arPattHandle)
Associate a set of patterns with an ARHandle.
Definition arPattAttach.c:51
int arPattDetach(ARHandle *arHandle)
Reset an ARHandle to no pattern association.
Definition arPattAttach.c:61
ARPattHandle * arPattCreateHandle2(const int pattSize, const int patternCountMax)
Allocate a pattern handle and set pattern template size and maximum number of patterns loadable.
Definition arPattCreateHandle.c:58
int arPattDeleteHandle(ARPattHandle *pattHandle)
Free all loaded patterns and pattern handle.
Definition arPattCreateHandle.c:88
ARPattHandle * arPattCreateHandle(void)
Allocate a pattern handle.
Definition arPattCreateHandle.c:53
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)
Definition arPattGetID.c:286
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.
Definition arPattGetID.c:1527
int arPattGetImage2(int imageProcMode, int pattDetectMode, int patt_size, int sample_size, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *paramLTf, 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.
Definition arPattGetID.c:841
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)
Definition arPattGetID.c:109
int arPattGetID2(ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *paramLTf, 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.
Definition arPattGetID.c:173
int arPattGetIDGlobal(ARPattHandle *pattHandle, int imageProcMode, int pattDetectMode, ARUint8 *image, int xsize, int ysize, AR_PIXEL_FORMAT pixelFormat, ARParamLTf *paramLTf, 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.
Definition arPattGetID.c:184
int arPattLoadFromBuffer(ARPattHandle *pattHandle, const char *buffer)
Definition arPattLoad.c:55
int arPattLoad(ARPattHandle *pattHandle, const char *filename)
Load a pattern file into a pattern handle.
Definition arPattLoad.c:144
int arPattFree(ARPattHandle *pattHandle, int patno)
Frees (unloads) a pattern file from memory.
Definition arPattLoad.c:160
int arPattActivate(ARPattHandle *pattHandle, int patno)
Activate a previously deactivated pattern.
Definition arPattLoad.c:170
int arPattDeactivate(ARPattHandle *pattHandle, int patno)
Deactivate a previously activated pattern.
Definition arPattLoad.c:179
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.
Definition arPattSave.c:42
int arUtilQuatPos2Mat(const ARdouble q[4], const ARdouble p[3], ARdouble m[3][4])
Definition arUtil.c:323
char * arUtilGetFileExtensionFromPath(const char *path, const int convertToLowercase)
Get file extension from a path.
Definition arUtil.c:500
int arUtilMatMulf(const float s1[3][4], const float s2[3][4], float d[3][4])
Definition arUtil.c:185
void arUtilPrintTransMat(const ARdouble trans[3][4])
Prints a transformation matrix via ARPRINT(...).
Definition arUtil.c:1411
int arUtilGetSquareCenter(ARdouble vertex[4][2], ARdouble *x, ARdouble *y)
Definition arUtil.c:125
int arUtilRemoveExt(char *filename)
Definition arUtil.c:1377
ARUint32 arGetVersion(char **versionStringRef)
Get the artoolkitX version information in numberic and string format.
Definition arUtil.c:102
int arUtilMatInvf(const float s[3][4], float d[3][4])
Definition arUtil.c:227
const char * arUtilGetPixelFormatName(const AR_PIXEL_FORMAT arPixelFormat)
Get a string holding a descriptive name for a given pixel format enumeration.
Definition arUtil.c:423
int arUtilMatMuldff(const ARdouble s1[3][4], const float s2[3][4], float d[3][4])
Definition arUtil.c:169
char * arUtilGetFileURI(const char *path)
Get a path as a file URI.
Definition arUtil.c:558
char * arUtilGetResourcesDirectoryPath(AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior)
Get the path to the resources directory using the specified behavior.
Definition arUtil.c:746
char * arUtilGetFileBasenameFromPath(const char *path, const int convertToLowercase)
Get file base name from a path.
Definition arUtil.c:469
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...
Definition arUtil.c:1274
int arUtilMatInv(const ARdouble s[3][4], ARdouble d[3][4])
Definition arUtil.c:202
int arUtilGetPixelSize(const AR_PIXEL_FORMAT arPixelFormat)
Get the size in bytes of a single pixel for a given pixel format.
Definition arUtil.c:394
int arUtilDivideExt(const char *filename, char *s1, char *s2)
Definition arUtil.c:1390
int arUtilQuatNorm(ARdouble q[4])
Definition arUtil.c:372
const char * arUtilGetFileNameFromPath(const char *path)
Definition arUtil.c:449
int arUtilReplaceExt(char *filename, int n, char *ext)
Definition arUtil.c:1355
char * arUtilGetDirectoryNameFromPath(char *dir, const char *path, const size_t n, const int addSeparator)
Definition arUtil.c:532
void arUtilPrintMtx16(const ARdouble mtx16[16])
Prints a 4x4 row-major matrix via ARPRINT(...).
Definition arUtil.c:1419
int arUtilChangeToResourcesDirectory(AR_UTIL_RESOURCES_DIRECTORY_BEHAVIOR behavior, const char *path)
Change to the resources directory using the specified behavior.
Definition arUtil.c:1303
int arUtilMat2QuatPos(const ARdouble m[3][4], ARdouble q[4], ARdouble p[3])
Definition arUtil.c:252
int arUtilMatMul(const ARdouble s1[3][4], const ARdouble s2[3][4], ARdouble d[3][4])
Definition arUtil.c:152
Logging utilities.
artoolkitX functions for handling calibrated camera parameters.
A structure which carries information about a video frame retrieved by the video library.
Definition ar.h:148
AR2VideoTimestampT time
Time at which buff was filled.
Definition ar.h:154
unsigned int bufPlaneCount
For multi-planar video frames, this is the number of frame planes. For single-plane formats,...
Definition ar.h:151
ARUint8 ** bufPlanes
For multi-planar video frames, this must be an array of length bufPlaneCount of (ARUint8*),...
Definition ar.h:150
int fillFlag
Set non-zero when buff is valid.
Definition ar.h:153
ARUint8 * buff
A pointer to the packed video data for this video frame. The video data pixel format is as specified ...
Definition ar.h:149
ARUint8 * buffLuma
A pointer to a luminance-only version of the image. For luminance-only video formats this pointer is ...
Definition ar.h:152
A structure to hold a timestamp in seconds and microseconds, with arbitrary epoch.
Definition ar.h:139
uint64_t sec
Definition ar.h:140
uint32_t usec
Definition ar.h:141
Structure holding state of an instance of the monocular pose estimator.
Definition ar.h:385
ICPHandleT * icpHandle
Definition ar.h:386
Structure holding state of an instance of the stereo pose estimator.
Definition ar.h:395
ICPStereoHandleT * icpStereoHandle
Definition ar.h:396
Structure holding state of an instance of the square marker tracker.
Definition ar.h:342
ARLabelInfo labelInfo
Definition ar.h:360
ARdouble areaMax
Definition ar.h:373
int arCornerRefinementMode
Definition ar.h:372
int arLabelingThreshAutoInterval
Definition ar.h:363
AR_MATRIX_CODE_TYPE matrixCodeType
When matrix code pattern detection mode is active, indicates the type of matrix code to detect.
Definition ar.h:371
AR_PIXEL_FORMAT arPixelFormat
Definition ar.h:344
ARImageProcInfo * arImageProcInfo
Definition ar.h:369
int arImageProcMode
To query this value, call arGetImageProcMode(). To set this value, call arSetImageProcMode().
Definition ar.h:348
int arLabelingThresh
Definition ar.h:347
ARMarkerInfo2 markerInfo2[AR_SQUARE_MAX]
Definition ar.h:357
int arPatternDetectionMode
Definition ar.h:349
int arLabelingThreshAutoBracketUnder
Definition ar.h:366
int arLabelingThreshAutoAdaptiveBias
Definition ar.h:368
ARdouble pattRatio
A value between 0.0 and 1.0, representing the proportion of the marker width which constitutes the pa...
Definition ar.h:370
int arPixelSize
Definition ar.h:345
int arLabelingThreshAutoAdaptiveKernelSize
Definition ar.h:367
ARParamLT * arParamLT
Definition ar.h:351
int marker2_num
Definition ar.h:356
int history_num
Definition ar.h:358
ARdouble areaMin
Definition ar.h:374
AR_LABELING_THRESH_MODE arLabelingThreshMode
Definition ar.h:362
int arLabelingMode
Definition ar.h:346
int arDebug
Definition ar.h:343
ARPattHandle * pattHandle
Definition ar.h:361
int xsize
Definition ar.h:352
ARTrackingHistory history[AR_SQUARE_MAX]
Definition ar.h:359
int ysize
Definition ar.h:353
int arMarkerExtractionMode
Definition ar.h:350
int arLabelingThreshAutoBracketOver
Definition ar.h:365
ARdouble squareFitThresh
Definition ar.h:375
ARMarkerInfo markerInfo[AR_SQUARE_MAX]
Definition ar.h:355
int marker_num
Definition ar.h:354
int arLabelingThreshAutoIntervalTTL
Definition ar.h:364
(description)
Definition ar.h:247
ARdouble pos[AR_LABELING_WORK_SIZE][2]
Definition ar.h:255
int work[AR_LABELING_WORK_SIZE]
Definition ar.h:256
ARUint8 * bwImage
Definition ar.h:250
int clip[AR_LABELING_WORK_SIZE][4]
Definition ar.h:254
int area[AR_LABELING_WORK_SIZE]
Definition ar.h:253
int label_num
Definition ar.h:252
AR_LABELING_LABEL_TYPE * labelImage
Definition ar.h:248
int work2[AR_LABELING_WORK_SIZE *7]
area, pos[2], clip[4].
Definition ar.h:257
Captures detail of a trapezoidal region which is a candidate for marker detection.
Definition ar.h:171
ARdouble pos[2]
Center.
Definition ar.h:173
int y_coord[AR_CHAIN_MAX]
Y values of coordinates.
Definition ar.h:176
int x_coord[AR_CHAIN_MAX]
X values of coordinates.
Definition ar.h:175
int area
Area in pixels.
Definition ar.h:172
int vertex[5]
Vertices.
Definition ar.h:177
int coord_num
Number of coordinates in x_coord, y_coord.
Definition ar.h:174
Describes a detected trapezoidal area (a candidate for a marker match).
Definition ar.h:213
int area
Area in pixels of the largest connected region, comprising the marker border and regions connected to...
Definition ar.h:214
ARMarkerInfo2 * markerInfo2Ptr
Pointer to source region info for this marker.
Definition ar.h:227
int dir
If pattern detection mode is either pattern mode OR matrix but not both, and id != -1,...
Definition ar.h:218
ARdouble cf
If pattern detection mode is either pattern mode OR matrix but not both, will be marker matching conf...
Definition ar.h:221
int dirMatrix
If pattern detection mode includes a matrix mode, and id != -1, will be marker direction (range 0 to ...
Definition ar.h:220
ARdouble vertex[4][2]
2D positions (in camera image coordinates, origin at top-left) of the corners of the marker....
Definition ar.h:226
int dirPatt
If pattern detection mode includes a pattern mode, and id != -1, will be marker direction (range 0 to...
Definition ar.h:219
ARdouble cfMatrix
If pattern detection mode includes a matrix mode, will be marker matching confidence (range 0....
Definition ar.h:223
int errorCorrected
For marker types including error detection and correction, the numbers of errors detected and correct...
Definition ar.h:229
ARdouble line[4][3]
Line equations for the 4 sides of the marker.
Definition ar.h:225
int id
If pattern detection mode is either pattern mode OR matrix but not both, will be marker ID (>= 0) if ...
Definition ar.h:215
int idPatt
If pattern detection mode includes a pattern mode, will be marker ID (>= 0) if marker is valid,...
Definition ar.h:216
int idMatrix
If pattern detection mode includes a matrix mode, will be marker ID (>= 0) if marker is valid,...
Definition ar.h:217
int matched
Initialised to 0 during marker detection, a non-zero value indicates that this marker has already bee...
Definition ar.h:231
ARdouble pos[2]
2D position (in camera image coordinates, origin at top-left) of the centre of the marker.
Definition ar.h:224
AR_MARKER_INFO_CUTOFF_PHASE cutoffPhase
If a trapezoidal region is detected, but is eliminated from the candidates for tracking,...
Definition ar.h:228
uint64_t globalID
If arPattDetectionMode is a matrix mode, matrixCodeType is AR_MATRIX_CODE_GLOBAL_ID,...
Definition ar.h:230
ARdouble cfPatt
If pattern detection mode includes a pattern mode, will be marker matching confidence (range 0....
Definition ar.h:222
Structure holding camera parameters, including image size, projection matrix and lens distortion para...
Definition param.h:99
Structure holding camera parameters, in lookup table form.
Definition param.h:151
Structure holding camera parameters, in lookup table form; floating point version.
Definition param.h:120
A structure which holds descriptions of trained patterns for template matching.
Definition ar.h:268
ARdouble * pattpow
Root-mean-square of the pattern intensities.
Definition ar.h:273
int patt_num
Number of valid patterns in the structure.
Definition ar.h:269
int pattSize
Number of rows/columns in the pattern.
Definition ar.h:277
int ** patt
Array of 4 different orientations of each pattern's colour values, in 1-byte per component BGR order.
Definition ar.h:272
int ** pattBW
Array of 4 different orientations of each pattern's 1-byte luminosity values.
Definition ar.h:274
ARdouble * pattpowBW
Root-mean-square of the pattern intensities.
Definition ar.h:275
int * pattf
0 = no pattern loaded at this position. 1 = pattern loaded and activated. 2 = pattern loaded but deac...
Definition ar.h:271
int patt_num_max
Maximum number of patterns that may be loaded in this structure.
Definition ar.h:270
Defines a pattern rectangle as a sub-portion of a marker image.
Definition ar.h:286
float bottomRightX
Horizontal coordinate of the bottom right corner of the pattern space, in range 0....
Definition ar.h:289
float bottomRightY
Vertical coordinate of the bottom right corner of the pattern space, in range 0.0f-1....
Definition ar.h:290
float topLeftY
Vertical coordinate of the top left corner of the pattern space, in range 0.0f-1.0f.
Definition ar.h:288
float topLeftX
Horizontal coordinate of the top left corner of the pattern space, in range 0.0f-1....
Definition ar.h:287
(description)
Definition ar.h:238
int count
Definition ar.h:240
ARMarkerInfo marker
Definition ar.h:239
Definition icp.h:75
Definition icp.h:84