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

답변 (1개)

Jan
Jan 2018년 7월 1일
편집: Jan 2018년 7월 1일

1 개 추천

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

제품

릴리스

R2018a

질문:

2018년 7월 1일

편집:

Jan
2018년 7월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by