Interpolation Between Two Matrices

I would like to interpolate between two matrices with the same dimensions using the interp function on MATLAB. However, I do not understand how to apply it in this case. The Matrices are from two image slices that are seperated by 1 mm. I would like to know the image slice in between these two slices. I've tried using the method of simply averaging the two images but I would like to try something more sophisticated.
Thanks! Kevin

Respuestas (1)

Jan
Jan el 1 de Jul. de 2018
Editada: Jan el 1 de Jul. de 2018
If you want the average between two matrices, using mean is smart enough. There is no need for a more sophisticated method.
I have no idea, where the 1mm might come into play.
img1 = rand(10, 15, 3);
img2 = rand(10, 15, 3);
imgAvg1 = 0.5 * (img1 + img2);
Or:
imgPool = cat(1, img1(:).', img2(:).');
imgInter = interp1(1:2, imgPool, 1.5);
imgAvg2 = reshape(imgInter, size(img1));
Bother methods calculate the same average RGB color. This works with 2D gray scale images also

Productos

Versión

R2018a

Preguntada:

el 1 de Jul. de 2018

Editada:

Jan
el 1 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by