finding MSE and MAE for RGB image

 Respuesta aceptada

Walter Roberson
Walter Roberson el 21 de Dic. de 2012
To within a constant factor that might depend upon image size,
MSE = sum( (FirstImage(:) - SecondImage(:)).^2 );

8 comentarios

FIR
FIR el 21 de Dic. de 2012
Walter then for MAE
FIR
FIR el 21 de Dic. de 2012
my image is peppers.png
Image Analyst
Image Analyst el 21 de Dic. de 2012
It's just the absolute value of the differences! Be sure to cast to double to allow negative numbers. Subtracting uint8's will clip to zero. Is this homework?
Good point about casting to doubles. I should have said
MSE = sum( (double(FirstImage(:)) - double(SecondImage(:))).^2 );
FIR
FIR el 21 de Dic. de 2012
can u please tell what is the difference in notation of 1 and 2,both equation are sme but notation is different
Walter Roberson
Walter Roberson el 21 de Dic. de 2012
As the document indicates, |x| with a subscript of 2 corresponds to the L2 normal, which is the Euclidean Norm, also known as Euclidean distance. The Euclidean distance is like sqrt( (x1-x2)^2 + (y1-y2)^2) and so on. Notice that in the formula given, they square this value -- that is what the superscript 2 is about, squaring the result of the Euclidean distance. The squaring cancels out the sqrt(), leaving (x1-x2)^2 + (y1-y2)^2
The |x| with a subscript 1 is the L1 norm, also known as the taxicab distance or the Manhattan norm. This corresponds to x1-x2 + y1-y2 with no sqrt(). Notice though that in the formula they do not square this, leaving x1-x2 + y1-y2, abs(x1-x2) + abs(y1-y2)
FIR
FIR el 21 de Dic. de 2012
so walter can u tell how to write eq for MAE PLEASE
Walter Roberson
Walter Roberson el 21 de Dic. de 2012
Like MSE except using abs() instead of .^2

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

FIR
el 21 de Dic. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by