ARToolKitPlus Version 2.2
ARToolKitPlus::TrackerMultiMarker Class Reference

#include <TrackerMultiMarker.h>

Inheritance diagram for ARToolKitPlus::TrackerMultiMarker:
ARToolKitPlus::Tracker

Public Member Functions

 TrackerMultiMarker (int imWidth, int imHeight, int maxImagePatterns=8, int pattWidth=6, int pattHeight=6, int pattSamples=6, int maxLoadPatterns=0)
 
virtual bool init (const char *const nCamParamFile, const char *const nMultiFile, ARFloat nNearClip, ARFloat nFarClip)
 
virtual int calc (const uint8_t *nImage)
 
virtual void setUseDetectLite (bool nEnable)
 Enables usage of arDetectMarkerLite. Otherwise arDetectMarker is used.
 
virtual void getDetectedMarkers (int *&nMarkerIDs)
 
virtual const ARMultiMarkerInfoT * getMultiMarkerConfig () const
 
virtual void getARMatrix (ARFloat nMatrix[3][4]) const
 
- Public Member Functions inherited from ARToolKitPlus::Tracker
virtual bool setPixelFormat (PIXEL_FORMAT nFormat)
 
virtual bool loadCameraFile (const char *nCamParamFile, ARFloat nNearClip, ARFloat nFarClip)
 
virtual void setLoadUndistLUT (bool nSet)
 
virtual int arDetectMarker (const uint8_t *dataPtr, int thresh, ARMarkerInfo **marker_info, int *marker_num)
 marker detection using tracking history
 
virtual int arDetectMarkerLite (const uint8_t *dataPtr, int thresh, ARMarkerInfo **marker_info, int *marker_num)
 marker detection without using tracking history
 
virtual ARFloat arMultiGetTransMat (ARMarkerInfo *marker_info, int marker_num, ARMultiMarkerInfoT *config)
 calculates the transformation matrix between camera and the given multi-marker config
 
virtual ARFloat arGetTransMat (ARMarkerInfo *marker_info, ARFloat center[2], ARFloat width, ARFloat conv[3][4])
 calculates the transformation matrix between camera and the given marker
 
virtual int arLoadPatt (char *filename)
 loads a pattern from a file
 
virtual int arFreePatt (int patno)
 frees a pattern from memory
 
virtual void activateBinaryMarker (int nThreshold)
 
virtual void setMarkerMode (MARKER_MODE nMarkerMode)
 
virtual void activateVignettingCompensation (bool nEnable, int nCorners=0, int nLeftRight=0, int nTopBottom=0)
 
virtual void changeCameraSize (int nWidth, int nHeight)
 Changes the resolution of the camera after the camerafile was already loaded.
 
virtual void setUndistortionMode (UNDIST_MODE nMode)
 
virtual bool setPoseEstimator (POSE_ESTIMATOR nMethod)
 
virtual void setHullMode (HULL_TRACKING_MODE nMode)
 
virtual void setBorderWidth (ARFloat nFraction)
 
virtual void setThreshold (int nValue)
 Sets the threshold value that is used for black/white conversion.
 
virtual int getThreshold () const
 Returns the current threshold value.
 
virtual void activateAutoThreshold (bool nEnable)
 Turns automatic threshold calculation on/off.
 
virtual bool isAutoThresholdActivated () const
 Returns true if automatic threshold detection is enabled.
 
virtual void setNumAutoThresholdRetries (int nNumRetries)
 
virtual void setImageProcessingMode (IMAGE_PROC_MODE nMode)
 
virtual const ARFloat * getModelViewMatrix () const
 Returns an opengl-style modelview transformation matrix.
 
virtual const ARFloat * getProjectionMatrix () const
 Returns an opengl-style projection transformation matrix.
 
virtual PIXEL_FORMAT getPixelFormat () const
 Returns the compiled-in pixel format.
 
virtual int getBitsPerPixel () const
 Returns the numbber of bits per pixel for the compiled-in pixel format.
 
virtual int getNumLoadablePatterns () const
 
virtual CameragetCamera ()
 Returns the current camera.
 
virtual void setCamera (Camera *nCamera)
 Sets a new camera without specifying new near and far clip values.
 
virtual void setCamera (Camera *nCamera, ARFloat nNearClip, ARFloat nFarClip)
 Sets a new camera including specifying new near and far clip values.
 
virtual ARFloat calcOpenGLMatrixFromMarker (ARMarkerInfo *nMarkerInfo, ARFloat nPatternCenter[2], ARFloat nPatternSize, ARFloat *nOpenGLMatrix)
 Calculates the OpenGL transformation matrix for a specific marker info.
 
