Image zoom 2:1
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 4 256x256 pixel gray images. I want to reduce these 4 images at a ratio of 2:1 and then combine them side by side to form a single image. Finally, I want to find the mean and standard deviation of the last image I have obtained. How can i do it?![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1401609/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1401609/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1401614/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1401619/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1401624/image.bmp)
% Read the four standard images
image1 = imread('image1.jpg');
image2 = imread('image2.jpg');
image3 = imread('image3.jpg');
image4 = imread('image4.jpg');
% Resize the images to the desired size of 256x256 pixels
image1_resized = imresize(image1, [256 256]);
image2_resized = imresize(image2, [256 256]);
image3_resized = imresize(image3, [256 256]);
image4_resized = imresize(image4, [256 256]);
% Create a blank canvas for the combined image
combined_image = uint8(zeros(256, 512, 3));
% Place the resized images side by side in the combined image
combined_image(:, 1:256, :) = image1_resized;
combined_image(:, 257:512, :) = image2_resized;
combined_image(:, 513:768, :) = image3_resized;
combined_image(:, 769:1024, :) = image4_resized;
% Display the combined image
imshow(combined_image);
0 Kommentare
Antworten (1)
DGM
am 2 Jun. 2023
Bearbeitet: DGM
am 2 Jun. 2023
% these aren't JPGs
A = imread('image1.bmp');
B = imread('image2.bmp');
C = imread('image3.bmp');
D = imread('image4.bmp');
% these are all already 256x256
% so i don't know why you're resizing them
% concatenate images using ... concatenation
outpict = [A; B; C; D];
imshow(outpict,'border','tight')
% do whatever you wanted to the last image
Dmean = mean(D(:))
Dstd = std(double(D(:)))
0 Kommentare
Siehe auch
Kategorien
Mehr zu Geometric Transformation and Image Registration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!