Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
alvar::MarkerDetectorImpl Class Referenceabstract

Templateless version of MarkerDetector. Please use MarkerDetector instead. More...

#include <MarkerDetector.h>

Inheritance diagram for alvar::MarkerDetectorImpl:
Inheritance graph
[legend]

Public Member Functions

int Detect (IplImage *image, Camera *cam, bool track=false, bool visualize=false, double max_new_marker_error=0.08, double max_track_error=0.2, LabelingMethod labeling_method=CVSEQ, bool update_pose=true)
 Detect Marker 's from image More...
 
int DetectAdditional (IplImage *image, Camera *cam, bool visualize=false, double max_track_error=0.2)
 
void SetMarkerSize (double _edge_length=1, int _res=5, double _margin=2)
 
void SetMarkerSizeForId (unsigned long id, double _edge_length=1)
 
void SetOptions (bool _detect_pose_grayscale=false)
 
void TrackMarkerAdd (int id, PointDouble corners[4])
 Add markers to be tracked Sometimes application or e.g. the MultiMarker implementation knows more about marker locations. Then this method can be used after Detect to indicate where additional trackable markers could be found. The DetectAdditional is called for tracking these. More...
 
void TrackMarkersReset ()
 Clear the markers that are tracked. More...
 

Protected Member Functions

virtual void _markers_clear ()=0
 
virtual void _markers_push_back (Marker *mn)=0
 
virtual size_t _markers_size ()=0
 
virtual void _swap_marker_tables ()=0
 
virtual Marker_track_markers_at (size_t i)=0
 
virtual void _track_markers_clear ()=0
 
virtual void _track_markers_push_back (Marker *mn)=0
 
virtual size_t _track_markers_size ()=0
 
 MarkerDetectorImpl ()
 
virtual Markernew_M (double _edge_length=0, int _res=0, double _margin=0)=0
 
virtual ~MarkerDetectorImpl ()
 

Protected Attributes

bool detect_pose_grayscale
 
double edge_length
 
Labelinglabeling
 
std::map< unsigned long, double > map_edge_length
 
double margin
 
int res
 

Detailed Description

Templateless version of MarkerDetector. Please use MarkerDetector instead.

Definition at line 54 of file MarkerDetector.h.

Constructor & Destructor Documentation

alvar::MarkerDetectorImpl::MarkerDetectorImpl ( )
protected

Definition at line 33 of file MarkerDetector.cpp.

alvar::MarkerDetectorImpl::~MarkerDetectorImpl ( )
protectedvirtual

Definition at line 39 of file MarkerDetector.cpp.

Member Function Documentation

virtual void alvar::MarkerDetectorImpl::_markers_clear ( )
protectedpure virtual
virtual void alvar::MarkerDetectorImpl::_markers_push_back ( Marker mn)
protectedpure virtual
virtual size_t alvar::MarkerDetectorImpl::_markers_size ( )
protectedpure virtual
virtual void alvar::MarkerDetectorImpl::_swap_marker_tables ( )
protectedpure virtual
virtual Marker* alvar::MarkerDetectorImpl::_track_markers_at ( size_t  i)
protectedpure virtual
virtual void alvar::MarkerDetectorImpl::_track_markers_clear ( )
protectedpure virtual
virtual void alvar::MarkerDetectorImpl::_track_markers_push_back ( Marker mn)
protectedpure virtual
virtual size_t alvar::MarkerDetectorImpl::_track_markers_size ( )
protectedpure virtual
int alvar::MarkerDetectorImpl::Detect ( IplImage *  image,
Camera cam,
bool  track = false,
bool  visualize = false,
double  max_new_marker_error = 0.08,
double  max_track_error = 0.2,
LabelingMethod  labeling_method = CVSEQ,
bool  update_pose = true 
)

Detect Marker 's from image

The coordinates are little tricky. Here is a short summary.

  • Image (top-left origin).
  • The marker corners in the image are searched in sub-pixel accuracy in counter-clockwise order starting from "lower-left" corner.
  • The corresponding marker corners and marker points are in marker coordinates (x is to east, y is to north, and z is up from the marker)
  • The marker points are read from inside the margins starting from top-left and reading the bits first left-to-right one line at a time.

Definition at line 78 of file MarkerDetector.cpp.

int alvar::MarkerDetectorImpl::DetectAdditional ( IplImage *  image,
Camera cam,
bool  visualize = false,
double  max_track_error = 0.2 
)

Definition at line 168 of file MarkerDetector.cpp.

virtual Marker* alvar::MarkerDetectorImpl::new_M ( double  _edge_length = 0,
int  _res = 0,
double  _margin = 0 
)
protectedpure virtual
void alvar::MarkerDetectorImpl::SetMarkerSize ( double  _edge_length = 1,
int  _res = 5,
double  _margin = 2 
)

Set the default marker size to be used for all markers unless

Parameters
_edge_lengthLength of the marker's edge in whatever units you are using (e.g. cm)
_resThe marker content resolution in pixels. By default we use 5x5 markers. If you use 0 with MarkerData, the marker resolution is detected automatically.
_marginThe marker margin resolution in pixels (The actual captured marker image has pixel resolution of _margin+_res+_margin)
Note
The default marker content resolution (_res) of 5 can only detect marker ids from 0 to 255. For larger marker ids, you need to increase the marker content resolution accordingly.

Definition at line 63 of file MarkerDetector.cpp.

void alvar::MarkerDetectorImpl::SetMarkerSizeForId ( unsigned long  id,
double  _edge_length = 1 
)

Set marker size for specified marker id. This needs to be called after setting the default marker size.

Parameters
idThe specified marker id
_edge_lengthLength of the marker's edge in whatever units you are using (e.g. cm)

Definition at line 70 of file MarkerDetector.cpp.

void alvar::MarkerDetectorImpl::SetOptions ( bool  _detect_pose_grayscale = false)

Set marker size for specified marker id. This needs to be called after setting the default marker size.

Parameters
_detect_pose_grayscaleDo we detect marker pose using grayscale optimization?

Definition at line 74 of file MarkerDetector.cpp.

void alvar::MarkerDetectorImpl::TrackMarkerAdd ( int  id,
PointDouble  corners[4] 
)

Add markers to be tracked Sometimes application or e.g. the MultiMarker implementation knows more about marker locations. Then this method can be used after Detect to indicate where additional trackable markers could be found. The DetectAdditional is called for tracking these.

Definition at line 47 of file MarkerDetector.cpp.

void alvar::MarkerDetectorImpl::TrackMarkersReset ( )

Clear the markers that are tracked.

Definition at line 43 of file MarkerDetector.cpp.

Member Data Documentation

bool alvar::MarkerDetectorImpl::detect_pose_grayscale
protected

Definition at line 72 of file MarkerDetector.h.

double alvar::MarkerDetectorImpl::edge_length
protected

Definition at line 69 of file MarkerDetector.h.

Labeling* alvar::MarkerDetectorImpl::labeling
protected

Definition at line 66 of file MarkerDetector.h.

std::map<unsigned long, double> alvar::MarkerDetectorImpl::map_edge_length
protected

Definition at line 68 of file MarkerDetector.h.

double alvar::MarkerDetectorImpl::margin
protected

Definition at line 71 of file MarkerDetector.h.

int alvar::MarkerDetectorImpl::res
protected

Definition at line 70 of file MarkerDetector.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Thu Jun 6 2019 19:27:24