Cameras for Raspberry Pi

  1. Home
  2. Docs
  3. Cameras for Raspberry Pi
  4. Synchronized Stereo Camera HAT
  5. Camarray – Arducam 1MP (OV9782 Color) Quad-Camera Bundle Kit

Camarray – Arducam 1MP (OV9782 Color) Quad-Camera Bundle Kit

1.Introduction

This Arducam Camarray HAT (supports four inputs) is an upgraded version of the Arducam synchronous stereo camera HAT (supports two inputs). This quad-camera bundle kit aggregates four OV9782 color cameras into one video stream, compared to its counterpart OV9282 monochrome quad-camera bundle kit. So that it is completely synchronized, the output is a standard MIPI CSI-2 interface, which can be connected to Raspberry Pi, Jetson Nano, Jetsno NX, and other platforms.

1 8

2.Hardware

Follow the picture below for hardware connection (refer to the picture below for four-camera OV9281, only the camera is different).

2 7

The HAT can be plugged into the Jetson Nano and powered by a 2×3 row of female sockets through its 2×20 GPIO pin header.

Camera Board

UC 760 camera board sizing

Camarray HAT

3.Software

3.1.Driver installation

3.1.1.Understanding Different Camera Drivers

There are potentially three camera drivers you may come across on the RPI boards, the official camera driver(OV5647/IMX219/IMX477), the Arducam MIPI Camera userland driver, and the Arducam V4L2 OBISP driver.
● The Arducam MIPI Camera driver does not conflict with the official driver.
● Arducam V4L2 OBISP driver conflicts with the official driver. After installing the Arducam V4L2 OBISP driver, the official driver’s corresponding commands (raspistill and raspivid) will be invalid; if you want to use the official driver, you need to uninstall the Arducam V4L2 OBISP driver first.
● Arducam V4L2 OBISP driver conflicts with Arducam MIPI Camera driver. If you want to use the Arducam MIPI Camera driver, you need to uninstall the Arducam V4L2 OBISP driver first.
● When the Arducam V4L2 OBISP driver is installed, the other two drivers will be automatically overwritten. After uninstalling the Arducam V4L2 OBISP driver, it will automatically restore to the official driver.

Note


This product uses the Arducam V4L2 OBISP drive scheme.

3.1.2.Identify the Camera Driver Installed

It mainly determines whether the Arducam V4L2 OBISP driver is installed in the current system.
Execute the following command

sudo nano /boot/config.txt

Press PgDn to see if there is dtoverlay=arducam at the end of the text.

3 5
  • If there is dtoverlay=arducam, it means that the V4L2 OBISP driver of Arducam has been installed before and is in a valid state.
  • If it is #dtoverlay=arducam, it is commented out. It means that the Arducam V4L2 OBISP driver has been installed before, but it is in the uninstalled state. Delete # to restore the V4L2 OBISP driver. Note that it will take effect after rebooting.
  • If not, it means that the Arducam V4L2 OBISP driver has never been installed before, and you need to install it completely according to the following instructions.

3.1.3.Driver installation

Refer to the link to install the Arducam V4L2 OBISP driver.

  • Download the driver package
wget https://github.com/ArduCAM/Arducam_OBISP_MIPI_Camera_Module/releases/download/v1.0/Release.tar.gz
4 3
  • Unzip
tar zxvf Release.tar.gz
5 2
  • Enter the catalog
cd Release/
6 3
  • Install driver
./install_driver.sh
7 3

Enter y and Enter to restart the system.

If the Raspberry Pi system is not an officially released version, an error will be reported when the driver is installed, and a version error message will be displayed.


The following link can view the official release version of the Raspberry Pi system: https://www.raspberrypi.org/software/operating-systems/


3.1.4.Driver Uninstallation

By the way, there are two ways to uninstall the Arducam V4L2 OBISP driver.

Method 1: Execute the uninstall command

Enter the catalog

cd Release/

Excuting an order

./uninstall_driver.sh

It will take effect after rebooting.

Method 2: Modify the configuration file

Excuting an order

sudo nano /boot/config.txt

Press PgDn to find dtoverlay=arducam at the end.

Modify it to #dtoverlay=arducam, press Ctrl+X, y, Enter to save and exit.

