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
답변 (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
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!