mirror of
https://github.com/modelec/detection_pot.git
synced 2026-01-18 16:47:33 +01:00
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "../utils/utils.h"
|
|
#include "ArucoTag.h"
|
|
|
|
class ArucoDetector {
|
|
std::vector<ArucoTag> arucoTags;
|
|
|
|
Type::RobotPose* robotPose;
|
|
|
|
cv::Mat cameraMatrix;
|
|
cv::Mat distCoeffs;
|
|
|
|
cv::VideoCapture cap;
|
|
|
|
// 4.6
|
|
// cv::Ptr<cv::aruco::Dictionary> dictionary;
|
|
|
|
// 4.8
|
|
cv::aruco::Dictionary dictionary;
|
|
cv::aruco::DetectorParameters parameters;
|
|
cv::aruco::ArucoDetector detector;
|
|
|
|
bool headless;
|
|
|
|
cv::Mat transformationMatrix;
|
|
|
|
Team team;
|
|
|
|
bool started = false;
|
|
|
|
public:
|
|
ArucoDetector(Type::RobotPose* pose, const std::string& calibrationPath, Team team, int cameraId = 0, bool headless = false);
|
|
|
|
~ArucoDetector();
|
|
|
|
std::pair<int, std::vector<std::pair<ArucoTag, std::pair<cv::Mat, cv::Mat>>>> detectArucoTags(std::vector<ArucoTag> tags = {});
|
|
|
|
void readCameraParameters(const std::string& path);
|
|
|
|
void addArucoTag(const ArucoTag& tag);
|
|
|
|
static void flowerDetector(const ArucoTag& type, const cv::Mat& translationMatrix, const cv::Mat& rotationMatrix);
|
|
|
|
static void solarPanelDetector(const ArucoTag& type, cv::Mat translationMatrix, const cv::Mat& rotationMatrix, const Type::RobotPose& robotPose);
|
|
};
|