This commit is contained in:
ackimixs
2024-02-10 16:58:54 +01:00
parent 50b67eb2bf
commit e14fba8a0e
2 changed files with 15 additions and 6 deletions

View File

@@ -19,14 +19,20 @@ ArucoDetector::ArucoDetector(const Type::RobotPose& pose, const std::string& cal
);
this->readCameraParameters(calibrationPath);
this->cap = cv::VideoCapture(cameraId);
// this->cap = cv::VideoCapture(cameraId);
this->cam = lccv::PiCamera;
cam.options->video_width=1920;
cam.options->video_height=1080;
cam.options->framerate=60;
cam.options->verbose=true;
if (!cap.isOpened()) {
/* if (!cap.isOpened()) {
std::cerr << "Error opening camera." << std::endl;
} else
{
started = true;
}
}*/
started = true;
if (!headless)
{
@@ -49,7 +55,7 @@ ArucoDetector::ArucoDetector(const float x, const float y, const float z, const
ArucoDetector::~ArucoDetector()
{
cap.release();
cam.stopVideo();
cv::destroyAllWindows();
}
@@ -86,7 +92,8 @@ std::pair<int, std::vector<std::pair<ArucoTag, std::pair<cv::Mat, cv::Mat>>>> Ar
}
cv::Mat frame;
cap >> frame; // Capture frame from the camera
cam.getVideoFrame(frame, 1);
// cap >> frame; // Capture frame from the camera
std::pair<int, std::vector<std::pair<ArucoTag, std::pair<cv::Mat, cv::Mat>>>> result;

View File

@@ -2,6 +2,7 @@
#include "../utils/utils.h"
#include "ArucoTag.h"
#include <lccv.hpp>
class ArucoDetector {
std::vector<ArucoTag> arucoTags;
@@ -11,7 +12,8 @@ class ArucoDetector {
cv::Mat cameraMatrix;
cv::Mat distCoeffs;
cv::VideoCapture cap;
// cv::VideoCapture cap;
lccv::PiCamera cam;
// 4.6
cv::Ptr<cv::aruco::Dictionary> dictionary;