Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// Created by andya on 02.07.18.
//
#ifndef BOSON_CAMERA_H
#define BOSON_CAMERA_H
#include <string>
#include <linux/videodev2.h>
#include <opencv2/opencv.hpp>
#include "boson_camera/boson_cameraConfig.h"
class BosonCamera {
int fd;
std::string device;
struct v4l2_capability cap;
struct v4l2_format format;
struct v4l2_buffer buffer;
cv::Mat raw_input;
public:
int width;
int height;
timeval last_ts;
bool raw16_;
BosonCamera();
BosonCamera(std::string device_address);
~BosonCamera();
void init();
void allocateBuffer();
void startStream();
void ConfigureStream();
void stopStream();
void closeConnection();
int ConnectSerial();
void SetVideoFormat();
void SetSmartAverager(bool ave) const;
void SetPixelFormat(bool raw) const;
void SetNucMode(int nuc) const;
void DoNuc(bool& nuc) const;
cv::Mat captureRawFrame();
void Configure(boson_camera::boson_cameraConfig &config);
private:
void AGC_Basic_Linear(cv::Mat input_16, cv::Mat output_8, int height, int width);
};
#endif