**5.3 Spatial feature manipulation**

Examples of spatial feature manipulation techniques include edge enhancement, convolution, and spatial filtering. Edge enhancement methods attempt to achieve low frequency brightness information while at the same time preserving local contrast. These are obtained by combining the original pixel values with a high frequency component image of the same scene [25, 26]. The high frequency component can be created by spatial filtering which involves subtracting a convolved image from its original image. Convolution involves the use of an array of coefficients (e.g. 3 × 3 and 5 × 5) known as masks or kernels to apply a digital number to an output pixel corresponding to the central pixel of the original image. This can

#### **Figure 5.**

*3D surface and contour chart outputs of a simple ratio of R band pixels on G band pixels showing eczema atopic dermatitis symptom on skin (***Figure 1a***).*

be implemented by simply finding the average or median [27] pixel value of the original image and entering that in the corresponding central pixel of the output image. The mask is moved to apply the operation throughout the original image to obtain the convolved image. Spatial filtering is done to emphasize or deemphasize image data of varied spatial frequencies (observed tonal variation roughness). Spatial filtering is a special case of convolution and is a pixel neighborhood operation. **Figure 7** shows sequential enhancements of the data of the psoriasis vulgaris skin image which was shown in **Figure 1c**.

**Figure 7a** is the original image which is shown here again for ease of comparison. **Figure 7b** is an output image of R/G ratioing while **Figure 7c** is an edge

#### **Figure 6.**

*Ulcerative colitis affected colon: (a) output of R/G ratio; and (b) subsequent segmented image. The colitis is represented by the whitish regions.*

#### **Figure 7.**

*Psoriasis vulgaris skin: (a) original image; (b) output of R/G ratio; (c) edge enhancement subsequent to 'a'; (d) convolution subsequent to 'b'; (e) segmentation subsequent to 'c'; and (f) true color RGB fusion with edge enhancement.*

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


**Table 3.**

*Example codes for implementing spatial feature enhancements.*

**Figure 8.**

*Psoriasis vulgaris skin monochrome fused images: (a) G data; and (b) edge-enhanced G data.*

enhancement applied subsequently. The edge enhancement was obtained by applying a multi-directional pixel differencing method to detect the edges. This was implemented by using a threshold difference value of 0.1 to create a binary data of, say '1' for 'edge' if the absolute difference with at least one value of its neighboring four-directional pixels was greater than the established threshold value and or '0' if otherwise [17] as in **Table 3**. It should be noted that the function code in **Table 3** was applied to cell B2 and copied on only the remaining inner cells as only those are sounded by four neighbors. The function codes were modified for the outer cells (pixels). [28, 29] provide more details on multi-directional pixel value differencing. **Figure 7d** shows the output image of a 3 × 3 window convolution operation performed subsequent to the edge enhancement. Similarly to edge detection and for the same reason, the function code shown in **Table 3** was applied to cell B2 and copied onto the remaining inner cells. **Figure 7e** was obtained as subsequent segmentation. Finally, **Figure 7f** is a true color RGB image with edge enhancement obtained by data fusion using the VBA macro in the Appendix.

**Figure 8** demonstrates the implementation of spatial filtering in the G band data for the psoriasis vulgaris skin image shown in **Figure 1c**. **Figure 8a** is simply the fused image of the G data where only the G data was used for the R, G, and B components (see Appendix) to obtain a monochrome image output. This output image prior to the spatial filtering is not very sharp. **Figure 8b** was obtained after applying the spatial filtering. To accomplish this, the data was first convolved using a 3 × 3 window filter and the output data was subtracted from the original data. Finally, the result of the subtraction was added back to the original data. The final output image is edge enhanced and thus is sharper.
