优化项目结构
This commit is contained in:
34
inc/MindVisionCamera.h
Normal file
34
inc/MindVisionCamera.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#ifndef MINDVISION_CAMERA_H
|
||||
#define MINDVISION_CAMERA_H
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <string>
|
||||
|
||||
// MindVision SDK 头文件 - 可能需要根据实际SDK文件调整
|
||||
extern "C" {
|
||||
#include "CameraApi.h" // 这是MindVision SDK的典型头文件
|
||||
}
|
||||
|
||||
class MindVisionCamera {
|
||||
public:
|
||||
int camera_handle; // MindVision SDK中的相机句柄
|
||||
bool is_opened;
|
||||
std::string target_color;
|
||||
int width;
|
||||
int height;
|
||||
int fps;
|
||||
|
||||
MindVisionCamera(int cam_id = 0, const std::string& target_color = "red");
|
||||
~MindVisionCamera();
|
||||
|
||||
void set_cam_params();
|
||||
bool read_frame(cv::Mat& frame);
|
||||
void release();
|
||||
bool switch_color(const std::string& target_color);
|
||||
|
||||
private:
|
||||
void set_camera_parameters();
|
||||
bool initialize_camera(int cam_id);
|
||||
};
|
||||
|
||||
#endif // MINDVISION_CAMERA_H
|
||||
Reference in New Issue
Block a user