鑒於目前網絡上關於krpano的使用和介紹少之又少,結合自己的學習和使用經歷,做個總結和記錄。
1.安裝
下載地址:
linux
https://krpano.com/forum/wbb/index.php?page=Thread&threadID=15064
windows: 可自行百度,這塊網上的資源比較多,建議下載,有些配置文件在linux里可以直接拿來用,作為學習入門還是不錯的
直接下載即可
2.注冊
下載完成后進入下載目錄。如果沒有通過注冊,生成的圖片是帶有水印的,注冊的命令是./krpanotools register ### #處填寫注冊碼。
3.生成全景圖的命令
./krpanotools makepano -config=配置文件目錄 filepath
4.配置文件
basicsettings.config
# Basic Settings # Documentation: http://krpano.com/tools/kmakemultires/config?version=119 # krpano 1.19 # image filtering and compression settings filter=LANCZOS jpegquality=82 jpegsubsamp=422 jpegoptimize=true # load gps exif information from the input files and transfer them to the xml parsegps=true # parse the input files for orientation / leveling information and either # directly remap the images or add a prealign setting in the xml to level them autolevel=remap # sort the input files alphabetically sortinput=true # protection settings (nomb = no Flashplayer menubar for standalone swf) kprotectclparameters=-nomb
normal.config
# Normal/Single-Resolution Panos # Skin with Default Buttons # Documentation: http://krpano.com/tools/kmakemultires/config?version=119 # krpano 1.19 # basic settings include basicsettings.config panotype=autodetect hfov=360 # output flash=true html5=true # convert spherical/cylindrical to cubical converttocube=true converttocubelimit=360x45 # multiresolution settings multires=false maxsize=8000 maxcubesize=2048 # output images path tilepath=%INPUTPATH%/%BASENAME%/%BASENAME%.tiles/pano[_c].jpg # preview pano settings preview=true graypreview=false previewsmooth=25 previewpath=%INPUTPATH%/%BASENAME%/%BASENAME%.tiles/preview.jpg # generate smaller mobile images #customimage[mobile].size=1024 #customimage[mobile].path=%INPUTPATH%/%BASENAME%/%BASENAME%.tiles/mobile_%s.jpg #customimage[mobile].imagesettings=jpegquality=85 jpegsubsamp=444 jpegoptimize=true #customimage[mobile].xml=<mobile>[NL][TAB]<cube url="[PATH]" />[NL]</mobile> # xml output xml=true xmlpath=%INPUTPATH%/%BASENAME%/pano.xml # skin / xml template include defaultbuttons.skin # html output/template html=true htmlpath=%INPUTPATH%/%BASENAME%/index.html htmltemplate=html/embedpano.html # include testing servers htmltemplate_additional_file=html/tour_testingserver.exe htmltemplate_additional_file=html/tour_testingserver_macos+x
基本上可以滿足大多數需求,也可以通過windows安裝包自帶的一些配置。官網文檔
使用過程中遇到的一些問題:
1.前期處理較小的圖片文件沒什么問題,當處理的圖片文件較大時,腳本容易出現假死的情況,此時如果用到是node的exe或者shelljs 時,衍生shell時應該增加maxBuffer 配置。
2.前期使用了基於redis的訂閱發布模式獲取數據,只能一個進程處理,效率比較低,后來采用了redis隊列的方式,使用PM2管理node進程,效率明顯升高。
3.類似圖形處理的程序對cpu的要求比較高,使用的時候應該注意。