Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pmi432 / LR07 / 2read / image processing toolbox guide.pdf
Скачиваний:
166
Добавлен:
18.03.2015
Размер:
18.08 Mб
Скачать

Displaying Different Image Types

Displaying Truecolor Images

Truecolor images, also called RGB images, represent color values directly, rather than through a colormap. A truecolor image is an m-by-n-by-3 array. For each pixel (r,c) in the image, the color is represented by the triplet

(r,c,1:3).

To display a truecolor image, using either imshow or imtool, specify the image matrix as an argument. For example, this code reads a truecolor image into the MATLAB workspace and then displays the image. This documentation uses the variable name RGB to represent a truecolor image in the workspace

RGB = imread(`peppers.png'); imshow(RGB)

or

imtool(RGB)

4-71

4 Displaying and Exploring Images

Systems that use 24 bits per screen pixel can display truecolor images directly, because they allocate 8 bits (256 levels) each to the red, green, and blue color planes. On systems with fewer colors, imshow displays the image using a combination of color approximation and dithering. See “Displaying Colors” on page 14-2 for more information.

Note If you display a color image and it appears in black and white, check if the image is an indexed image. With indexed images, you must specify the colormap associated with the image. For more information, see “Displaying Indexed Images” on page 4-66.

4-72

Соседние файлы в папке 2read