+ All Categories
Home > Documents > Control Limited Adaptive Histogram Equalization for Image Enhancement

Control Limited Adaptive Histogram Equalization for Image Enhancement

Date post: 28-Apr-2015
Category:
Upload: pi194043
View: 1,791 times
Download: 7 times
Share this document with a friend
Description:
Control Limited Adaptive Histogram Equalization for Image Enhancement description and code
10
Contrast Limited Adaptive Histogram Equalization for Image Enhancement - OpenCV Pi19404 February 2, 2013
Transcript

Contrast LimitedAdaptive HistogramEqualization for

Image Enhancement- OpenCV

Pi19404

February 2, 2013

Contents

Contents

Contrast Limited Adaptive Histogram Equalization for Image Enhance-

ment 3

0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30.2 Histogram Equalization . . . . . . . . . . . . . . . . . . . . . . . . 3

0.3 Adaptive Histogram Equalization . . . . . . . . . . . . . . . . . 5

0.4 Control Limited Adaptive Histogram Equalization . . . . . . 6

0.5 Application 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

0.6 Application 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

0.7 Application 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

0.8 Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

Contrast Limited Adaptive HistogramEqualization for Image Enhancement

0.1 IntroductionContrast Limited Adaptive Histogram Equalization is technique toenhance the images by improving the contrast of image.First we lookat global histogram equalization, local histogram equalization,adaptivehistogram equalization and variance of adaptive histogram equalizationcalled Contrast Limited Adaptive Histogram Equalization.

0.2 Histogram Equalization

A Image is said to have good contrast if it has good color variance.A Image histogram is a good tool to analyze the contrast of theimage. A Image Histogram is simply the count of pixel intensitiesorganized into set of predefined bins

A image with low contrast has histogram concenterated about somepixels while a image with high contrast has histogram that is equallyspread over range of pixels.

Below are histogram of low high contrast image.It can be observedthat histogram is concenterated about few pixel values.Most of pixelsin image lie in narrow range ,hence there is a low variance in pixelintensities .

(a) Low contrast Image (b) Histogram

3 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

To produce a high contrast version of the image ,the task is toprocess the image such that histogram is more evenly distributedacross all the pixel values,indicating the image contains a largevariation of pixels indicating a high contrast image.It may lead toenhancing the unwanted noise and supressing desired information inimage.

These effects can be observed for images with very poor contrastsuch that histogram is very narrow,equalization will not transform thehistogram to great extent by may lead in increasing the noise inthe image

The aim of histogram equalization tecnhiques is to apply some trans-formation of the image so that output image has increased contrastand histogram that is well distributed over the all range of pixels

(c) Low contrast Image (d) Histogram

(e) High contrast Image (f) Histogram

However this method has many disadvantages and produces arti-ficial images under certain scenarois. Below are samples images forwhich histogram equalization produces image that introduces artifactsor leads to less visually appealing images.

The main reason for these effects may be attributed to thefact that image transformation is performed considering the globalhistogram of image and the same transformation many not neces-sarily be suitable in local context . The histogram equalization alsotends to produce visible gradients when applied to low contrast

4 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

images.

(g) Low contrast Image (h) Histogram

(i) High contrast Image (j) Histogram

Figure 1: Disadvantages of Equalization

0.3 Adaptive Histogram Equalization

Adaptive histogram equalization divides the image into several blocks.For each block histogram is computed and equalization if per-formed over the neighborhood. Generally neighborhood is choosenabout a point and operation is performed for all points in the image.

The parameter to control is the local neighborhood size.Too small asize will make will make it too sensitive to local variations and imagenoise and this will lead to artifacts .

These effects are pronounced in regions which are homogenous,regions with high frequency or noise

The boundary between adjacent blocks are also clearly visible dueto variation in local transformation function.To improve the image byproviding a smooth variation of pixel values across adjacent blocksinterpolation technique is used.

The interpolated pixel is computed by using bi-linear interpola-tion of vaue of pixel in 3 neighboring blocks.

5 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

The transformation function accepts a pixel intensity values andoutputs a transformed pixel intensity value.

