**5.1 Contrast manipulation**

Three different forms of contrast manipulation are segmentation (a.k.a. gray level thresholding), level slicing, and contrast stretching. Segmentation generally connotes the division of an image into typically two contiguous regions [5], e.g. foreground versus background. The division is based on a threshold value identified to separate the levels appropriately. Different contrasting colors are assigned to the different classes. The algorithm is extended to obtain more than two levels using multiple threshold values (one less the number of classes), what is termed as level slicing. This could imply splitting an image into various diagnostically and therapeutically relevant areas, for instance, differentiating between anatomically healthy tissues and infected tissues at multiple levels. Thus, segmentation (or level slicing) can be considered as a pre-stage of image classification. It can be used to classify different features including raw pixels, edges, textures, and so on. On the other hand, contrast stretching is applied to image data to spread the data across the full range of 256 gray levels.

**Figure 4** provides example contrast manipulation outputs of **Figure 1b** which portray different depictions of allergic rash dermatitis eczema on a human skin. **Figure 4a** is a segmented contrast stretched B band image where the eczema symptoms are shown as the foreground and the clear skin as the background. **Figure 4b** shows a five-level sliced R/G ratio image where the lowest level (lightest gray) represents clear skin while the subsequent darker grays indicate different severities of the symptoms. Multi-image manipulation operations such as the simple ratio of R data on G data are discussed in Section 5.2. **Figure 4c** is a fused contrast stretched false color RGB image where contrast stretching was applied to all three datasets before fusion. **Figure 4d** is a fused contrast stretched monochrome R band image.

To obtain the output in **Figure 4a**, the B band data (min = 2; max = 203) was first stretched to fill a range of 0–255 by using the corresponding function code in **Table 1**. Then, the data was split into two arbitrary values (0.3 and 0.8) for display based on a threshold value of 150 using the corresponding function code in **Table 1**.

The output of **Figure 4b** was accomplished by first obtaining a simple ratio data (min = 1.1; max = 6.8) of R band pixels on G band pixels (simple ratios are discussed in Section 5.2) and then slicing them into five arbitrary values (0.1, 0.3, 0.5, 0.7, and 0.9) for display based on four threshold values of 1.2, 1.4, 1.8, and 2.2. The function codes are shown in **Table 2**.

**Figure 4c** was obtained by implementing contrast stretching separately to R band data (min = 123; max = 255), G band data (min = 18; max = 224), and B

#### **Figure 4.**

*Contrast manipulation outputs: (a) segmented contrast stretched B band image; (b) level sliced R/G ratio image; (c) fused contrast stretched false color RGB image; and (d) fused contrast stretched monochrome R band image.*


#### **Table 1.**

*Example code for implementing contrast stretching and segmentation in Excel.*


#### **Table 2.**

*Example code for implementing simple spectral ratioing and level slicing in excel.*

band data (min = 2; max = 203) and then fusing the three datasets using a modified form of the Visual Basic for Applications (VBA) macro in the Appendix. A similar function code as in **Table 1** was used to accomplish the contrast stretching here. **Figure 4d** was achieved by fusing just the contrast stretched R band data in triplicate (in place of R, G, and B) to obtain a monochrome image. Image fusion here was also accomplished by using a modified form of the VBA macro in the Appendix.

#### **5.2 Multi-image manipulation**

By its name, multi-image manipulation means manipulating data of more than one image together. Multispectral-band integrated enhancement techniques include spectral ratioing, integrating biological components, canonical components, and intensity-hue-saturation color space transformations. All these techniques have been discussed by [25, 26], and several others. [16, 17] demonstrated the

### *Adopting Microsoft Excel for Biomedical Signal and Image Processing DOI: http://dx.doi.org/10.5772/intechopen.81732*

implementation of spectral ratioing in Excel with an agricultural example. Here, we extend the demonstration with example applications in biomedical sciences.

Spectral ratioing enhancements are accomplished either by correspondingly dividing pixel values of one band by pixel values of another band as in simple ratios, or by dividing the pixel difference of corresponding cells in two bands by the sum of the same pixel values as for normalized difference ratios. These ratioing operations are effective for feature extraction from the image data. An example output image of a simple ratio between the R band pixels and G band pixels (R/G; indicated in **Figure 3**) is displayed in **Figure 5**. The image quantitatively shows the eczema atopic dermatitis symptoms on a skin as was seen in **Figure 1a**. The three areas of the skin showing symptoms indicate different severities. This demonstrates the effectiveness of spectral ratioing in distinguishing between biological tissues of different conditions. A similar output data which was subsequently level sliced to obtain quantitative measures of different severities of allergic rash dermatitis eczema on a skin was shown in **Figure 4b**. The ability to express such variations quantitatively can allow for more precise treatment.

Another example output of R/G spectral ratioing is shown in **Figure 6** for the ulcerative colitis affected colon shown in **Figure 1d**. This results in identification of different tissues particularly capturing the colitis as white (**Figure 6a**). **Figure 6b** was obtained by further segmentation of **Figure 6a** data (min = 1.2; max = 14.3)) based on a threshold value of 2, where the colitis affected tissues showed pixel values less than or equal to the threshold value. The projected area of the image covered by colitis is approximately 21%, which was obtained as a ratio of the number of colitis infected pixels to the total number image pixels times 100.
