![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251704/Untitled.png)
how to combine two image to get one image
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hello every one
I want to combine two images to get an image that contains the two images like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251703/image.png)
this is my code two combine the two images but i don,t know how i get the result ilke the image above
clear all
clc
I1=imread('D82.gif');
I2=imread('1.2.03.tiff');
TF=25-1;%
w=floor((TF+1)/2);
n=100;
x=[I1(1:n+(2*w),1:n+(2*w)),I2(1:n+(2*w),1:n+(2*w))];
how i can get a result lik the image
0 comentarios
Respuestas (1)
Thiago Henrique Gomes Lobato
el 1 de Dic. de 2019
This should do what you want:
I = imread('cameraman.tif');
I2 = imresize(rgb2gray(imread('onion.png')),[size(I,1),size(I,2)]);
ImLength = size(I,1);
% Create image large enough to encapsulate both of them
Iend = uint8(zeros(2*ImLength,2*ImLength));
Iend(1:ImLength,1:ImLength) = I; % First image
Iend(ImLength+1:end,1:ImLength) = I2; % Second image
Iend(1:ImLength,ImLength+1:end) = I2; % Second image
Iend(ImLength+1:end,ImLength+1:end) = I; % First image
figure,imshow(Iend)
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/251704/Untitled.png)
0 comentarios
Ver también
Categorías
Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!