#include <TrackerSingleMarker.h>
Public Member Functions | |
TrackerSingleMarker (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, ARFloat nNearClip, ARFloat nFarClip) |
virtual int | addPattern (const char *nFileName) |
virtual vector< int > | calc (const uint8_t *nImage, ARMarkerInfo **nMarker_info=NULL, int *nNumMarkers=NULL) |
virtual void | selectDetectedMarker (const int id) |
virtual int | selectBestMarkerByCf () |
virtual void | setPatternWidth (ARFloat nWidth) |
virtual void | getARMatrix (ARFloat nMatrix[3][4]) const |
virtual float | getConfidence () const |
Defines a simple interface for single-marker tracking with ARToolKitPlus ARToolKitPlus::TrackerSingleMarker provides all methods to access ARToolKit for single marker tracking without needing to mess around with it low level methods directly.
Per default the tracker searches for Id-based markers with normal border and uses the RPP algorithm for pose estimation. You can override this using the according methods.
If you need multi-marker tracking use TrackerMultiMarker.
ARToolKitPlus::TrackerSingleMarker::TrackerSingleMarker | ( | 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::TrackerSingleMarker::addPattern | ( | const char * | nFileName | ) | [virtual] |
adds a pattern to ARToolKit pass the patterns filename
virtual vector<int> ARToolKitPlus::TrackerSingleMarker::calc | ( | const uint8_t * | nImage, | |
ARMarkerInfo ** | nMarker_info = NULL , |
|||
int * | nNumMarkers = NULL | |||
) | [virtual] |
calculates the transformation matrix pass the image as RGBX (32-bits)
virtual void ARToolKitPlus::TrackerSingleMarker::getARMatrix | ( | ARFloat | nMatrix[3][4] | ) | const [virtual] |
Provides access to ARToolKit' patt_trans matrix This method is primarily for compatibility issues with code previously using ARToolKit rather than ARToolKitPlus. patt_trans is the original transformation matrix ARToolKit calculates rather than the OpenGL style version of this matrix that can be retrieved via getModelViewMatrix().
virtual float ARToolKitPlus::TrackerSingleMarker::getConfidence | ( | ) | const [inline, virtual] |
Returns the confidence value of the currently best detected marker.
virtual bool ARToolKitPlus::TrackerSingleMarker::init | ( | const char * | nCamParamFile, | |
ARFloat | nNearClip, | |||
ARFloat | nFarClip | |||
) | [virtual] |
initializes TrackerSingleMarker nCamParamFile is the name of the camera parameter file nLogger is an instance which implements the ARToolKit::Logger interface
virtual int ARToolKitPlus::TrackerSingleMarker::selectBestMarkerByCf | ( | ) | [virtual] |
Select the best marker based on Confidence
virtual void ARToolKitPlus::TrackerSingleMarker::selectDetectedMarker | ( | const int | id | ) | [virtual] |
manually select one of the detected markers instead of using the best one
virtual void ARToolKitPlus::TrackerSingleMarker::setPatternWidth | ( | ARFloat | nWidth | ) | [inline, virtual] |
Sets the width and height of the patterns in OpenGL units defaults to 2.0, so the unity cube fits the marker surface