Skip to content

a-rmolina/arducam-apps

 
 

Repository files navigation

rpicam-apps

This is a small suite of libcamera-based applications to drive the cameras on a Raspberry Pi platform.

Warning

These applications and libraries have been renamed from libcamera-* to rpicam-*. Symbolic links are installed to allow users to keep using the old application names, but these will be deprecated soon. Users are encouraged to adopt the new application and library names as soon as possible.

Build

To build the c++ code to capture in a Raspberry PI

The standard used is the c++17 as it is the one used by the Raspberry Pi base apps. These instructions has been obtained from the official Raspberry Pi documentation pages here.

  1. Install the dependencies.
sudo apt install -y libcamera-dev libepoxy-dev libjpeg-dev libtiff5-dev libpng-dev

sudo apt install -y qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5

sudo apt install libavcodec-dev libavdevice-dev libavformat-dev libswresample-dev

sudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev

sudo apt install -y meson ninja-build
  1. Configure the build using the following meson command.
meson setup build -Denable_libav=enabled -Denable_drm=enabled -Denable_egl=enabled -Denable_qt=enabled -Denable_opencv=disabled -Denable_tflite=disabled
  1. Build the program.
meson compile -C build

To setup the python control and visualization code.

This code has been tested in python 3.8 and 3.10.

  1. Install, if necessary, the Python virtual environment module.
sudo apt-get install python3-venv
  1. Create a virtual enviroment and install the required libraries.
cd python
python3 -m venv venv --prompt arducam
source venv/bin/activate
pip install -r requirements.txt

License

The source code is made available under the simplified BSD 2-Clause license.

Status

ToT libcamera build/run test

Use Examples

Capturing Code

  • Save Images on a File
./build/apps/arducam-raw -t 2000 -o $HOME/outputs/residual_test/name%05d.raw --mode 2028:1080:10:U --shutter 1ms  --gain 1 --awbgains 1,1 --resolution MEDIUM --nopreview --verbose 2 --segment 1
  • Send Images to a TCP server
./build/apps/arducam-raw -t 2000 -o tcp://10.42.0.1:32233 --mode 2028:1080:10:U --shutter 1ms  --gain 1 --awbgains 1,1 --resolution MEDIUM --nopreview --verbose 2

Visualization code

  • Start a server in a local repository to visualize the images.
python3 arducam_tcp.py --ip 127.0.0.1 --resolution MEDIUM
  • Save the images on files whithout showing them.
python3 arducam_tcp.py --ip 127.0.0.1 --resolution MEDIUM --output_folder outputs --no_show

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.3%
  • Python 22.8%
  • Meson 1.9%