Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
alvar::MarkerData Class Reference

MarkerData contains matrix of Hamming encoded data. More...

#include <Marker.h>

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

Public Types

enum  MarkerContentType { MARKER_CONTENT_TYPE_NUMBER, MARKER_CONTENT_TYPE_STRING, MARKER_CONTENT_TYPE_FILE, MARKER_CONTENT_TYPE_HTTP }
 

Public Member Functions

bool DecodeContent (int *orientation)
 DecodeContent should be called after UpdateContent to fill content_type, decode_error and data More...
 
unsigned long GetId () const
 Get ID for recognizing this marker. More...
 
 MarkerData (double _edge_length=0, int _res=0, double _margin=0)
 Default constructor. More...
 
void SetContent (MarkerContentType content_type, unsigned long id, const char *str, bool force_strong_hamming=false, bool verbose=false)
 Updates the marker_content by "encoding" the given parameters. More...
 
void SetId (unsigned long _id)
 Set the ID. More...
 
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 Compared to the basic implementation in Marker this will also detect the marker resolution automatically when the marker resolution is specified to be 0. More...
 
- Public Member Functions inherited from alvar::Marker
void CompareContent (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam, int *orientation) const
 Compares the marker corners with the previous match. More...
 
void CompareCorners (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, int *orientation, double *error)
 Compares the marker corners with the previous match. More...
 
CvMat * GetContent () const
 Returns the content as a matrix. More...
 
double GetError (int errors=(MARGIN_ERROR|DECODE_ERROR)) const
 Get marker detection error estimate. More...
 
double GetMargin () const
 
