25#include <opencv2/aruco.hpp>
27namespace jevois {
class StdModule; }
35 "this parameter cannot be changed at runtime (must be set in the module's params.cfg).",
40 (D5X5_250) (D5X5_1000) (D6X6_50) (D6X6_100) (D6X6_250) (D6X6_1000) (D7X7_50)
41 (D7X7_100) (D7X7_250) (D7X7_1000) (ATAG_16h5) (ATAG_25h9) (ATAG_36h10) (ATAG_36h11) );
45 "this parameter cannot be changed at runtime (must be set in the module's params.cfg).",
46 Dict::D4X4_50, Dict_Values, ParamCateg);
58 false, aruco::ParamCateg);
131 public jevois::Parameter<aruco::detparams, aruco::dictionary,
132 aruco::dopose, aruco::markerlen, aruco::showcube>
151 void detectMarkers(cv::InputArray image, cv::OutputArray ids, cv::OutputArrayOfArrays corners);
159 std::vector<std::vector<cv::Point2f> > corners, std::vector<cv::Vec3d>
const & rvecs,
160 std::vector<cv::Vec3d>
const & tvecs);
165 std::vector<std::vector<cv::Point2f> > corners, std::vector<cv::Vec3d>
const & rvecs,
166 std::vector<cv::Vec3d>
const & tvecs);
173 unsigned int w,
unsigned int h, std::vector<cv::Vec3d>
const & rvecs,
174 std::vector<cv::Vec3d>
const & tvecs);
Simple wrapper class over the opencv_contrib ArUco augmented reality markers.
void detectMarkers(cv::InputArray image, cv::OutputArray ids, cv::OutputArrayOfArrays corners)
Detect markers.
JEVOIS_DECLARE_PARAMETER(detparams, std::string, "Filename of detector parameters, or empty - Note that " "this parameter cannot be changed at runtime (must be set in the module's params.cfg).", "", ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(showcube, bool, "Show a 3D cube on top of each detected marker, when dopose is also true", false, aruco::ParamCateg)
Parameter.
void postUninit() override
Un-initialize, nuke allocated resources.
cv::Ptr< cv::aruco::ArucoDetector > itsDetector
virtual ~ArUco()
Destructor.
jevois::CameraCalibration itsCalib
void drawDetections(jevois::RawImage &outimg, int txtx, int txty, std::vector< int > ids, std::vector< std::vector< cv::Point2f > > corners, std::vector< cv::Vec3d > const &rvecs, std::vector< cv::Vec3d > const &tvecs)
Draw any markers previously detected by detectMarkers()
JEVOIS_DEFINE_ENUM_CLASS(Dict,(Original)(D4X4_50)(D4X4_100)(D4X4_250)(D4X4_1000)(D5X5_50)(D5X5_100)(D5X5_250)(D5X5_1000)(D6X6_50)(D6X6_100)(D6X6_250)(D6X6_1000)(D7X7_50)(D7X7_100)(D7X7_250)(D7X7_1000)(ATAG_16h5)(ATAG_25h9)(ATAG_36h10)(ATAG_36h11))
Enum for parameter.
static cv::aruco::Dictionary getDictionary(aruco::Dict d)
Static method to allow anyone to get the ArUco dictionary for a given value of our dictionary paramet...
void sendSerial(jevois::StdModule *mod, std::vector< int > ids, std::vector< std::vector< cv::Point2f > > corners, unsigned int w, unsigned int h, std::vector< cv::Vec3d > const &rvecs, std::vector< cv::Vec3d > const &tvecs)
Send serial messages about detections.
JEVOIS_DECLARE_PARAMETER(markerlen, float, "Marker side length (millimeters), used only for pose estimation", 100.0F, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(dopose, bool, "Compute (and show) pose vectors, requires a valid camera calibration", false, ParamCateg)
Parameter.
JEVOIS_DECLARE_PARAMETER(dictionary, Dict, "Symbol dictionary to use - Note that " "this parameter cannot be changed at runtime (must be set in the module's params.cfg).", Dict::D4X4_50, Dict_Values, ParamCateg)
Parameter.
void postInit() override
Initialize, create the detector and read the config files.
void estimatePoseSingleMarkers(cv::InputArrayOfArrays corners, cv::OutputArray rvecs, cv::OutputArray tvecs)
Estimate pose of individual markers.
friend friend class Component