Here are the scripts to expand:
Input:
Bilinear Interpolation -- same size as input
infile="P90achop.jpg"
inname=`convert $infile -format "%t" info:`
rr=`convert $infile -ping -format "%[fx:w*57/90]" info:`
w2=`convert $infile -ping -format "%[fx:w/2]" info:`
h2=`convert $infile -ping -format "%[fx:h/2]" info:`
echo "rr=$rr; w2=$w2; h2=$h2"
convert $infile -monitor \
-fx "xx=(i-$w2); aa=atan(xx/$rr); yy=(j-$h2); u.p{$rr*aa+$w2,yy*cos(aa)+$h2}" +monitor \
${inname}_corrected4.jpg
Bilinear interpolation -- wider and taller than input -- shows curved top and bottom
infile="P90achop.jpg"
inname=`convert $infile -format "%t" info:`
rr=`convert $infile -ping -format "%[fx:w*57/90]" info:`
w2=`convert $infile -ping -format "%[fx:w/2]" info:`
h2=`convert $infile -ping -format "%[fx:h/2]" info:`
ww=`convert xc: -format "%[fx:2*$rr*tan(0.5*90/57)]" info:`
hh=`convert xc: -format "%[fx:2*$h2/cos(45/57)]" info:`
ww2=`convert xc: -format "%[fx:$ww/2]" info:`
hh2=`convert xc: -format "%[fx:$hh/2]" info:`
echo "rr=$rr; w2=$w2; h2=$h2 hh=$hh; ww=$ww; ww2=$ww2; hh2=$hh2"
convert -size ${ww}x${hh} xc: $infile -virtual-pixel black -monitor \
-fx "xx=(i-$ww2); aa=atan(xx/$rr); yy=(j-$hh2); v.p{$rr*aa+$w2,yy*cos(aa)+$h2}" +monitor \
${inname}_corrected6.jpg
Bilinear interpolation -- wider than input, but properly limited in height so as not to show background fill
infile="P90achop.jpg"
inname=`convert $infile -format "%t" info:`
rr=`convert $infile -ping -format "%[fx:w*57/90]" info:`
w2=`convert $infile -ping -format "%[fx:w/2]" info:`
h2=`convert $infile -ping -format "%[fx:h/2]" info:`
hh=`convert xc: -format "%[fx:2*$h2]" info:`
ww=`convert xc: -format "%[fx:2*$rr*tan(0.5*90/57)]" info:`
ww2=`convert xc: -format "%[fx:$ww/2]" info:`
echo "rr=$rr; w2=$w2; h2=$h2 hh=$hh; ww=$ww"
convert -size ${ww}x${hh} xc: $infile -monitor \
-fx "xx=(i-$ww2); aa=atan(xx/$rr); yy=(j-$h2); v.p{$rr*aa+$w2,yy*cos(aa)+$h2}" +monitor \
${inname}_corrected5.jpg
Bicubic interpolation -- wider than input, but properly limited in height so as not to show background fill. Slightly sharper result
infile="P90achop.jpg"
inname=`convert $infile -format "%t" info:`
rr=`convert $infile -ping -format "%[fx:w*57/90]" info:`
w2=`convert $infile -ping -format "%[fx:w/2]" info:`
h2=`convert $infile -ping -format "%[fx:h/2]" info:`
hh=`convert xc: -format "%[fx:2*$h2]" info:`
ww=`convert xc: -format "%[fx:2*$rr*tan(0.5*90/57)]" info:`
ww2=`convert xc: -format "%[fx:$ww/2]" info:`
echo "rr=$rr; w2=$w2; h2=$h2 hh=$hh; ww=$ww"
convert -size ${ww}x${hh} xc: $infile -interpolate bicubic -monitor \
-fx "xx=(i-$ww2); aa=atan(xx/$rr); yy=(j-$h2); v.p{$rr*aa+$w2,yy*cos(aa)+$h2}" +monitor \
${inname}_corrected5b.jpg