mirror of
https://github.com/modelec/detection_pot.git
synced 2026-01-19 00:57:28 +01:00
up
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user