Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

NB: USE MATLAB Write a MATLAB program that computes the average intensity of eac

ID: 3715924 • Letter: N

Question

NB: USE MATLAB

Write a MATLAB program that computes the average intensity of each color in an RGB image. The image name to open and process is stored in a string variable. The program should compute the average intensity of R, G, and B in the image and then produce a new image with the same dimensions as the original image, but with all pixels set to that average intensity. You must use loops to do this assignment. Do NOT employ the MATLAB mean command. You may use any image of your choice for this exercise, so long as it is in color.

Explanation / Answer

MATLAB implementation of the Color Frequency concept

With this script, you pick a color image and then it computes the color frequency image. The color frequency image is an image where the pixel intensity represents the frequency of pixels in the original image that have that same pixel color as that pixel location.

(If you replace imshow() with image(), and comment out the imwrite() function then you won't need the Image Processing Toolbox.)