Filter löschen
Filter löschen

Qn regarding Matlab Montage

6 Ansichten (letzte 30 Tage)
RuiQi
RuiQi am 30 Jun. 2016
Kommentiert: RuiQi am 1 Jul. 2016
Is it possible to generate a montage of images with some spacing in between ? My images are really small so it would look better if I am able to add some gap in between the images.

Akzeptierte Antwort

Nut
Nut am 30 Jun. 2016
Bearbeitet: Nut am 30 Jun. 2016
Hi,
yes, it is possible. This is just a basic example:
mont(:,1:500) = I1;
mont(:,550:1049) = I2;
mont(550:1049,1:500) = I3;
mont(550:1049,550:1049) = I4;
figure,imshow(mont)
Clearly this is a brute syntax, it refers to grayscale images of size 500x500 pixel, with a gap of 50 pixel between them. You have to adjust it depending on:
- the sizes and the number of your images, depending on these you can also define the indices of "mont" through a for cycle and preallocate the "mont" matrix;
- the format of your images (rgb or grayscale);
- the dimension of the gap you want;
- the color of the gap you want.
This solution is to create a single image concatenating a lot of images. However, if you need only to view all images in a single screen, without creating a new image, also the "subplot" function could be helpful for you:
  1 Kommentar
RuiQi
RuiQi am 1 Jul. 2016
The subplot function, with a for loop was exactly what I needed. Thanks !!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by