I have two matrices that represent a picture in the gray scale. Values 0-255.
I want to calculate a metric called MSE which uses the formula
where p1(w,h) coresponds to the value of the pixel (w,h) in the first picture. Same for p2. Then all of that squared. For simplicity i used to for loops to iterate the matrices. Each iteration a find the difference,then to the power of 2 then add it to the total.
The problem is that,let's say for the first iteration the p1(w,h) = 156 and the p2(w,h) = 169. When i subtract them i do not get -13. I get 0.
May be this is a silly question but im new to this and have been trying to solve this for hours.
ΝΟΤΕ: I was always getting a 0 in return so i did one operation per line to find the issue.