WPILibC++ 2024.3.2
frc::AprilTagDetector Class Reference

An AprilTag detector engine. More...

#include <frc/apriltag/AprilTagDetector.h>

Classes

struct  Config
 Detector configuration. More...
 
struct  QuadThresholdParameters
 Quad threshold parameters. More...
 
class  Results
 Array of detection results. More...
 

Public Member Functions

 AprilTagDetector ()
 
 ~AprilTagDetector ()
 
 AprilTagDetector (const AprilTagDetector &)=delete
 
AprilTagDetectoroperator= (const AprilTagDetector &)=delete
 
 AprilTagDetector (AprilTagDetector &&rhs)
 
AprilTagDetectoroperator= (AprilTagDetector &&rhs)
 
Results Detect (int width, int height, int stride, uint8_t *buf)
 Detect tags from an 8-bit image. More...
 
Results Detect (int width, int height, uint8_t *buf)
 Detect tags from an 8-bit image. More...
 
Configuration functions
void SetConfig (const Config &config)
 Sets detector configuration. More...
 
Config GetConfig () const
 Gets detector configuration. More...
 
void SetQuadThresholdParameters (const QuadThresholdParameters &params)
 Sets quad threshold parameters. More...
 
QuadThresholdParameters GetQuadThresholdParameters () const
 Gets quad threshold parameters. More...
 
Tag family functions
bool AddFamily (std::string_view fam, int bitsCorrected=2)
 Adds a family of tags to be detected. More...
 
void RemoveFamily (std::string_view fam)
 Removes a family of tags from the detector. More...
 
void ClearFamilies ()
 Unregister all families. More...
 

Detailed Description

An AprilTag detector engine.

This is expensive to set up and tear down, so most use cases should only create one of these, add a family to it, set up any other configuration, and repeatedly call Detect().

Constructor & Destructor Documentation

◆ AprilTagDetector() [1/3]

frc::AprilTagDetector::AprilTagDetector ( )

◆ ~AprilTagDetector()

frc::AprilTagDetector::~AprilTagDetector ( )
inline

◆ AprilTagDetector() [2/3]

frc::AprilTagDetector::AprilTagDetector ( const AprilTagDetector )
delete

◆ AprilTagDetector() [3/3]

frc::AprilTagDetector::AprilTagDetector ( AprilTagDetector &&  rhs)
inline

Member Function Documentation

◆ AddFamily()

bool frc::AprilTagDetector::AddFamily ( std::string_view  fam,
int  bitsCorrected = 2 
)

Adds a family of tags to be detected.

Parameters
famFamily name, e.g. "tag16h5"
bitsCorrectedMaximum number of bits to correct
Returns
False if family can't be found

◆ ClearFamilies()

void frc::AprilTagDetector::ClearFamilies ( )

Unregister all families.

◆ Detect() [1/2]

Results frc::AprilTagDetector::Detect ( int  width,
int  height,
int  stride,
uint8_t *  buf 
)

Detect tags from an 8-bit image.

The image must be grayscale.

Parameters
widthwidth of the image
heightheight of the image
stridenumber of bytes between image rows (often the same as width)
bufimage buffer
Returns
Results (array of AprilTagDetection pointers)

◆ Detect() [2/2]

Results frc::AprilTagDetector::Detect ( int  width,
int  height,
uint8_t *  buf 
)
inline

Detect tags from an 8-bit image.

The image must be grayscale.

Parameters
widthwidth of the image
heightheight of the image
bufimage buffer
Returns
Results (array of AprilTagDetection pointers)

◆ GetConfig()

Config frc::AprilTagDetector::GetConfig ( ) const

Gets detector configuration.

Returns
Configuration

◆ GetQuadThresholdParameters()

QuadThresholdParameters frc::AprilTagDetector::GetQuadThresholdParameters ( ) const

Gets quad threshold parameters.

Returns
Parameters

◆ operator=() [1/2]

AprilTagDetector & frc::AprilTagDetector::operator= ( AprilTagDetector &&  rhs)

◆ operator=() [2/2]

AprilTagDetector & frc::AprilTagDetector::operator= ( const AprilTagDetector )
delete

◆ RemoveFamily()

void frc::AprilTagDetector::RemoveFamily ( std::string_view  fam)

Removes a family of tags from the detector.

Parameters
famFamily name, e.g. "tag16h5"

◆ SetConfig()

void frc::AprilTagDetector::SetConfig ( const Config config)

Sets detector configuration.

Parameters
configConfiguration

◆ SetQuadThresholdParameters()

void frc::AprilTagDetector::SetQuadThresholdParameters ( const QuadThresholdParameters params)

Sets quad threshold parameters.

Parameters
paramsParameters

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