Industrial X-Ray Image Enhancement Algorithm based on AH and MSR ()
1. Introduction
The valid method to enhance X-ray image is histogram enhancement. The histogram of industry X-ray in a small filed, most of pixels in the low frequency areas, and there are hardly few pixels in high frequency areas, Even the industry X-ray image is an image seems like the black image. Therefore, it is need a method to image enhancement. Recently, many people researcher on this field. Shu Yang and Cairong Wang proposed an image enhancement algorithm based on multi-scale morphological reconstruction [1]. Stephane G. Mallat researches the theory for multi-resolution signal decomposition [2]. Pizer S. M. proposed adaptive histogram equalization and its variations [3]. Tang Jinshan adopted a direct image contrast enhancement algorithm in the wavelet domain for screening mammograms [4]. Wang Xiu-bi [5] refers to image enhancement based on lifting wavelet transform [6]. Jinshan Tang and Qingling Sun used contrast measure in the wavelet domain for screening mammograms image enhancement algorithm. In this paper, we will investigate image-enhancement technology based on adaptive histogram and wavelet.
2. Limited Contrast AHE
2.1. Histogram Enhancement Theory
Histogram enhancement, the advantages of high speed and better effect, wildly applied in X-Ray processing. Histogram is the function of gray levels, which denotes the gray level of every pixel. Therefore, the contrast radio will be improved by gray nonlinear transform to adjust the accumulation function, and the gray in small range will be transform in the whole filed.
Image histogram is an important tool to analysis image gray distribution, which is a summary graph showing a count of the data points failing in the data. Therefore, histogram is defined as follows.
(1)
which n is the total pixels of X-ray image, is the gray level of corresponding pixels.
The X-ray is the low contrast, which most pixels are in the same gray level, thus it is hard to recognize. Histogram equalization is a method to improve image contrast it built a nonlinear transfer function to transform the histogram of original image. The processed image with equal gray scale in the same gray level, at the same time, the maximum entropy is acquire, it means that the image information is abundant.
Hypothesis that the gray transfer function is, which slope is the limited non-minus continuum decline function, it can transform input image to output image, the is the histogram of input image, and is the histogram of output image. According the definition of the histogram, the original image histogram and processed histogram areas are equal:
(2)
The relationship between and is the following:
(3)
where is constant. After transformedevery pixel of the image is tensile to extend the image gray level areas, and the vision effect is improved.
2.2. AHE Algorithm
Compared with the whole histogram equalization, the adaptive histogram enhancement (AHE) has the advantage of good local contrast. But the AHE algorithm will commute the local histogram and accumulation distributing function of every pixels, it is extremely computational intensive. Besides, the AHE algorithm is sensitive for noises, which is liable to bad enhancement for local area.
2.3. Limited Contrast AHE Algorithm
AHE algorithm improve the image contrast, at the same time magnified the noise. Even the enhancement will lead to image distortion in some detail area, which lead to noise amplification and distortion, that affects the image diagnose.
The first step of AHE algorithm is input image block. And the local histogram in every block.
Thus limit contrast function to AHE in every block to generate transform function respectively. Then the adaptive bilinear interpolation used to joint output image.
It is need to preliminary adjustment before the image block, Definite the limit function to limit the gray level probability density, and adjust the exceed histogram, Figure 1 shows the processing.
To decrease the block effect, it is need to bilinear interpolation.The block gray value is the gray transform function of adjacent pixels.
Figure 2 depicts the bilinear interpolation processing, is the center of the sub image, compute the areas scale in adjacent areas, the value is the following:
(4)
is the gray transform function, is the gray value of pixel. This image enhancement algorithm based on histogram, independent with the pixel position.
3. X-Ray Image Enhancement Algorithm Based on Adaptive Histogram and MSR
Multiple Scale Retinex algorithm used to industrial Xray enhancement, if is the environment brightness function, which reflects light intensity, is the reflected function, which means the variety of X-ray absorption the ratio of every part of elements, determines the dramatic range of X-ray image. Therefore, MSR algorithm usually used in X-ray enhancement to ensure the best DR (dramatic range) and the contrast is enlightening.
3.1. MSR Principle
It is well known that the X-ray is the gray scale image, the MSR is following.
(5)
which the parameter is the number of the environment functions, represents environment function,
(a) (b)
Figure 1. Limited function chart. (a) Original gray chart; (b) adjusted gray chart.
and is the weight function. The different standard deviation of normal is selected by the function to control the scale range of the environment function, the parameter with the large, middle and small scales. And the weight is basis for dramatic range and color sense [7].
3.2. X-Ray Image Enhancement Algorithm Based on Adaptive Histogram and MSR
The main idea of adaptive histogram and MSR is adjust the original image histogram, then bilinear difference is used to rebuild, and the gray scale vale and position information is recorded. After coordinate transformation, the image is divided three sub images in three scale, the MSR enhancement will modify the amplify ratio, at the same time, the image will be a better dramatic range and effects.
The input image is blocked into sub images, then we adjust the gray value, the original limited function is 0.001, and the image is divided into three scales. Most of image information are in low contrast area, the ratio is acquired by the Equation (6), and the transform ratio B will be acquired. According to the CLAHE algorithm, equalization every sub images, computed every the global MSE, the result is used to adjust limit function.
(6)
The Gauss transform ratio is acquired by the Equation (7).
(7)
The final transform ratio B is the following.
(8)
which the weight ratio is acquired by the Equation (9), the Equations (8) and (9) is built the relationship between the input and output images.
(9)
We will get three Gauss ratios in three scales, the image convolution in every scale, the Gauss filter is recursive, the input and output images will be acquired by the forward and the backward filter, at the same time, the relationship of the input data and out put is illustration in the Equation (10).
(10)
Equation (8) is the weight mean of every scale, the weight is 1/3, the output image will be acquire through the Equations (9) and (10).
4. Experiments and Conclusions
Figure 3 is the picture of CJ10-40 AC contractor, which size is 2816*300 pixels, CJ10-40 AC contractor has an important role in power system, so it is meaningful to enhance X-ray image in non-contract detection.
Figure 3(a) is the original input image, we can see that the contrast is very low that it is hardly to see anything in the Figure 3(a). Figure 3(c) is the MSR results, the processing time is 15.9787 s. The enhancement is poor, the processing image also with low contrast, and hardly to recognize in background. Figure 3(e) is the HE adjust enhancement results, the image contrast is enhanced slightly. Figure 3(g) is the ALE algorithm results.
From the Figure 3(g), we see that the gray field is enlarged in different field. But the back ground of the Figure 3(g) is complied mixed with noises. Figure 3(j) is the algorithm results. The elapse time 4.68264 s. the image contrast is enhanced. Figure 3(i) is our method, we see that the gray field is enlarged. From the results, we can conclusion that our algorithm can improved the global contrast, at the same time, it is obviously that image enhanced between the detected element and background.
Table 1 depicts the relationships between the time and the MSE of test CJ10-40 X ray image, from the Table 1, we will see that our method is better in MSE and time than other methods.
Figure 4 is the picture of JQX-10F3Z AC contractor, which size is 2816*1000 pixels, JQX-10F3Z contractor also has an important role in power system, Figure 4 is the processing of the test 2nd. The 2nd test is the element with complex inner structure.
Table 2 describes the value of MSE and times of different methods. Compared with the different methods in the list, our method has a better result in MSE and the processing time is acceptable.
5. Conclusions
Industrial X-ray widely applied in nondestructive testing,Industrial X-ray image has the characteristics of low contrast and more details, thus it is need to an image enhancement algorithm. To enhance the image contrast,
Table 1. The time and MSE of test 1st image.
Table 2. The time and MSE of test 2nd image.
limited adaptive histogram equalization algorithm is used in the first step. We set the initial limit coefficient of limit function then building a map between the image and the detail scales by the wavelet ratio, which is adjusted by the local contracting information. According the enhance function radios, the reconstruct image is rebuild.
Compared with other image enhancement algorithms, experimental results show that our algorithm can improve the global image contrast effectively, moreover, restrain the background and enhance the contrast between the background and the detection element. Processed image, with more details information and better vision, benefits to further identify and recognize.
6. Acknowledgements
The paper is supported by the Yunnan power institute of the Yunnan power test institute (group) Ltd.