53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
//
|
|
// Created by xtkuang on 2025/6/4.
|
|
//
|
|
|
|
#ifndef MECHMIND_CAMERA_H
|
|
#define MECHMIND_CAMERA_H
|
|
|
|
#pragma once
|
|
|
|
#include <mutex>
|
|
#include <opencv2/opencv.hpp>
|
|
#include "devices/abstract_camera.h"
|
|
#include "area_scan_3d_camera/Camera.h"
|
|
#include "area_scan_3d_camera/api_util.h"
|
|
#include "area_scan_3d_camera/Mapping2DToDepth.h"
|
|
#include "area_scan_3d_camera/Frame3D.h"
|
|
#include "area_scan_3d_camera/Frame2DAnd3D.h"
|
|
|
|
|
|
namespace cmvr::device
|
|
{
|
|
enum Image2DType {COLOR, GRAY};
|
|
//工业级摄像机
|
|
class MechmindCamera: public AbstractCamera {
|
|
public:
|
|
explicit MechmindCamera(const XmlNode& config);
|
|
~MechmindCamera() override = default;
|
|
|
|
void init() override;
|
|
void start() override;
|
|
void stop() override;
|
|
void getRGBImage(cv::Mat& color, Rs2Intrinsics& intrinsics) override;
|
|
void getDepthImage(cv::Mat& depth, Rs2Intrinsics& intrinsics) override;
|
|
void getRGBDImages(cv::Mat &color, cv::Mat &depth, Rs2Intrinsics& intrinsics) override;
|
|
void updateParams(const std::pair<std::string, std::string>& param) override;
|
|
void startRecording(const std::string &video_path) override;
|
|
void stopRecording() override;
|
|
|
|
private:
|
|
std::string ip_;
|
|
bool align_;
|
|
Image2DType image2d_type_;
|
|
|
|
std::mutex dev_mtx_;
|
|
mmind::eye::Camera camera_;
|
|
|
|
static void textured_plc_to_rgbd_(const mmind::eye::TexturedPointCloud& cloud, cv::Mat& color, cv::Mat& depth);
|
|
};
|
|
}
|
|
|
|
|
|
|
|
#endif //MECHMIND_CAMERA_H
|