Cannot set auto exposure OFF on B020201 module in opencv

1.Which seller did you purchase the product(s) from?
thepihut.com
2.The Model number of the product(s) you have purchased?
B020201
3.Which Platform are you using the product(s) on?
Python Mac OSX
4.Which instruction are you following?
https://stackoverflow.com/questions/11420748/setting-camera-parameters-in-opencv-python I also got this functionality working on a Raspberry Pi 4 with the Pi Camera.
5.Has your product ever worked properly?
it works properly but I cannot set the exposure manually with opencv python
6.What problems are you experiencing?
I am trying to set the auto exposure off on the B020201 camera module.

I am using opencv 4.5.3.56 in python 3.8.0 on mac osx Big Sur. the camera works and I am able to run my python script but I cannot set the auto exposure off and control it manually.

This is my code

cam = cv2.VideoCapture(cam_id)
cam.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cam.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)

cam.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc(‘UYVY’)) #I also tried cv2.VideoWriter.fourcc(‘MJPG’)

cam.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0.75) # I also tried cam.set(cv2.CAP_PROP_AUTO_EXPOSURE, 0.25)
cam.set(cv2.CAP_PROP_EXPOSURE, 10.0)

print(cam.get(cv2.CAP_PROP_AUTO_EXPOSURE))

The print statement always returns 0.0 no matter what I do and the auto exposure is always on.

Can you help me with this issue?

Thanks in advance

Michele
7.What attempts at troubleshooting have you already made?
See above
8.How would you like us to help you?
Could you please provide code or a workflow to achieve the goal of turning off uto exposure in python with opencv

Hi,

Please refer to the following image.

Thank you so much for your help. I can confirm this works on Windows.

It doesn’t work on OSX though and as you haven’t listed a solution for OSX I am now assuming it only works on Linux and Windows. Is that correct?

I have found this github repo which helped me working with UVC cameras on OSX but the exposure results are inconsistent.

https://github.com/jtfrey/uvc-util

Do you know a way of controlling the exposure of this UVC camera via python code on OSX?

Many thanks

Michele

 

Hi,

We have not tested the change exposure on python code on OSX so far, so we can’t give you enough suggestions.