Ask Your Question

Revision history [back]

.set() is not working for brightness and exposure on Macbook

Hi, I m using opencv 4.1.2 and Macbook to set camera properties but continously getting False in response for brightness and exposure while height and width are fine.image description Macbook OpenCV 4.1.2 Logitech Brio 4K

`import cv2 import time cap = cv2.VideoCapture(1,cv2.CAP_AVFOUNDATION) r=cap.set(3,1920) print(r) r=cap.set(4,1080) print(r) time.sleep(2) r1=cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0) r=cap.set(cv2.CAP_PROP_EXPOSURE, -7) print(r1) print(r) r=cap.set(cv2.CAP_PROP_BRIGHTNESS,1.0) print(r) print(cap.get(cv2.CAP_PROP_BRIGHTNESS)) ret, img = cap.read() img1="1.jpg" cv2.imwrite(img1, img)

cv2.imshow(img)

cap.release() `

Response True True False False False 0.0

click to hide/show revision 2
None

updated 2020-07-30 06:03:48 -0600

berak gravatar image

.set() is not working for brightness and exposure on Macbook

Hi, I m using opencv 4.1.2 and Macbook to set camera properties but continously getting False in response for brightness and exposure while height and width are fine.image description fine. Macbook OpenCV 4.1.2 Logitech Brio 4K

`import

import cv2
import time
cap = cv2.VideoCapture(1,cv2.CAP_AVFOUNDATION)
r=cap.set(3,1920) 
print(r)
r=cap.set(4,1080)
print(r)
time.sleep(2)
r1=cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0)
r=cap.set(cv2.CAP_PROP_EXPOSURE, -7)
print(r1)
print(r)
r=cap.set(cv2.CAP_PROP_BRIGHTNESS,1.0)
print(r)
print(cap.get(cv2.CAP_PROP_BRIGHTNESS))
ret, img = cap.read()
img1="1.jpg"
cv2.imwrite(img1, img)img)
#cv2.imshow(img)
cap.release()

Response

cv2.imshow(img)

cap.release() `

Response

True
True
False
False
False
0.0

0.0