It will take effect after rebooting.

3.2.Test command

3.2.1.Check whether the camera is detected

ls /dev/video0

3.2.2Check the video format supported

v4l2-ctl --list-formats-ext

Currently, only the two formats of RGGB and pRAA are supported, and the format of RG10 is not supported.

3.2.3.Real-time display of images

The image display commands currently supported by the four-camera OV9782 are:

#RAW8

arducamstill -t 0 -pixfmt RGGB -w 5120 -h 800

#RAW10

arducamstill -t 0 -pixfmt pRAA -w 5120 -h 800

RGGB means RAW8, pRAA means RAW10.
-w and -h represent the width and height of the input image.

Take RAW8 5120×800 as an example.

arducamstill -t 0 -pixfmt RGGB -w 5120 -h 800

The last line will display the frame number in real time.

Press Ctrl+C to exit the image display.

3.2.4.Only receive data without display 

Affected by platform performance, the display may drop frames.
You can test the actual number of input image frames by only receiving data without displaying images.

The commands that only receive data but do not display are as follows:

#RAW8

v4l2-ctl --set-fmt-video=width=5120,height=800,pixelformat='RGGB' --stream-mmap --stream-count=-1 -d /dev/video0

#RAW10

v4l2-ctl --set-fmt-video=width=5120,height=800,pixelformat='Y10P' --stream-mmap --stream-count=-1 -d /dev/video0

For example, in the RAW8 mode just now, the display is only 36fps, but only the data can be received up to 44fps.

3.2.5.Adjust exposure

Operation method: Open two command windows at the same time, the first window executes the image display command, and the second window executes the adjust exposure command.

The commands for adjusting the exposure are:

v4l2-ctl -c exposure=1000

The command to view the exposure parameters (minimum, maximum, default) is:

v4l2-ctl -l

For example, execute the command in the second window:

v4l2-ctl -c exposure=1000

Increase the exposure time, and the resulting picture will become brighter and the frame rate will drop.

3.2.6.Adjust the gain

Operation method: Open two command windows at the same time, the first window executes the image display command, and the second window executes the gain adjustment command.

The command to adjust the gain is:

v4l2-ctl -c gain=12

The command to view gain parameters (minimum, maximum, default) is:

v4l2-ctl -l

For example, execute the command in the second window:

v4l2-ctl -c gain=12

Increase the gain, and the resultant picture will become brighter, and the frame rate will not change.

3.2.7.Adjust the frame rate

Operation method: Open two command windows at the same time, the first window executes the image display command, and the second window executes the frame rate adjustment command.

The command to adjust the frame rate is:

v4l2-ctl -c frame_rate=30

Among them, frame_rate=X, X is the set number of frames.

For example, execute the command in the first window:

arducamstill -t 0 -pixfmt RGGB -w 5120 -h 800

The last line displays the current frame rate in real time.

Then execute the command in the second window:

v4l2-ctl -c frame_rate=10

Then the frame rate display of the first window will change to 10fps.

In the second window, execute the following command to view the frame rate range of the current display mode:

v4l2-ctl -l

If the set frame rate exceeds the maximum value, it will work according to the maximum value. The same goes for the minimum value.

Affected by platform performance, the display may drop frames.
For example, when the frame rate is set to 46 frames, the display can only reach 37fps.

When only receiving data is not displayed, the frame rate can be displayed as 44fps.

When only data is received, the displayed frame rate value is not real-time. It will be calculated iteratively with the historical value and change slowly.

3.3.Display image through VLC player

The Raspberry Pi system comes with a VLC player, and it can also display images in real time through the VLC player.

3.3.1.Display image

Select Media-Open Capture Device…, or shortcut key Ctrl+C.

On the Capture Device tab, click the down arrow at Video device name, select /dev/video0, and then click Play.

Affected by the performance of the Raspberry Pi and the player, the image may be sluggish.

3.3.2.Adjust exposure, gain and frame rate

ClickTools-Effects and Filters

Under the v4l2 control tab,

  • Drag the Exposure slider to adjust the exposure.
  • Drag the Gain slider to adjust the gain.
  • Drag the frame_rate slider to adjust the frame rate.

Was this article helpful to you? Yes No