I want to mosaic two imges using MATLAP script
would do you help me how I will Image Stitching?
Please, help me by providing its codes

Réponses (3)

Image Analyst
Image Analyst le 15 Juin 2020

0 votes

Try imtile() or montage() or imshowpair().
Or try this:
tallImage = [image1;image2]; % Must have same number of columns and color channels.
wideImage = [image1, image2]; % Must have same number of rows and color channels.
KSSV
KSSV le 15 Juin 2020
Modifié(e) : KSSV le 15 Juin 2020

0 votes

  1. Read both the images using imread.
  2. Check the sizes of both the images.
  3. Convert the images two same size if they are not in same size using imresize.
  4. Join both the images using cat.
I1 = imread(image1) ; %m,n size
I2 = imread(image2) ; % m,n size
% Merge next to each
I12 = cat(2,I1,I2) ;
imshow(I12)
% Merge one above the other
I12 = cat(1,I1,I2) ;
imshow(I12)

7 commentaires

Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
Dear KSS for your on time response. But when I use your code to mosaic two images the following errors comes. And it is not working. Would re-vist it?
imshow(I12)
Error using cat
Dimensions of arrays being concatenated are not consistent.
>> I12 = cat(1,I1,I2) ;
imshow(I12)
Error using cat
Dimensions of arrays being concatenated are not consistent.
KSSV
KSSV le 15 Juin 2020
I have already specified that both the images should be of same dimension. Use imresize to get them to the same dimensions.
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
Since I am the bigginer for this kind of analysis, would provide the imresize code as well. That image I am working on is two, which is obtained from urban area. Also, I am waiting your response that I send to you personally
KSSV
KSSV le 15 Juin 2020
I1 = imread(image1) ;
I2 = imread(image2) ;
[m1,n1,p1] = size(I1) ;
[m2,n2,p2] = size(I2) ;
m = max(m1,m2) ;
n = max(n1,n2) ;
I1 = imresize(I1,[m,n]) ;
I2 = imresize(I2,[m,n]) ;
I12 = cat(1,I1,I2) ;
imshow(I12)
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
This works, but still it has a problem. I makes stick together on the top of the other images. But, it does not mosaicked the images. I need as they mosaic
sorry for the disturbance I made
KSSV
KSSV le 15 Juin 2020
What do you mean by mosiac?? Show example.
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
When I say mosaic, I mean that producing one image from two images. Just overlaying one on the other, ruther that merging one image over the top of the other.

Connectez-vous pour commenter.

Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020

0 votes

The code you provide works for "Merge one above the other". But, I needs overlaying or mosacking rather than merging one above the other

5 commentaires

KSSV
KSSV le 15 Juin 2020
Try montage function.
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
When I say mosaic, I mean that producing one image from two images. Just overlaying one on the other, ruther that merging one image over the top of the other.
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
I could not now the function of montage yet
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
When I say mosaic, I mean that producing one image from two images. Just overlaying one on the other, ruther than merging one image over the top of the other.
Mekonen Merga Iticha
Mekonen Merga Iticha le 15 Juin 2020
When I say mosaic, I mean that producing one image from two images. By using matching principles, and feature extractions overlaying two images. Example using the prinples of Harris
points1 = detectHarrisFeatures(I1);
points2 = detectHarrisFeatures(I2);
.
.

Connectez-vous pour commenter.

Catégories

Produits

Version

R2020a

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by