How to set or get VideoCapture Properties
Hello all.
I am attempting to set the properties of a nice Webcam with OpenCV. In particular, I would like to be able to change the exposure, gain, and auto-exposure/gain properties of my camera. I have tried setting properties with methods such as the following in my project:
bool CaptureThread::connectToCamera()
{
cap = new VideoCapture(0);
cap->set(CV_CAP_PROP_FRAME_WIDTH, width);
cap->set(CV_CAP_PROP_FRAME_HEIGHT, height);
cap->set(CV_CAP_PROP_EXPOSURE, 0.20); //Or multiple other values here.
return cap->isOpened();
}
The width and height parameters are set accordingly here and elsewhere, but any other parameters I attempt to pass are ignored. My only real goal is to be able to set these values manually so that the camera doesn't waste time balancing itself for a clearer image. (This will be used in an entirely closed lightening environment.
Can anyone help me with this issue, or let me know if these functions aren't usable by all cameras? Otherwise, do you have suggestions for a workaround?
I apologize if I am not being clear or giving enough information. I will try to clarify anything else that is needed of me.
Its not explicitly mentioned, but the return value should give you a clue if the set was successful. Its a simple boolean.
@Ketta Also see the answer here might be helpful.