.flo (光流)檔案轉化為其他格式的圖片
阿新 • • 發佈:2019-01-07
流程:
1. 在http://vision.middlebury.edu/flow/submit/ 下載flow-code.zip
2. 解壓到linux中flow-code資料夾下執行以下命令:
cd imageLib
make
cd ..
make
./colortest 10 colors.png
如果有圖片colors.png出現就為成功。
3.轉化自己圖片:
單張圖片轉化
在flow-code 資料夾下執行並建立other資料夾放入000000.flo檔案:
./color_flow ./other/000000.flo ./out.png
就可以得到結果了。其中可能會出現ReadError: can not open:。。。這是你輸入檔案地址有錯誤可以在flowIO.cpp 檢視格式需求。
多張圖片轉化
# Function: .flo file convert to .png file import os path = '自己的flo檔案地址如(/root/userfolder/Flownet2/work/inference/run.epoch-0-flow-field/)' png_path = '儲存地址如(/root/userfolder/Flownet2/work/inference/flo2png/)' length = len(os.listdir(path)) num = 0 while (num < length): ml = './color_flow\t' + path + str(num) + '.flo\t' + png_path + str(num) + '.png' os.system(ml) num += 1