My Project
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
MarkerData Class Reference

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

#include <Marker.h>

Inheritance diagram for MarkerData:
Marker

Public Types

enum  MarkerContentType { MARKER_CONTENT_TYPE_NUMBER , MARKER_CONTENT_TYPE_STRING , MARKER_CONTENT_TYPE_FILE , MARKER_CONTENT_TYPE_HTTP }
 

Public Member Functions

 MarkerData (double _edge_length=0, int _res=0, double _margin=0)
 Default constructor. More...
 
unsigned long GetId () const
 Get ID for recognizing this marker.
 
void SetId (unsigned long _id)
 Set the ID.
 
virtual bool UpdateContent (std::vector< Point< cv::Point2d >> &_marker_corners_img, cv::Mat &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.
 
bool DecodeContent (int *orientation)
 DecodeContent should be called after UpdateContent to fill content_type, decode_error and data
 
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.
 
- Public Member Functions inherited from Marker
void CompareCorners (std::vector< Point< cv::Point2d >> &_marker_corners_img, int *orientation, double *error)
 Compares the marker corners with the previous match. More...
 
void CompareContent (std::vector< PointDouble > &_marker_corners_img, cv::Mat &gray, Camera *cam, int *orientation) const
 Compares the marker corners with the previous match.
 
void UpdatePose (std::vector< Point< cv::Point2d >> &_marker_corners_img, Camera *cam, int orientation, int frame_no=0, bool update_pose=true)
 Updates the markers pose estimation.
 
cv::Mat GetContent () const
 Returns the content as a matrix.
 
void SaveMarkerImage (const char *filename, int save_res=0) const
 Saves the marker as an image.
 
void ScaleMarkerToImage (cv::Mat &image) const
 Draw the marker filling the ROI in the given image.
 
void Visualize (cv::Mat &image, Camera *cam, const cv::Scalar color=CV_RGB(255, 0, 0)) const
 Visualize the marker.
 
void SetMarkerSize (double _edge_length=0, int _res=0, double _margin=0)
 Method for resizing the marker dimensions

 
double GetMarkerEdgeLength () const
 Get edge length (to support different size markers.
 
 ~Marker ()
 Destructor

 
 Marker (double _edge_length=0, int _res=0, double _margin=0)
 Default constructor. More...
 
 Marker (const Marker &m)
 Copy constructor

 
int GetRes () const
 
double GetMargin () const
 
double GetError (int errors=(MARGIN_ERROR|DECODE_ERROR)) const
 Get marker detection error estimate. More...
 
void SetError (int error_type, double value)
 Set the marker error estimate.
 

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
 
- Public Attributes inherited from Marker
Pose pose
 The current marker Pose.
 
std::vector< PointDoublemarker_points
 Marker color points in marker coordinates.
 
std::vector< PointDoublemarker_corners
 Marker corners in marker coordinates.
 
std::vector< PointDoublemarker_corners_img
 Marker corners in image coordinates.
 
std::vector< PointDoublemarker_margin_w
 Samples to be used in figuring out min/max for thresholding.
 
std::vector< PointDoublemarker_margin_b
 Samples to be used in figuring out min/max for thresholding.
 

Static Public Attributes

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

Protected Member Functions

virtual void VisualizeMarkerContent (cv::Mat &image, Camera *cam, double datatext_point[2], double content_point[2]) const
 
void DecodeOrientation (int *error, int *total, int *orientation)
 
int DecodeCode (int orientation, BitsetExt *bs, int *erroneous, int *total, unsigned char *content_type)
 
void Read6bitStr (BitsetExt *bs, char *s, size_t s_max_len)
 
void Add6bitStr (BitsetExt *bs, char *s)
 
int UsableDataBits (int marker_res, int hamming)
 
bool DetectResolution (std::vector< Point< cv::Point2d >> &_marker_corners_img, cv::Mat &gray, Camera *cam)
 
- Protected Member Functions inherited from Marker
void VisualizeMarkerPose (cv::Mat &image, Camera *cam, double visualize2d_points[12][2], const cv::Scalar color=CV_RGB(255, 0, 0)) const
 
virtual void VisualizeMarkerError (cv::Mat &image, Camera *cam, double errortext_point[2]) const
 
bool UpdateContentBasic (std::vector< PointDouble > &_marker_corners_img, cv::Mat &gray, Camera *cam, int frame_no=0)
 

Additional Inherited Members

- Protected Attributes inherited from Marker
double margin_error
 
double decode_error
 
double track_error
 
double edge_length
 
int res
 
double margin
 
cv::Mat marker_content
 

Detailed Description

MarkerData contains matrix of Hamming encoded data.

Definition at line 285 of file Marker.h.

Constructor & Destructor Documentation

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


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