eat-sleep-code / camera

This program makes the use of a Raspberry Pi HQ camera a little more powerful and user-friendly. It unleashes easy exposure bracketing, timelapse functionality, etc. It also adds on-screen controls for use with touch screens, additional error handling, and presets for some common settings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compatibility Notice

Due to breaking changes in the Raspberry Pi OS camera stack, if you wish to use this software on a Raspberry Pi running "Bullseye" (or newer) version of Raspberry Pi OS, you must enable Legacy Camera Support via sudo raspi-config > Interface Options > Legacy Camera.


Camera

This program makes the use of a Raspberry Pi HQ camera a little more powerful and user-friendly. It unleashes easy exposure bracketing, timelapse functionality, etc. It also adds on-screen controls for use with touch screens, additional error handling, and presets for some common settings.


Getting Started

  • Use raspi-config to:
    • Set the Memory Split value to a value of at least 256MB
    • Enable the CSI camera interface
    • Enable Legacy Camera Support (if applicable)
    • Set up your WiFi connection
  • Connect the Raspberry Pi HQ Camera to your Raspberry Pi

Installation

Installation of the program, any software prerequisites, as well as DNG support can be completed with the following two-line install script.

wget -q https://raw.githubusercontent.com/eat-sleep-code/camera/master/install-camera.sh -O ~/install-camera.sh
sudo chmod +x ~/install-camera.sh && ~/install-camera.sh

Usage

camera <options>

Options

  • --action : Set the camera action (default: capture)
  • --shutter : Set the shutter speed in milliseconds (default: auto)
  • --iso : Set the ISO (default: auto)
  • --exposure : Set the exposure mode (default: auto)
  • --ev : Set the exposure compensation (+/-10) (default: 0)
  • --bracket : Set the exposure bracketing value (default: 0)
  • --awb : Set the Auto White Balance (AWB) mode (default: auto)
  • --outputFolder : Set the folder where images will be saved (default: dcim/)
  • --raw : Set whether DNG files are created in addition to JPEG files (default: True)
  • --timer : Set the interval for timelapse mode in seconds (default: 0)
  • --previewWidth : Set the preview window width (default: 800)
  • --previewHeight : Set the preview window height (default: 460)

Keyboard Controls

  • Press s+▲ or s+▼ to change shutter speed
  • Press i+▲ or i+▲ to change ISO
  • Press c+▲ or c+▲ to change exposure compensation
  • Press b+▲ or b+▲ to change exposure bracketing
  • Press [p] to toggle the preview window
  • Press the [space] bar to take photos or begin a timelapse
  • Press ␛ to exit

Web Controls

If you need to control your camera via a web-based interface, please see camera.remote.


Autostart at Desktop Login

To autostart the program as soon as the Raspberry Pi OS desktop starts, execute the following command:

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

Add the following line to the end of the file and then save the file:

@lxterminal --geometry=1x1 -e sudo python3 /home/pi/camera/camera.py

Infrared Cameras

If you are using an infrared (IR) camera, you will need to modify the Auto White Balance (AWB) mode at boot time.

This can be achieved by executing sudo nano /boot/config.txt and adding the following lines.

# Camera Settings 
awb_auto_is_greyworld=1

Also note, that while IR cameras utilize "invisible" (outside the spectrum of the human eye) light, they can not magically see in the dark. You will need to illuminate night scenes with one or more IR emitting LEDs to take advantage of an Infrared Camera.


ℹ️ This application was developed using a Raspberry Pi HQ (2020) camera and Raspberry Pi 3B+ and Raspberry Pi 4B boards. Issues may arise if you are using either third party or older hardware.

About

This program makes the use of a Raspberry Pi HQ camera a little more powerful and user-friendly. It unleashes easy exposure bracketing, timelapse functionality, etc. It also adds on-screen controls for use with touch screens, additional error handling, and presets for some common settings.


Languages

Language:Python 93.9%Language:Shell 6.1%