This class is used to detect markers in an image using the aruco-library. More...
#include <marker_detection.h>
Public Types | |
enum | CameraId { cam_left, cam_right } |
Public Member Functions | |
std::vector< aruco::Marker > | detect (const cv::Mat &image, CameraId id, const ArucoMarkerRecognitionConfig &config) |
Detects markers in the given image with the camera parameters of the camera with the given id. More... | |
MarkerDetection () | |
The default constructor of this class. More... | |
MarkerDetection (double marker_size) | |
The constructor of this class. More... | |
void | setCameraParameters (const sensor_msgs::CameraInfo &cam_params_left, const sensor_msgs::CameraInfo &cam_params_right) |
Set the camera parameters of the two cameras. More... | |
Private Attributes | |
aruco::CameraParameters | cam_params_left_ |
aruco::CameraParameters | cam_params_right_ |
double | DEFAULT_MARKER_SIZE = 0.1 |
double | marker_size_ |
This class is used to detect markers in an image using the aruco-library.
Definition at line 33 of file marker_detection.h.
An enum describing the ids of the two cameras
Enumerator | |
---|---|
cam_left | |
cam_right |
Definition at line 53 of file marker_detection.h.
|
inline |
The default constructor of this class.
Definition at line 58 of file marker_detection.h.
aruco_marker_recognition::MarkerDetection::MarkerDetection | ( | double | marker_size | ) |
The constructor of this class.
marker_size | The size of the used markers in meters |
Definition at line 26 of file marker_detection.cpp.
std::vector< aruco::Marker > aruco_marker_recognition::MarkerDetection::detect | ( | const cv::Mat & | image, |
CameraId | id, | ||
const ArucoMarkerRecognitionConfig & | config | ||
) |
Detects markers in the given image with the camera parameters of the camera with the given id.
image | The image the markers are detected in |
id | The id of the camera the given image was fetched from (specified in the enum CameraId) |
Definition at line 30 of file marker_detection.cpp.
void aruco_marker_recognition::MarkerDetection::setCameraParameters | ( | const sensor_msgs::CameraInfo & | cam_params_left, |
const sensor_msgs::CameraInfo & | cam_params_right | ||
) |
Set the camera parameters of the two cameras.
cam_params_left | The parameters of the left camera |
cam_params_right | The parameters of the right camera |
Definition at line 73 of file marker_detection.cpp.
|
private |
The camera parameters of the left camera
Definition at line 45 of file marker_detection.h.
|
private |
The camera parameters of the right camera
Definition at line 48 of file marker_detection.h.
|
private |
The default marker size in meters
Definition at line 39 of file marker_detection.h.
|
private |
The custom marker size in meters
Definition at line 42 of file marker_detection.h.