Vol. 3  No. 10 (2011) , Article ID: 8086 , 5 pages DOI:10.4236/eng.2011.310129

Industrial X-Ray Image Enhancement Algorithm Based on AH and MSR

Wei Jie1, Dada Wang1, Yanwei Wang2, Jin Li2, Lei Wang2, Hong Liang2

1Yunnan Power Grid Corperation, Kunming, China

2Automation College, Harbin Engineering University, Harbin, China


Received August 3, 2011; revised August 22, 2011; accepted September 25, 2011

Keywords: X-Ray, MSR, Adaptive, Image Enhancement


An X-ray image enhancement algorithm based on AH (adaptive histogram) and MSR (Multi-scale Retinex) algorithm is proposed in this paper for the industrial X-ray image, which contrast is low, and the detail features is poor. Firstly, the contrast limited adaptive histogram equalization and neighborhood algorithm is used for the image. Then the mapping is built between the image and the detail scales by the enhance function ratio rules, which is adjusted by the local contracting information. Finally, according the enhance function radios, the reconstructed image is rebuild. Compared with other image enhancement algorithms, experimental results show that our algorithm can improve the global image effectively, moreover it overcomes the visible artifacts of X-ray image. Therefore, the x-ray image becomes clearer, and a better perceptual image is acquired for the image feature recognizing and matching.

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.


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:


The relationship between and is the following:


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:


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.


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.


The Gauss transform ratio is acquired by the Equation (7).


The final transform ratio B is the following.


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.


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).


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,


Figure 3. The processing of test 1st image. (a) Input image of X-ray; (b) histogram; (c) MSR image; (d) MSR histogram; (e) HE image; (f) HE histogram; (g) AHE image; (h) AHE histogram; (i) our method; (j) corresponding histogram.

Table 1. The time and MSE of test 1st image.


Figure 4. The processing of test 2nd image. (a) Input image of X-ray; (b) histogram; (c) MSR image; (d) MSR histogram; (e) HE image; (f) HE histogram; (g) AHE image; (h) AHE histogram; (i) our method; (j) our method histogram.

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.


  1. S. Yang, C. Wang and L. G. Deng, “A New Approach of Image Enhancement Based on Multi-Scale Morphological Reconstruction,” 9th International Conference on Hybrid Intelligent Systems, Shenyang, 12-14 August 2009, pp. 113-116. doi:10.1109/HIS.2009.30
  2. S. G. Mallat, “A Theory for Multiresolution Signal Decomposition: The Wavelet Representation,” IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. 2, No. 7, 1989, pp. 674-693. doi:10.1109/34.192463
  3. S. M. Pizer and E. P. Ambtrrn, “Adaptive Histogram Equalization and Its Variations,” Computer Vision Graphics & Image Processing, Vol. 39, No. 3, 1987, pp. 355-368. doi:10.1016/S0734-189X(87)80186-X
  4. J. S. Tang, X. M. Liu and Q, L. Sun, “A Direct Image Contrast Enhancement Algorithm in the Wavelet Domain for Screening Mammograms,” IEEE Journal of Selected Topics in Signal Processing, Vol. 3, No. 1, 2009, p. 1.
  5. X.-B. Wang, “Image Enhancement Based on Lifting Wavelet Transform,” 4th International Conference on Computer Science & Education, Xiamen, 25-28 July 2009, pp. 739-741.
  6. J. S. Tang, Q. L. Sun and K. Agyepong, “An Image Enhancement Algorithm Based on a Contrast Measure in the Wavelet Domain for Screening Mammograms,” IEEE International Conference on Image Processing, San Antonio, 16-19 September 2007, pp. 74-80. doi:10.1109/ICIP.2007.4379757
  7. J. M. Morel, A. B. Petro and C. A. Sbert, “PDE Formalization of Retinex Theory,” IEEE Transactions on Image Processing, Vol. 19, No. 11, 2010, pp. 2825-2837. doi:10.1109/TIP.2010.2049239