how to obtain rms error
3 次查看(过去 30 天)
显示 更早的评论
Please tell me how to calculate the rms error in image registration?
0 个评论
采纳的回答
Image Analyst
2012-10-11
Wouldn't it just go like this
difference = single(image1) - single(image2);
squaredError = difference .^ 2;
meanSquaredError = sum(squaredError(:)) / numel(image1);
rmsError = sqrt(meanSquaredError);
Of course you could compact that all into one line if you want.
5 个评论
MAT-Magic
2020-1-18
编辑:Image Analyst
2020-1-18
@Image Analyst, can I use this formula for two vectors having same length?
difference = single(image1) - single(image2);
squaredError = difference .^ 2;
meanSquaredError = sum(squaredError(:)) / numel(image1);
rmsError = sqrt(meanSquaredError);
?
Image Analyst
2020-1-18
Yes, you can, but I'd use mean() instead of sum to simplify it:
differenceImage = single(image1) - single(image2);
squaredErrorImage = differenceImage .^ 2;
meanSquaredError = mean(squaredErrorImage(:)) % A scalar
rmsError = sqrt(meanSquaredError)
And if they're vectors of the same shape (row or column) then you don't even need the (:).
更多回答(1 个)
Daniel Shub
2012-10-11
编辑:Daniel Shub
2012-10-11
Just to be a little bit difference. If you have the DSP system toolbox you can do
step(dsp.RMS('Dimension', 'all'), x)
where x is your error signal. So in the case of two imagines (image1 and image2)
image1 = randn(128);
image2 = randn(128);
x = image1-image2;
6 个评论
Ishara Nipuni
2019-1-25
I calculated the RMS value of my image registration algorithm by using your code. But I can't understand how to do a validation for my registration algorithm with th RMS value. Can you tell me please how can I com to conclusions about the accuracy of my registration algorithm with the use of RMS values?
Ishara Nipuni
2019-1-25
I calculated the RMS value with getting the same image as image1 and image2. But the value was not zero. But I think that it should be zero. Can you please explain me about it?
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Read, Write, and Modify Image 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!