Skip to content

setting exposure not working for Logitech cameras #15958

@ramymagdy-rm

Description

@ramymagdy-rm

Expected behaviour

since version 3.2.0.7, setting exposure was not possible anymore, I had to use other cameras and they worked! but not for Logitech C930 or C270 along with opencv-python, using different platforms macOS, Linux and windows

Write here how did you expect the library to function.
to set the exposure using the function, I've used before
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_EXPOSURE, -11)

Actual behaviour

now setting the exposure has no effect
even cap.get(cv2.CAP_PROP_EXPOSURE)
returns 0.0

Write here what went wrong.

Steps to reproduce

use any of the mentioned cameras

for the code use a simple video acquisition

  • example code

import cv2

cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_EXPOSURE, -11)
print(cap.get(cv2.CAP_PROP_EXPOSURE))

while True:
#cap.set(cv2.CAP_PROP_FPS, 30)
_, frame = cap.read()
#cv2.imshow('frame', frame)
cv2.imwrite('image.png', frame)

key = cv2.waitKey(1)
if key & 0xFF == ord('s'):
cv2.imwrite('image.png', frame)
if key & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()

  • operating system
    macOS Catalina, linux ubuntu 18.04, windows 10

  • architecture (e.g. x86)
    64-bit

  • opencv-python version
    opencv-python -> 4.1.1(26)

macOS Catalina, python 3.7.5
linux ubuntu 18.04, python 3.6.8
windows 10, python 3.7.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions