i want compute mean absolute error between 2 image in matlab , named mae there code:
x=imread('duck.jpg'); imshow(x) xmin=min(x); xmax = max(x); xmean=mean(x); = double(x) / 255; v = var(i(:)); y = imnoise(x, 'gaussian', 0, v / 10); y = double(y) / 255; imshow(y)
there's no need evaluate min()
, max()
, mean()
first image in order evaluate mae.
since mae sum of (l1-norm) differences between corresponding pixels in 2 images x
, y
(divided number of pixels), can evaluate as:
mae=sum(abs(x(:)-y(:)))/numel(x);
where numel()
function returns number of elements in argument. in case since x
, y
have same number of elements can either put numel(x)
or numel(y)
.
Comments
Post a Comment