How to display two images into one figure without blocking each other?
Afficher commentaires plus anciens
Dear all,
I have two images in jpg format. I would like to these two images display in one figure lay on each other and without blocking each other. Is it possible?
I attach these two images. Thank you for your answers.
Réponses (1)
Image Analyst
le 23 Avr 2017
Yes, just stitch them together
wideImage = [image1, image2]; % Have the same number of rows.
or else use imfuse() or imshowpair(). Or put them into separate axes.
5 commentaires
Veronika
le 23 Avr 2017
Image Analyst
le 23 Avr 2017
If they aren't the same number of rows and the same number of color channels, you can't stitch them side by side. They can only vary in the number of columns.
You can stitch top and bottom if they have the same number of rows and color channels like this:
tallImage = [image1; image2];
If one is color and one grayscale, you must convert the grayscale one to color like this:
rgbImage = cat(3, grayImage, grayImage, grayImage);
For a really flexible stitching program see Stitch: http://www.mathworks.com/matlabcentral/fileexchange/25797-stitch
Veronika
le 24 Avr 2017
Image Analyst
le 24 Avr 2017
Try
ax = gca; % Get handle to current/last used axes control.
ax.YDir = 'reverse'; % Flip it top to bottom.
Veronika
le 24 Avr 2017
Catégories
En savoir plus sur Image Arithmetic dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

