Вы находитесь на странице: 1из 5

The Application of Image Enhancement on Color and Grayscale Images

Nisar Ahmed, Waqas Ahmed


HITEC University, Taxila Cantt. Pakistan. Taxila Cantonment, Pakistan nisarahmedrana@yahoo.com

Dr. Jamil Ahmed (Chairman Department of Electrical Engineering)


AbstractImage enhancement techniques are used to emphasize and sharpen image features to obtain a visually more pleasant, more detailed, or less noisy output image. Contrast enhancement can be achieved by linear contrast stretching, histogram equalization and adaptive histogram equalization for gray scale image. Color contrast can be achieved by linear color stretching or applying the histogram equalization on the intensity layer of HSI image. Likewise noise reduction can be achieved by different methods like averaging, median and sigma filter. In this paper image enhancement using these techniques has been discussed. A graphical user interface has made in MATLAB to test and verify proposed results of the above mentioned techniques. Keywords- Biomedical image processing, Color graphics, Image enhancement, Image processing

Figure 1. Application specific image enhancement

I.

INTRODUCTION

The aim of image enhancement is to improve the interpretability or perception of information in image for human viewers, or to provide `better' input for other automated image processing techniques. Images can be processed by different means, but image processing using digital computers is the most common method because digital methods are fast, flexible, and precise. Image enhancement improves the quality of images for visual perception. Typical image enhancement operations are removing blur and noise, increasing contrast and revealing details. Image processing technology is used by planetary scientists to enhance images of Mars, Venus, or other planets. Doctors use this technology to manipulate CAT scans and MRI images. Image processing in the laboratory can motivate students and make science relevant to student learning. Image processing is an excellent topic for classroom application of science research techniques. [1] In an application specific image enhancement technique the system is instructed for the specific procedures to obtain a better output image as shown by the block diagram of Figure 1.

A. Contrast Enhancement Image Contrast is the difference in appearance of two or more parts of an image seen simultaneously. Contrast enhancement is used to increase the visual perception of difference between different parts of an image. A number of algorithms for contrast enhancement are currently in use throughout the world. The methods of brightness contrast and color contrast has been discussed here. An image must have good brightness contrast for proper vision. In a low contrast image we cant distinguish clearly between objects. Increasing the contrast makes the light areas become lighter and dark areas become darker. Three methods are used to auto-correct the contrast of image. First method uses linear stretching of histogram over the entire range. This technique maps the intensities to new values such that the data is stretched to the whole range. The equation used for linear contrast stretching is equation of line. Whereas m is gradient and c is y intercept.

The second technique is histogram equalization which is an important technique especially for thermal, satellite and XRay image. This technique is especially important when we the usable data is represented by close contrast values. Histogram equalization spread out the most frequent intensity values to allow the areas of lower contrast to gain a higher contrast. Sometime it produces unrealistic results in photographs however it is very useful method which can lead to better views of bone structure in X-Ray images. A disadvantage of the method is that it is indiscriminate. It may increase the contrast of background noise, while decreasing the usable contents of image. In scientific imaging

1st All Pakistan Technical Paper Competition COMSATS Institute of Information Technology, Lahore Pakistan, April 19, 2011

14

where spatial correlation is more important than intensity of signal, the small signal to noise ratio usually hampers visual detection. To overcome this problem a generalized method is used which uses multiple histograms to emphasize local contrast, rather than overall contrast. This is our third technique known as adaptive contrast enhancement. It enhances the contrast by dividing it in small blocks and then removes the artificial boundaries by using bilinear interpolation.

d) Electronic transmission of image data can also introduce noise. [2] Linear Filtering is easiest method to remove certain type of noise. Averaging or Gaussian filter can be used to accomplish this job. Averaging filter is useful to remove grain noise. Each pixel gets set to the average of its neighboring pixels. The problem with averaging filter is that edges of image get blurred. Median filter works in a similar way as averaging filter, the only difference is the output value of a pixel is determined by the median of the neighboring pixel rather than mean. The principle advantage of median filtering over averaging is that it is much less sensitive to extreme values. Therefore median filtering is better able to remove noise without blurring the edges. Adaptive filtering using Wiener filter often produce much better results than linear filtering. Adaptive filter preserve edges and other high frequency information of an image so it is more selective then linear or median filters. This filter produces best output when noise is AWGN. The only problem of this method over the previous is it requires more computational time. The problem with linear or mean filter is the edges of our image get blurred. To overcome this problem there are some selective techniques. Sigma filter is a selective mean filter. It preserves edges better and is less sensitive to outliers. The filter smoothes an image by taking an average over the neighboring pixels, but only includes those pixels that have a value not deviating from the current pixel by more than a given range. Outliers having a value very different from the surrounding are not included in the average and, thus, completely eliminated from blurring. Anisotropic diffusion is a technique which reduces image noise without removing significant contents of the image, typically details that are important for the interpretation of the image such as lines or edges. [3] C. Blur Reduction When we use a camera, we want the recorded image to be a faithful representation of the scene that we see but every image is more or less blurry. When an image does not shows sharp details of its features it is called blurred image. Thus, image deblurring is fundamental in making pictures sharp and useful. Some blurring always arises in the recording of a digital image; because it is unavoidable that scene information spills over to neighboring pixels. In image deblurring, we seek to recover the original, sharp image by using a mathematical model of the blurring process. Unfortunately there is no hope that we can recover the original image exactly! This is due to various unavoidable errors in the recorded image. The most important errors are fluctuations in the recording process and approximation errors when representing the image with a limited number of digits. The influence of this noise puts a limit on the size of the details that we can hope to recover in the reconstructed image, and the limit depends on both the noise and the blurring process. Image

Figure 2. Histogram of images enhanced by the three methods discussed above.

Contrast enhancement of color images is typically done by transforming an image to a color space that has separate image intensity component. In this technique color transformation function is used to convert an RGB image into LAB color space. In this color space L layer represent luminosity of the image. Working with luminosity will not change colors; it only affects the intensity of the pixels. Image color contrast can also be improved by another technique which works directly in RGB color space rather than converting it into intensity image. In this method the histogram of the three layers is separately stretched over the entire range as discussed for grayscale images. It provides much better color contrast and we get an image having balanced colors. B. Removing Noise Digital images are prone to a variety of types of noise. Noise is the result of errors in the image acquisition process that result in pixel values that do not reflect the true intensities of the real scene. Noise can be introduced into digital images due to several reasons such as a) If the image is scanned from a photograph, the film grain is a source of noise. It can be a result of a damaged film or due to the scanner itself. b) If the image is captured directly from a digital camera it can be due to mechanism of gathering the data. c) It can also be introduced due to less light or high shutter speed of digital camera.

1st All Pakistan Technical Paper Competition COMSATS Institute of Information Technology, Lahore Pakistan, April 19, 2011

15

pixels get distorted from its original location due to several reasons. [4] Blur occur in digital images due to several reasons such as using wrong aperture priority mode, motion while capturing image in wrong shutter priority mode and some other reasons. The aperture settings are known as the f-stop which is the adjustment of optical system in a camera lens. When the camera lens is out of focus the incoming light is smeared out. The lowest number of f-stop lets the most amount of light to reach the image sensor. The next f-stop lets half as much light to reach the sensor and so on. When low f-stop is used low light reach the image sensor and the depth of field is limited and this is suitable for close-up photos. Objects in the background get blurred but when you have to capture the landscape images you have to adjust the f-stop to a high value to capture the maximum depth of field and near objects get blurred because minimum light reaches the image sensors. This slight blurring of image can be effectively reduced by using Blind Deconvolution filter. This algorithm restores the image and the point spread function simultaneously. Additional cameras optical system characteristics can be used as input parameters that could help to improve the quality of image restoration. The shutter determines how long the shutter remains open to record the scene. Shutter speed is measured in fraction of a second or, in seconds when shooting a long exposure. When shooting images in dim conditions without flash, a slow shutter speed is required to capture the complete details of the image. When camera is set to slow shutter speed the camera and subject should remain perfectly still; otherwise, the image will get motion blur. If the image is a victim of motion blur due to camera shake at low shutter speed Weiner Deconvolution filter can be used to reduce the blur. The image can be restored effectively when the frequency characteristics (distortion angle and distance) of the image are known up to an extent. The result gets more pleasant as we enter the parameters near the original value. [5] II. RESULTS

Figure 3. Graphical User Interface designed to apply different techniques and analyze the results.

The images in figure 4 shows the result of color contrast enhancement, the image on the left is a washed out image having poor contrast. After the application of color correction technique which works separately on the RGB layers the resultant image has much better detail and looks like a good image for visual perception.

Figure 4. Color Contrast Enhancement

The proposed methods have been applied to high dynamic range images. This set includes images taken from Digital Camera and some images are downloaded from internet. Results are shown in figures with comparison. The left images represent the original images and the right images are the outputs after Image Enhancement. It is visible that applying our software on the image retrieves details in dark areas and increases the contrast in bright areas. The graphical user interface helps a lot in applying different technique and analyzing results. It shows the original as well as processed image in the same window. Histogram of processed image is updated continuously to analyze the result. All the filters and functions can be easily accessed from toolbars as well as menu.

Images captured in low light are darker and a low contrast. In the figure 5 the image on the left is the original darker image which is first transformed into a lighter image by shifting histogram towards right side and then applying color correction by converting it into intensity image.

Figure 5. Brightness and Color Contrast Enhancement

Image captured in ambient light having a color other than white may have a color cast. An aerial image may also have a

1st All Pakistan Technical Paper Competition COMSATS Institute of Information Technology, Lahore Pakistan, April 19, 2011

16

color cast due to low quality SLR or some other reason. One such image is shown in figure 6. This effect can easily be eliminated by applying histogram equalization on intensity layer.

This filter cant produce such an accurate results when used in natural motion blurred images. The blurred image can be restored by iteration and additional camera parameters can be used to enhance the quality of restored image. The Salt and Pepper type noise is typically caused by malfunctioning of the pixel elements in the camera sensors, faulty memory locations, or timing errors in the digitization process. For the images corrupted by Salt and Pepper noise, the noisy pixels can take only the maximum and the minimum values in the dynamic range. [6] Figure 9 shows an image corrupted by salt and pepper noise. The image is restored by using median filter. The image on the right side is restored image but its edges and sharpness is blurred due to median filtering. The blurring can be increased or decreased by varying the radius of median filter.

Figure 6. Color Cast Reduction using histogram equilization

Cameras having autofocus take a little time to focus the subject so prior capturing of image may hay some lens blur. If the camera is in high f-stop it is tuned to capture near object and blur the far objects. If a landscape image is captured in high f-stop settings the whole image has a Gaussian blur. We can remove this by using Weiner filter by adjusting its parameters to Gaussian filter which sharpen the image features. The image in figure 7 is blurred by this effect and has a slightly low contrast. This image is corrected by sharpening the image followed by histogram equalization.
Figure 9. Noisy image restored by median filter

Sparkle noise causes artificial artifacts in digital images. A bright spot exist in image which have a typical intensity of 40%. This effect can easily be reduced by using sigma filter by adjusting the value of threshold. Figure 10 shows the image corrupted by sparkle noise and then restored by adjusting a suitable value of sigma filter. This image shows that sigma filter produce much better results than median filter in some cases.
Figure 7. Image sharpening and contrsat enhancement

Weiner deconvolution filter provide us best results in debluring when we know the length and angle of distortion in motion blurred images. The results become more and more accurate when we put a value close to the original distortion. Figure 8 shows the result of motion blurred image restored by using correct length and angle of distortion.

Figure 10. Noisy image restored by sigma filter

Figure 8. Motion blurred image restored by Weiner filter

After histogram equalization, image contrast improved. The images displayed much more detail in all cases. With this added detail, also came some noise in the background. In future experiments, a filter to eliminate or minimize this noise might prove beneficial. This effect can be reduced up to an extent by using sigma filter.

1st All Pakistan Technical Paper Competition COMSATS Institute of Information Technology, Lahore Pakistan, April 19, 2011

17

In figure 7 after sharpening the image by applying Gaussian filter some noise appeared in background, this problem can be improved by choosing a better filter or modifying the current filter. While in figure 6 which have very poor contrast didnt shown good results. The filter has created more contrast in some areas a better filter will be used to overcome this problem with pictures with low resolution and poor contrast. We have also darkened the image to get better results.
Image Sharpening TABLE I. CONTRAST ENHANCEMENT Wiener Deconvolution Comparison of different contrast enhancement techniques
Advantage Disadvantage

TABLE III.

BLUR REDUCTION

Blur reduction techniques


Advantage Disadvantage

Image can be sharpened by enhancing edges. Cab be used to reduce motion blur effectively.

Can only be used to restore out of focus image. Effective results can only be obtained if correct distortion factor is known

Linear Contrast Stretching

Can only be used for linear stretching. This technique is best for visual perception especially when image have close contrast data. The application of this technique produces best results for radiographic and thermal images. This is the best technique to be applied when global histogram equalization cant produce good results.

Cant produce much attractive results in many cases. The main disadvantage of the techniques is noise amplification when the image has major low intensity area. The problem with this technique is its limited contrast enhancement due to local contrast enhancement.

In image sharpening and motion blur reduction only two techniques are discussed which produces best results in their application area. III. CONCLUSION

Histogram Equalization

Adaptive Histogram Equalization

Histogram equalization shows best result in most of the cases but if the image has a wide light color area we will incorporate adaptive histogram equalization.
TABLE II. NOISE REMOVAL

Image enhancement techniques are widely available, but their applications are not well defined. Application software has been designed to check the effect on the filter before its application. A detailed discussion has been made on the base of results to select an algorithm on the base of filtering requirements. These techniques are tested on a large number of images and have shown significant results. Though various aspects of image enhancement are catered for in the implementation and subsequent exercise of results, nevertheless, we understand that it is so demanding and absorbing area for research that the work could substantially be carried forward in following directions as a future work: a) Improvement in selective noise reduction techniques.

Comparison of Noise removing techniques


Advantage Disadvantage

b) Level correction of image by combining it with image segmentation. c) edges. Noise reduction by anisotropic diffusion using closed

Linear Filtering Median Filtering

Sigma Filter

Easy to implement. Gaussian or averaging filter can do the job. Easy to implement. Can produce better result than linear filter. Easy to implement by adding threshold in median filter. Produce best result among the three due to threshold for noise. Produce best output when the noise is additive white Gaussian noise. Remove noise without removing significant content of image such as lines or edges.

Image edges get to much blurred. Image edges get blurred.

d) Increasing the speed of image enhancement by using DSP kit. REFERENCES


[1] [2] [3] [4] Image Processing and Image Enhancement, Dr. William L. Joyner, East Tennessee State University Johnson City, Texas, 1996 [Mathworks.com] Anisotropic diffusion presented by Perona and Malik in 1987 Deblurring Images: Matrices, Spectra, and Filtering, written by Per Christian Hansen, James G. Nagy, and Dianne P. OLeary, Published by Siam Digital Photography, written by Doug Sahlin, Published by McGrawHill/Osborne Salt and Pepper Noise Detection and removal by Tolerance based Selective Arithmetic Mean Filtering Technique for image restoration Written by Shahriar Kaisar Md.Sakib Rijwan Jubayer Al Mahmud Muhammad Mizanur Rahman, Institution Dept. of Computer Science & Information Technology, Islamic University of Technology (IUT), Board Bazar, Gazipur-1704, Bangladesh

Cant be used for salt & pepper noise.

Adaptive Filtering (Wiener Filter*) Anisotropic Diffusion

Require high computational time. Implementation is much difficult. Cant be used at every image.

[5] [6]

* There are different type of adaptive filtering techniques.

Sigma filter is best among all the discussed techniques because it better preserve the edges while removing the noise, we can use it as a median filter by adjusting the value of threshold to 100%.

1st All Pakistan Technical Paper Competition COMSATS Institute of Information Technology, Lahore Pakistan, April 19, 2011

18

Вам также может понравиться