i am generating a panorama from a sky image with lookup tables, lutX.png and lutY.png
In the older version the result is in color on the newer i get a grayscale image.
The call in bash is as follows
Code: Select all
convert lutX.png lutY.png raw.jpg -fx "u[2].p{ u*$wraw , v*$hraw }" pan.jpg
example images can be found here
http://gop.meteo.uni-koeln.de/~hatpro/j ... ge_magick/
the full code with variables and lookup tabels is:
Code: Select all
# width and height or original image
wraw=$(identify -format %w raw.jpg)
hraw=$(identify -format %h raw.jpg)
# simple estimate for center and radius
cx=$(($wraw/2))
cy=$(($hraw/2))
rad=$cx
# desired width and height of panorama
# panorama length = raw image width
wpan=$(( $wraw ))
# height is something
hpan=$(( $wpan * 100/628 ))
; generate lookup table for x coordinate
convert -size $wpan'x'$hpan xc: -channel G -fx "($cx-$rad*j/$hpan*sin(2*pi*i/$wpan))/$wraw" -separate lutX.png
; generate lookup table for y coordinate
convert -size $wpan'x'$hpan xc: -channel R -fx "($cy+$rad*j/$hpan*cos(2*pi*i/$wpan))/$hraw" -separate lutY.png
# do the pano
convert lutX.png lutY.png raw.jpg -fx "u[2].p{ u*$wraw , v*$hraw }" pan.jpg