how can i join different images ?
Show older comments
is their any method to join different part of whole image to form one complete picture in this application?. For example i have attached image to understand you very clearly. In this image i have stiched image but this is not perfect. I want to do perfect stitching with auto option, so software can do it by itself. Thanks in advance
1 Comment
Devyani Sankhe
on 29 Jan 2021
Answers (2)
David Hill
on 28 Jan 2021
Images will all be 3D matrices that you can contatenate together anyway you want.
newImage=[Image1,Image2,Image3;Image4,Image5,Image6];%may need to pad some images with white or black to make the size consistent
17 Comments
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
Edited: David Hill
on 28 Jan 2021
a=imread('images.jpg');
b=imread('sun.jpg');
A=[a;zeros(225-168,300,3)];%pad with black to make same size
B=[b,zeros(225,300-225,3)];%pad with black to make same size
imshow(A);
imshow(B);
C=[A,B];
c=[A;B];
imshow(c);
imshow(C);
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
Did you download the attachments (pictures) to the folder MATLAB is using ?
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
Edited: David Hill
on 28 Jan 2021
Into the folder or path that MATLAB is looking at. Look at the current folder block on your work space.
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
I don't see the image files (images.jpg and sun.jpg) in your image (Error 2.png) in the current folder. Make sure the image files are in the current folder (see your image above Error 2.png attached).
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
Looks good. Just run the first 4 lines. Then execute the other commands one at a time to see the difference.
David Hill
on 28 Jan 2021
Then you could look at
C=[A,B,A,B;B,A,B,A];
imshow(C);
Devyani Sankhe
on 28 Jan 2021
David Hill
on 28 Jan 2021
Edited: David Hill
on 28 Jan 2021
Load all your images (hopefully they are the same size).
for k=1:100
image{k}=imread(sprintf('image%d.jpg',k);%assuming files are named consistantly: image1.jpg, image2.jpg, ...
end
%then stich them together
newImage=[image{1:5};image{5:-1:10};...];
Devyani Sankhe
on 28 Jan 2021
Edited: Devyani Sankhe
on 29 Jan 2021
Devyani Sankhe
on 29 Jan 2021
Devyani Sankhe
on 30 Jan 2021
David Hill
on 30 Jan 2021
If you want any more help, show us what you have done and ask a specific question. We don't care that you are new to MATLAB.
Image Analyst
on 30 Jan 2021
1 vote
Try montage() or imtile()
17 Comments
Devyani Sankhe
on 30 Jan 2021
Devyani Sankhe
on 30 Jan 2021
Devyani Sankhe
on 30 Jan 2021
Devyani Sankhe
on 30 Jan 2021
Image Analyst
on 30 Jan 2021
You forgot to read the posting guidelines:
and because of that, you forgot to attach the individual images that need to be stitched together. I'll check back later for them.
Devyani Sankhe
on 30 Jan 2021
Image Analyst
on 30 Jan 2021
From your second image, it looks like there should be 12 smaller images. You forgot to attach those again. I'll check back later for those 12 images.
Devyani Sankhe
on 30 Jan 2021
Devyani Sankhe
on 31 Jan 2021
Image Analyst
on 31 Jan 2021
It doesn't look like they're all the same size? How did these all get chopped up in the first place, and why, when that happened, were they not all the same size?
Devyani Sankhe
on 31 Jan 2021
Image Analyst
on 31 Jan 2021
Yes but it's more difficult. Do you want the white surround just butted together so that the stitched image will have white bands running through it? Or do you want to overlap, like panorama stitching?
Devyani Sankhe
on 31 Jan 2021
Image Analyst
on 31 Jan 2021
Then look at the links I sent you in my last message. Sorry, but it would take too much of my time to do it for you, especially since I've never done it before. It would probably take hours or more, not the 5 or 10 minutes of my free time I usually devote to someone's question. Good luck.
Devyani Sankhe
on 31 Jan 2021
Edited: Devyani Sankhe
on 31 Jan 2021
Image Analyst
on 31 Jan 2021
I did suggest code. Won't you at least look at it? I won't try it for you - you can do it just as well as I can. I won't have time to adapt it for you. Sorry but this would go way beyond the time i spend for people. Alternatively I suggest you try to obtain images that don't need to be stitched in this way.
Devyani Sankhe
on 31 Jan 2021
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
