Abstract
Dual-energy X-ray imaging has a vast range of application in security. Luggage inspection is an essential process for an airplane or court house security as well as securing mass events. An image of a content of some package may help to figure out if there is any dangerous object inside and avoid possibly threatening situation. As the raw X-ray images are not always easy to analyze and interpret, some image processing methods like an object detection, a frequency resolution increase or a pseudocoloring are being used. Since color can be a powerful tool to improve the usefulness of an information display, we propose pseudocoloring improvement by modifying material-based approach with edge detection to fill and sharpen color layers over the image making it easier to read and analyze. We demonstrate the effectiveness of the methods using real data, acquired from a professional dual-energy X-ray scanner.
Similar content being viewed by others
Avoid common mistakes on your manuscript.
1 Introduction
X-Ray scanners provide images based on different level of absorption of radiation of different materials. Scanners are used, for example, in medical tomography and security on which we focus. Dual-energy X-ray imaging is a well-known technique. It requires two measurements at different energies and allows displaying material properties (the effective atomic number and mass density). In most cases, the resulting images are displayed in gray scale where the most absorbing parts are colored white, and areas transparent to the X-rays are colored with black (see Fig. 1a). An inversion of this colorspace is also popular and frequently used. This kind of presentation, in some applications, is good enough for well-trained technicians, but the necessity of providing more details to images causes that some marking is required. A common approach is to use a linear color map (LCM) (see Fig. 1b). More advanced methods allow to classify scanned objects or their parts to certain materials on the basis of mass attenuation coefficient [1–3]. This coefficient depends on the material’s atomic number. In theory, it should allow us to classify the object on the basis of their atomic number, but tests showed that objects’ thickness has a major impact on the classification.
The proposed method—edge enhanced image pseudocoloring (EEIPC)—is based on material qualification, but also takes objects’ shapes into account. An image features such a structure and geometric description are used to correct object assignment. Our aim is to provide images that allow to easily distinguish one object from another by significantly enhancing object edges during the colorizing procedure. The presented method is capable of colorizing objects in a way that it matches its material. It is also important to remove the most of artifacts and unexpected transitions of material color ranges, but preserving sharp borders between objects. The EEIPC method is an enhancement of the material classification presented in our previous work [4]. Similar image filter is also discussed in [5]. In this paper we also are concerned about assessment of image sharpness. We examine image sharpness and color using two measures: standard deviation of image histogram and LPC-Sharpness Index introduced in [6, 7]. It is also important to know that the most important quality estimation of our method comes from the scanners operators using this method in their daily work.
2 Methodology
X-ray inspection system is composed of X-ray source, X-ray detector and conveyor belt [8]. Security scanners use a very short (0.0110 nm) electromagnetic radiation waves. X-rays are emitted with photon energy ranging from 30 to 200 KeV [9]. Photons successfully passed through a scanned object are measured by detectors ordered in a L-shaped bar [10]. As the baggage goes through the scanner tunnel, the attenuated X-rays are collected by the row of detectors. Detectors’ driver assembles data from multiple detectors into one discrete grayscale image.
2.1 Hardware
Our scanner works with a single X-ray monoblock generator and a dual-energy range detector which provides simultaneously two energy images. This means that during one-time X-ray shot, we obtain two sets of data for two images generation (low and high energies, \(I_{\mathrm{LE}}\) and \(I_\mathrm{HE}\), respectively). A detector for dual-energy digital radiography has a complicated construction. There are two scintillators, for low energy: GOS (153 \(\hbox {mg/cm}^{2}\)) and for high energy: CsI(TI). The first one is 3.0 mm thick, and the second one is 4.1 mm thick. There is also a filter element (0.6 mm copper) between LE and HE scintillators. In order to produce our test images, a tube generates X-rays using 160 keV voltage with 5300 A current, which are measured by the detectors after passing through scanned objects. We are using Spellman XRB160P model/type tube with X-Scan 1,5L-1253 DE-ENET detectors.
Tested objects were moved by conveyor at 40 cm/s speed rate. Scanned objects could have maximum width of 1000 mm and unlimited length due to the possibility of moving them horizontally.
2.2 Dual energy
For our scans, we use dual-energy data collection. Dual-energy X-ray imaging brings us benefits in the form of depth resolution enhancement, because of slightly different attenuation characteristics which are depending on photons energy. In this section data acquisition from detectors and creation of raw images is discussed, see [11]. The X-ray tube emits \(N_0\) photons, but only N passes through the scanned object and reaches the detector. The numbers of photons that will pass through the object depends on its attenuation coefficient (\(\mu \)) and object thickness (T):
The coefficient \(\mu \) depends on the density of the material (\(\rho \)), and mass attenuation of the material (\(\tau \)). \(\tau \) is experimentally obtained and tabularized function depending on the material effective atomic number (Z) and energy of the photons (E):
Attenuation graphs for some substances are displayed in Fig. 2.
From Eq. (1) we have:
and finally we get the following equation:
which means, there is a proportion between number of rays that crossed a scanned object and a coefficient of its attenuation. If our object is not a uniform, \(m_E\) is replaced by summations:
where \(\varOmega \) is number of different materials. \(N_0\) is a variable which depends on photon energy and it will be denoted as \(N_0(E)\) from now. The X-ray spectrum is polychromatic in energy range [E1, E2]:
where \(N^\prime _0(E)\) is number of photons emitted with energy E in range [E1, E2]:
where D(E) represents detector efficiency. The detector efficiency and X-ray tube spectrum are known.
From the Eq. (6) it could be possible to determine Z value of each material in a scanned object but in real scan we do not know how much objects and what materials we have to designate proper \(\rho \) and \(\tau \) values for this equation. To retrieve approximate information of an object material, we use combination of data from two measurements of different energies.
We receive number of registered photons that crossed a scanned object (N) from the detector. Knowing the number of photons emitted (\(N_0\)), the ratio is:
As it was stated in 2.1, we gather data in two energy ranges, LE and HE, see [13]. Finally, we can use following formulas, to calculate so-called Q values [14]:
where \((I_\mathrm{LE})\) and \((I_\mathrm{HE})\) stand for low-energy image and high-energy image, respectively, and Q determines the expected material of an object registered on a pixel and will be used in the proposed algorithm.
3 Algorithm
A current section describes a coloring algorithm that uses two raw images received from the scanner to produce sharp and colorized image.
3.1 Material determination
X-ray images obtained for high energy (\(I_\mathrm{HE}\)) and low energy (\(I_\mathrm{LE}\)) are shown in Fig. 3. All image examples in this work are cropped to the region of interest from received scans.
In order to determine the Q(x, y) value for every pixel we use quotient of the logarithms of object’s material values (see Eq. 9) of HE and LE scan.
The number of materials (\(\varOmega \)) as well as their Q ranges can be chosen arbitrary. Typically to the standards used in the professional security scanners, only three types of materials are distinguished:
-
1.
metals (average \(Z > 26\))—\(Q^{(1)} \in (1.02, 1.15)\),
-
2.
non-organic (others)—\(Q^{(2)} \in (1.005, 1.02]\),
-
3.
organic (carbon based)—\(Q^{(3)} \in (0.972, 1.005]\),
but in general there can be any \(\varOmega \) number of different materials. For all materials their Q ranges were obtained experimentally. These values are tied strictly to the scanner configuration and may vary on different machines and energy settings. In our case, pixels with values below 0.972 are treated as a background and pixels with values above 1.15 are marked as not penetrated by X-rays.
After pixel classification we create \(\varOmega +2\) (number of materials, plus background and foreground) binary images for all material types based on pixel value:
where \(i \in (0,\varOmega +1)\), Q(x, y) is a quotient of the logarithms of \(I_\mathrm{LE}\) and \(I_\mathrm{HE}\) images (Eq. 9), \(Q_L^{i}\) and \(Q_H^{i}\) are low and high limits of the Q values for ith material, respectively (see Fig. 4).
3.2 Edge sharpening
Images generated in such a way are very sharp, and they have a lot of isolated pixels and unwanted artifacts. Such problem can be fixed by using a morphological filling or blurring. We use a simple Gaussian blurring technique to prepare those images for the next processing step. Optimal sizes of the Gaussian filter masks are \(((S,T)=5,5)\) and \(((S,T)=7,7)\), i.e., the kernel of a Gaussian filter with a standard deviation of \(\sigma \in (2/3, 1)\). A filter with smaller standard deviation is unable to cover all in-object holes, while bigger masks give no improvement in the final image while increasing computational complexity. As a result we obtain blurred (\(i=\varOmega +2\)) material images:
where \(\varGamma _{\sigma }\) is a Gaussian blur operator. Because of the blurring procedure, the material images are overlapping each other nearby edges. We use the edge detection algorithm [15, 16] to restore sharp edges.
where CED is the Canny edge operator, \(I_\mathrm{HE}\) is the high energy image, and \(\epsilon \) is an edge image. We chose the Canny edge detector due to its ability to describe edges in a vector form. It provides the information about an angle of a contrast gradient in every point classified as the edge.
where \((x_{\epsilon }, y_{\epsilon })\) are pixels that belong to the edge \(\epsilon \) determined by the Canny edge detector. A Sobel filter is used to calculate these gradient angles \((\theta )\) from horizontal \((g_x)\) and vertical \((g_y)\) direction:
These angles are often called contrast gradient degree. In the Canny algorithm, angles are discretized to one of the following four values (discretized directions \(\theta _\mathrm{D}\)) which are equal to 0\(^{\circ }\), 45\(^{\circ }\), 90\(^{\circ }\) and 135\(^{\circ }\) covering 45\(^{\circ }\) around each one. For every pixel which belongs to Canny’s edge vector, the appropriate contrast gradient degree is assigned. We used voting algorithm to determine an affiliation of a point to a certain mask. The size of the region of interest created around current pixel is equal to the size of previously used Gaussian filter mask. An example is shown in Fig. 5.
As shown in Fig. 5, a border \(\epsilon \) found by the Canny algorithm is marked with black pixels (Fig. 5b). The central pixel \(\mathbf {r}(x_0, y_0)\) is a border point being processed in the current step. In this example the central pixel has the contrast gradient \(\mathbf {g}(x,y)\) with angle \(\theta _\mathrm{D}\) in the range of \(45^{\circ } \pm 22.5^{\circ }\), so it requires comparison of two neighboring pixels from SW and NE (pixels with bold border in Fig. 5b). Values of these two pixels are read from blurred material image \(\pi _{\sigma }^{(i)}\) (see Fig. 6), and a greater one is chosen.
A line perpendicular to the proper discretized gradient \(\kappa (\mathbf {g_{\bot }}(x,y))\) splits the neighbor into two triangles (or two rectangles depending on the \(\theta _\mathrm{D}\)). This line is marked as diagonal line in our example image in Fig. 5b. The triangle (or rectangle) that contains the pixel with a higher value of a pixel \(\mathbf {r_f}(x,y)\) is being set as the foreground (dark background pixels in Fig. 5b), and the second part of the square is marked as the background (light background pixels in Fig. 5). These values are used to create so-called affiliation matrices
which contains information whether the pixel is included in the material layer or not. Every affiliation matrix has the same size as the acquired image and is initially filled with zeros. Only the pixels that were effectively blurred are being processed this way (see Fig. 6c).
Next, the algorithm fills the affiliation matrices with the proper values. Every pixel with a value equal to one (1) on the blurred image \(\pi _{\sigma }^{(i)}\) (pure black in Fig. 6b) will be mapped into maximum value on the affiliation matrix. Every pixel with a zero value on the same image will be mapped into minimal negative value on the affiliation matrix. The values of the other pixels are set to 0 (shown in a gray in Fig. 6b).
At this step, for each pixel in Canny edge image \(\epsilon \), the region of interest of the affiliation mask must be determined. This region is centered on the position of the current Canny edge vector pixel \(\mathbf {r}(x_0,y_0)\). The sizes of this region and Gaussian mask used in previous step are the same. In the region of interest for each foreground pixel, a positive value is added. This value is proportional to the distance between the point and the borderline \(\kappa (\mathbf {g_{\bot }})\) separating the foreground and the background parts. For each background pixel a negative value is added in the same manner.
where \(|| \mathbf {a}, \kappa ||_{\widehat{b}}\) is a signed distance between the vector \(\mathbf {a}\) and the line \(\kappa \) depending on the direction of the unit vector \(\widehat{b}\).
After the inspection of each edge pixel, all negative pixels are removed from the affiliation mask:
It is the final step of the construction of the affiliation matrix for the single layer. Now the affiliation matrix must be determined for each material layers taking all the affiliation matrices into account.
At this point of analysis there are some pixels that belong to several material layers. We have to determine to which single layer the analyzed pixel should be assigned. We use the voting algorithm which compares affiliation masks pixels from the same coordinates on different material layers. If pixel has a maximum value on some mask, its value is set to 1, while on the other masks the pixels on the same coordinates are set to zero.
3.3 Image colorizing
On the basis of the affiliation matrices \(\alpha ^{(i)}\) and the corresponding low-energy image \(I_\mathrm{LE}\) and high-energy image \(I_\mathrm{HE}\), we construct final color image. We have decided to use CIE L*a*b* color space because it separates achromatic channel from chromatic channels and due to its ability to compare colors as a simple Euclidean distance of its coordinates. With S-CIELAB extension it allows for measuring color reproduction errors of digital images [17].
To properly colorize scans a specific color maps are predefined for all material types, i.e., for all \(Q^{(i)}\) material ranges a specific lightness \(L^{*(i)}\) value as well as \(a^{*(i)}\) and \(b^{*(i)}\) chromatic color values are predefined. In this step we map high-energy image \(I_\mathrm{HE}\) into an \(L^*\) channel
and chromatic \(a^*\), \(b^*\) channels are calculated using the following formulas
where \(i \in (0, \varOmega +1)\), and \(\varPsi \) are mapping operations defined as:
After coloring procedure, the final image is converted into sRGB color space and displayed to the scanner operator. Examples of original images and pseudocolored images as well as some edge details are shown in Figs. 7, 8, and 9.
4 Tests and results
For testing purposes we have prepared a set of 12 images scanned in low and high energies. For every pair of LE and HE images we calculate contrast and sharpness indices for original grayscale images, images with linear color map (LCM) without sharpening filter and images colorized with the presented method (EEIPC). As a contrast measure we chose a standard deviation of an image histogram
where \(i_k\) is a kth image value, L is a maximum image value, \(h(i_k)\) is \(i_k\)th value of a normalized histogram of the image, and \(\overline{h}\) is an average value of the histogram. As an image sharpness measure we chose Local Phase Coherence Sharpness Index (LPC-SI) proposed by Hassen [7] which describes the alignment of local phase patterns in the scalespace in the vicinity of distinctive sharp image features and as a result gives a single number determining the image sharpness. These measures are applicable only to single-channel images. To compare tri-chromatic images, \(\sigma \) and LPC-SI were calculated for each color channel separately in an sRGB color space and then the arithmetic average value from three channels was taken as a result. The quantitative evaluation results are given in Table 1 for original grayscale images, for images with linear color map (LCM) and for our colorizing method with sharpness filter (EEIPC). For every image we highlight the better evaluation measure value.
The quantitative results show clearly that our EEIPC method gives more sharp edges and cleaner boundaries between objects at about 30 % compared to LCM method and almost 60 % compared to original grayscale images. It also does not change low-frequency parts of an image and preserves overall mean and contrast \(\sigma \) of the original image.
Figure 7 shows a few examples of scans for original grayscale images, LCM colorized images and images colorized with our EEIPC method. There are also some close-ups to edge details and material boundaries shown in Fig. 8 for both colorizing methods. Figure 9 shows a close to a part of a scan in chromatic channels of CIELAB color model. There are sharp metal edges clearly visible in Fig. 9b, d enhanced by our EEIPC method, whereas these edges are not visible at all when only a LCM method was used.
The most important benefit of presented algorithm is an ability to distinguish between material layers regardless of whether the edges of scanned object are smooth or sharp. The described algorithm can analyze unrestricted number of different layers. We have to remember that in practical scanning baggage procedure, inspectors can be confused seeing more than four different color ranges.
Algorithm’s time computational complexity depends linearly on the number of layers’ edge pixels. For each layer the complexity is similar to two-dimensional convolution filter and is thus in the order of O(PMf) where P is the number of pixels, M is number of material masks, and f is the area of the Gaussian mask. Presented algorithm runs almost real time on our testing machine with Intel i5-3470 3.2 GHz. Processing time for the testing images with resolution \(900 \times 540\) pixels varies between 1 and 3 s for typical scanned object and three material layers. Such processing time is shorter than time needed for the scanner user to complete the operating task.
5 Conclusions and future
The discussed false coloring algorithm EEIPC has already been introduced into professional usage as a part of a software driver for scanners produced under the name of Arida. It is being used among others image adjusting and object detection algorithms. A colored X-ray image is a basic tool for baggage inspectors. This algorithm is also used for potential risk detection filter where areas of attenuation coefficient are close to known drugs and explosives. Currently our team works on an algorithm for risk detection based on both material properties and on geometric information like, for example, the shape of a weapon, see [18–20]. There is also important to evaluate the quality of the colorized images by a subjective quality tests in which a number of human subjects are asked to judge the quality of the sequence images. The subjective tests will be based on the recommendations given by the International Telecommunication Union (ITU) [21] that define how to carry out subjective quality tests.
References
Moreland, K.: Diverging color maps for scientific visualization. In: Proceedings of the 5th International Symposium on Advances in Visual Computing: Part II, pp. 92 -103 Springer, Berlin (2009)
Flitton, G., Breckon, T., Megherbi, N.: A comparison of 3D interest point descriptors with application to airport baggage object detection in complex CT imagery. Pattern Recognit. 46, 2420–2436 (2013)
Hussein, A., Yang, X.: Colorization using edge-preserving smoothing filter. SIViP 8(8), 1681–1689 (2014)
Dmitruk, K., Mazur, M., Denkowski, M., Mikołajczak, P.: Method for filling and sharpening false colour layers of dual Energy X-ray images. In: Proceedings of IFAC Conference on Programmable Devices and Embedded System, PDeS 2015, Cracow, pp. 351–356 (2015)
Zhang, W., Feng, X., Han, Y.: A novel image segmentation model with an edge weighting function. SIViP 8(1), 121–132 (2014)
Wang, Z., Simoncelli, E.P.: Local phase coherence and the perception of blur. In: Thrun, S., Saul, L., Schölkopf, B. (eds.) Advances in Neural Information Processing Systems, vol. 16, pp. 1435–1442. MIT Press, Cambridge (2004)
Hassen, R., Wang, Z., Salama, M.: Image sharpness assessment based on local phase coherence. IEEE Trans. Image Process. 22(7), 2798–2810 (2013)
Ying, Z., Naidu, R., Crowford, C.: Dual energy computed tomography for explosive detection. J. X-Ray Sci. Technol. 14, 235–256 (2006)
Watabiki, H., Takeda, T., Mitani, S., Yamazaki, T., Inoue, M., Koba, H., Miyazaki, I., Saito, N., Wada, S., Kanai, T.: Development of dual-energy X-ray inspection system. Anritsu Tech. Rev. 20, 59–66 (2013)
Evans, J., Liu, Y., Chan, J., Downes, D.: View synthesis for depth from motion 3D X-ray imaging. Pattern Recognit. Lett. 44, 1863–1873 (2006)
Rebuffel, V., Dinten, J.M.: Dual-energy X-ray imaging: Benefits benefits and limits. Insight — Non-destr. Test. Condition Monit. 49(10), 589–594 (2007)
Hubbell, J., Seltzer, S.: Tables of X-ray mass attenuation coefficients and mass energy-absorption coefficients from 1 kev to 20 meV for elements z = 1 to 92 and 48 additional substances of dosimetric interest. In: NISTIR, vol. 5632 (1995)
Chang, S., Lee, H., Cho, G.: Application of a dual-energy monochromatic X-ray CT algorithm to polychromatic X-ray CT: a feasibility study. Nucl. Eng. Technol. 44, 61–70 (2012)
Firsching, F., Fuchs, T., Uhlmann, N.: Method for dual high energy X-ray imaging with flat panel detectors. In: 18th WCNDT (2012)
Canny, J.: A computational approach to edge detection. IEEE Trans. Pattern Anal. Mach. Intell. PAMI-8(6), 679–698 (1986)
Ari, S., Ghosh, D., Mohanty, P.: Edge detection using ACO and F ratio. SIViP 8(4), 625–634 (2014)
Zhang, X., Wandell, B.: A spatial extension of CIELAB for digital color image reproduction. In: Proceedings of SID International Symposium Digest of Technical Papers, vol. 27, pp. 731–734 (1996)
Roomi, M., Rajashankarii, R.: Detection of concealed weapons in X-ray images using fuzzy k-nn. Int. J. Comput. Sci. Eng. Inf. Technol. 2, 187–196 (2012)
Nixon, M.: Feature Extraction and Image Processing for Computer Vision, 3rd edn. Academic Press, New York (2012)
Rajaei, A., Dallalzadeh, E., Rangarajan, L.: Symbolic representation and classification of medical X-ray images. SIViP 9(3), 715–725 (2015)
ITU-R: Methodology for the subjective assessment of the quality for television pictures. Recommendation ITU-R BT.500-11. Geneva (2002)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.
About this article
Cite this article
Dmitruk, K., Denkowski, M., Mazur, M. et al. Sharpening filter for false color imaging of dual-energy X-ray scans. SIViP 11, 613–620 (2017). https://doi.org/10.1007/s11760-016-1001-7
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11760-016-1001-7