Before we begin examining the differences of color image processing to grayscale image processing techniques, we must first understand the difference between color and grayscale images. As explained in previous chapters, a grayscale image can be represented as a two-dimensional, m-by-n matrix (m rows and n columns). Its elements, called pixels, have values spreading from 0 to 255 (in the case of 8-bit images). A value of zero represents black, a value of 255 represents white, while all the values in between represent different shades of gray.
In the case of color images, the matrices become three-dimensional. The first two dimensions, as in the case of grayscale images, are the number of rows and the number of columns (m-by-n). The difference is that the third dimension typically comprises three layers, representing colors. That is, color images are three-dimensional (usually m-by-n-by-3) matrices and can be thought of as three grayscale images combined...