CompareImages¶
2个图像之间的估计器。
描述¶
计算两个图像波段(参考带和测量带)的均方误差(MSE)、平均绝对误差(MAE)和峰值信噪比(PSNR)。用户必须设置所使用的频道,并且可以指定ROI。
参数¶
参考图像属性¶
Reference image -ref.in image
Mandatory
Image used as reference in the comparison.
Reference image channel -ref.channel int
Default value: 1
Used channel for the reference image.
测量的图像属性¶
Measured image -meas.in image
Mandatory
Image used as measured in the comparison.
Measured image channel -meas.channel int
Default value: 1
Used channel for the measured image.
感兴趣区域(相对于参考图像)¶
Start X -roi.startx int
Default value: 0
ROI start x position.
Start Y -roi.starty int
Default value: 0
ROI start y position.
Size X -roi.sizex int
Default value: 0
Size along x in pixels.
Size Y -roi.sizey int
Default value: 0
Size along y in pixels.
MSE -mse float
Mandatory
Mean Squared Error value.
MAE -mae float
Mandatory
Mean Absolute Error value.
PSNR -psnr float
Mandatory
Peak Signal to Noise Ratio value.
count -count float
Mandatory
Nb of pixels which are different.
Available RAM (MB) -ram int
Default value: 256
Available memory for processing (in MB).
实例¶
从命令行执行以下操作:
otbcli_CompareImages -ref.in GomaApres.png -ref.channel 1 -meas.in GomaAvant.png -meas.channel 2 -roi.startx 20 -roi.starty 30 -roi.sizex 150 -roi.sizey 200
来自Python的评论:
import otbApplication
app = otbApplication.Registry.CreateApplication("CompareImages")
app.SetParameterString("ref.in", "GomaApres.png")
app.SetParameterInt("ref.channel", 1)
app.SetParameterString("meas.in", "GomaAvant.png")
app.SetParameterInt("meas.channel", 2)
app.SetParameterInt("roi.startx", 20)
app.SetParameterInt("roi.starty", 30)
app.SetParameterInt("roi.sizex", 150)
app.SetParameterInt("roi.sizey", 200)
app.ExecuteAndWriteOutput()