• No results found

4.2 Image Enhancement

4.2.2 Colour Normalisation

Having identified the ROI, colour normalisation was applied next. The aim was to stan- dardise the colours across the set of retinal images. Colour normalisation was achieved using the Histogram Specification (HS) approach described in [74]. This approach op- erates by mapping the colour histograms of each image to the reference image colour histograms [74, 148]. The task commenced with the selection of a reference image that represents the best colour distribution determined through visual inspection on the set of retinal images by a trained clinician. Next, the RGB channel histograms of the reference image were generated. Finally, the RGB histograms of other images were extracted and each of these histograms was tuned to match the reference image’s RGB histograms. The colour normalisation process used in this thesis consists of four steps, which are enumerated below [74]. Figure 4.2 illustrates this process.

1. Extract histograms for both the reference, hr, and target, ht images. Both his- tograms shared the same definition as follow:

h(i) =α (4.1)

where i = {0,1,2, ...,I−1}, I is the number of different intensity values (I = 256 with respect to the 24-bit RGB colour scheme used for the work described in this thesis), and α is the occurrences of iin the corresponding image (reference

Table 4.1: Histogram equalisation transformation values,s, generated from the original intensity values of the target image

i ht P(ht) si 0 10 0.28 1.96→ 2 1 10 0.28 3.92→ 4 2 4 0.11 4.69→ 5 3 3 0.08 5.25→ 5 4 3 0.08 5.81→ 6 5 2 0.06 6.23→ 6 6 3 0.08 6.79→ 7 7 1 0.03 7.00→ 7

image for hr or target image for ht). Figure 4.2(a) shows an example of a 6 × 6 size target image with its corresponding pixel intensity values andI= 8. The extracted target image colour histogram,ht, is shown in Figure 4.2(b), while the reference image colour histogram is depicted in Figure 4.2(c).

2. Compute the cumulative Probability Density Function (PDF) ofht to obtain the value ofs, which is then normalised to the total number of intensity levels. PDF is the probability of intensity value i appearing in a particular image. The s

value is defined as:

si = (I−1) i X x=0 P(ht(x)) = (I−1) i X x=0 ht(x) M N (4.2)

where P(ht) is the PDF of intensity value w, and M N is the size of the target image ROI in pixels. Table 4.1 shows the conversion of the original target image intensity values to s values for the example depicted in Figure 4.2(a). Column two represents the histogram values ofw. All of the s values are rounded up to the nearest integer in the range [0,W - 1].

3. Compute the transformation function, G, from the reference image histogram,

hr: G(zq) = (I−1) q X y=0 P(hr(y)) = (I−1) q X y=0 hr(y) M N (4.3)

Table 4.2: Transformation function,G, for the reference image intensity values z hr P(hr) G(z) 0 2 0.06 0.42→ 0 1 2 0.06 0.84→ 1 2 4 0.11 1.61→ 2 3 8 0.22 3.15→ 3 4 13 0.36 5.67 → 6 5 7 0.19 7.00→ 7 6 0 0 7.00 → 7 7 0 0 7.00 → 7

Table 4.3: Mappings from itozq

i→ si → zq→ z 0 2 2 2 1 4 3 3 2 5 6 4 3 5 6 4 4 6 6 4 5 6 6 4 6 7 7 5 7 7 7 5

whereq ={0,1,2, ...,I−1},P(hr) is the PDF of intensity valuezandM N is the size of the reference image ROI in pixels. Round allGvalues to an integer value in the range [0,I- 1]. Column four in Table 4.2 shows the transformed values of the original reference image intensity values,z(see column one of Table 4.2). The corresponding histogram curve of the reference image is shown in Figure 4.2(c).

4. For each si, find the matching zq value so that G(zq) = si. If more than one

zq values satisfy the si, the smallest zq value will be selected. If none of the

G(zq) match the si, than the nearest and lowestG(zq) will be used to get thezq value. Table 4.3 shows the full mapping from the original target image intensity values, i, to their equalised intensity values, s, and finally to the corresponding intensity values in the reference image,z. The first and second columns were taken from the first and fourth columns of Table 4.1. The third and fourth columns were generated from the fourth and first columns of Table 4.2. The original pixel value,i, in the target image is then replaced by its matching pixel value,z, in the reference image. Thus, the transformed (normalised) ˆhtimage (see Figure 4.2(d)) will now have a similar histogram curve ashrand consequently the colours within the target image will be closer to the reference image colours. Figure 4.2(e) shows the changes to the target image pixel intensity values after colour normalisation (the original intensity values are shown in Figure 4.2(a)).

0 0 1 1 1 0 0 2 3 4 2 1 0 3 6 7 4 1 1 3 6 6 4 1 1 2 5 5 2 0 0 0 1 1 0 0 2 2 3 3 3 2 2 4 4 4 4 3 2 4 5 5 4 3 3 4 5 5 4 3 3 4 4 4 4 2 2 2 3 3 2 2 (a) (b) (c) (d) (e)

Figure 4.2: Example of the colour normalisation task as adopted in this thesis: (a) tar- get image pixel intensity values, (b) target image colour histogram extracted from (a), (c) reference image colour histogram, (d) target image colour histogram after histogram specification, and (e) target image pixel intensity values after histogram specification

Figure 4.3(a) depicts an actual example of an original retinal image with its corre- sponding RGB histograms shown in Figure 4.3(d). The horizontal axis represents the histogram intervals (histogram bins) and represents the colour intensity values ranging from 0 to 255. Figure 4.3(b) and (e) shows the reference image selected by the clinician and its RGB histograms respectively. The colour normalised retinal image given in Figure 4.3(a) is presented in Figure 4.3(c) and the corresponding RGB histograms are shown in Figure 4.3(f). Note that a dark coloured image is produced if most of its pixels occur on the left hand side of the histogram, and will get brighter if the distribution of the pixels moves towards the right hand side. This is shown in Figure 4.3(a) where the green channel histogram (histogram curve in green colour) covers only the left half of the histogram, while the red channel histogram (red colour curve) is evenly distributed across the histogram bins. Thus, a dark and reddish retinal image is produced (the retinal image presented in Figure 4.3(a)). A darker blue colour is desired as the author would like to maintain the original colour of the retina, which is more likely to be as depicted by the reference image (Figure 4.3(b)). As we can see, the reference image green histogram is distributed more evenly across the histogram bins, while the red pixels occur to the right half of the histogram. This combination produced a better and more desirable retinal image colour (see retinal image in Figure 4.3(b)). The HS approach then maps the colour histograms of Figure 4.3(a) to the one shown in Figure 4.3(b). As a result, the green channel of the retinal image in Figure 4.3(a) now covers most of the histogram bins, while the red channel histogram has been moved towards the right half of the histogram (see Figure 4.3(c)). A brighter and better represented colour retinal image is therefore produced, as shown in Figure 4.3(c), that has a similar colour to the reference image presented in Figure 4.3(b).