Development of digital processing method of microfocus X-ray images

The article describes the basic methods of X-ray images digital processing. Also in the article is proposed method for background image aligning based on modeling of distorting function and subtracting it from the image. As a result is proposed the improved algorithm for locally adaptive median filtering for which has been carried out the effectiveness experimental verification.


Introduction
Micro focus X-ray is a method for producing X-ray images using radiation sources that have focal spot of the size less than 100 μm. The use of these radiation sources makes possible to obtain images with a direct image magnification 5-20 times [1,2]. Nowadays microfocus X-ray is widely used in medicine, industrial non-destructive testing and evaluation of the crops quality [3]. In some cases, microfocus Xray images cannot be reliably evaluated due to poor image quality.
The main disadvantages of microfocus X-ray images are irregular background, distorted brightness characteristics and the availability of noises. Due to these disadvantages is required to carry out microfocus X-ray images digital processing. To reduce these shortcomings in the article are proposed processing technique of microfocus X-ray images. The proposed method of image processing consists of two stages: image background correction and noise suppression based on locally adaptive median filtering.

Image background correction
During the X-ray examination by means of the scheme with the image zooming, appears irregular image background. This fact complicates the visual analysis and subsequent digital image processing. To eliminate the uneven image background is introduced the distorting function. It is assumed that the receiver records the image, which can be represented as the sum of image and distorting function that creates an irregular background. In the case of microfocus X-ray distorting function usually can be described by a function of the form: where Cis a constant and its value depends on the microfocus X-ray machine mode and the operating conditions. This type of distorting function occurs because of shooting features of image zooming, since the intensity of X-ray is reduced in proportion to the square of the distance. The following method can be used to determine the constant C. By the Sobel method in the image are allocated boundaries of the object, then is performed the operation of holes morphological fill in. After that are defined the image edges profiles, the profiles are based only on the parts of the image edges that do not belong to the objects. For each profile are determined minimum and maximum, and then is calculated the difference between them. The constant C is determined as the average difference between the profiles minimum and maximum. The image f(x, y) is obtained by subtracting g(x, y) from the registered image: ( , ) ( , ) ( , ). f x y h x y g x y  (2) Figure 1 shows the X-ray image of BGA chips, as well as the image background surface. Figure 2 shows the result of subtracting the distorting function g(x, y) from the X-ray image.  As can be seen in figure 2, the image surface is leveled; uneven illumination of the background is removed. After correction of image background it is much more convenient to carry out the automatic analysis, in addition it is easier to carry out visual analysis. For example, for the represented image the chip pads can be identified by simply applying a threshold conversion. In case of the non-uniform background, this conversion is inefficient.

Median filtering
Today to reduce the noise on X-rays image are often used averaging filter or filters based on statistical processing (median filter). However, these methods have significant disadvantages: weak suppression of impulse noise and components distortion in the image. As an example of the median filtering is shown in figure 3 (b). We can see that this filter provides insufficient noises suppression, as well as it  degrades sharpness. The modified locally adaptive median filter, which is proposed in [4] has no such disadvantages.
Locally adaptive median filter operates on the following algorithm: Part 1: if A 1 > 0 and A 2 < 0, to part 2; otherwise increase S; if S ≤ S max , repeat part 1; otherwise the result is Z med .
Part 2: B 1 = Z p -Z min + 1 ; B 2 = Z p -Z max -1 ; if B 1 > 0 and B 2 < 0 the result is Z p ; otherwise the result is Z med , where Z min and Z max are the minimum and maximum brightness values in the vicinity of S; Z medmedian brightness in the vicinity of S; Z pbrightness value of the pixel being processed; S maxmaximum size of the area. The algorithm works as follows. In the first part is carried out the check whether the median is of local minimum or maximum. If it is, the size of the area is increased, in the opposite case is carried out transition to part 2. In part 2 is checked whether the value of pixel brightness is of maximum or minimum in the area. If "yes"the brightness of a pixel is changed to the median, if not, it remains unchanged.
The considered filter suppresses noise and retains much more image details than ordinary median filter. However, when filtering the micro focus X-ray images it has been found that in some cases, the filter removes noise less effectively, for example, in case when in the vicinity is located more than one noise pixel. The example of locally adaptive median filter is shown in figure 4(a). This filter does not substantially degrade image sharpness, though it does not also fully suppress the noise. This can occur if in the image receiver ceases to work closely located spaced pixels or if on the luminescent screen system of a digital camera fall fine metal particles.
To improve the discussed filter was proposed to replace in part 2 minimum and maximum brightness value in the vicinity of S for the brightness value after reaching a minimum and to the maximum (second minimum and a second maximum). Then part 2 will look like: B 1 = Z p -Z min + 1 ; B 2 = Z p -Z max -1 ; if B 1 > 0 and B 2 < 0 the result is Z p ; otherwise the result is Z med .

Conclusions
The studies have shown that modified filter effectively suppresses noise and slightly reduces the sharpness of the X-ray image. The proposed method allows correcting the background of micro focus image without using background image and without operator. In addition, it also allows removing image noise without compromising image sharpness and without distorting of fine detail. The analysis of images processed by the proposed method shows that processed images are more informative than processed by conventional techniques.