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