Section A

Design of Unsharp Mask Filter based on Retinex Theory for Image Enhancement

Ju-young Kim1, Jin-heon Kim2,*
Author Information & Copyright
1Dept. of Computer Engineering, Seo-Kyeong University, jinheon@skuniv.ac.kr
2Dept. of Electronic Computer Engineering, Seo-Kyeong University, kjy920217@naver.com
*Corresponding Author: Jin-heon Kim, 124 Seokyeong-ro, Seongbuk-gu, Seoul, Tel : +82-10-2090-1945, E-mail : jinheon@skuniv.ac.kr.

© Copyright 2017 Korea Multimedia Society. This is an Open-Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/4.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.

Received: Jun 20, 2017 ; Revised: Jun 24, 2017 ; Accepted: Jun 28, 2017

Published Online: Jun 30, 2017

Abstract

This paper proposes a method to improve the image quality by designing Unsharp Mask Filter (UMF) based on Retinex theory which controls the frequency pass characteristics adaptively. Conventional unsharp masking technique uses blurring image to emphasize sharpness of image. Unsharp Masking(UM) adjusts the original image and sigma to obtain a high frequency component to be emphasized by the difference between the blurred image and the high frequency component to the original image, thereby improving the contrast ratio of the image. In this paper, we design a Unsharp Mask Filter(UMF) that can process the contrast ratio improvement method of Unsharp Masking(UM) technique with one filtering. We adaptively process the contrast ratio improvement using Unsharp Mask Filter(UMF). We propose a method based on Retinex theory for adaptive processing. For adaptive filtering, we control the weights of Unsharp Mask Filter(UMF) based on the human visual system and output more effective results.

Keywords: Unsharp masking; Unsharp mask filter; Retinex theory; Image enhancement

I. INTRODUCTION

In order to popularize image devices and improve the image quality of images, researches are going on, and they are used in various fields. For example, it is used in various fields such as digital camera sensor [1], medical device [2], medical image [3], infrared camera [4], license plate recognition [5]. When acquiring a digital image from a video device, a video having a low contrast ratio may be obtained due to a limitation of a shooting environment or a video device. In this situation, image improvement technology can be improved when image improvement is needed. In the field of image processing, there are two ways to improve the contrast ratio of images. First, it is possible to improve the contrast ratio by separating the high frequency and low frequency components from the image and recombining them with different weights according to the respective components. Representative methods include unsharp masking [6] [7], and high pass filtering. This method can enhance the visual quality of the image by emphasizing the high frequency region more than the low frequency region. The second method is to individually modify each pixel value using the statistical information of the image. Histogram Equalization (HE) [8] [9], Brightness preserving Bi-Histogram Equalization (BBHE) Image Histogram Equalization (DSIHE) [11]. Histogram Equalization (HE) [8] [9] improves the image quality by enhancing the contrast of gradation measures by distributing gradients of the image evenly. However, the histogram smoothing method does not consider the average brightness of the original image, so that the average brightness of the resulting image is excessively changed, resulting in unnaturalness of the image. Brightness preserving Bi-Histogram Equalization (BBHE) [10] and Dualistic Sub-Image Histogram Equalization (DSIHE) [11] are typical methods to overcome these drawbacks. The above methods divide the histogram of the original image into two sub histograms and smooth it. BBHE uses the averaged value of the original image, and DSIHE divides it into two sub-histograms using the entropy value of the original image.

In this paper, we propose a new Unsharp Masking (UM) method that emphasizes the high frequency region to improve the contrast ratio of images. In the filtering process, weights of each filter are adaptively filtered by adjusting the weights based on Retinex theory [12]. Retinex algorithm is a method to improve image by improving brightness by considering illumination and reflection components. That is, in recognizing visual information, the information of the light source affects the visual information of the actual object. The Retinex algorithm is the first scheme proposed by Edwin Land, which estimates illumination components and reduces the effects of them to improve the image quality. Many people have studied to improve the contrast ratio of images based on Retinex algorithm [13][14]. In this paper, the Unsharp Mask Filter (UMF) [15] is adaptively processed based on the Retinex theory to improve the contrast ratio of the image.

This paper is composed as follows. In Chapter 2, unsharp masking, Retinex theory, and frequency response of image are introduced. In Chapter 3, the proposed method and the existing techniques are tested and verified. Chapter 4 concludes the study.

II. RELATED RESEARCH

