【发布时间】:2017-04-08 11:33:07
【问题描述】:
我使用机器学习估计了一个深度图,我想评估我的结果(使用 matlab)。深度图和深度真实是具有 8 位的图像(在评估之前归一化为 [0 1])。我使用 relative、rmse 和 log 10 错误来进行评估。
function result = evaluate(estimated,depthTrue,number)
if(number == 1)
result = relative(estimated,depthTrue);
end
if (number == 2)
result = log10error(estimated,depthTrue);
end
if(number ==3)
result = rmse(estimated,depthTrue);
end
end
function result = relative(estimated,depthTrue)
result = mean(mean(abs(estimated - depthTrue)./depthTrue));
end
function result = log10error(estimated,depthTrue)
result = mean(mean(abs(log10(estimated) - log10(depthTrue))));
end
function result = rmse(estimated,depthTrue)
result = sqrt(mean(mean(abs(estimated - depthTrue).^2)));
end
当我尝试对图像进行评估时,我得到了无穷大值(只有 log10error 和相对值)。经过搜索,我发现depthTrue 和estimated 可以有0 值。
log10(0)
ans =
-Inf
5/0
ans =
Inf
那么,我该怎么办?
【问题讨论】: