Camera properties

asked 2018-07-13 01:25:56 -0500

Dear community,

I am currently working on a program that tests a 7-segment display for its function. The program (written in Python with OpenCV libary) saves a camera image and examines segments of the image for characteristic points.

In Windows 10, the program runs without problems, in Windows 7, however, the camera configuration does not work because this assumes a Windows function called "videoquelle"

Code:

cap = cv2.VideoCapture() cap.set(3 , 1200 ) # width
cap.set(4 , 1000 ) # height
cap.set(10, 100 ) # brightness min: 0 , max: 255 , increment:1
cap.set(11, 255 ) # contrast min: 0 , max: 255 , increment:1
cap.set(12, 0 ) # saturation min: 0 , max: 255 , increment:1 cap.set(13, 0 ) # hue
cap.set(14, 30 ) # gain min: 0 , max: 127 , increment:1 cap.set(15, -4 ) # exposure min: -7 , max: -1 , increment:1 cap.set(17, 1200 ) # white_balance min: 4000, max: 7000, increment:1 cap.set(28, 24 ) # focus min: 0 , max: 255 , increment:5

camera_port = 0
camera = cv2.VideoCapture(camera_port)
time.sleep(0.1) 
return_value, image = camera.read()
cv2.imwrite("test.png", image)
del(camera)

Does anyone have an idea how the parameterization of the camera can be done exclusively via the Code ?

Best regards

Sebastian

edit retag flag offensive close merge delete