An improved gray-scale transformation method for pseudo-color image enhancement

Image enhancement is a very important process of image preprocessing and it plays a critical role in the improvement of image quality and the follow-up image analysis, which makes the research of image enhancement algorithm a hot research field. Image enhancement not only needs to strengthen image determination and recognition, but also needs to avoid the consequential color distortion. Pseudo-color enhancement is the technique to map different gray scales of a black-and-white image into a color image. As humans have extremely strong ability in distinguishing different colors visually and relatively weak capacity in discriminating gray scales, so, color the gray-scale changes which cannot be differentiated by human eyes so that they can tell them apart. The mapping function in conventional gray-scale transform method is not working well in dark and low-contrast images. So, this paper comes up with an improved gray-scale transformation algo-rithm. This algorithm can achieve the enhancement, preserve the image colors, process dark and low-contrast images, reinforce the enhancement and improve the blocking effect. The experiment proves that the enhanced image obtained by the method of this paper can have improved average brightness, natural colors and more detail information and it has good application value.


Introduction
Image enhancement is mainly aimed to make image after being processed more suitable for human visual system or computer recognition system so as to enhance the reorganizability of the image. Pseudo-color image processing is to change the black and while gray scales into different colors. If more layers are separated, more information human eyes can extract so as to achieve image enhancement. This is a kind of image enhancement technique which leads to significant visual effect and which is not very complex. The pseudo-color enhancement methods mainly include gray-scale stratification method, grayscale-pseudo-color transformation method, frequencydomain filtering method and so on [1]. The display of color image relies on three basic elements: brightness, contrast and color. Among the above-mentioned methods, the pseudo-color processing method of gray-scalepseudo-color transformation method is to turn gray-scale image into continuous color image with multiple color gradients. This method first introduces gray-scale image into three transformation matrixes: red, green and blue with different transformation characteristics. Then, it sends different outputs of these three matrixes into the red, green and blue of the color imaging matrix respectively. Finally, it mixes into a certain color. It performs different transforms on the same gray scale with three transformation matrixes and leads to different outputs so that the gray scales with different sizes can be combined into different colors. The image transformed by this method has excellent visual effect. As the use of color image is becoming more and more popular, color image enhancement technique is also becoming more and more important and many processing techniques based on grayscale image are also improved to meet the requirements of color image processing [2,3].
Common image enhancement processing approaches include gray-scale transformation, histogram modification, image sharpening, de-noising, geometric distortion correction, frequency-domain filtering and color enhancement. The applications of image enhancement algorithms are well targeted and there is not a universal enhancement algorithm fit for various applications. Generally, image enhancement improves the image contrast, which involves detail definition. Image enhancement, according to its action scope, can be divided into spatial domain enhancement and transformation domain enhancement [4]. The former includes various filter techniques such as histogram equalization, specification processing and difference equation and the latter can be divided into DCT domain, DFT domain and wavelet domain according different action scopes. Most of early gray-scale image enhancement only performs stretch processing on contrast. With the diversified development of image applications, although conventional enhancement technology has improved the image quality to some extent, its applications have also met some restrictions. For a long time, pseudo-color technology hasn't been applied to such related fields as image processing. Traditional pseudo-color processing method has a low resolution and insufficient color sensitivity, so it cannot meet the users' requirements [5], [6]. Therefore, this paper has improved the conventional pseudo-color image enhancement, made research on the image after being conducted with pseudo-color enhancement from perspectives of details of object and comfort of human eyes and drawn some valuable conclusions.
This paper is mainly about pseudo-color image enhancement. While stating the basic image enhancement methods, this paper makes study and comparison on several typical pseudo-color image enhancement methods, analyzes their different strengths and weaknesses and enhances the resolution by performing pseudo-color transformation on gray-scale image as human eyes have a lower resolution on gray-scale image than color image. But conventional pseudo-color technology works just soso on enhancing the detail information of the image. Therefore, this paper has proposed an improved grayscale transformation method and explained the characteristics of this algorithm. The final experiment result has proven that the method of this paper is very effective, that it has excellent visuality and that it has enhanced the definition of the image details.

