Formula First effect:
The upper left corner represents the exposure parameters, general -10~-3 and then the big basic is too bright ...
The first thing to determine is whether the camera can adjust the exposure ... Not all cameras support the adjustment of exposure.
1. See if the camera can adjust the exposure.
Download Open AMCap, select a specific camera, Options--video device--properties--see if the camera control in the second column can adjust the exposure ...
If you can, then the basic can be OPENCV control to adjust the exposure
2. Configure the OpenCV adjustment
Configuration environment See: Address
The simple brute code is as follows:
#include <opencv2/opencv.hpp>
#include <iostream>
using namespace CV;
using namespace std;
int main ()
{
videocapture cap (0);
Mat frame;
Cap.set ()
Auto i = Cap.get (cv_cap_prop_exposure);
cout << "Exposure before setting is:" << i << Endl;
int loop adjustment = 0;
while (Waitkey ()!=27)
{
cyclic adjustment + +;
Cyclic regulation%=;
cout << "After setting exposure as:" << cap.get (cap_prop_exposure);
Cap.set (Cv_cap_prop_exposure, (cyclic adjustment/10) -10);
cout << "After setting exposure as:" << cap.get (cap_prop_exposure) <<endl;
Cap >> frame;
Puttext (Frame, "Exposure:" + to_string (cyclic adjustment/10-10), point (3), 0, 1.0, Scalar (255, 0));
Imshow ("Call camera", frame);
return 0;
}
Accidentally need to adjust the camera parameters, so I wrote a blog ~ ~
OpenCV Use Pleasant ~