Consider the block with size (A;B) and co-ordinates (i � 1; j � 1),(i; j� 1) ,(i� 1; j) and (i; j) and let value of pixel according to trans-formation function in these blocks be v1,v2,v3,v4.

The bilinear interpolation can be expressed as for pixel (x; y) inblock 4

v = (A� x) � (B � y) � v1 + (A� y) � x � v2 + (A� x) � y � v3 + x � y � v4

For the block that lie along the boundary of the image linearinterpolation is used Consider the block (i; 0) and (i � 1; 0) if pixelcorridnaties are such that x < A=2 and y < B=2 then

v = (A� x) � v1 + x � v2

Similarily for blocks along boundary in y direction (0; j) and (0; j � 1)

v = (B � y) � v1 + y � v2

The interpolation will reduce the boundary effects and providesmooth transition of pixel values between adjacent blocks of image.

0.4 Control Limited Adaptive HistogramEqualization

It can be observed that noise in enhanced in regions of low contrastusing adaptive histogram equalization. For such regions a histogramclip limit can be defined.The histogram is clipped at the specifiedvalue and pixels are distributed to obtain a locally uniform histogram.

The histogram value is maintained the same if not excess pix-els are not added to it, however we clip all the pixels so asto obtain a relatively uniform historam indicating a image with goodcontrast.The transformation is computed using the clipped histogram.

The histogram of adaptive equalization,interpolated and CLAHE arealmost same. The only different is how they handel pixels at alocal level.While interpolation provides smooth transition betweenadjacent blocks of pixels.

6 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

The effect of clipping is to produce locally uniform histogram .Theclipped level for all the blocks the transformation domain will be thesame for all the blocks.The locally uniform histogram will give rise tolocally good contrast image and the uniform clip level will give riseto a globally consistant image.

(a) Low contrast Image (b) Histogram (c) Equalize

(d) Histogram (e) normalized (f) Histogram

(g) Local HE (h) Histogram (i) interpolated

(j) Histogram (k) CLAHE (l) Histogram

Figure 2: Local Histogram Equalization

7 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

0.5 Application 1

An application of CLAHE is for underwater image processing.First thecolor cast in under water image are removed using color constancyalgorithm,then CLAHE is applied on the illumination channel of thecolor image.

(a) gray world (b) CLAHE (c) gray world

(d) CLAHE

Figure 3: Application of CLAHE to image enchancement-Application 1

0.6 Application 2

If in the above approach the color cast is not removed successfully,applying the CLAHE algorithm to the illumination channel does nothelp much in improving the contrast of the image.

Another approach we can take is to apply CLAHE to RGB channelson the image independently choosing the clip level for each channelindependently based on the requirement.

In some situations it may be required to apply CLAHE to onlyone of RGB channels and Global histogram equalization is appliedto other channels.In the below examples it can be seen that suchprocessing is useful for enhancement of underwater images.

8 | 10

Contrast Limited Adaptive Histogram Equalization for Image Enhancement

(a) image (b) CLAHE R

(c) global RGB (d) CLAHE RGB

Figure 4: Application of CLAHE to image enchancement-Application 2

0.7 CodeCode is available in repository http://code.google.com/p/m19404/source/

browse/CLAHE/HistogramEqualization the implemetation is written inopencv using C++ wrappers and is same as OpenCv Code for Claheand Code for Clahe with few minor modifications based on theabove analysis.

9 | 10

Bibliography

Bibliography

[1] OpenCv Code for Clahe. url: https://github.com/joshdoe/opencv-clahe.

[2] Karel Zuiderveld. Code for Clahe. url: http://tog.acm.org/resources/GraphicsGems/gemsiv/clahe.c.

[3] Karel Zuiderveld. �Graphics gems IV�. In: ed. by Paul S. Heckbert. San Diego, CA,USA: Academic Press Professional, Inc., 1994. Chap. Contrast limited adaptivehistogram equalization, pp. 474�485. isbn: 0-12-336155-9. url: http://dl.acm.org/citation.cfm?id=180895.180940.

10 | 10


Recommended