double GetMarkerEdgeLength () const
 Get edge length (to support different size markers. More...
 
int GetRes () const
 
 Marker (double _edge_length=0, int _res=0, double _margin=0)
 Default constructor. More...
 
 Marker (const Marker &m)
 Copy constructor. More...
 
void SaveMarkerImage (const char *filename, int save_res=0) const
 Saves the marker as an image. More...
 
void ScaleMarkerToImage (IplImage *image) const
 Draw the marker filling the ROI in the given image. More...
 
void SetError (int error_type, double value)
 Set the marker error estimate. More...
 
void SetMarkerSize (double _edge_length=0, int _res=0, double _margin=0)
 Method for resizing the marker dimensions. More...
 
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. More...
 
void Visualize (IplImage *image, Camera *cam, CvScalar color=CV_RGB(255, 0, 0)) const
 Visualize the marker. More...
 
 ~Marker ()
 Destructor. More...
 

Public Attributes

unsigned char content_type
 
union {
   unsigned long   id
 
   char   str [MAX_MARKER_STRING_LEN]
 
data
 MarkerData content can be presented either as number (MARKER_CONTENT_TYPE_NUMBER) or string More...
 
- Public Attributes inherited from alvar::Marker
std::vector< PointDoublemarker_corners
 Marker corners in marker coordinates. More...
 
std::vector< PointDoublemarker_corners_img
 Marker corners in image coordinates. More...
 
std::vector< PointDoublemarker_margin_b
 Samples to be used in figuring out min/max for thresholding. More...
 
std::vector< PointDoublemarker_margin_w
 Samples to be used in figuring out min/max for thresholding. More...
 
std::vector< PointDoublemarker_points
 Marker color points in marker coordinates. More...
 
Pose pose
 The current marker Pose. More...
 
ar_track_alvar::ARCloud ros_corners_3D
 
std::vector< PointDoubleros_marker_points_img
 Marker points in image coordinates. More...
 
int ros_orientation
 
EIGEN_MAKE_ALIGNED_OPERATOR_NEW bool valid
 

Static Public Attributes

static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const int MAX_MARKER_STRING_LEN =2048
 
- Static Public Attributes inherited from alvar::Marker
static const int DECODE_ERROR =2
 
static const int MARGIN_ERROR =1
 
static const int TRACK_ERROR =4
 

Protected Member Functions

void Add6bitStr (BitsetExt *bs, char *s)
 
int DecodeCode (int orientation, BitsetExt *bs, int *erroneous, int *total, unsigned char *content_type)
 
void DecodeOrientation (int *error, int *total, int *orientation)
 
bool DetectResolution (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam)
 
void Read6bitStr (BitsetExt *bs, char *s, size_t s_max_len)
 
int UsableDataBits (int marker_res, int hamming)
 
virtual void VisualizeMarkerContent (IplImage *image, Camera *cam, double datatext_point[2], double content_point[2]) const
 
- Protected Member Functions inherited from alvar::Marker
bool UpdateContentBasic (std::vector< Point< CvPoint2D64f > > &_marker_corners_img, IplImage *gray, Camera *cam, int frame_no=0)
 
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
 

Additional Inherited Members

- Protected Attributes inherited from alvar::Marker
double decode_error
 
double edge_length
 
double margin
 
double margin_error
 
CvMat * marker_content
 
int res
 
double track_error
 

Detailed Description

MarkerData contains matrix of Hamming encoded data.

Examples:
SampleMarkerCreator.cpp.

Definition at line 221 of file Marker.h.

Member Enumeration Documentation

Enumerator
MARKER_CONTENT_TYPE_NUMBER 
MARKER_CONTENT_TYPE_STRING 
MARKER_CONTENT_TYPE_FILE 
MARKER_CONTENT_TYPE_HTTP 

Definition at line 235 of file Marker.h.

Constructor & Destructor Documentation

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

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 254 of file Marker.h.

Member Function Documentation

void alvar::MarkerData::Add6bitStr ( BitsetExt bs,
char *  s 
)
protected

Definition at line 906 of file Marker.cpp.

int alvar::MarkerData::DecodeCode ( int  orientation,
BitsetExt bs,
int *  erroneous,
int *  total,
unsigned char *  content_type 
)
protected

Definition at line 771 of file Marker.cpp.

bool alvar::MarkerData::DecodeContent ( int *  orientation)
virtual

DecodeContent should be called after UpdateContent to fill content_type, decode_error and data

Reimplemented from alvar::Marker.

Definition at line 878 of file Marker.cpp.

void alvar::MarkerData::DecodeOrientation ( int *  error,
int *  total,
int *  orientation 
)
protected

Definition at line 632 of file Marker.cpp.

bool alvar::MarkerData::DetectResolution ( std::vector< Point< CvPoint2D64f > > &  _marker_corners_img,
IplImage *  gray,
Camera cam 
)
protected

Definition at line 670 of file Marker.cpp.

unsigned long alvar::MarkerData::GetId ( ) const
inlinevirtual

Get ID for recognizing this marker.

Reimplemented from alvar::Marker.

Definition at line 259 of file Marker.h.

void alvar::MarkerData::Read6bitStr ( BitsetExt bs,
char *  s,
size_t  s_max_len 
)
protected

Definition at line 829 of file Marker.cpp.

void alvar::MarkerData::SetContent ( MarkerContentType  content_type,
unsigned long  id,
const char *  str,
bool  force_strong_hamming = false,
bool  verbose = false 
)

Updates the marker_content by "encoding" the given parameters.

Examples:
SampleMarkerCreator.cpp.

Definition at line 957 of file Marker.cpp.

void alvar::MarkerData::SetId ( unsigned long  _id)
inlinevirtual

Set the ID.

Reimplemented from alvar::Marker.

Definition at line 261 of file Marker.h.

bool alvar::MarkerData::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 Compared to the basic implementation in Marker this will also detect the marker resolution automatically when the marker resolution is specified to be 0.

Reimplemented from alvar::Marker.

Definition at line 764 of file Marker.cpp.

int alvar::MarkerData::UsableDataBits ( int  marker_res,
int  hamming 
)
protected

Definition at line 945 of file Marker.cpp.

void alvar::MarkerData::VisualizeMarkerContent ( IplImage *  image,
Camera cam,
double  datatext_point[2],
double  content_point[2] 
) const
protectedvirtual

Reimplemented from alvar::Marker.

Definition at line 107 of file Marker.cpp.

Member Data Documentation

unsigned char alvar::MarkerData::content_type

Definition at line 241 of file Marker.h.

union { ... } alvar::MarkerData::data

MarkerData content can be presented either as number (MARKER_CONTENT_TYPE_NUMBER) or string

unsigned long alvar::MarkerData::id

Definition at line 245 of file Marker.h.

EIGEN_MAKE_ALIGNED_OPERATOR_NEW const int alvar::MarkerData::MAX_MARKER_STRING_LEN =2048
static

Definition at line 234 of file Marker.h.

char alvar::MarkerData::str[MAX_MARKER_STRING_LEN]

Definition at line 246 of file Marker.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