![]() |
ARX
1.0
The next-generation open source augmented reality toolkit.
|
#include <ARX/AR/ar.h>
#include <stdio.h>
#include <math.h>
#include <stdint.h>
#include <stdbool.h>
Macros | |
#define | MAX(x, y) (x > y ? x : y) |
#define | MIN(x, y) (x < y ? x : y) |
#define | CLAMP(x, r1, r2) (MIN(MAX(x,r1),r2)) |
#define | SQRT sqrt |
#define | _100_0 100.0 |
#define | _30_0 30.0 |
#define | _10_0 10.0 |
#define | _2_0 2.0 |
#define | SQRT_3_0 1.7320508 |
#define | _1_0 1.0 |
#define | _0_5 0.5 |
#define | _0_0 0.0 |
#define | AR_GLOBAL_ID_OUTER_SIZE 14 |
#define | AR_GLOBAL_ID_INNER_SIZE 3 |
Functions | |
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) |
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. More... | |
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. More... | |
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) |
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. More... | |
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... | |
Variables | |
const signed char | hamming63DecoderTable [64] |
const bool | hamming63DecoderTableErrorCorrected [64] |
const signed char | parity65DecoderTable [64] |
#define _0_0 0.0 |
#define _0_5 0.5 |
#define _100_0 100.0 |
#define _10_0 10.0 |
#define _1_0 1.0 |
#define _2_0 2.0 |
#define _30_0 30.0 |
#define AR_GLOBAL_ID_INNER_SIZE 3 |
#define AR_GLOBAL_ID_OUTER_SIZE 14 |
#define MAX | ( | x, | |
y | |||
) | (x > y ? x : y) |
#define MIN | ( | x, | |
y | |||
) | (x < y ? x : y) |
#define SQRT sqrt |
#define SQRT_3_0 1.7320508 |
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 | ||
) |
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. |
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. |
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 | ||
) |
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. |
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. |
const signed char hamming63DecoderTable[64] |
const bool hamming63DecoderTableErrorCorrected[64] |
const signed char parity65DecoderTable[64] |