Pseudo-color image enhancement method
There are several pseudo-color processing techniques, including gray-scale stratification method, gray-scalepseudo-color transformation method and frequencydomain filtering method.

Gray-scale stratification method
Gray scale is the most direct visual feature to describe the content of gray-scale image. it refers to the color depth of the pixels in black-and-white image, ranging from 0 to 255 with white as 255 and black as 0. The numbers in the middle represent the intermediate colors from black to white, i.e. different gray scales. A monochromatic gray-scale image is divided into different regions according to the gray scales and every region is given a color so as to achieve stratified display. Grayscale stratification method is to divide the gray scales of a gray-scale image into N regions I i (i = 1, 2,…, N) from 0 (black) to M 0 (white), assigns a color C i to every region and turns a gray-scale image into a pseudo-color image. By stratifying the monochromatic image according to its gray-scale value, it divides it into different regions (the size of the region can be adjusted at will) and assigns new colors to every region so that some detail differences can be highlighted in different regions [ 7].
Assume that the gray-scale range of the original black-and-white image is Divide this range into k regions with (k + 1) gray scales Map every region into one color and the mapping relationship is Here, g(x, y) is the output pseudo-color image and C i is the color mapped by the gray scale in [I(i -1), I(i)]. After such mapping, the original black-and-white image f (x, y) has become a pseudo-color image g(x, y). If the gray scales of the original image f (x, y) are distributed throughout the foregoing k gray-scale regions, then the pseudo-color image g(x, y) has k colors [8].

Gray-scale-pseudo-color transformation method
According to the principle of colorimetry, divide the gray-scale range of the original image f (x, y) into multiple regions and turns it into three primary colors IR (x, y), IG (x, y) and IB (x, y) after three different transformations of red, green and blue: TR, TG and TB. Then, use them to control the red, green and blue in the color display and combine into a color image in the screen of color display device [9]. Fig.1 is a group of transfer function of grayscale-color transformation.

Fig. 1. Transfer functions of grayscale-color transformation
The (a), (b) and (c) in Fig. 1 represent the transfer functions of red, green and blue and (d) is to combine all three color transfer functions. It can be seen from (a) that the pixels with a gray scale smaller than L / 2 will be transformed into dark red as many as possible while those with a gray scale ranging from L / 2 to 3L / 4 are the linear transformations from dark red to bright red. All pixels with a gray scale bigger than 3L / 4 will be transformed into the brightest red. Through the above mapping transformation curves, the gray-scale image can be colored. Finally, add the value of every pixel obtained through three channels and perform pseudo-color processing on every pixel. At the end, get the pseudo-color image [9], [10].

Frequency-domain filtering method
All the images we can see are the representation in spatial domain and we cannot recognize the images in frequency domain. To perform filtering in frequency domain, first it requires Fourier transform. Second, it directly performs filtering. Finally, it changes back to the spatial domain with inverse Fourier transform. Frequency-domain filtering method is to transform the image from the space or the spatial domain into the frequency domain, in which different filters can be constructed. In the frequency domain, use three filters with different transfer characteristics to separate into three independent components. Then, perform inverse Fourier transform, obtain three monochromatic images which represent different frequency components and perform further processing on these three images. Finally, add them to the red, green and blue display channels as three primary color components respectively and obtain a color image [11].
The following Fig. 2 is pseudo color images of MacBook Pro x-ray scanning diagram. Fig. 2

