I experimented with using imagemagick to convert from spherical to cubic, but found that the performance was severely lacking in comparison to the krpano tools. Here's an example, extracting the top face from an equirectangular:
|
Quellcode
|
1
|
convert equirectangular.jpg ( +clone -set option:distort:viewport %%[fx:w/PI]x%%[fx:w/PI]+%%[fx:(w-w/PI)/2]+%%[fx:(h-w/PI)/2] -distort SRT 0 ) +swap -interpolate bicubic -fx "xx=i/w-.5;yy=j/h-.5;ofs=(xx<0)?.5:1.5;pan=(yy==0)?ofs*pi:atan((xx)/(yy))+2*pi;pan=mod((yy>0)?pan+pi:pan,2*pi);tlt=(xx==0&&yy==0)?0:mod(-atan(.5/hypot(xx,yy))+pi/2,pi);v.p{ pan*v.h/pi, tlt*v.h/pi}" out.png
|