ARToolKitPlus  Version 2.2
Public Member Functions | List of all members
ARToolKitPlus::TrackerSingleMarker Class Reference

#include <TrackerSingleMarker.h>

Inheritance diagram for ARToolKitPlus::TrackerSingleMarker:
ARToolKitPlus::Tracker

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 std::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
 
- 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 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.

Constructor & Destructor Documentation

◆ TrackerSingleMarker()

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

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

◆ addPattern()

virtual int ARToolKitPlus::TrackerSingleMarker::addPattern ( const char *  nFileName)
virtual

adds a pattern to ARToolKit pass the patterns filename

◆ calc()

virtual std::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)

Returns
detected markers in image

◆ getARMatrix()

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().

◆ getConfidence()

virtual float ARToolKitPlus::TrackerSingleMarker::getConfidence ( ) const
inlinevirtual

Returns the confidence value of the currently best detected marker.

◆ init()

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

initializes TrackerSingleMarker

Parameters
nCamParamFileis the name of the camera parameter file

◆ selectBestMarkerByCf()

virtual int ARToolKitPlus::TrackerSingleMarker::selectBestMarkerByCf ( )
virtual

Select the best marker based on Confidence

◆ selectDetectedMarker()

virtual void ARToolKitPlus::TrackerSingleMarker::selectDetectedMarker ( const int  id)
virtual

manually select one of the detected markers instead of using the best one

◆ setPatternWidth()

virtual void ARToolKitPlus::TrackerSingleMarker::setPatternWidth ( ARFloat  nWidth)
inlinevirtual

Sets the width and height of the patterns in OpenGL units defaults to 2.0, so the unity cube fits the marker surface


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