I have segmented the file (I) into 4 parts (A, B, C, D) as shown in the matlab code below. How to rejoin theses file. Could u please help as I am working on medical images.

1 次查看(过去 30 天)
I=imread('cameraman.tif'); subplot 334 imshow(I); [r c p]= size(I); %r-rows,c-columns,p-planes A=I(1:r/2,1:c/2,:); B=I(1:r/2,c/2+1:c,:); C=I(r/2+1:r,1:c/2,:); D=I(r/2+1:r,c/2+1:c,:); subplot 332 imshow(A); title('Image part 1'); imwrite(A, 'FirstPart.tif'); subplot 333 imshow(B); title('Image part 2'); imwrite(A, 'SecondPart.tif') subplot 335 imshow(C); title('Image part 3'); imwrite(A, 'ThirdPart.tif') subplot 336 imshow(D); title('Image part 4'); imwrite(A, 'ForthPart.tif')

回答(1 个)

Image Analyst
Image Analyst 2016-12-10
Did you know you're writing out A every single time? You're not writing out B, C, and D. Once you fix that, you can just stitch them together after using imread()
A = imread('FirstPart.tif');
B = imread('SecondPart.tif');
C = imread('ThirdPart.tif');
D = imread('ForthPart.tif');
fullImage = [A,B;C,D];
Also read this link to learn how to properly format your code.

类别

Help CenterFile Exchange 中查找有关 Computer Vision with Simulink 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by