Effacer les filtres
Effacer les filtres

how to read images from dir and combine images with different size in one image

1 vue (au cours des 30 derniers jours)
sina alizadeh
sina alizadeh le 25 Nov 2016
Commenté : Image Analyst le 3 Déc 2016
how to combine multi images in one image with different size and position beside each other in 3 3 matrix , just like a image in link :

Réponses (1)

Image Analyst
Image Analyst le 25 Nov 2016
See my demo to paste a rectangular image into a larger canvass.
  6 commentaires
sina alizadeh
sina alizadeh le 3 Déc 2016
tanks for your reply but i don't want to cropped image,my solution is make one image from reading multi images from dir to make a 3 * 3 matrix to show with a different size of each images , i use montage() but can't change the size of the images. and i combine images with imfuse() but can't change the position of images and they overlay to each other
A = imread('1.jpg');
for idx = 2 : 12
B = imread([ num2str(idx) '.jpg']); %// Read in the next image
B = imresize(B,0.5);
A = imfuse(A, B, 'blend','Scaling','joint'); %// Fuse and store into A
end
image(A);
how can i create this image ? in the question A1,A2,...A9 are the images from dir with different random size
Image Analyst
Image Analyst le 3 Déc 2016
First do this outside the loop
[rowsA, columnsA, numColorsA] = size(A)
Then, in the loop, instead of this:
B = imresize(B,0.5);
do this to resize B to be the same size as A
B = imresize(B, [rowsA, columnsA]); % No need to pass in numColorsA.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by