0
我使用机器学习估计了深度图,并且我想评估我的结果(使用matlab)。深度图和深度真是带有8位的图像(在评估之前归一化为[0 1])。我用相对,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和估计可以有0个值。
log10(0)
ans =
-Inf
5/0
ans =
Inf
那么,我该怎么办?
thnx先生,我发现解决方案我用米(0不存在)的值。 –