Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes
alvar::Marker Class Reference

Basic 2D Marker functionality. More...

#include <Marker.h>

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

List of all members.

Public Member Functions

void CompareContent (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam, int *orientation) const
 Compares the marker corners with the previous match.
void CompareCorners (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, int *orientation, double *error)
 Compares the marker corners with the previous match.
virtual bool DecodeContent (int *orientation)
 Decodes the marker content. Please call UpdateContent before this. This virtual method is meant to be implemented by heirs.
CvMat * GetContent () const
 Returns the content as a matrix.
double GetError (int errors=(MARGIN_ERROR|DECODE_ERROR)) const
 Get marker detection error estimate.
virtual unsigned long GetId () const
 Get id for this marker This is used e.g. in MarkerDetector to associate a marker id with an appropriate edge length. This method should be overwritten to return a suitable identification number for each marker type.
double GetMargin () const
double GetMarkerEdgeLength () const
 Get edge length (to support different size markers.
int GetRes () const
 Marker (double _edge_length=0, int _res=0, double _margin=0)
 Default constructor.
 Marker (const Marker &m)
 Copy constructor.
void SaveMarkerImage (const char *filename, int save_res=0) const
 Saves the marker as an image.
void ScaleMarkerToImage (IplImage *image) const
 Draw the marker filling the ROI in the given image.
void SetError (int error_type, double value)
 Set the marker error estimate.
virtual void SetId (unsigned long _id)
void SetMarkerSize (double _edge_length=0, int _res=0, double _margin=0)
 Method for resizing the marker dimensions.
virtual bool UpdateContent (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam, int frame_no=0)
 Updates the marker_content from the image using Homography.
void UpdatePose (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, Camera *cam, int orientation, int frame_no=0, bool update_pose=true)
 Updates the markers pose estimation.
void Visualize (IplImage *image, Camera *cam, CvScalar color=CV_RGB(255, 0, 0)) const
 Visualize the marker.
 ~Marker ()
 Destructor.

Public Attributes

std::vector< PointDoublemarker_corners
 Marker corners in marker coordinates.
std::vector< PointDoublemarker_corners_img
 Marker corners in image coordinates.
std::vector< PointDoublemarker_margin_b
 Samples to be used in figuring out min/max for thresholding.
std::vector< PointDoublemarker_margin_w
 Samples to be used in figuring out min/max for thresholding.
std::vector< PointDoublemarker_points
 Marker color points in marker coordinates.
Pose pose
 The current marker Pose.
ar_track_alvar::ARCloud ros_corners_3D
std::vector< PointDoubleros_marker_points_img
 Marker points in image coordinates.
int ros_orientation
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
bool 
valid

Static Public Attributes

static const int DECODE_ERROR = 2
static const int MARGIN_ERROR = 1
static const int TRACK_ERROR = 4

Protected Member Functions

bool UpdateContentBasic (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam, int frame_no=0)
virtual void VisualizeMarkerContent (IplImage *image, Camera *cam, double datatext_point[2], double content_point[2]) const
virtual void VisualizeMarkerError (IplImage *image, Camera *cam, double errortext_point[2]) const
void VisualizeMarkerPose (IplImage *image, Camera *cam, double visualize2d_points[12][2], CvScalar color=CV_RGB(255, 0, 0)) const

Protected Attributes

double decode_error
double edge_length
double margin
double margin_error
CvMat * marker_content
int res
double track_error

Detailed Description

Basic 2D Marker functionality.

This class contains the basic Marker functionality for planar markers.

Examples:
SampleMultiMarker.cpp, and SampleMultiMarkerBundle.cpp.

Definition at line 51 of file Marker.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 515 of file Marker.cpp.

alvar::Marker::Marker ( double  _edge_length = 0,
int  _res = 0,
double  _margin = 0 
)

Default constructor.

Parameters:
_edge_lengthLength of the marker's edge in whatever units you are using (e.g. cm)
_resThe marker content resolution in pixels (this is actually
_marginThe marker margin resolution in pixels (The actual captured marker image has pixel resolution of _margin+_res+_margin)

Definition at line 518 of file Marker.cpp.

alvar::Marker::Marker ( const Marker m)

Copy constructor.

Definition at line 529 of file Marker.cpp.


Member Function Documentation

void alvar::Marker::CompareContent ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
IplImage *  gray,
Camera cam,
int *  orientation 
) const

Compares the marker corners with the previous match.

Definition at line 178 of file Marker.cpp.

void alvar::Marker::CompareCorners ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
int *  orientation,
double *  error 
)

Compares the marker corners with the previous match.

In some cases the tracking of the marker can be accepted solely based on this. Returns the marker orientation and an error value describing the pixel error relative to the marker diameter.

Definition at line 163 of file Marker.cpp.

bool alvar::Marker::DecodeContent ( int *  orientation) [virtual]

Decodes the marker content. Please call UpdateContent before this. This virtual method is meant to be implemented by heirs.

Reimplemented in alvar::MarkerData, and alvar::MarkerArtoolkit.

Definition at line 316 of file Marker.cpp.

CvMat* alvar::Marker::GetContent ( ) const [inline]

Returns the content as a matrix.

Definition at line 86 of file Marker.h.

double alvar::Marker::GetError ( int  errors = (MARGIN_ERROR | DECODE_ERROR)) const [inline]

Get marker detection error estimate.

Parameters:
errorsFlags indicating what error elements are combined The marker detection error can consist of several elements: MARGIN_ERROR is updated in UpdateContent and it indicates erroneous values inside the marginal area. DECODE_ERROR is updated in DecodeContent and it indicates erroneous values inside the actual marker content area. TRACK_ERROR is updated in MarkerDetector.Detect and it indicates the amount of tracking error returned from CompareCorners

Definition at line 143 of file Marker.h.

virtual unsigned long alvar::Marker::GetId ( ) const [inline, virtual]

Get id for this marker This is used e.g. in MarkerDetector to associate a marker id with an appropriate edge length. This method should be overwritten to return a suitable identification number for each marker type.

Reimplemented in alvar::MarkerData, alvar::MarkerArtoolkit, and alvar::MultiMarkerInitializer::MarkerMeasurement.

Definition at line 117 of file Marker.h.

double alvar::Marker::GetMargin ( ) const [inline]

Returns the margin thickness, that is, the number of rows or columns of black squares surrounding the content area.

Definition at line 131 of file Marker.h.

double alvar::Marker::GetMarkerEdgeLength ( ) const [inline]

Get edge length (to support different size markers.

Definition at line 101 of file Marker.h.

int alvar::Marker::GetRes ( ) const [inline]

Returns the resolution (the number of square rows and columns) of the marker content area. The total number of content squares within the content area is resolution*resolution.

Definition at line 125 of file Marker.h.

void alvar::Marker::SaveMarkerImage ( const char *  filename,
int  save_res = 0 
) const

Saves the marker as an image.

Definition at line 322 of file Marker.cpp.

void alvar::Marker::ScaleMarkerToImage ( IplImage *  image) const

Draw the marker filling the ROI in the given image.

Examples:
SampleMarkerCreator.cpp.

Definition at line 342 of file Marker.cpp.

void alvar::Marker::SetError ( int  error_type,
double  value 
) [inline]

Set the marker error estimate.

Definition at line 152 of file Marker.h.

virtual void alvar::Marker::SetId ( unsigned long  _id) [inline, virtual]
void alvar::Marker::SetMarkerSize ( double  _edge_length = 0,
int  _res = 0,
double  _margin = 0 
)

Method for resizing the marker dimensions.

Examples:
SampleMultiMarker.cpp, and SampleMultiMarkerBundle.cpp.

Definition at line 356 of file Marker.cpp.

bool alvar::Marker::UpdateContent ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
IplImage *  gray,
Camera cam,
int  frame_no = 0 
) [virtual]

Updates the marker_content from the image using Homography.

Reimplemented in alvar::MarkerData.

Definition at line 184 of file Marker.cpp.

bool alvar::Marker::UpdateContentBasic ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
IplImage *  gray,
Camera cam,
int  frame_no = 0 
) [protected]

Definition at line 188 of file Marker.cpp.

void alvar::Marker::UpdatePose ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
Camera cam,
int  orientation,
int  frame_no = 0,
bool  update_pose = true 
)

Updates the markers pose estimation.

Definition at line 306 of file Marker.cpp.

void alvar::Marker::Visualize ( IplImage *  image,
Camera cam,
CvScalar  color = CV_RGB(255,0,0) 
) const

Visualize the marker.

Examples:
SampleMultiMarker.cpp, and SampleMultiMarkerBundle.cpp.

Definition at line 134 of file Marker.cpp.

void alvar::Marker::VisualizeMarkerContent ( IplImage *  image,
Camera cam,
double  datatext_point[2],
double  content_point[2] 
) const [protected, virtual]

Reimplemented in alvar::MarkerData.

Definition at line 52 of file Marker.cpp.

void alvar::Marker::VisualizeMarkerError ( IplImage *  image,
Camera cam,
double  errortext_point[2] 
) const [protected, virtual]

Definition at line 91 of file Marker.cpp.

void alvar::Marker::VisualizeMarkerPose ( IplImage *  image,
Camera cam,
double  visualize2d_points[12][2],
CvScalar  color = CV_RGB(255,0,0) 
) const [protected]

Definition at line 39 of file Marker.cpp.


Member Data Documentation

const int alvar::Marker::DECODE_ERROR = 2 [static]

Definition at line 158 of file Marker.h.

double alvar::Marker::decode_error [protected]

Definition at line 162 of file Marker.h.

double alvar::Marker::edge_length [protected]

Definition at line 164 of file Marker.h.

double alvar::Marker::margin [protected]

Definition at line 166 of file Marker.h.

const int alvar::Marker::MARGIN_ERROR = 1 [static]

Definition at line 157 of file Marker.h.

double alvar::Marker::margin_error [protected]

Definition at line 161 of file Marker.h.

CvMat* alvar::Marker::marker_content [protected]

Definition at line 167 of file Marker.h.

Marker corners in marker coordinates.

Definition at line 174 of file Marker.h.

Marker corners in image coordinates.

Definition at line 176 of file Marker.h.

Samples to be used in figuring out min/max for thresholding.

Definition at line 184 of file Marker.h.

Samples to be used in figuring out min/max for thresholding.

Definition at line 182 of file Marker.h.

Marker color points in marker coordinates.

Definition at line 172 of file Marker.h.

The current marker Pose.

Examples:
SampleMultiMarker.cpp, and SampleMultiMarkerBundle.cpp.

Definition at line 135 of file Marker.h.

int alvar::Marker::res [protected]

Definition at line 165 of file Marker.h.

Definition at line 179 of file Marker.h.

Marker points in image coordinates.

Definition at line 178 of file Marker.h.

Definition at line 180 of file Marker.h.

const int alvar::Marker::TRACK_ERROR = 4 [static]

Definition at line 159 of file Marker.h.

double alvar::Marker::track_error [protected]

Definition at line 163 of file Marker.h.

EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool alvar::Marker::valid

Definition at line 61 of file Marker.h.


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


ar_track_alvar
Author(s): Scott Niekum
autogenerated on Sat Dec 28 2013 16:46:16