An improved gray-scale transformation method for pseudo-color image enhancement
Each pixel value of the image is actually an index or code, the code value as the color look-up table CLUT (Color Look-Up Table) in one of the entrance of the address, according to this address, it can find out the intensity values that include the actual R, G, and B. CLUT is a pre -made table, and the entry address of the table item is also called the reference number. There is a transformation relationship between the pixel value of the color image itself and the cord number of the CLUT, which can be defined by a defined transformation relationship. The color displayed by the found value is true, but not the real color of the image itself. Assume that a gray-scale image f (x, y) can be seen as a density function of coordinate (x, y). Divide the gray of the image into several scales; in other words, segment this density function with some planes parallel with the coordinate plane in the intersecting area. For example, divide it into N regions L 1 , L 2 ,…,L N and distribute a color to every region. In another word, assign a color C i (i = 1, 2,…, N) to every grayscale region to turn the gray-scale image into a pseudocolor image with N colors.
The pseudo-color transformation in gray-scale transformation method is to put the gray-scale image f (x, y) into three transformation matrixes: red, green and blue with different transformation characteristics and then send the different outputs of these three matrixes to red, green and blue formulas respectively. According to the principle of colorimetry, any color can be combined with proper ratios of three primary colors: red, green and blue. So, pseudo-color processing generally can be described as The following formulas indicate the color value of R, G and B channels of R (x, y), G (x, y) and B (x, y) and f (x, y) represents the gray-scale value of the gray-scale image of a specific pixel.
When 64 ≤ f ≤ 127, When 128 ≤ f ≤ 191, When 191 ≤ f ≤ 255, Here, f (x, y) is the gray-scale value of the original im- y)] represent the mapping relations between the value of three primary colors and the gray-scale vale respectively and R (x, y), G (x, y), B (x, y) are the numerical values of three components: red, green and blue of the pseudo-color image.
Formula (2) - (6) shows that transformation method is to realize three independent transforms on the input image gray-scale value and maps into three primary color value: red, green and blue of different sizes to produce corresponding color display. The mapping relationship y)] can either be linear or non-linear. Red transformation maps any gray scales lower than L / 2 into the darkest red. Red input increases linearly within the range of L / 2 ∼ 3L / 4. The gray scales within the range of 3L / 4 ∼ L remain the same, equal to the brightest red. Other color mapping can also be explained with similar methods. If f (x, y) = 0, then f R (x, y) = f G (x, y) = 0, f B (x, y) = L and blue is displayed, if f (x, y) = L / 2, then f R (x, y) = f B (x, y) = 0, f G (x, y) = L and green is displayed and if f (x, y) = L, f R (x, y) = L, f R (x, y) = f B (x, y) = 0 and red is displayed. Therefore, it can be seen that the pure primary colors can only be mapped in both ends and the exact center of the gray-scale axis.
Pseudo color is generally used in the display mode below 65K color, the standard color palette is to select 16 or 256 colors evenly in the 256K chromatogram. Some images tend to be biased toward one or several hue, and if the standard palette is used, the color distortion is more. Therefore, for the same image, the use of different palette may shows that different color effects.

Experimental test
The contrast of an image greatly affects the quality of the image. A contrast which is too big or too small may lead to unclear image details and variance contrast can re-flect the subjective feeling of contrast of complex image. While observing the variance contrast of the image, we can evaluate the enhancement by integrating the average brightness of the image. r, g and b are the matching coefficients of these three components respectively. By adjusting the coefficients, we can control the colors and brightness of the processed pseudo color and obtain the pseudo-color image of different color keynotes. Fig.3 and Fig.4 below are the pseudo-color images transformation of the same image under different matching coefficients. It can be found from the results of Fig. 3 and Fig. 4 that the colors in (b) are a little bit red, and colors in (c) are a little bit blue, the chromaticity in (d) change the least, (b) and (c) have more changes in its chromaticity and they has preserved their colors better with significant changes in the brightness and contrast and outstanding details. In visual effect, the images have bright colors, proportionate contrast and brightness and well-preserved chromaticity. Therefore, it can be concluded that if proper parameter setting is selected, the processed image quality has been improved to a certain degree and the information increased compared with the original image. It has not only obtained a clear color image, but also better preserved its colors. Meanwhile, while enhancing the global brightness, it can also suppress the bright part of the image and overcome the vignetting effect. The image has clear details and has no color distortion and the operational efficiency is also improved.

Conclusion
In the image processing, image enhancement technology has played a significant role in improving the image quality. It selectively emphasizes certain information of the image and suppressing other information so as to improve the visual effect of the image. Pseudo-color enhancement refers to the technology to transform different gray scales of black-and-white image into different colors according to linear or non-linear mapping functions and obtain a color image. This paper has proposed an improved gray-scale transformation method for image enhancement to overcome the defects in pseudo-color image enhancement. While performing color image enhancement, this method conducts the processing in RGB space and improves color missing to a large extent. Through experiment and analysis, it can be found that the improved algorithm can obtain better image enhancement on most dark images.