virtual ARFloat executeSingleMarkerPoseEstimator (ARMarkerInfo *marker_info, ARFloat center[2], ARFloat width, ARFloat conv[3][4])
 Calls the pose estimator set with setPoseEstimator() for single marker tracking.
 
virtual ARFloat executeMultiMarkerPoseEstimator (ARMarkerInfo *marker_info, int marker_num, ARMultiMarkerInfoT *config)
 Calls the pose estimator set with setPoseEstimator() for multi marker tracking.
 

Additional Inherited Members

- Static Public Member Functions inherited from ARToolKitPlus::Tracker
static bool calcCameraMatrix (const char *nCamParamFile, ARFloat nNear, ARFloat nFar, ARFloat *nMatrix)
 

Detailed Description

Defines a simple interface for multi-marker tracking with ARToolKitPlus ARToolKit::TrackerMultiMarker provides all methods to access ARToolKit for multi marker tracking without needing to mess around with it directly.

Per default the tracker searches for Id-based markers with normal border and uses the RPP algorithm for pose estimation. Furthermore it uses only 4 'good' points of the convex hull to do the pose estimation. You can override this using the according methods.

Constructor & Destructor Documentation

◆ TrackerMultiMarker()

ARToolKitPlus::TrackerMultiMarker::TrackerMultiMarker ( int imWidth,
int imHeight,
int maxImagePatterns = 8,
int pattWidth = 6,
int pattHeight = 6,
int pattSamples = 6,
int maxLoadPatterns = 0 )

These parameters control the way the toolkit warps a found marker to a perfect square. The square has size pattWidth * pattHeight, the projected square in the image is subsampled at a min of pattWidth/pattHeight and a max of pattSamples steps in both x and y direction

Parameters
imWidthwidth of the source image in px
imHeightheight of the source image in px
maxImagePatternsdescribes the maximum number of patterns that can be analyzed in a camera image.
pattWidthdescribes the pattern image width (must be 6 for binary markers)
pattHeightdescribes the pattern image height (must be 6 for binary markers)
pattSamplesdescribes the maximum resolution at which a pattern is sampled from the camera image (6 by default, must a a multiple of pattWidth and pattHeight).
maxLoadPatternsdescribes the maximum number of pattern files that can be loaded. Reduce maxLoadPatterns and maxImagePatterns to reduce memory footprint.

Member Function Documentation

◆ calc()

virtual int ARToolKitPlus::TrackerMultiMarker::calc ( const uint8_t * nImage)
virtual

calculates the transformation matrix pass the image as RGBX (32-bits)

◆ getARMatrix()

virtual void ARToolKitPlus::TrackerMultiMarker::getARMatrix ( ARFloat nMatrix[3][4]) const
virtual

Provides access to ARToolKit' internal version of the transformation matrix This method is primarily for compatibility issues with code previously using ARToolKit rather than ARToolKitPlus. This is the original transformation matrix ARToolKit calculates rather than the OpenGL style version of this matrix that can be retrieved via getModelViewMatrix().

◆ getDetectedMarkers()

virtual void ARToolKitPlus::TrackerMultiMarker::getDetectedMarkers ( int *& nMarkerIDs)
virtual

Returns array of detected marker IDs Only access the first getNumDetectedMarkers() markers

◆ getMultiMarkerConfig()

virtual const ARMultiMarkerInfoT * ARToolKitPlus::TrackerMultiMarker::getMultiMarkerConfig ( ) const
inlinevirtual

Returns the loaded ARMultiMarkerInfoT object If loading the multi-marker config file failed then this method returns NULL.

◆ init()

virtual bool ARToolKitPlus::TrackerMultiMarker::init ( const char *const nCamParamFile,
const char *const nMultiFile,
ARFloat nNearClip,
ARFloat nFarClip )
virtual

initializes ARToolKit nCamParamFile is the name of the camera parameter file nNearClip & nFarClip are near and far clipping values for the OpenGL projection matrix nLogger is an instance which implements the ARToolKit::Logger interface

◆ setUseDetectLite()

virtual void ARToolKitPlus::TrackerMultiMarker::setUseDetectLite ( bool nEnable)
inlinevirtual

Enables usage of arDetectMarkerLite. Otherwise arDetectMarker is used.

Enables usage of arDetectMarkerLite. Otherwise arDetectMarker is used In general arDetectMarker is more powerful since it keeps history about markers. In some cases such as very low camera refresh rates it is advantegous to change this. Using the non-lite version treats each image independent.


The documentation for this class was generated from the following file: