There are two formulas that are hard for me to imagine in MATLAB . Suppose there are two RGB image, Aand Bthe same size with m, nrepresenting rows and columns, and the third dimension d = 3. Formula1basically calculates the rate of change pixels, when Aa source image and Ba distorted version. Formula2calculates the average pixel rate.
1. Formula1= { sum(C(m,n,d)) / (m * n)} * 100
where `C(m,n) = 0`, if `A(m,n) = B(m,n)`
`=1`, if `A(m,n) != B(m,n)`
Sum all rows and columns, including the third dimension.
I tried something like this:
Formula1 = sum(sum(abs(double(A)-double(B))./(m*n), 1), 2);
But that makes no mistake. However, this is not the correct way to present it, since the conditions are ifnot included. The problem area is how to enable the condition by checking if A == Bor not and if A != B.
2.
Formula2 ={ 1/ (m*n)} * sum { norm (A - B) / 255} * 100
Again, there will also be a summation over all dimensions. I do not know how to form the matrix norm.
Formula3 is ={ 1/ (m*n)} * sum {(A - B) / 255} * 100
I tried like this
C = double (sum (AB, 3)); r = reshape (100 * (C / 255) / (m * n), [1 3])
But there is a mistake saying that the measurement should be the same, and changing the form does not work.