Capture frames becomes very slow when it's night
Hi everybody, I have a problem with my webcam, has every faith it makes night it becomes slower my code and the following:
#include "opencv2/opencv.hpp"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
void main(void)
{
VideoCapture cap;
cap.open(0);
cap.set(CV_CAP_PROP_FRAME_WIDTH, 160*2);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 120*2);
cap.set(CAP_PROP_FPS,60);
cap.set(CV_CAP_PROP_POS_MSEC, 100);
cap.set(CV_CAP_PROP_BRIGHTNESS, 100);
cap.set(CV_CAP_PROP_CONTRAST, 100);
cap.set(CV_CAP_PROP_SATURATION, 200);
cap.set(CV_CAP_PROP_HUE, 1);
cap.set(CV_CAP_PROP_GAIN, 100);
cap.set(CAP_PROP_AUTOFOCUS, 0);
//cap.set(CV_CAP_PROP_EXPOSURE, CAP_PROP_ISO_SPEED);
while (1)
{
Mat frame;
int64 t = getTickCount();
cap.grab();
cap.retrieve(frame);
t = getTickCount() - t;
printf("Time elapsed: %fms\n", t * 1000 / getTickFrequency());
cout << cap.get(CAP_PROP_FPS) << endl;
imshow("frame", frame);
waitKey(timing);
}
}
Your camera adjust time exposure.. When you use set VdeoVapture method you should use get after to check if parameter is set
I tried to put that
But it is always the same problem, when I put my finger in the camera the number of capture begins to slow
You cannot change the world : when there is not enough photon you have to increase time exposure and hope that read noise is low. You should buy somethin like this good quantum efficiency
You mean there is no possibility to set this with a change in max temp wait
It depends of your driver and your camera. When you write cap.set(CV_CAP_PROP_EXPOSURE, 50); have you check value set using get(CV_CAP_PROP_EXPOSURE) ? Even if you manage to set a low time exposure may be you will have a black image :not enough photon convert in charge in a pixel
I just want to have a static acquisition temp and equal to 60fps
my camera it's logitech c170
That's not possible with a logitech c170. in doc it is written up to 30 fps. Your value is wrong it is ranging from 0 to -11 (may be -14) read this
Ok but it is not static how to make it static
I just changed CV_CAP_PROP AUTO EXPOSURE thank you very much