Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

finding MSE and MAE for RGB image

Asked by FIR

FIR

on 21 Dec 2012
Accepted Answer by Walter Roberson

Walter Roberson

i have a equation below please tell how to find MSE and MAE for RGB image

http://imgur.com/94kpN

0 Comments

FIR

FIR

Tags

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson

Walter Roberson

on 21 Dec 2012
Accepted answer

To within a constant factor that might depend upon image size,

MSE = sum( (FirstImage(:) - SecondImage(:)).^2 );

8 Comments

Walter Roberson

Walter Roberson

on 21 Dec 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

on 21 Dec 2012

so walter can u tell how to write eq for MAE PLEASE

Walter Roberson

Walter Roberson

on 21 Dec 2012

Like MSE except using abs() instead of .^2

Walter Roberson

Walter Roberson

Contact us