- All your individual images A to F are RGB images
- The values in the missing part can be NaN in the final merged/stitched image.
How do i stitch or merge an image together
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
LinusL
am 5 Aug. 2021
Beantwortet: Prachi Kulkarni
am 10 Aug. 2021
I would like to merge/stitch 6 image together but, there is a missing part inside (which is meant to be).
The overal image will form a final image (with a hole in a middle (missing pieces).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/703877/image.png)
How do i stitch the images as per the image above? Thank you
0 Kommentare
Akzeptierte Antwort
Prachi Kulkarni
am 10 Aug. 2021
Hi,
I am assuming that-
Sample code to get the final merged/stitched image is attached below-
% Creating test images A to F with different colours
A = ones(5,12,3); % creating image A
A(:,:,1) = 0; % setting color of A = cyan
B = ones(4,6,3); % creating image B
B(:,:,2) = 0; % setting color of B = magenta
C = ones(4,6,3); % creating image C
C(:,:,3) = 0; % setting color of C = yellow
D = ones(7,4,3); % creating image D
D(:,:,[1 2]) = 0; % setting color of D = blue
E = ones(7,4,3); % creating image E
E(:,:,[2 3]) = 0; % setting color of E = red
F = ones(3,12,3); % creating image F
F(:,:,[1 3]) = 0; % setting color of F = green
% Merging/stitching the images
w = size(A,2);
wD = size(D,2);
wE = size(E,2);
hDE = size(D,1);
finalImage = [A; [B C]; [D NaN(hDE,w-wD-wE,3) E]; F];
imagesc(finalImage);
For more information, please refer to the documentation on-
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!