13
6. Gray level enhancement • Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in an image. This operation is called contrast enhancement. •A common reason for manipulating these attributes is the need to compensate for difficulties in image acquisition. •For example, in images where an object of interest is backlit, that object can be underexposed

6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Embed Size (px)

Citation preview

Page 1: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

6. Gray level enhancement• Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in an image. This operation is called contrast enhancement.•A common reason for manipulating these attributes is the need to compensate for difficulties in image acquisition. •For example, in images where an object of interest is backlit, that object can be underexposed almost to the point of being a silhouette.

Page 2: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

• Contrast enhancement aims to improve an image such that the content of an image become visually more pleasing.

• Figures 6.1(a) & 6.1(b) show the image before and after contrast enhancement.

Page 3: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Fig.6.1(a). A dark image

Page 4: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Fig.6.1(b) An enhanced image

Page 5: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

• There are several techniques in enhancing the contrast of digital image such as histogram stretch, histogram equalization and adaptive contrast enhancement.

• Histogram equalization is a popular technique for improving the appearance of a poor image.

• Its function is similar to that of a histogram stretch but often provides more visually pleasing results across wider range of images.

Page 6: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Histogram Equalization Algorithm

• Histogram Equalization is a technique where the histogram of the resultant image is as flat as possible.

• With histogram stretching the overall shape of the histogram remains the same.

• The theoretical basis for histogram equalization involves probability theory, where the histogram is treated as the probability distribution of the gray levels.

Page 7: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

• The histogram equalization process for digital image consists of four steps:

i. Find the running sum of the histogram values

ii. Normalize the values from step (i) by dividing by the total number of pixels

iii. Multiply the values from step (ii) by maximum gray level value and round

iv. Map the gray‑level values to the results from step (iii) using a one‑to‑one

correspondence

Page 8: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

• Example: Given a 3 bits-image, so the possible range of values is 0 to 7. Suppose the image has the following histogram:

Table 6.1 Histogram of image

Page 9: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Fig.6.3. Histogram of original image

Page 10: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Table 6.2 shows the steps to find the histogram-equalized values.

Table 6.2. Histogram-equalized values

Page 11: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

• In order to get the histogram‑equalized image, all pixels in the original image with gray level 0 are set to 1, values of 1 are set 2, 2 set 4, 4 set to 4, and so on; as indicated by Table 6. 2.

• Table 6.3 shows the histogram of the histogram‑equalized image.

Page 12: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Table 6.3. Histogram of the histogram-equalized image

Page 13: 6. Gray level enhancement Some of the simplest, yet most useful, image processing operations involve the adjustment of brightness, contrast or colour in

Fig. 6.5. Histogram of histogram-equalized image