Today I’ll share a little bash script I’ve done using imagemagick to patch equirectangular nadir :


#!/bin/sh
#Fabrice Kerzerho 2017

while [ $# -gt 0 ];do
picture=$1
PWidth=$(identify -format « %w » $picture)
PHeight=$(identify -format « %h » $picture)
hauteurcrop=$(echo « $PHeight-($PHeight/9.6) »|bc)
echo « hauteurcrop : $hauteurcrop »
stretch=20

convert « $picture » -crop « $PWidth »x »$hauteurcrop »+0+0 temp_nadir_ball.tif

convert temp_nadir_ball.tif -crop « $PWidth »x »$stretch »+0+ »$(echo « $hauteurcrop »-« $stretch »|bc) » -resize « $PWidth »x »$(echo « $PHeight/9.6″|bc) »! -channel RGBA -blur 0x8 nadir-patch.tif

convert « $picture » -page +0+ »$hauteurcrop » nadir-patch.tif -flatten « ${picture%.*}-patch.jpg »

rm temp_nadir_ball.tif
rm nadir-patch.tif
shift
done

I use it inside Thunar’s custom actions on lots of panos to produce and upload them quickly to google maps ( no really need to perform perfect personnal panos to such service, unless you’ve made them as a paid service ).

Let’s visualize the mapped result :


Perfect for quick panos production :-);