Why am i getting two different MSE, while using formula and syntax immse?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Samson David Puthenpeedika
el 22 de En. de 2022
Comentada: Samson David Puthenpeedika
el 22 de En. de 2022
IS there any mistake in the formula applied for mean squarred error?
moving_img= imread("AT3_1m4_02.tif");
fixed_img= imread("AT3_1m4_03.tif");
crp_mv_img=imcrop(moving_img, [235, 210, 100, 100]);
crp_fx_img=imcrop(fixed_img, [235, 210, 100, 100]);
mse_1=immse(crp_fx_img,crp_mv_img)
[r,c]=size(crp_fx_img);
mse_2= sum((crp_mv_img-crp_fx_img).^2,"all")/(r*c)
Is mse_2 wrong?
0 comentarios
Respuesta aceptada
DGM
el 22 de En. de 2022
Editada: DGM
el 22 de En. de 2022
The reason is that the two images are integer-class. The difference and square may result in data truncation.
moving_img = imread("AT3_1m4_02.tif");
fixed_img = imread("AT3_1m4_03.tif");
crp_mv_img = imcrop(moving_img, [235, 210, 100, 100]);
crp_fx_img = imcrop(fixed_img, [235, 210, 100, 100]);
mse_1 = immse(crp_fx_img,crp_mv_img)
[r,c] = size(crp_fx_img);
se = (double(crp_mv_img)-double(crp_fx_img)).^2; % square error
[min(se(:)) max(se(:))] % values are outside of range for uint8
mse_2 = sum(se,"all")/(r*c)
Más respuestas (0)
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!