Various algorithms have been developed to improve contrast ratio of images. As a typical research, blurring is a method for removing noise. High pass filtering and unsharp masking techniques are used to improve the contrast ratio.

jmis-4-2-65-g1
Fig. 1. Image bluring and Sharpening result (a) original image (b) Gaussian bluring (c) sum of laplician Filtering image and original image (d) Bilateral filtering
Download Original Figure
2.1 Image Bluring and Sharpening

The blurring technique makes the image smoother. A typical blurring technique is Gaussian blurring using a weighted average filter, and blurring using an average filter. The weighted average filter gives a large weight to the mask intermediate value, and the lower the weight from the center. The average filter outputs the values in the mask as the average value of the pixel values. Blurring removes high-frequency components through low-pass filtering. Blurring has the advantage of eliminating image noise, but it has the disadvantage that it is blurred as a whole and the contrast ratio is weakened. To solve these drawbacks, bilateral filtering that can remove noise while preserving edge has been studied.

Image Sharpening is a method to improve the contrast ratio of images. unsharp mask, The Laplacian filtering, LOG, differential operator, etc., can be used to detect the edge and improve the contrast ratio by summing with the original image.

2.2 Unsharp Masking (UM)

The Unsharp Masking (UM) technique is a technique to improve the contrast ratio by adding edge components to the original image. One of the image sharpening techniques is to remove the blurred image from the original image to obtain the unsharp mask image. The unsharp mask image removes the low frequency components and outputs only the high frequency components. Adding the original image and the unsharp mask image shows a sharpening image with an improved contrast ratio. The unsharp masking process can be expressed as Equation (1).

I ( x , y ) = I ( x , y ) + H ( x , y ) H ( x , y ) = I ( x , y ) G ( x , y ) G ( x , y ) = 1 2 π σ 2 e ( x 2 + y 2 ) 2 σ 2  
(1)

In the above equation (1), I′(x,y) is an image with an improved contrast ratio I (x, y) is an input image. H (x, y) is a high-frequency image for improving the contrast ratio and can be obtained by subtracting the blurring image from the original image. The filters used for the blurring images were weighted average filters. Using a weighted average filter, the higher the value of sigma, the stronger the blurring intensity. Adjusting the sigma value in the Gaussian distribution equation for UM plays a role in adjusting the high frequency component. The following figure 2 shows the UM technique as a signal.

jmis-4-2-65-g2
Fig. 2. signal representation of unsharp Masking process (a) Original signal (b) bluring signal (c) unsharp mask (d) sharpend signal.
Download Original Figure

Figure 2 (a) shows the input signal. Figure 2 (b) shows the low-frequency signal, and Figure 2 (c) shows how the high-frequency component is left by removing the low-frequency signal from the input signal. Figure 2 (d) shows that the high-frequency component is added to the input signal to further emphasize the high-frequency component. The following Figure 3 shows the process of obtaining an unsharp mask image from an Image.

jmis-4-2-65-g3
Fig. 3. unsharp mask result (a) original image (b) bluring Image (c) unsharp mask image
Download Original Figure

After obtaining the unsharp mask image, we can obtain the sharpening image with the improved contrast ratio by adding the mouth image and the unsharp mask image. Various algorithms have been developed for adaptive processing of such unsharp masking technique [15][16].

2.3 Retinex Theory

Retinex is a combination of Retina and Cortex. Retina is the retina, and Cortex is the cerebral cortex. When a human perceives an object through the eye, the eye simply receives the light reflected from the object. However, in the cerebrum, the eye considers the ambient lighting components and interprets them. The algorithm that has been studied based on this principle is Single Scale Retinex. Single Scale Retinex defines the function to obtain the ambient illumination with the most basic Retinex algorithm. The function is used to estimate the illumination component. The image is expressed by the product of the illumination component and the reflection component as shown in Equation (2). I (x, y) is finally obtained image information. R (x, y) and L (x, y) refer to the reflection component and the illumination component.

I i ( x , y ) =   R i ( x , y )   ×   L i ( x , y )
(2)

The Retinex algorithm is a technique to improve the image quality by reducing the influence of illumination. Expression (3) is based on the reflection component of Eq. (2). As introduced in the introduction, Retinex is an algorithm based on human visual perception model. In the Retinex algorithm using Weber-Fechner’s law, equation (3) is transformed again as in equation (4)

R   ( x , y ) =     I   ( x , y ) L   ( x , y )  
(3)
R   ( x , y ) =     log ( I   ( x , y ) L   ( x , y ) )
(4)

