Pseudocode
PROCEDURE luminance(image, x, y)
c <- pixel(image, x, y)
c' <- avg(c)
return c'
END PROCEDURE
Description
Calculate the average (mean) value for that pixel then return this value.
Average Value
This is effectively_averaging_ the value of the pixel over its components.
\[v = \frac{\sum_iP_i}{N}\]
Where:
- v
-
final (new) pixel value
- p
-
vector containing N channels
- N
-
number of channels
Related Concepts
Acknowledgements
Adapted from Pseudocode produced for COMP120 by Dr. Micheal Scott.