#include <TrackerMultiMarker.h>
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 *nCamParamFile, const char *nMultiFile, ARFloat nNearClip, ARFloat nFarClip) |
virtual int | calc (const unsigned char *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 |
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.
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
imWidth | width of the source image in px | |
imHeight | height of the source image in px | |
maxImagePatterns | describes the maximum number of patterns that can be analyzed in a camera image. | |
pattWidth | describes the pattern image width (must be 6 for binary markers) | |
pattHeight | describes the pattern image height (must be 6 for binary markers) | |
pattSamples | describes the maximum resolution at which a pattern is sampled from the camera image (6 by default, must a a multiple of pattWidth and pattHeight). | |
maxLoadPatterns | describes the maximum number of pattern files that can be loaded. Reduce maxLoadPatterns and maxImagePatterns to reduce memory footprint. |
virtual int ARToolKitPlus::TrackerMultiMarker::calc | ( | const unsigned char * | nImage | ) | [virtual] |
calculates the transformation matrix pass the image as RGBX (32-bits)
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().
virtual void ARToolKitPlus::TrackerMultiMarker::getDetectedMarkers | ( | int *& | nMarkerIDs | ) | [virtual] |
Returns array of detected marker IDs Only access the first getNumDetectedMarkers() markers
virtual const ARMultiMarkerInfoT* ARToolKitPlus::TrackerMultiMarker::getMultiMarkerConfig | ( | ) | const [inline, virtual] |
Returns the loaded ARMultiMarkerInfoT object If loading the multi-marker config file failed then this method returns NULL.
virtual bool ARToolKitPlus::TrackerMultiMarker::init | ( | const char * | nCamParamFile, | |
const char * | 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
virtual void ARToolKitPlus::TrackerMultiMarker::setUseDetectLite | ( | bool | nEnable | ) | [inline, virtual] |
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.