Question: Write a function/method called thresholdWithAvg which thresholds the given image using its average intensity. (Hint: To calculate the average intensity, iterate through every pixel in

Write a function/method called thresholdWithAvg which thresholds the given image using its average intensity. (Hint: To calculate the average intensity, iterate through every pixel in the image to sum their intensities and finally divide the sum by the total number of pixels. Later, generate your new image using thresholding on that computed average intensity.) Run the following commands at the Matlab/Octave command line. And attach the screenshot here. im=imread('2501FinalImage2.png'); im=rgb2gray(im); out=thresholdWithAvg(im); figure; subplot(1,2,1); imshow(uint8(im)); subplot(1,2,2); imshow(uint8(out));
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
