API References

Main Classes

struct cctag::Parameters

Structure containing all the major parameters using in the CCTag detection algorithms.

Public Functions

Parameters(std::size_t nCrowns = kDefaultNCrowns)

The constructor, normally the most interesting parameter is the number of crowns.

Parameters
  • nCrowns: The number of crowns that the markers to detect are made up of.

template<class Archive>
void serialize(Archive &ar, unsigned int version)

Serialize the parameter settings.

Template Parameters
  • Archive: The class to use to store the data.

Parameters
  • [inout] ar: The object where to store the data.

  • [in] version: The serialization version.

void setDebugDir(const std::string &debugDir)

Set the debug directory where debug data is stored.

Parameters
  • [in] debugDir:

void setUseCuda(bool val)

Whether to use the Cuda implementation or not.

Note

Ignored if the code is not built with Cuda support.

Parameters
  • [in] val: true to use the Cuda implementation, false to use the CPU.

class cctag::CCTag : public cctag::ICCTag

Class modeling the CCTag marker containing the position of the marker in the image, its ID and its status.

Public Functions

float x() const override

Ger the x coordinate of the center of the marker.

Return

x coordinate of the center.

float y() const override

Ger the x coordinate of the center of the marker.

Return

x coordinate of the center.

const cctag::numerical::geometry::Ellipse &rescaledOuterEllipse() const override

Get the rescaled outer ellipse of the marker. The rescaled outerEllipse is in the coordinate system of the input image, while the internal ellipse is relative to a pyramid level.

Return

the outer ellipse.

MarkerID id() const override

Get marker ID.

Return

the marker ID.

int getStatus() const override

Get the status of the marker.

Return

the status of the marker.

Functions

Warning

doxygenfunction: Unable to resolve multiple matches for function “cctagDetection” with arguments (boost::ptr_list<ICCTag> &markers, int pipeId, std::size_t frame, const cv::Mat &graySrc, std::size_t nRings = 3, logtime::Mgmt *durations = nullptr, const std::string &parameterFile = “”, const std::string &cctagBankFilename = “”) in doxygen xml output for project “CCTag” from directory: ../build/xml. Potential matches:

- void cctagDetection(CCTag::List &markers, int pipeId, std::size_t frame, const cv::Mat &imgGraySrc, const Parameters &providedParams, const cctag::CCTagMarkersBank &bank, bool bDisplayEllipses, cctag::logtime::Mgmt *durations)
- void cctagDetection(boost::ptr_list<ICCTag> &markers, int pipeId, std::size_t frame, const cv::Mat &graySrc, const cctag::Parameters &params, logtime::Mgmt *durations = nullptr, const CCTagMarkersBank *pBank = nullptr)
- void cctagDetection(boost::ptr_list<ICCTag> &markers, int pipeId, std::size_t frame, const cv::Mat &graySrc, std::size_t nRings, logtime::Mgmt *durations, const std::string &parameterFilename, const std::string &cctagBankFilename)
void cctag::cctagDetection(boost::ptr_list<ICCTag> &markers, int pipeId, std::size_t frame, const cv::Mat &graySrc, const cctag::Parameters &params, logtime::Mgmt *durations = nullptr, const CCTagMarkersBank *pBank = nullptr)

Perform the CCTag detection on a gray scale image.

Parameters
  • [out] markers: Detected markers. WARNING: only markers with status == 1 are valid ones. (status available via getStatus())

  • [in] pipeId: Choose between several CUDA pipeline instances

  • [in] frame: A frame number. Can be anything (e.g. 0).

  • [in] graySrc: Gray scale input image.

  • [in] params: Parameters for the detection.

  • [in] durations: Optional object to store execution times.

  • [in] pBank: Path to the cctag bank. If not provided, radii will be the ones associated to the CCTags contained in the markersToPrint folder.

Utility Classes

class cctag::numerical::geometry::Ellipse

