Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Add on to the following code to compute a matrix holding the grayscale images standard deviation at each pixel (i.e., X(i,j) holds the standard deviation
Add on to the following code to compute a matrix holding the grayscale images standard deviation at each pixel (i.e., X(i,j) holds the standard deviation across all the images gray pixel intensities at row i, column j). Please comment your code!
% Matrix initialization setsum1 = zeros(215, 300, 3, 'double'); % Loop through all the image files in one directory and store in the matrix filelist = dir('set1\*.jpg'); for i=1:length(filelist) imname = ['\set1\' filelist(i).name]; nextim = imread(imname); setsum1 = setsum1 + im2double(nextim); end % Compute the average image in color setsum1_rgb = setsum1./length(filelist); % Compute the average image in grayscale setsum1_gray = rgb2gray(setsum1_rgb);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started