API References¶
Main Classes¶
-
struct Parameters¶
Structure containing all the major parameters using in the CCTag detection algorithms.
Public Functions
-
explicit 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>
inline void serialize(Archive &ar, unsigned int version)¶ Serialize the parameter settings.
- Template Parameters
Archive – The class to use to store the data.
- Parameters
ar – [inout] The object where to store the data.
version – [in] The serialization version.
-
void setDebugDir(const std::string &debugDir)¶
Set the debug directory where debug data is stored.
- Parameters
debugDir – [in]
-
void setUseCuda(bool val)¶
Whether to use the Cuda implementation or not.
Note
Ignored if the code is not built with Cuda support.
- Parameters
val – [in]
true
to use the Cuda implementation,false
to use the CPU.
-
explicit Parameters(std::size_t nCrowns = kDefaultNCrowns)¶
-
class 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
-
inline virtual float x() const override¶
Ger the x coordinate of the center of the marker.
- Returns
x coordinate of the center.
-
inline virtual float y() const override¶
Ger the x coordinate of the center of the marker.
- Returns
x coordinate of the center.
-
inline virtual 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.
- Returns
the outer ellipse.
-
inline virtual MarkerID id() const override¶
Get marker ID.
- Returns
the marker ID.
-
inline virtual int getStatus() const override¶
Get the status of the marker.
- Returns
the status of the marker.
-
inline virtual float x() const override¶
Functions¶
-
void cctag::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 ¶meterFilename, const std::string &cctagBankFilename)¶
Perform the CCTag detection on a gray scale image.
- Parameters
markers – [out] Detected markers. WARNING: only markers with status == 1 are valid ones. (status available via getStatus())
pipeId – [in] Choose between several CUDA pipeline instances
frame – [in] A frame number. Can be anything (e.g. 0).
graySrc – [in] Gray scale input image.
nRings – [in] Number of CCTag rings.
durations – [in] Optional object to store execution times.
parameterFilename – [in] Path to a parameter file. If not provided default parameters will be used.
cctagBankFilename – [in] Path to the cctag bank. If not provided, radii will be the ones associated to the CCTags contained in the markersToPrint folder.
-
void cctag::cctagDetection(boost::ptr_list<ICCTag> &markers, int pipeId, std::size_t frame, const cv::Mat &graySrc, const cctag::Parameters ¶ms, logtime::Mgmt *durations = nullptr, const CCTagMarkersBank *pBank = nullptr)¶
Perform the CCTag detection on a gray scale image.
- Parameters
markers – [out] Detected markers. WARNING: only markers with status == 1 are valid ones. (status available via getStatus())
pipeId – [in] Choose between several CUDA pipeline instances
frame – [in] A frame number. Can be anything (e.g. 0).
graySrc – [in] Gray scale input image.
params – [in] Parameters for the detection.
durations – [in] Optional object to store execution times.
pBank – [in] 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 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.
-
explicit 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
matrix – [in] The 3x3 matrix representing the ellipse.
-
Ellipse(const Point2d<Eigen::Vector3f> ¢er, float a, float b, float angle)¶
Build an ellipse from a set of parameters.
- Parameters
center – [in] The center of the conic.
a – [in] The length of the semi-axis x.
b – [in] The length of the semi-axis y.
angle – [in] The orientation of the ellipse wrt the x-axis as a clock-wise angle in radians.
-
inline const Matrix &matrix() const¶
Return the matrix representation of the ellipse.
- Returns
3x3 matrix representation of the ellipse.
-
inline Matrix &matrix()¶
Return the matrix representation of the ellipse.
- Returns
3x3 matrix representation of the ellipse.
-
inline const Point2d<Eigen::Vector3f> ¢er() const¶
Return the center of the ellipse.
- Returns
3 element vector with the homogeneous coordinates of the ellipse.
-
inline Point2d<Eigen::Vector3f> ¢er()¶
Return the center of the ellipse.
- Returns
3 element vector with the homogeneous coordinates of the ellipse.
-
inline float a() const¶
Return the length of the x-semi axis of the ellipse.
- Returns
the length of the x-semi axis of the ellipse.
-
inline float b() const¶
Return the length of the y-semi axis of the ellipse.
- Returns
the length of the y-semi axis of the ellipse.
-
inline float angle() const¶
Return the orientation of the ellipse.
- Returns
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
a – [in] the length of the x-semi axis.
-
void setB(float b)¶
Set the length of the y-semi axis of the ellipse.
- Parameters
b – [in] the length of the y-semi axis.
-
void setAngle(float angle)¶
Set the orientation angle of the ellipse.
- Parameters
angle – [in] the clock-wise orientation angle in radians.
-
void setCenter(const Point2d<Eigen::Vector3f> ¢er)¶
Set the center of the ellipse.
- Parameters
center – [in] the new center of the ellipse.
-
void setMatrix(const Matrix &matrix)¶
Update the ellipse from a matrix representing a conic.
- Parameters
matrix – [in] 3x3 matric representing the ellipse.
-
void setParameters(const Point2d<Eigen::Vector3f> ¢er, float a, float b, float angle)¶
Update the ellipse from its parameters.
- Parameters
center – [in] The center of the conic.
a – [in] The length of the semi-axis x.
b – [in] The length of the semi-axis y.
angle – [in] 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.
- Parameters
mT – [in] a 3x3 matrix representing the transformation.
- Returns
the transformed ellipse.
-
void getCanonicForm(Matrix &mCanonic, Matrix &mTprimal, Matrix &mTdual) const¶
Compute the canonical form of the conic, along with its transformation.
- Parameters
mCanonic – [out] 3x3 diagonal matrix representing the ellipse in canonical form.
mTprimal – [out] 3x3 transformation matrix such that C =
mTprimal.transpose()
*mCanonic
*mTprimal
mTdual – [out] 3x3 inverse transformation matrix (=
mTprimal.inv()
)
-
Ellipse() = default¶