It models an ellipse with standard form \( \frac{x^2 - x_c}{a^2} + \frac{y^2 - y_c}{b^2} = 1 \), centered in _center \((x_c, x_y)\) and rotated clock-wise by _angle wrt the x-axis. Note that, arbitrarly, the representation with the major axis aligned with the y-axis is chosen.

Subclassed by cctag::numerical::geometry::Circle

Public Functions

Ellipse() = default

Default constructor, set all parameters to zero.

Ellipse(const Matrix &matrix)

Build an ellipse from a 3x3 matrix representing the ellipse as a conic.

Note

By default, the representation with the major axis aligned with the y-axis is chosen.

Parameters
  • [in] matrix: The 3x3 matrix representing the ellipse.

Ellipse(const Point2d<Eigen::Vector3f> &center, float a, float b, float angle)

Build an ellipse from a set of parameters.

Parameters
  • [in] center: The center of the conic.

  • [in] a: The length of the semi-axis x.

  • [in] b: The length of the semi-axis y.

  • [in] angle: The orientation of the ellipse wrt the x-axis as a clock-wise angle in radians.

const Matrix &matrix() const

Return the matrix representation of the ellipse.

Return

3x3 matrix representation of the ellipse.

Matrix &matrix()

Return the matrix representation of the ellipse.

Return

3x3 matrix representation of the ellipse.

const Point2d<Eigen::Vector3f> &center() const

Return the center of the ellipse.

Return

3 element vector with the homogeneous coordinates of the ellipse.

Point2d<Eigen::Vector3f> &center()

Return the center of the ellipse.

Return

3 element vector with the homogeneous coordinates of the ellipse.

float a() const

Return the length of the x-semi axis of the ellipse.

Return

the length of the x-semi axis of the ellipse.

float b() const

Return the length of the y-semi axis of the ellipse.

Return

the length of the y-semi axis of the ellipse.

float angle() const

Return the orientation of the ellipse.

Return

the clock-wise orientation angle in radians of the ellipse wrt the x-axis

void setA(float a)

Set the length of the x-semi axis of the ellipse.

Parameters
  • [in] a: the length of the x-semi axis.

void setB(float b)

Set the length of the y-semi axis of the ellipse.

Parameters
  • [in] b: the length of the y-semi axis.

void setAngle(float angle)

Set the orientation angle of the ellipse.

Parameters
  • [in] angle: the clock-wise orientation angle in radians.

void setCenter(const Point2d<Eigen::Vector3f> &center)

Set the center of the ellipse.

Parameters
  • [in] center: the new center of the ellipse.

void setMatrix(const Matrix &matrix)

Update the ellipse from a matrix representing a conic.

Parameters
  • [in] matrix: 3x3 matric representing the ellipse.

void setParameters(const Point2d<Eigen::Vector3f> &center, float a, float b, float angle)

Update the ellipse from its parameters.

Parameters
  • [in] center: The center of the conic.

  • [in] a: The length of the semi-axis x.

  • [in] b: The length of the semi-axis y.

  • [in] angle: The orientation of the ellipse wrt the x-axis as a clock-wise angle in radians.

Ellipse transform(const Matrix &mT) const

Return a new ellipse obtained by applying a transformation to the ellipse.

Return

the transformed ellipse.

Parameters
  • [in] mT: a 3x3 matrix representing the transformation.

void getCanonicForm(Matrix &mCanonic, Matrix &mTprimal, Matrix &mTdual) const

Compute the canonical form of the conic, along with its transformation.

Parameters
  • [out] mCanonic: 3x3 diagonal matrix representing the ellipse in canonical form.

  • [out] mTprimal: 3x3 transformation matrix such that C = mTprimal.transpose() * mCanonic * mTprimal

  • [out] mTdual: 3x3 inverse transformation matrix (= mTprimal.inv())

Friends

friend std::ostream &operator<<(std::ostream &os, const Ellipse &e)

Print the ellipse in matrix form in Matlab notation.

Return

the stream with appended the matrix representation of the ellipse.

Parameters
  • [inout] os: the stream where to output the ellipse.

  • [in] e: the ellipse

struct cctag::logtime::Mgmt
class Measurement