I’m trying to write to the IMX219 camera sensor register and change the exposure time in the arducam_camera.py code when it first opens the camera. However, it won’t allow me to change the exposure time. Does anyone know a way to fix this? I’m also playing around with changing the binning and that too doesn’t seem to work. However, if I write to the camera rotation register that does work.
#self.arducam_utils.write_sensor(0x1142, 0x41A) #set 1142 from 255us to 1050us #self.arducam_utils.write_sensor(0x1143, 0x41A) #set 1143 from 254us to 1050us
self.arducam_utils.write_sensor(0x015A, 0x3E8) #course integration time 1000
self.arducam_utils.write_sensor(0x015B, 0x3E8)
self.arducam_utils.write_sensor(0x025A, 0x3E8)
self.arducam_utils.write_sensor(0x025B, 0x3E8)
self.arducam_utils.write_sensor(0x0174, 0x00) #Set Binning H from 1 to 2
self.arducam_utils.write_sensor(0x0175, 0x00) #Set Binning V from 1 to 2
self.arducam_utils.write_sensor(0x0274, 0x00) #Set Binning H from 1 to 2
self.arducam_utils.write_sensor(0x0275, 0x00) #Set Binning V from 1 to 2
print(self.arducam_utils.read_sensor(0x015D))
turn off RGB conversion
if self.arducam_utils.convert2rgb == 0:
self.cap.set(cv2.CAP_PROP_CONVERT_RGB, self.arducam_utils.convert2rgb)
set width
if width != -1:
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
set height
if height != -1:
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
I followed exactly all the stops shown in the link you provided above.
It seems the v4l2 is installed successfully in this step:
amtd@amtd-desktop:~$ sudo pip3 install v4l2
WARNING: The directory ‘/home/amtd/.cache/pip’ or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo’s -H flag.
Collecting v4l2
Downloading v4l2-0.2.tar.gz (23 kB)
Building wheels for collected packages: v4l2
Building wheel for v4l2 (setup.py) … done
Created wheel for v4l2: filename=v4l2-0.2-py3-none-any.whl size=13024 sha256=c18a8f3b47653e86c01b638fe9707de4b6fb7919f9b5fe32c4aed78f93125d82
Stored in directory: /tmp/pip-ephem-wheel-cache-nmfrwcjl/wheels/82/fa/1f/e86ec7e34cf44a14cae4ea0318e336be9f5ea2bf864cb055b2
Successfully built v4l2
Installing collected packages: v4l2
Successfully installed v4l2-0.2
But it still cannot find v4l2 when running the demo code in this step:
amtd@amtd-desktop:~/MIPI_Camera/Jetson/Jetvariety/example$ python arducam_displayer.py -d 0
Traceback (most recent call last):
File “arducam_displayer.py”, line 8, in <module>
from utils import ArducamUtils
File “/home/amtd/MIPI_Camera/Jetson/Jetvariety/example/utils.py”, line 1, in <module>
import v4l2
ImportError: No module named v4l2
PS: I am using IMX219 auto-focus camera on Nano, without Jetvariety adapter board.
I’m using Python 3.6. So I follow the instruction to use “sudo pip3 install v4l2”. According to the instruction, “sudo pip install v4l2” is used for Python 2.7.
I want to manually set parameters of exposure time, white balance, iris, gain, etc… There is no such example in your demo code. I used Google to search, but ended without useful findings. Can you please share some codes with me? Thank you.