How to join two images from end to end using matlab and what course of matlab I should learn for that?
1 view (last 30 days)
Show older comments
I have to join multiple images upto four side by side, as I need to measure yarn's cross section for a length of 50 cm, using images from tomography and optical microscopy, the issue is that I have multiple images upto four and I want to join them side by side to see continuity in the surface of yarn, so that I can examine continously from start till end. Will somebody be able to answer my query as what courses are available in matlab which I should learn to connect these images, accurately to minimul error, and what programmes are there or if someone could elaborate the procedure for that.
Thank you kindly.
0 Comments
Answers (2)
Image Analyst
on 19 Mar 2025
Just stitch the images together using commas and brackets:
% Stitch side-by-side
wideImage = [image1, image2, image3, image4]; % All images must have same # of rows.
% Stitch vertically.
tallImage = [image1; image2; image3; image4]; % All images must have same # of columns.
To learn other fundamental concepts, invest 2 hours of your time here:
1 Comment
Image Analyst
on 19 Mar 2025
It's a generic, general purpose demo of how to threshold an image to find blobs, and then measure things about the blobs, and extract certain blobs based on their areas or diameters.
Walter Roberson
on 19 Mar 2025
Consider using montage
1 Comment
DGM
on 20 Mar 2025
Edited: DGM
on 20 Mar 2025
Or if you want the output as a new image, you can use imtile(). The usage and options are very similar to montage(), but you get the result directly instead of needing to force the geometry and extract the data from the figure.
EDIT:
Actually, I was wrong about the difference in the default geometry behavior. In general, you still would need to enforce it either way, but if all you need is the image data, it saves figure creation and capture.
% two images of dissimilar size
A = imread('peppers.png'); % 384x512x3
B = imread('cameraman.tif'); % 256x256x1
% montage() scales the images based on the figure size.
% if we want to preserve the image resolution,
% we need to enforce the geometry
% and capturing data from the figure
sz = [size(A,1:2); size(B,1:2)]; % the geometry of each image
sz = max(sz,[],1); % the union of the geometries
hi = montage({A,B},'thumbnailsize',sz);
op1 = hi.CData;
% imtile() scales the images based on the geometry of the first image
% unless the first image is the largest, we still need to enforce the geometry.
% getting the result doesn't require figure capture though.
% that might be desirable for speed or convenience.
op2 = imtile({A,B},'thumbnailsize',sz);
% they're the same size
[size(op1); size(op2)]
% the content is identical
immse(op1,op2)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
