Color image processing: pseudocolor processing by Gleb V. Tcheslavski: gleb@ee.lamar.edu http://ee.lamar.edu/gleb/dip/index.htm Spring 2008 ELEN 4304/5365 DIP 1 Preliminaries Pseudocolor (false color) image processing consists of assigning colors to gray values based on a specified criterion. The term pseudocolor emphasizes that the colors were assigned artificially opposing to the true (real) colors. The principal use of pseudocolors is for human visualization and dit interpretation tti of gray scale details dtil on an image or their sequence. Spring 2008 ELEN 4304/5365 DIP 2 1
The technique of intensity (density) slicing can be explained by interpreting a grayscale image as a 3D function being sliced by a plane parallel to the coordinate plane of the image. For instance, a plane at l i slices the image into two levels. Assigning next one color to the pixels, whose intensities are above the plane and another color to the pixels, whose intensities are below the plane (pixels are on different sides of the plane), we create a two-color image, whose appearance depends on pixel intensities. Spring 2008 ELEN 4304/5365 DIP 3 Alternatively, the same mapping can be interpreted using the following representation. Any input intensity level is assigned to one of two colors, depending on whether it is above or below the value of l i. When more levels are used, the mapping function looks like stairs. Spring 2008 ELEN 4304/5365 DIP 4 2
In general, this technique is as follows: Supposing that the image has the gray scale values [0, L-1] where the level l 0 represents black [f(x,y) = 0] and the level l L-1 represents white, we form P planes perpendicular to the intensity axes at levels l 1, l 2,..., l P such that 0 < P < L-1 and the planes partition the gray scale into P + 1 intervals V 1, V 2,, V P+1. Then, intensity to color assignment is made according to f ( x, y ) = c if f ( x, y ) V k k Where c k is the color associated with the k th intensity interval V k defined by the partitioning planes at l = k-1 and l = k. Spring 2008 ELEN 4304/5365 DIP 5 Monochrome image of Picker Thyroid Phantom Result of intensity slicing i into 8 colored regions It is quite evident that the regions appearing as uniform (with a constant intensity) in the monochrome image are really quite variable as shown in the pseudocolor image. Spring 2008 ELEN 4304/5365 DIP 6 3
4/28/2008 takes much useful and meaningful role when subdivision is based on physical h i l characteristics h t i ti off the th image. i In X-ray images of the weld, it is known that, while encountering porosity or a crack in the weld, the full strength of the X-rays would hit the sensor. Therefore, assuming 8-bit X-ray weld images, the intensity values close to 255 would indicate problems. Therefore, assigning one color to level 255 and another color to all other levels, would simplify the weld inspection and lower its error rate. Spring 2008 ELEN 4304/5365 DIP 7 Average rainfall measurements are usually done by satellites: a grayscale image is formed, whose intensity values are proportional to precipitation. i it ti Rain fall data plotted on a world map Color-coding greatly improves readability of such maps. Spring 2008 ELEN 4304/5365 DIP 8 4
Other types of intensity-to-color transformations exist. One practically attractive method implies performing three independent transformations on the intensity of any input pixel. The results are fed separately into the red, green, and blue monitor channels producing a composite image whose colors are modulated by the transformation functions. Note that the result is a function of pixel s intensity but not of its position. Spring 2008 ELEN 4304/5365 DIP 9 Airport X-ray scanner: ordinary luggage and one with a block of simulated plastic explosives. Pseudocolor image obtained with the first set of transformation functions: explosive and background have different intensity levels and are mapped to different colors. The block, however, is quite uniform. Explosives and the bag were mapped by similar transformations: the observer can see through the explosives. Spring 2008 ELEN 4304/5365 DIP 10 5
Trimmed sinusoidal functions used for the intensity transformations in the previous example. Changing the phase and frequency of each sinusoid can emphasize (in color) ranges in the gray scale: if all three transformations have the same phase and frequency, the output image would be monochrome. A small change in phase between 3 transformations leads to a slight change in pixels, whose intensities correspond to peaks. Pixels with intensity values in the steep section of sinusoids are assigned to much stronger colors. Spring 2008 ELEN 4304/5365 DIP 11 Often, it is desired to combine several monochrome images into a single color composite image. A frequent use of this approach is in multispectral image processing: different sensors produce individual monochrome images, each in a different spectral band. Next, three images can be selected for display (based, for instance, on a type of information each sensor produces). Spring 2008 ELEN 4304/5365 DIP 12 6
Intensity to color transformation Spectral satellite images of DC area: red, green, blue, and near infrared. First 3 images combined into a full-color image sometimes (dense areas) are hard to interpret. Red component replaced by the near IR (component with strong response to biomass): biomass is represented in red and urban features appear grayish. Spring 2008 ELEN 4304/5365 DIP 13 Images of Io combined from different Galileo imagers (some of them are in an invisible region). However, understanding of chemical and physical processes affecting sensor responses helps building meaningful color maps: Material newly ejected from active volcanoes are mapped to red; older sulfur deposits are indicated by yellow. Such composite images might be easier to understand and interpret than individual images acquired from individual sensors. Spring 2008 ELEN 4304/5365 DIP 14 7
Full-color image processing basics There are two major categories of full-color image processing: 1) Process each component image (R,G,B, for instance) individually and then form a composite processed image; 2) Directly work with color pixels: since full-color images have at least 3 components, color pixels are vectors In RGB color space, an arbitrary vector (color pixel) is c R ( x, y) R( x, y) c( x, yz, ) = cg ( xy, ) Gxy (, ) = cb ( x, y) B( x, y) Whose components are the RGB components of a color image at a point. Note that the vector components are spatial variables! Spring 2008 ELEN 4304/5365 DIP 15 Full-color image processing basics It might be easier to process each individual component image but the result of such processing is not always equivalent to direct processing. In order to both processings to be equivalent: 1) The process (filtering) has to be applicable to both vectors and scalars; 2) The operation on each component of a vector must be independent of the other components. Spring 2008 ELEN 4304/5365 DIP 16 8