Equation (3) can be expressed by the following equation using the log subtraction rule and the surrounding function. Where S (x, y) is used to estimate the illumination component of the surrounding area. The * is the convolution symbol, which estimates the illumination component by convolving the original image and the surrounding function. The Gaussian function such as Eq. (5) is mainly used as a peripheral function. Where K is the normalization coefficient, and c is the Gaussian constant.

R   ( x , y ) = log ( I   ( x , y ) log ( F ( x , y ) * I   ( x , y ) )    
(5)
( x , y ) =     K e ( x 2 + y 2 ) / c 2   ,   S ( x , y ) d x d y = 1
(6)

The final result of Single Scale Retinex (SSR) is normalized to a value between 0 and 255 in Eq. (5). Single Scale Retinex (SSR) uses only one peripheral function, so we get a very different result depending on the Gaussian constant value, so we need to set an appropriate Gaussian constant according to the input image. When the Gaussian constant is large, the difference between the bright region and the dark region becomes more clear, but the information of the boundary portion is lost, and the information of the bright region is lost much. The boundary is clear when the Gaussian constant is small, but the difference between the bright region and the dark region is not large.

2.4 Digital Filter and Frequency Response

In digital image processing, a filter passes only the frequency that it wants to pass through the image. That is, the pass frequency region can be controlled. Designing a filter and modifying or improving an image is called filtering. In order to check the frequency response of the filter in the image, a Fourier transform process is required. Fourier Transform is a process of converting spatial domain data into frequency domain data. Through the Fourier Transform, it is possible to analyze the frequency pass characteristics by checking the spatial filter as a frequency response. On the contrary, it is possible to analyze the frequency response and to design it as a digital filter with pass characteristics. Convolution of the filter in the image is equivalent to multiplying the Fourier transform function of the two functions in the frequency domain.

g ( x , y ) = f ( x , y ) * h ( x , y ) G ( u , v ) F ( u , v ) H ( u , v )
(10)
g ( x , y ) =   T 1 G ( u , v ) = T 1 F ( u , v ) H ( u , v )
(11)

T−1 :Inverse Fourier Transform

The processing of image and filter can be expressed as (10). The frequency response can be confirmed by Fourier Transform, and the digital filter can be designed through the frequency response. The figure below shows the result of Fourier transform of the Sobel filter and checking the frequency response.

jmis-4-2-65-g4
Fig. 4. Frequency Response of log filter (a) 3 * 3 Sobel filter (b) Output frequency response of the Sobel filter as shaded (c) Frequency Response of a 3D Sobel filter
Download Original Figure

III. PROPOSED METHOD

The algorithm proposed in this paper can be confirmed by Flowchart as shown in Figure 5.

jmis-4-2-65-g5
Fig. 5. Flowchart of design of unsharp Mask filter based on Retinex theory for image enhancement.
Download Original Figure

The specific contents of the algorithm are described in the following sections.

3.1 Unsharp Mask Filter Design

In this paper, the process of Unsharp Masking (UM) technique is designed as a spatial filter and processed by a single filtering operation. And the frequency response is confirmed by Fourier transform. The Unsharp Mask Filter (UMF) design can be obtained by the difference between the center 1 filter and the Gaussian filter. The spatial filter can be processed by multiplying the image in the frequency domain. In the process of designing unsharp mask filter, UMF can be obtained by subtracting the Gaussian Filter from the center 1 filter. In the next UMF, a filter with a center of 1 is added and filtering is performed. If you check the result image, you can see that the contrast ratio is improved than the input image.

The figure above shows the result of checking the filter when designing Unsharp Mask Filter (UMF). Figure 6 (a) shows the kernel with center 1, figure 6 (b) shows the Gaussian kernel, figure 6 (c) shows the UMF and figure 6 (d) shows the sharpening kernel. The UMF can be obtained by subtracting the Gaussian filter from the filter with center 1. On the contrary, the same result can be obtained by subtracting the filter with the center 1 from the Gaussian filter.

jmis-4-2-65-g6
Fig. 6. unsharp mask filter design process (a) original kernel (b) Gaussian kernel (c) unsharp mask kernel (d) sharpening kernel
Download Original Figure

Figure 7 shows the design process of Unsharp Mask Filter (UMF) by frequency response through Fourier Transform.

jmis-4-2-65-g7
Fig. 7. frequency response of unsharp mask filter design (a) Frequency Response of original kernel (b) frequency response of Gaussian kernel (c) Frequency Response of unsharp mask filter.
Download Original Figure

By designing the UMF and performing Fourier Transform, the frequency ranges to be passed can be confirmed and a new filter can be designed. The high-pass filter for emphasizing the edge in the horizontal direction in the image is Figure 8 (a). The high-pass filter for emphasizing the edge in the vertical direction is figure 8. (b). The frequency domain to be passed can be designed as a filter and the contrast ratio can be emphasized by the direction of the image.

jmis-4-2-65-g8
Fig. 8. unsharp mask filter design by direction (a) unsharp mask filter to emphasize the edge in the horizontal direction (b) unsharp mask filter to emphasize the edge in the vertical direction
Download Original Figure
3.2 Adaptive Filtering with Weight

We used Retinex principle to design Unsharp Mask Filter (UMF) and adaptive filtering. The principle of Retinex is used to control contrast ratio emphasis based on human visual perception model. Human vision is not well recognized when emphasizing the contrast ratio in the light-bright area, and better recognizes the contrast ratio emphasized in the dark area. By using this principle, it is possible to improve the weight ratio of the UMF in the dark area and the weight of the UMF in the bright area, thereby effectively improving the contrast ratio. Letting W (x, y) be the intensity for improving the contrast ratio and L (x, y) be the image information finally obtained as the illumination component, I (x, y).

I   ( x , y ) =   W   ( x , y )   ×     I U M F ( x , y )  
(12)
W   ( x , y ) =   I   ( x , y )     L   ( x , y )
(13)

The intensity W (x, y) of the contrast ratio is obtained by the difference between the image information and the illumination component. In order to obtain L (x, y) , a peripheral function S(x, y)is defined and estimated. The * used to find S(x, y) is the Convolution symbol, and the original image and the surrounding function can be obtained by Convolution computation.

L   ( x , y ) =   S ( x , y ) * I   ( x , y )
(14)

The surrounding function S(x, y) is a normalization coefficient using the Gaussian function, and s is the sigma value controlling the size of the Gaussian function.

S ( x , y ) =     K e ( x 2 + y 2 ) / s 2   ,   F ( x , y ) d x d y = 1
(15)

Finally, if the magnitude of the illumination effect is obtained by the image information, the intensity of the contrast ratio can be adjusted according to the size of the image information.

{ W   ( x , y ) = 0.5 ( W   ( x , y ) > 200   ) W   ( x , y ) = 1.3 ( 75 < W   ( x , y ) < 200   ) W   ( x , y ) = 2.0 (   W   ( x , y ) < 75   )
(16)

The strength of the unsharp mask filter is determined according to the finally determined W (x, y) and the result of the improvement of the contrast ratio can be confirmed. Different results can be obtained depending on the Gaussian constant value in the peripheral function. An appropriate Gaussian constant should be set. Figure 8 below shows an adaptively improved contrast ratio.

Figure 9 shows that the unsharp mask filter is more emphasized than the conventional method, and the emphasized images are naturally emphasized adaptively. Table 1 and Table 2 below show the PSNR and AMBE results of the Figure 8 images. The PSNR (Peak Signal Noise Ration) index is an index of the loss information of the image. The higher the PSNR, the less the loss. The AMBE (Absolute Mean Brightness Error) indicator shows that the smaller the average brightness difference is, the better the average brightness maintaining performance of the input image.

jmis-4-2-65-g9
Fig. 9. results using existing and proposed techniques (a) Image of cathedral using UM (b) Image of cathedral using adaptive UMF (c) Image of cathedrals2 using UM (d) Image of cathedrals2 using adaptive UMF (e) Image of duck using UM (f) Image of duck using adaptive UMF (g) Image of notredam94 using UM (h) Image of notredam94 using adaptive UMF
Download Original Figure
Table 1. Results using PSNR index.
PSNR UM Adaptive UMF
duck 20.9016 21.7520
Chariot 21.8072 22.0377
Cathedrals2 21.5105 22.9392
Notredam94 20.3287 22.2292
Download Excel Table
Table 2. Results using AMBE index.
PSNR UM Adaptive UMF
duck 0.0315 0.0025
Chariot 0.0415 0.0402
Cathedrals2 0.1386 0.1291
Notredam94 0.0283 0.0224
Dog 0.0447 0.0348
Download Excel Table

If we check the experimental results, we can see that the proposed method outputs better results.

IV. EXPERIMENTS AND RESULT

In this paper, Unsharp Mask Filter (UMF) is designed to improve the contrast ratio, and the contrast ratio can be emphasized by one filtering process. In the past, we used the method of finding differences between images using images and adding the differences. However, it can be processed at once using the proposed technique. We design a filter and check the frequency response of the filter through Fourier transform. A new filter can be designed to control the pass characteristics through the frequency response. By designing UMF and adjusting the amount of contrast ratio emphasis based on the Retinex theory, the image can be adaptively improved. In the future, we will study how we can make the weight of UMF by making it a mathematical function, and control not only the contrast ratio but also brightness information of image.

Acknowledgement

This Research was supported by Seo-kyeong University in 2016.

REFERENCES

[1].

S. Jungho, “Iterative Unsharp Mask Filter for Digital Auto-Focusing,” Journal of the Institute of Electronics Engineers of Korea, Vol. 47, No.2, pp. 145-152, September 2010.

[2].

J. YongGyu and E. JaeKwon and K. TaeWoo and K.vladimir, and L. JaeSeok, “ Selective Unsharp Masking Algorithm for Low Dose Digital X-ray Image Enhancement,” THE INSTITUTE OF ELECTRONICS ENGINEERS OF KOREA, pp. 339-342, 2001.

[3].

Tian Xiurong, “The application of Adaptive unsharp mask algorithm in medical image enhancement,” IEEE Cross Strait Quad-Regional Radio Science and Wireless Technology Conference, pp. 26-30, 2011.

[4].

K. YongJun and S. ByungCheol, “Super-resolution Algorithm Using Adaptive Unsharp Masking for Infra-red Image,” The Korean society of Broad engineers, Vol. 21, No.2, pp. 180-191, 2016.

[5].

K. JinHo, “Vehicle License Plate Recognition for Smart Tolling by Selective Sharpening,” The Korea Contents Society, Vol. 14, No.12, pp. 1-9, 2014.

[6].

R. C. Gonzalez and R. E. Woods, “Digital Image Processing, 3nd edition”. Prentice Hall, 2007.

[7].

L. ImGeun, “Image Contrast Enhancement using Adaptive Unsharp Mask and Directional Information,” Journal of the Korea Computer Information Society, Vol.16, No. 3, pp. 27-34, 2011.

[8].

A. Rosenfeld and P. D. Torre, “Histogram Concavity Analysis as an Aid in Threshold Selection,” IEEE Transactions on Systems Man Cybernetics, Vol. SMC-13, Issue 2, pp. 231-235, 1983.

[9].

M. I. Sezan, “A Peak Detection Algorithm and Its Application to Histogram-Based Image Data Reduction,” Journal of Computer Vision, Graphics, and Image Processing, Vol. 49, No. 1, pp. 36-51, 1990.

[10].

Y. T. Kim, “Contrast Enhancement using Brightness Preserving Bi-Histogram Equalization,” IEEE Transactions on Consumer Electronics, Vol. 42, No.1, pp. 1-8, 1997.

[11].

Y. Wang, Q. Chen, and B. Zhang, “Image enhancement based on equal area dualistic sub-image histogram equalization method,” IEEE Transactions on Consumer Electronics, Vol. 45, No. 1, pp. 68-75, 1999.

[12].

E. H. Land and J. J. McCann, “Lightness and Retinex theory,” Journal of the Optical Society of America, Vol. 61, No. 1, pp. 1-11, 1971.

[13].

H. S. Cha and S. H. Hong, “Advaced Retinex Algorithme for Image Enhancement,” Journal of the Multimedia Society, Vol.16, No. 1, 29-41, 2013.

[14].

S. W. Lee, C. Y. Song, S. S. Cho, S. H. Kim, W. S. Lee, and J. G. Kang, “Contrast Enhancement Based on Weight Mapping Retinex Algorithm,” The Journal of the Institute of Electronics Engineers of Korea, Vol.46, No. 4, pp. 31-41, 2009.

[15].

H. G. Kim, D. B. Lee, and B. C. Song, “Adaptive Unsharp Masking using Bilateral Filter,” The Journal of the Institute of Electronics Engineers of Korea, Vol.19, No. 11, pp. 56-63, 2012.

[16].

T. Go, S. Oriaki, and U. Eiji, “An Edge Preserving Filter-based Selective Unsharp Masking for Noisy Images”, ITC-CSCC, pp. 469-472, 2008.