psfTools庫默認是支持Linux系統(tǒng),Linux系統(tǒng)上的安裝比較簡潔,詳見install pfstools On Ubuntu 16.04。在Windows的安裝則依賴Cygwin。
sudo apt-get update
sudo apt-get install pfstools
Windows環(huán)境
Win10 + pfstools 2.1.0 + VS 2017 + opencv-4.0.1 + cygwin64
(Windows下的配置難度和Linux下的不是一個level,所以如果有Linux環(huán)境,建議還是盡量在Linux下安裝)
psfTools安裝
編譯
## matlab路徑需要手動設(shè)置
cd <pfstools_dir>
mkdir build
cd build
cmake ../
make
psfTools依賴庫較多,在編譯前可以預(yù)先檢查,所需依賴庫在下面已列出。psfTools編譯時若發(fā)現(xiàn)相關(guān)依賴庫未安裝,不會報錯,會跳過相關(guān)Tool的編譯,也可直接用下面的CMake switch跳過相關(guān)編譯。
OpenEXR
CMake switch: WITH_OpenEXR
Tools: pfsinexr, pfsoutexr
ImageMagick
CMake switch: WITH_ImageMagick
Tools: pfsinimgmagick, pfsoutimgmagick
Used to read/write most LDR files. Required for 16-bit file support. "pfsin"/"pfsout" will use NetPBM if ImageMagick is not available
NetPBM
CMake switch: WITH_NetPBM
Tools: pfsinppm, pfsoutppm, (pfsindcraw)
Alternative method of reading/writing LDR images. Note that this package is also required for pfsindcraw as ImageMagick cannot handle files read from unix pipes.
TIFF
CMake switch: WITH_TIFF
Tools: pfsintiff, pfsouttiff
TIFF images can also be read with pfsinimgmagick. This is a custom reader/writer, which supports LogLuv TIFF HDR image format.
QT 5
CMake switch: WITH_QT
Tools: pfsview
"pfsview" is a primary HDR image viewer.
If Qt library is not found, you need to specify the path to its cmake configuration files:
cmake -D "CMAKE_PREFIX_PATH=~/Qt5location/qt5/5.7/gcc_64/" ../
OpenGL, GLUT (or FreeGLUT)
CMake switch: WITH_pfsglview
Tools: pfsglview
pfsglview is a "backup" or alternative viewer. It is missing some features of pfsview, but offers faster zooming.
Matlab (mex)
CMake switch: WITH_MATLAB
Tools: all matlab scripts in src/matlab
Note that you need to set matlab path to <install_dir>/share/pfstools/matlab
Octave
CMake switch: WITH_Octave
Tools: All Octave scripts in src/octave
There are still some unresolved issues running Octave scripts under cygwin.
FFTW
CMake switch: WITH_FFTW
Tools: acceleration in pfstmo_durand02 (the TMO will be *very* slow otherwise)
GSL
CMake switch: WITH_GSL
Tools: pfstmo_mantiuk08
The GSL math library is required for this TMO.
OpenCV
CMake switch: WITH_OpenCV
Tools: pfsalign
Note that pfsalign requires SURF features, which are available on "nonfree" part of the library. Since part of the library is currently not included in most Linux distributions, so you will need to compile OpenCV from sources.
dcraw
CMake switch: none
Tools: pfsindcraw
Download code from: http://www.cybercom.net/~dcoffin/dcraw/
部分相關(guān)依賴庫的安裝
liboctave-dev,Perl interpreter,getopt , OpenEXR, ImageMagick, NetPBM,
-
GNU Scientific Library(GSL) for Windows安裝
Windows下使用GSL
安裝 Cygwin的時候勾選GSL
-
NetPBM
詳見官網(wǎng) Getting Netpbm,可通過Cygwin 環(huán)境安裝。
-
FFTW
FFTW是用來計算一維或者多維的離散傅里葉變換的庫,包含fft函數(shù)庫的各種應(yīng)用。
Cygwin
Windows安裝Cygwin教程opencv
VS2017配置opencv教程OpenEXR
編譯安裝
win10 下 安裝 OpenEXR
conda install -c conda-forge openexr
利用Cygwin安裝

ImageMagick
ImageMagick官網(wǎng)Octave
-
GLUT
手動下載安裝
OpenGL的庫,參考windows下安裝opengl的glut庫。
首先下載Windows環(huán)境下的GLUT,然后:
1 將glut h復制到C: Program Files x86 Windows Kits 8 0 Include um gl
2 將glut lib和glut32 lib復制到D: VS VC lib 下
3 將glut dll和glut32 dll復制到C: WINDOWS system32下
利用Cygwin安裝
DCRAW
Windows DCRAW版本不需要安裝,因為它們只包含一個緊湊的.exe控制臺應(yīng)用程序文件。該文件命名為dcraw.exe,移動exe至C:\Windows\dcraw.exe,以便在命令行中調(diào)用時從任何文件夾訪問。dcraw.exe下載鏈接。
psfTools使用
命令行手冊
matlab手冊
pfstools論壇
此處為一個簡單的,讀取文件夾下子文件夾內(nèi)符合篩選要求的.hdr文件并tonemapping保存的腳本。更多操作細節(jié)見linux下shell腳本編寫問題
SorDir="your/source/dir"
TarDir="your/target/dir"
if [ ! -d "$TarDir" ]; then
echo $TarDir
mkdir $TarDir
fi
FolderList=$(ls $SorDir)
for Folder in ${FolderList}
do
echo $Folder
if [ ! -d "$TarDir$Folder" ]; then
echo $TarDir$Folder
mkdir $TarDir$Folder
fi
HDRList=$(ls $SorDir$Folder/*_pred.hdr)
for HDRpath in ${HDRList}
do
HDRimg=${HDRpath##*/}
savePath="$TarDir$Folder/${HDRimg%.*}.png"
pfsin "$SorDir$Folder/$HDRimg" | pfstmo_drago03 | pfsout $savePath
done
done



