您的位置:首页 > 其它

Windows下使用krpanotools命令行生成全景图

2016-07-26 09:04 288 查看
调用命令行 D:\fd\krpano\krpano-1.19-pr4>krpanotools64.exe makepano -config=templates/vtour-multires.config C:\Users\fd\Pictures\fd.jpg
生成8个文件





几个修改
1.
panotype=autodetect 这个改成了sphere,官方解释
The panoramic type of the input image.
Possible settings:
autodetect - The type will be detected by the imagesize / aspect:
2:1 aspect = spherical pano
1:1 aspect and six files with the same 'basename' = cubical pano
<strong>other aspects - ask the user</strong>
sphere - force assuming that the input is a full spherical 360x180 image
cylinder - force assuming that the input is a 360x* cylinder
flat - force assuming that the input is a flat image
partialsphere - force assuming a partial sphere (hfov setting needed)
partialcylinder - force assuming a partial cylinder (hfov setting needed)

如果询问用户图片的类型,那就要向命令行输入,在java调用命令行的时候,我用了2个线程,一个线程读取输出提示,然后显示,另一个线程先sleep 5秒,然后输入需要的参数,但是读取的线程一直没有显示要用户输入的提示,5秒之后却反复输出要用户输入图片类型的提示,这令我十分不解,不是应该在5秒之前应该已经输出了提示吗?而且之后又为什么反复输出提示?最后直接设定了panotype=sphere,不和用户交互。
2.xmlpath路径修改
每一个全景图一个配置文件,
生成xml配置文件的地址
%BASENAME%是当前图片的名称,%INPUTPATH%是当前图片的目录。

3.html页面设置不输出
生成html页面的地址 html=false,不生成页面,我自己用来模板引擎,这个会导致js文件也不生成,自己搞一份配置文件,全局使用。

4.输出的图片路径修改
tilepath previewpath thumbpath customimage[vr].path 修改这四个,每个全景图都需要一份。

5.xml中的url配置
添加thumbpathxml,这样tour.xml文件中的thumburl就不是相对路径了。
添加tilepathxml,tour.xml的标签的url路径为绝对路径。
添加previewpathxml
customimage[vr].xml中的[path]写死,改成绝对路径。
# Virtual Tour with Multi-Resolution Panos
# Skin with Scrolling-Thumbnails, Bingmaps, Gyroscope, VR-Support
# Documentation: http://krpano.com/tools/kmakemultires/config?version=119 # krpano 1.19

# basic settings
include basicsettings.config
panotype=sphere
hfov=360
makescenes=true
tempdir=C:/Users/fd/IdeaProjects/zheyuevr/src/main/webapp/resources/krpano/temp

# output
flash=flase
html5=true

# convert spherical/cylindrical to cubical
converttocube=true
converttocubelimit=360x45

# multiresolution settings
multires=true
tilesize=512
levels=auto
levelstep=2
maxsize=auto
maxcubesize=auto

# output images path
tilepath=%INPUTPATH%/panos/%BASENAME%/[c/]l%Al/%Av/l%Al[_c]_%Av_%Ah.jpg
#tilepathxml=%INPUTPATH%/panos/%BASENAME%/%s/l1/%v/l1_%s_%v_%h.jpg

# preview pano settings
preview=true
graypreview=false
previewsmooth=25
previewpath=%INPUTPATH%/panos/%BASENAME%/preview.jpg
#previewpathxml=%INPUTPATH%/panos/%BASENAME%/preview.jpg

# generate special optimized, non-tiled, lower-res images for VR
customimage[vr].size=1536
customimage[vr].path=%INPUTPATH%/panos/%BASENAME%/vr/pano_%s.jpg
customimage[vr].imagesettings=jpegquality=82 jpegsubsamp=444 jpegoptimize=true
customimage[vr].xmlsceneparameters=havevrimage="true"
customimage[vr].xmlimageparameters=if="!webvr.isenabled"
customimage[vr].xmllevel=krpano
customimage[vr].xml=<image if="webvr.isenabled">[NL][TAB]<cube url="[PATH]" />[NL]</image>

# generate thumbnails
makethumb=true
thumbsize=240
thumbpath=%INPUTPATH%/panos/%BASENAME%/thumb.jpg
#thumbpathxml=%INPUTPATH%/panos/%BASENAME%/thumb.jpg

# xml output
xml=true
xmlpath=%INPUTPATH%/tour.xml

# html output/template
html=false
htmlpath=C:/Users/fd/IdeaProjects/zheyuevr/src/main/webapp/WEB-INF/pages/krpano/%BASENAME%/vtour/tour.html
htmltemplate_html5=auto

# skin / xml template
include vtourskin119.skin

# include vtour editor
#xmltemplate_additional_file=xml/plugins/vtoureditor.swf
#htmltemplate_additional_file=html/tour_editor.html
http://krpano.com/tools/kmakemultires/config/?version=119
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: