Skip to content

Panoramic Images Stitching Feature

Claude Pageau edited this page Oct 15, 2020 · 22 revisions

Description

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.

Operation

To Enable the Pano mode 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) while the WaveShare my own custom pantilthat driver and bcm2835

You should review the other PANO options and edit to your needs.

The default PANO_CAM_STOPS is configured to take three images around the pantilt pan 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. These can be viewed using the pi-timolo webserver under pano, panos. Scroll across image using the bottom slide bar to see rest of pano image to the right.

/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. Do not delete or modify this file. It might be possible to edit some of the config.cfg options but make a backup copy or do a menubox UPGRADE to restore default settings.

I have tested pano, timelapse and motion tracking simultaneously on a single core RPI. It takes a 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. I advise at least a quad core RPI since stitching will happen in it's own cpu core.

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

Successful stitching requires good lighting so it is advised to run only during the day. I may add a PANO_NO_NIGHT option (Let Me Know)

Clone this wiki locally