webcam image capture focusing problem

asked 2016-05-18 08:41:13 -0500

Dr Dre gravatar image

Hi guys

I have written a basic code which captures an image from webcam using python 2.7 .

The code is as follows

import numpy
import cv2
cap = cv2.VideoCapture(0)
ret, frame = cap.read()
cv2.imshow('image',frame)
cap.release()
cv2.waitKey(0)
cv2.destroyAllWindows()

This code gives the correct output but my camera takes a few seconds to focus so i get a black or dim image as output instead of a bright proper focused image..

how can i correct this problem. I am using cv2 and python 2.7

edit retag flag offensive close merge delete

Comments

This sounds like a camera problem and not an OpenCV one...

LorenaGdL gravatar imageLorenaGdL ( 2016-05-18 10:41:38 -0500 )edit