#include <opencv2/highgui.hpp>
#include <opencv2/videoio.hpp>
using namespace std;
int main()
{
Mat tmp;
while (!capture.read(tmp))
ERROR_(
"fail to read the image.");
VideoWriter writer("ts.avi", VideoWriter::fourcc('F', 'L', 'V', '1'), 40, tmp.size());
int exposure = 1000;
int gain = 64;
int r_gain = 1200;
int g_gain = 1200;
int b_gain = 1200;
FileStorage fs("out_para.yml", FileStorage::READ);
if (fs.isOpened())
{
fs["exposure"].isNone() ? void(0) : (fs["exposure"] >> exposure);
fs["gain"].isNone() ? void(0) : (fs["gain"] >> gain);
fs["r_gain"].isNone() ? void(0) : (fs["r_gain"] >> r_gain);
fs["g_gain"].isNone() ? void(0) : (fs["g_gain"] >> g_gain);
fs["b_gain"].isNone() ? void(0) : (fs["b_gain"] >> b_gain);
}
Mat frame;
while (capture.read(frame))
{
imshow("frame", frame);
writer.write(frame);
if (waitKey(1) == 27)
if (waitKey(0) == 27)
break;
}
}
@ CAMERA_WB_BGAIN
白平衡蓝色分量 Blue channel gain of white balance
Definition: camutils.hpp:65
@ CAMERA_WB_GGAIN
白平衡绿色分量 Green channel gain of white balance
Definition: camutils.hpp:64
@ CAMERA_MANUAL_EXPOSURE
手动曝光 Manual exposure
Definition: camutils.hpp:58
@ CAMERA_EXPOSURE
曝光值 Expusure
Definition: camutils.hpp:60
@ CAMERA_MANUAL_WB
手动白平衡 Manual white balance
Definition: camutils.hpp:59
@ CAMERA_WB_RGAIN
白平衡红色分量 Red channel gain of white balance
Definition: camutils.hpp:63
@ CAMERA_GAIN
模拟增益 Analog gain
Definition: camutils.hpp:61
@ RETRIEVE_CV
使用 OpenCV 的 'cvtColor' 进行处理 Retrieve using cvtColor function in OpenCV
Definition: camutils.hpp:41
@ GRAB_CONTINUOUS
连续采样 Continuous grabbing
Definition: camutils.hpp:31
#define ERROR_(...)
Definition: util.hpp:50
Definition: uty_math.hpp:65
Definition: camutils.hpp:23