Public Member Functions | Private Member Functions | Private Attributes | List of all members
aruco::BoardDetector Class Reference

This class detects AR boards Version 1.2 There are two modes for board detection. First, the old way. (You first detect markers with MarkerDetector and then call to detect in this class. More...

#include <boarddetector.h>

Public Member Functions

 BoardDetector (bool setYPerpendicular=true)
 
 BoardDetector (bool setYPerpendicular=true)
 
float detect (const cv::Mat &im) throw (cv::Exception)
 
float detect (const cv::Mat &im) throw (cv::Exception)
 
float detect (const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix=cv::Mat(), cv::Mat distCoeff=cv::Mat(), float markerSizeMeters=-1) throw (cv::Exception)
 
float detect (const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, cv::Mat camMatrix=cv::Mat(), cv::Mat distCoeff=cv::Mat(), float markerSizeMeters=-1) throw (cv::Exception)
 
float detect (const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, const CameraParameters &cp, float markerSizeMeters=-1) throw (cv::Exception)
 
float detect (const vector< Marker > &detectedMarkers, const BoardConfiguration &BConf, Board &Bdetected, const CameraParameters &cp, float markerSizeMeters=-1) throw (cv::Exception)
 
BoardgetDetectedBoard ()
 
BoardgetDetectedBoard ()
 
vector< Marker > & getDetectedMarkers ()
 
vector< Marker > & getDetectedMarkers ()
 
MarkerDetectorgetMarkerDetector ()
 
MarkerDetectorgetMarkerDetector ()
 
void setParams (const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters=-1)
 
void setParams (const BoardConfiguration &bc, const CameraParameters &cp, float markerSizeMeters=-1)
 
void setParams (const BoardConfiguration &bc)
 
void setParams (const BoardConfiguration &bc)
 
void setYPerpendicular (bool enable)
 
void setYPerpendicular (bool enable)
 

Private Member Functions

void rotateXAxis (cv::Mat &rotation)
 
void rotateXAxis (cv::Mat &rotation)
 

Private Attributes

bool _areParamsSet
 
BoardConfiguration _bconf
 
Board _boardDetected
 
CameraParameters _camParams
 
float _markerSize
 
MarkerDetector _mdetector
 
bool _setYPerpendicular
 
vector< Marker_vmarkers
 

Detailed Description

This class detects AR boards Version 1.2 There are two modes for board detection. First, the old way. (You first detect markers with MarkerDetector and then call to detect in this class.

Second: New mode, marker detection is included in the class

CameraParameters CP;
CP.readFromFile(path_cp)
BoardConfiguration BC;
BC.readFromFile(path_bc);
BD.setParams(BC,CP); //or only BD.setParams(BC)
//capture image
cv::Mat im;
capture_image(im);
float prob=BD.detect(im);
if (prob>0.3)
CvDrawingUtils::draw3DAxis(im,BD.getDetectedBoard(),CP);

Definition at line 65 of file aruco/include/aruco/boarddetector.h.

Constructor & Destructor Documentation

aruco::BoardDetector::BoardDetector ( bool  setYPerpendicular = true)

See discussion in

See also
enableRotateXAxis. Do not change unless you know what you are doing

Definition at line 41 of file aruco/src/aruco/boarddetector.cpp.

aruco::BoardDetector::BoardDetector ( bool  setYPerpendicular = true)

See discussion in

See also
enableRotateXAxis. Do not change unless you know what you are doing

Member Function Documentation

float aruco::BoardDetector::detect ( const cv::Mat &  im)
throw (cv::Exception
)

Detect markers, and then, look for the board indicated in setParams()

Returns
value indicating the likelihood of having found the marker

Definition at line 64 of file aruco/src/aruco/boarddetector.cpp.

float aruco::BoardDetector::detect ( const cv::Mat &  im)
throw (cv::Exception
)

Detect markers, and then, look for the board indicated in setParams()

Returns
value indicating the likelihood of having found the marker
float aruco::BoardDetector::detect ( const vector< Marker > &  detectedMarkers,
const BoardConfiguration BConf,
Board Bdetected,
cv::Mat  camMatrix = cv::Mat(),
cv::Mat  distCoeff = cv::Mat(),
float  markerSizeMeters = -1 
)
throw (cv::Exception
)

Given the markers detected, determines if there is the board passed

Parameters
detectedMarkersresult provided by aruco::ArMarkerDetector
BConfthe board you want to see if is present
Bdetectedoutput information of the detected board
camMatrixcamera matrix with intrinsics
distCoeffcamera distorsion coeff
camMatrixintrinsic camera information.
distCoeffcamera distorsion coefficient. If set Mat() if is assumed no camera distorion
markerSizeMeterssize of the marker sides expressed in meters
Returns
value indicating the likelihood of having found the marker
float aruco::BoardDetector::detect ( const vector< Marker > &  detectedMarkers,
const BoardConfiguration BConf,
Board Bdetected,
cv::Mat  camMatrix = cv::Mat(),
cv::Mat  distCoeff = cv::Mat(),
float  markerSizeMeters = -1 
)
throw (cv::Exception
)

Given the markers detected, determines if there is the board passed

Parameters
detectedMarkersresult provided by aruco::ArMarkerDetector
BConfthe board you want to see if is present
Bdetectedoutput information of the detected board
camMatrixcamera matrix with intrinsics
distCoeffcamera distorsion coeff
camMatrixintrinsic camera information.
distCoeffcamera distorsion coefficient. If set Mat() if is assumed no camera distorion
markerSizeMeterssize of the marker sides expressed in meters
Returns
value indicating the likelihood of having found the marker
float aruco::BoardDetector::detect ( const vector< Marker > &  detectedMarkers,
const BoardConfiguration BConf,
Board Bdetected,
const CameraParameters cp,
float  markerSizeMeters = -1 
)
throw (cv::Exception
)

Definition at line 76 of file aruco/src/aruco/boarddetector.cpp.

float aruco::BoardDetector::detect ( const vector< Marker > &  detectedMarkers,
const BoardConfiguration BConf,
Board Bdetected,
const CameraParameters cp,
float  markerSizeMeters = -1 
)
throw (cv::Exception
)
Board& aruco::BoardDetector::getDetectedBoard ( )
inline

Returns a reference to the board detected

Definition at line 86 of file aruco/include/aruco/boarddetector.h.

Board& aruco::BoardDetector::getDetectedBoard ( )
inline

Returns a reference to the board detected

Definition at line 86 of file old/aruco/include/aruco/boarddetector.h.

vector<Marker>& aruco::BoardDetector::getDetectedMarkers ( )
inline

Returns the vector of markers detected

Definition at line 92 of file old/aruco/include/aruco/boarddetector.h.

vector<Marker>& aruco::BoardDetector::getDetectedMarkers ( )
inline

Returns the vector of markers detected

Definition at line 92 of file aruco/include/aruco/boarddetector.h.

MarkerDetector& aruco::BoardDetector::getMarkerDetector ( )
inline

Returns a reference to the internal marker detector

Definition at line 89 of file old/aruco/include/aruco/boarddetector.h.

MarkerDetector& aruco::BoardDetector::getMarkerDetector ( )
inline

Returns a reference to the internal marker detector

Definition at line 89 of file aruco/include/aruco/boarddetector.h.

void aruco::BoardDetector::rotateXAxis ( cv::Mat &  rotation)
private
void aruco::BoardDetector::rotateXAxis ( cv::Mat &  rotation)
private
void aruco::BoardDetector::setParams ( const BoardConfiguration bc,
const CameraParameters cp,
float  markerSizeMeters = -1 
)

Use if you plan to let this class to perform marker detection too

Definition at line 49 of file aruco/src/aruco/boarddetector.cpp.

void aruco::BoardDetector::setParams ( const BoardConfiguration bc,
const CameraParameters cp,
float  markerSizeMeters = -1 
)

Use if you plan to let this class to perform marker detection too

void aruco::BoardDetector::setParams ( const BoardConfiguration bc)

Definition at line 57 of file aruco/src/aruco/boarddetector.cpp.

void aruco::BoardDetector::setParams ( const BoardConfiguration bc)
void aruco::BoardDetector::setYPerpendicular ( bool  enable)
inline

By default, the Y axis is set to point up. However this is not the default operation mode of opencv, which produces the Z axis pointing up instead. So, to achieve this change, we have to rotate the X axis.

Definition at line 117 of file old/aruco/include/aruco/boarddetector.h.

void aruco::BoardDetector::setYPerpendicular ( bool  enable)
inline

By default, the Y axis is set to point up. However this is not the default operation mode of opencv, which produces the Z axis pointing up instead. So, to achieve this change, we have to rotate the X axis.

Definition at line 117 of file aruco/include/aruco/boarddetector.h.

Member Data Documentation

bool aruco::BoardDetector::_areParamsSet
private

Definition at line 127 of file aruco/include/aruco/boarddetector.h.

BoardConfiguration aruco::BoardDetector::_bconf
private

Definition at line 128 of file aruco/include/aruco/boarddetector.h.

Board aruco::BoardDetector::_boardDetected
private

Definition at line 129 of file aruco/include/aruco/boarddetector.h.

CameraParameters aruco::BoardDetector::_camParams
private

Definition at line 131 of file aruco/include/aruco/boarddetector.h.

float aruco::BoardDetector::_markerSize
private

Definition at line 130 of file aruco/include/aruco/boarddetector.h.

MarkerDetector aruco::BoardDetector::_mdetector
private

Definition at line 132 of file aruco/include/aruco/boarddetector.h.

bool aruco::BoardDetector::_setYPerpendicular
private

Definition at line 124 of file aruco/include/aruco/boarddetector.h.

vector< Marker > aruco::BoardDetector::_vmarkers
private

Definition at line 133 of file aruco/include/aruco/boarddetector.h.


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


lidar_camera_calibration
Author(s):
autogenerated on Sat Feb 6 2021 03:39:37