psfTools库默认是支持Linux系统,Linux系统上的安装比较简洁,详见install pfstools On Ubuntu 16.04。在Windows的安装则依赖Cygwin。
sudo apt-get update
sudo apt-get install pfstools
Windows环境
Win10 + pfstools 2.1.0 + VS 2017 + opencv-4.0.1 + cygwin64
(Windows下的配置难度和Linux下的不是一个level,所以如果有Linux环境,建议还是尽量在Linux下安装)
psfTools安装
编译
## matlab路径需要手动设置
cd
mkdir build
cd build
cmake ../
make
psfTools依赖库较多,在编译前可以预先检查,所需依赖库在下面已列出。psfTools编译时若发现相关依赖库未安装,不会报错,会跳过相关Tool的编译,也可直接用下面的CMake switch跳过相关编译。
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 /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/
部分相关依赖库的安装
liboctave-dev,Perl interpreter,getopt , OpenEXR, ImageMagick, NetPBM,
-
GNU Scientific Library(GSL) for Windows安装
Windows下使用GSL
安装 Cygwin的时候勾选GSL
-
NetPBM
详见官网 Getting Netpbm,可通过Cygwin 环境安装。
-
FFTW
FFTW是用来计算一维或者多维的离散傅里叶变换的库,包含fft函数库的各种应用。
Cygwin
Windows安装Cygwin教程opencv
VS2017配置opencv教程OpenEXR
编译安装
win10 下 安装 OpenEXR
conda install -c conda-forge openexr
利用Cygwin安装
ImageMagick
ImageMagick官网Octave
-
GLUT
手动下载安装
OpenGL的库,参考windows下安装opengl的glut库。
首先下载Windows环境下的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控制台应用程序文件。该文件命名为dcraw.exe,移动exe至C:\Windows\dcraw.exe,以便在命令行中调用时从任何文件夹访问。dcraw.exe下载链接。
psfTools使用
命令行手册
matlab手册
pfstools论坛
此处为一个简单的,读取文件夹下子文件夹内符合筛选要求的.hdr文件并tonemapping保存的脚本。更多操作细节见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