Effacer les filtres
Effacer les filtres

Stitching image in 2 direction

3 vues (au cours des 30 derniers jours)
Hieu Tran Doan Trung
Hieu Tran Doan Trung le 1 Juin 2020
Hello everyone.
Anyone know how to sitching 2 images in 2 direction.
2 pictures below can not stitching in 1 direction (the postion of the nose and eyes are not in the same column and rows)
Thanks in advance.

Réponse acceptée

Image Analyst
Image Analyst le 2 Juin 2020
Modifié(e) : Image Analyst le 2 Juin 2020
If you don't want to butt the images against each other but there is some overlap that needs to be determined, then you will need to look up "panorama" : https://www.mathworks.com/matlabcentral/answers/?term=tag%3A%22panorama%22
  1 commentaire
Hieu Tran Doan Trung
Hieu Tran Doan Trung le 2 Juin 2020
Many usefull information, thanks so much for sharing this. I tried some of them.
At the moment i haven't solve the problem and i will stick with it in long period of time.
Anyway, i posted another question about the seams and stitching line in stitching image you may see it in the stitching pictures. Could you accept the questions please.
Many thanks to you. Good luck and have a nice day.

Connectez-vous pour commenter.

Plus de réponses (1)

Image Analyst
Image Analyst le 1 Juin 2020
Modifié(e) : Image Analyst le 1 Juin 2020
To stitch images:
wideImage = [image1, image2]; % Must have same number of rows.
tallImage = [image1; image2]; % Must have same number of columns.
  2 commentaires
Hieu Tran Doan Trung
Hieu Tran Doan Trung le 2 Juin 2020
Hello, thanks for quickly reply me.
Anyway, it is not simple like those solution above which can easily solve by montage or someothers thing.
2 pictures stitching together look like the pictures under. However, the pictures below is 1 direction stitching, not 2 direction stitching. I hope someone may give me a suggestion to solve this.
Thank you so much.
Hieu Tran Doan Trung
Hieu Tran Doan Trung le 2 Juin 2020
This is the code file for 1 direction stitching
clc;
clear all;
close all;
I1 = imread('Lena_p4.png');
I2 = imread('Lena_p5.png');
F = im2double(I1);
S = im2double(I2);
[rows cols] = size(F(:,:,1));
Tmp = [];
temp = 0;
for j = 1:cols% to prevent j to go beyond boundaries.
for i = 1:rows
temp = temp + (F(i,j,1) - S(i,1,1))^2;
end
Tmp = [Tmp temp]; % Tmp keeps growing, forming a matrix of 1*cols
temp = 0;
end
%
[Min_value, Index] = min(Tmp);
n_cols = Index + cols - 1;% New column of output image.
Opimg = [];
for i = 1:rows
for j = 1:Index
for y = 1:3
Opimg(i,j,y) = F(i,j,y);% First image is pasted till Index.
end
end
for k = Index+1:n_cols-1
for y = 1:3
Opimg(i,k,y) = S(i,k-Index+1,y);%Second image is pasted after Index.
end
end
end
[r_Opimg c_Opimg] = size(Opimg(:,:,1));
subplot(1,3,1);
imshow(F);axis ([1 c_Opimg 1 c_Opimg])
title('First Image');
subplot(1,3,2);
imshow(S);axis ([1 c_Opimg 1 c_Opimg])
title('Second Image');
subplot(1,3,3);
imshow(Opimg);axis ([1 c_Opimg 1 c_Opimg])

Connectez-vous pour commenter.

Catégories

En savoir plus sur Geographic Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by