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不存在)的值。 –