MATLAB: How can i convert an image to grayscale using for loop

image processing

I want to convert an image to gray scale using for loops

Best Answer

"rgb2gray converts RGB values to grayscale values by forming a weighted sum of the R, G, and B components:
0.2989 * R + 0.5870 * G + 0.1140 * B"
Should be easy to program that in terms of for loops over the rows and columns.
Related Question