We can’t seem to set the exposure on our OV7251 camera on a Raspberry Pi Zero 2 or Raspberry Pi 3B.
Things we’ve tried:
v4l2-ctl -d /dev/video0 --set-ctrl exposure=1700
Result: v4l2-ctl will report the correct exposure, but images taken through the v4l2-ctl command line tool don’t change. They have the same low intensity regardless of the exposure we set.
using openCV in Python, we’ve tried
cap = cv2.VideoCapture(0)
cap = cap.set(cv2.CAP_PROP_EXPOSURE, ITSY)
ret, frame = cap.read()
But the images we get all have the same intensity regardless of what we set for ITSY.
BTW: cap.get(cv2.CAP_PROP_EXPOSURE) returns -1 before and after trying to set the exposure time.
import arducam_mipicamera as arducam
camera = arducam.mipi_camera()
this crashes before we can even try to set the exposure. The error is:
init_camera: Unexpected result.
BTW: The example script for arducam_mipicamera, https://github.com/ArduCAM/MIPI_Camera/blob/master/RPI/python/preview.py
uses the Python package v4l2 which is incompatible with requires Python 2.7 which in turn has been
unmaintained for over two years. We suspect that arducam_mipicamera is also incompatible with Python 3 and that may be the reason for the error.
using arducamstill, compiled from the git project:
Simply running the programm gives us the rather uninformative output:
init camera status = 4099
To summarize: The two ways to effectively take images we have found were a) through the v4l2-ctl utility and b) through OpenCV, neither of which seem to set or respect the exposure setting.
thanks for your help. We downloaded the image you recommended and set up a RPI Zero 2 with it. We changed the config file /boot/config.txt by adding
under the line [all]
However, the camera does not work. For example, when executing
libcamera-jpeg -o test.jpg
[0:01:21.117955806]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3424-e68e0f1e
[0:01:21.147143198]  WARN CameraSensorProperties camera_sensor_properties.cpp:141 No static properties available for ‘ov7251’
[0:01:21.147239084]  WARN CameraSensorProperties camera_sensor_properties.cpp:143 Please consider updating the camera sensor properties database
[0:01:21.147311375]  ERROR CameraSensor camera_sensor.cpp:551 ‘ov7251 10-0060’: Camera sensor does not support test pattern modes.
[0:01:21.166697849]  ERROR IPAProxy ipa_proxy.cpp:149 Configuration file ‘ov7251.json’ not found for IPA module ‘raspberrypi’
[0:01:21.166821703]  ERROR IPARPI raspberrypi.cpp:190 Could not create camera helper for ov7251
[0:01:21.166885349]  ERROR RPI raspberrypi.cpp:1197 Failed to load a suitable IPA library
[0:01:21.167198681]  ERROR RPI raspberrypi.cpp:1129 Failed to register camera ov7251 10-0060: -22
ERROR: *** no cameras available ***
I am using Bullseye with kernel 5.15.76-v8+. Is there a preferred kernel version and libcamera version to use? All the software is updated and upgraded.
I can query the camera in v4l2-ctl but there are no control options for things like exposure, fps, etc. About 6 months ago I had a working Bullseye setup with this camera using libcamera for acquisition and v4l2-ctl to handle settings, but on a fresh install on the latest and newest OS and software this issue is happening.
Hi, Sorry for my late reply. I know the issue. It is due to that libcamera-dev has not add support for the ov7251 sensor. At present, opencv lib is a better application for you. Firstly, please ensure the video0 node is exist by running the ls /dev/video0 command.
Then you can use opencv to grap frame , referring to here