- capture_calib: capture calibration images (MindVision / USB) with a live quality gate (Laplacian sharpness, 3x3 coverage, board auto-detect) - calibrate: batch intrinsics from calib_images/, writes configs/camera.yaml - camera_calib: CameraCalib loader (intrinsics + distortion, cached undistort remap) and solvePose() via IPPE with a reprojection gate - configs/camera.yaml: MV-SUA131GC intrinsics, RMS 0.483 px over 31 images, ruler-verified distance error < 2% - xmake: three targets sharing an rm_deps rule, C++17 - gitignore: keep calibration photos/videos and generated compile_commands.json out of the repo
36 lines
1.7 KiB
C++
36 lines
1.7 KiB
C++
#ifndef CAMERA_SET_HPP
|
|
#define CAMERA_SET_HPP
|
|
|
|
#include "CameraDefine.h" // 类型定义
|
|
#include <opencv2/opencv.hpp>
|
|
|
|
|
|
class CameraGrabber
|
|
{
|
|
public:
|
|
CameraGrabber(); // 构造函数声明
|
|
~CameraGrabber(); // 析构函数声明
|
|
|
|
bool initializeCamera(); // 初始化相机
|
|
bool startCamera(); // 启动相机
|
|
bool stopCamera(); // 停止相机
|
|
// bool setExposureTime(double exposureTime); // 设置曝光时间
|
|
// bool setGain(double gain); // 设置增益
|
|
// bool setWhiteBalance(double redGain, double blueGain); // 设置白平衡
|
|
// bool setResolution(int width, int height); // 设置分辨率
|
|
// bool setFrameRate(double frameRate); // 设置帧率
|
|
bool getFrame(cv::Mat &frame); // 获取一帧图像
|
|
|
|
private:
|
|
CameraHandle hCamera = -1; // 相机句柄
|
|
tSdkCameraCapbility capability; // 相机能力描述
|
|
unsigned char *pRgbBuffer = nullptr; // 图像处理缓冲区
|
|
int channel = 3; // 通道数:1 灰度,3 彩色
|
|
bool isInitialized = false; // 是否已初始化
|
|
bool isPlaying = false; // 是否已启动取流
|
|
|
|
|
|
};
|
|
|
|
#endif
|