参考上海交通大学代码进行修改
This commit is contained in:
25
Catalyst-MDVS2/inc/Camera.h
Normal file
25
Catalyst-MDVS2/inc/Camera.h
Normal file
@@ -0,0 +1,25 @@
|
||||
#ifndef CAMERA_H
|
||||
#define CAMERA_H
|
||||
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <string>
|
||||
|
||||
class Camera {
|
||||
public:
|
||||
cv::VideoCapture cap;
|
||||
bool is_opened;
|
||||
std::string target_color;
|
||||
|
||||
Camera(int cam_id = 0, const std::string& target_color = "red");
|
||||
~Camera();
|
||||
|
||||
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();
|
||||
};
|
||||
|
||||
#endif // CAMERA_H
|
||||
Reference in New Issue
Block a user