-
Notifications
You must be signed in to change notification settings - Fork 102
Panoramic Images Stitching Feature
The PANO feature takes multiple overlapping images in different directions using a Pimoroni, Waveshare or compatible Pan Tilt Hat. Drivers and dependencies are installed during the curl pi-timolo-install.sh setup. PANO feature can run in parallel with TIMELAPSE_ON = True including TIMELAPSE_PANTILT_ON and/or any of the Motion Tracking Options eg Full Size Still Image MOTION_TRACK_ON = True (Other Motion options Set to False) or one of MOTION_VIDEO_ON or MOTION_TRACK_MINI_TL_ON or MOTION_TRACK_QUICK_PIC_ON. See config.py comments for more details.
Ensure your pan tilt hat has been assembled, installed and tested. See Pimoroni instructions or my waveshare.pantilthat Repo for details. Make sure you Enable I2C and PiCamera using sudo raspi-config per instructions.
To Enable the pi-timolo pano feature, set the config.py variables below
PANTILT_ON = True # True= Enable Pan Tilt Hat hardware, False= Disable for TIMELAPSE_PANTILT_ON and PANO_ON
PANO_ON = True # True= Enable panoramic image using pantilt overlapping images
Depending on the brand of pantilthat eg Pimoroni, Waveshare (or compatible), you will need to set the variable below accordingly.
PANTILT_IS_PIMORONI = True # True= Use Pimoroni pantilehat, False= Use Waveshare pantilthat
Pimoroni uses its own drivers (part of curl install). WaveShare uses a modified Waveshare pantilthat driver and bcm2835 (Also part of curl install)
You should review the other PANO options and edit to your needs.
PANO_IMAGE_PREFIX = 'pano-' # Prefix for pano images
PANO_TIMER_SEC = 300 # Default= 300 5min Duration between taking pano images (Allow enough time for stitching)
# Adjust timer To avoid multiple stitching operations at once per cpu and cores
PANO_NUM_START = 1000 # Default= 1000 Start of image numbering sequence
PANO_NUM_MAX = 20 # Maximum number of pano's to take 0=Continuous.
PANO_NUM_RECYCLE = True # True will Recycle numbering when NUM MAX exceeded
PANO_DAYONLY_ON = True # Default= True Take Pano only during day. False= Day and Night
PANO_IMAGES_DIR = './media/pano/images' # Dir for storing pantilt source images
PANO_DIR = './media/pano/panos' # Dir for storing final panoramic images
PANO_PROG_PATH = '/usr/local/bin/image-stitching' # Path to image stitching program config.cfg in pi-timolo dir.
Alternatively you can us the pano plugin to set the various variables for the pano only settings. See How to Use Plugins
The default PANO_CAM_STOPS is configured to take three images. These pantilt positions are near the pantilt center area 36 degrees apart based on a default 1280 x 720 image resolution. This provides enough overlap (if there is sufficient lighting) to successfully stitch a Panoramic image. Panos can be viewed using the pi-timolo webserver under pano/panos folder. Use the web page image horizontal scroll bar at bottom of image to see the rest of pano image to the right. Source pano images are store in pano/images folder (within webserver directory structure)
Note: Stitching will run as a background task. If you run ./pi-timolo.py with config.py VERBOSE_ON = True you will see the image-stitching progress messages interleaved with the pi-timolo logging messages. This is normal. You can run htop from another terminal to view cpu usage.
/usr/local/bin/image-stitching is a modified version of OpenPano that I modified to allow for specifying an Output file path as the first parameter. /usr/local/bin/image-stitching needs a config.cfg file that is located in the main pi-timolo directory.
IMPORTANT: Do not delete or modify *config.cfg file. It might be possible to edit some of the config.cfg options but make a backup copy first, or do a menubox.sh UPGRADE to restore default settings.
A quad core Raspberry pi is recommended with latest Buster OS. RPI4 took seconds to do a stitch. I did test pano, timelapse and motion tracking simultaneously on a single core RPI. It takes several minutes to stitch three images so I had to set the PANO_TIMER_SEC longer than 180 seconds or you would get multiple overlapping image-stitching's operations at the same time. This brought the single core system to a crawl (ok if you set PANO_TIMER_SEC to a long time. I like to take a pano once every hour or 3600 seconds.
See pi-timolo config.py file details per variable comments.
NOTE: If you change the image resolution you may have to adjust the PANO_CAM_STOPS to ensure images are overlapping enough. You can increase the number of stops but make sure PANO_TIMER_SEC is long enough to avoid multiple parallel stitching tasks. Use htop to view the Raspberry Pi active processes, cpu usage, memory, Etc.
Successful stitching requires good lighting so it is advised to run only during the day. The PANO_DAYONLY_ON option defaults to True so pano images will only work with daytime or equivalent indoor lighting. Set to False per comments to enable day/night operation. You will find the source images are taken but stitching will fail to generate a pano image if there is not enough lighting to detect stitch image overlap features.
Note: I have another pano project that uses multiple RPI's to take simultaneous images that are transmitted to a Hub RPI for stitching (Can be one of the Sender RPI's) For Details see https://github.com/pageauc/panopi
Good Luck
- Wiki Home
- Introduction
- Prerequisites
- Install or Upgrade
- Run pi-timolo from a drive mnt
- Customize config.py
- Panoramic Images
- user_motion_code.py
- Align Camera Motion Area
- Schedule StartAt
- Basic Troubleshooting
- Tuning Variable Settings
- menubox.sh
- Web Server View Files
- Make Timelapse Video
- Join or Convert h264 to MP4
- Run on Boot
- Setup & Run shutdown.py
- Rclone Media Sync
- watch-app.sh Usage
- Plugins Usage
- Mount USB Storage
- Mount Network Share
- Auto SubFolder Creation
- Manage Disk Space
- Utilities Summary
- GitHub Repo
gdrive is no longer default.