How to calculate bit error rate of two images?
2 views (last 30 days)
Show older comments
I have the Formula that i want to implement in Matlab..

0 Comments
Answers (1)
Bjorn Gustavsson
on 4 Mar 2021
xor is only really defined for a logical data-type, right? So what you want is to check the difference between each pixel in the two images? Then, if you have images in some comfortable data-type, like uint8, you want to figure out how many bits each difference corresponds to?
2 suggestions:
Have a look at:
absdI = abs(Im1-Im2);
and this should also be a useful hint:
[x1,x2,x3,x4] = ndgrid(0:1);
disp([(0:15)',x4(:),x3(:),x2(:),x1(:),sum([x4(:),x3(:),x2(:),x1(:)],2)])
HTH
2 Comments
Bjorn Gustavsson
on 4 Mar 2021
Well you might think whatever you want. If you check the help for xor you will learn what it will return. You can also check what it actually does:
xor(uint8(7),uint8(15))
You can also have a look at the help for bitxor.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!