***Matlab*** Write a program that will average a collection of images, compute t
ID: 3747839 • Letter: #
Question
***Matlab*** Write a program that will average a collection of images, compute the standard deviations at each pixel, and display the results The images below give some examples that were generated by averaging "100 unique commemorative photographs culled from the internet" by Jason Salavon. Your program will do something similar Little Leaguer Kids with Santa The Graduate Newlyweds Write code to do these things per set of images Compute the average image in grayscale Compute the average image in color, by averaging per RGB channel Compute a matrix holding the grayscale images' standard deviation at each pixel (i.e., Xi.j) holds the standard deviation across all the images' gray pixel intensities at row i, column j). Display each of the above.Explanation / Answer
%I have used 3 random images. For more images we can loop it also but to make it simpler I didnot use loops.
N = 3;
I_1 = im2double(imread('S_1.jpg'));
I_2 = im2double(imread('S_2.jpg'));
I_3 = im2double(imread('S_3.jpg'));
I_1_Gray = rgb2gray(I_1);
I_2_Gray = rgb2gray(I_2);
I_3_Gray = rgb2gray(I_3);
sumVal_RGB = I_1 + I_2 + I_3;
sumVal_Gray = I_1_Gray + I_2_Gray + I_3_Gray;
avg_RGB = sumVal_RGB ./ 3;
avg_Gray = sumVal_Gray ./ 3;
deviation_Gray = sqrt((power(I_1_Gray-avg_Gray,2) + power(I_3_Gray-avg_Gray,2) + power(I_3_Gray-avg_Gray,2)) / N);
subplot(1,3,1); imshow(avg_RGB,[]); title('Averagin RGB');
subplot(1,3,2); imshow(avg_Gray,[]); title('Averagin Grayscale');
subplot(1,3,3); imshow(deviation_Gray,[]); title('Standard Deviation');
%Note : For any more query or doubt, pls reply in the comments.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.