How to turn on the webcam for auto focus before snap the image?
My image capture code looks like this:
{
CvCapture* capture = cvCaptureFromCAM(0);
cvSetCaptureProperty(capture ,CV_CAP_PROP_FRAME_WIDTH , 800);
cvSetCaptureProperty(capture ,CV_CAP_PROP_FRAME_HEIGHT , 600);
if(!cvGrabFrame(capture))
{
cout << "Could not grab a frame\n\7";
exit(0);
}
IplImage* img=cvRetrieveFrame(capture);
}
I tried using the wait key, etc., tried to use Google, but to no avail. Does anyone know how I can guarantee that autofocus is applied even before the image is clicked? Because the image is now a little more “blurry” than I would like.
source
share