1.1 Introduction

Since Röntgen discovered in 1895 [90] that X-rays can be used to identify inner structures, X-rays have been developed not only for their use in medical imaging for human beings, but also in non-destructive testing (NDT) for materials or objects, where the aim is to analyze (non-destructively) the inner parts that are undetectable to the naked eye [44]. NDT with X-rays, known as X-ray testing, is used in many applications such as the inspection of automotive parts, quality control of welds, baggage screening, analysis of food products, inspection of cargos, and quality control of electronic circuits among others. X-ray testing usually involves measurement of specific part features such as integrity or geometric dimensions in order to detect, recognize, or evaluate wanted (or unwanted) inner parts. Thus, X-ray testing is a form of NDT defined as a task that uses X-ray imaging to determine if a test object deviates from a given set of specifications, without changing or altering that object in any way.  

The most widely used X-ray imaging systems employed in X-ray testing are Digital Radiography (DR) and Computed Tomography (CT) imaging.Footnote 1 On the one hand, DR emphasizes high throughput. It uses electronic sensors (instead of traditional radiographic film) to obtain a digital X-ray projection of the target object, consequently it is simple and quick. A flat amorphous silicon detector can be used as an image sensor in X-ray testing systems. In such detectors, and using a semiconductor, energy from the X-ray is converted directly into an electrical signal that can be digitalized into an X-ray digital image [91]. On the other hand, CT imaging provides a cross-sectional image of the target object so that each object is clearly separated from any others, however, CT imaging requires a considerable number of projections to reconstruct an accurate cross-sectional image, which is time consuming.

In order to achieve efficient and effective X-ray testing, automated and semi-automated systems are being developed to execute this task that can be difficult (e.g., recognition of very small defects), tedious (e.g., inspection of thousand of similar items) and sometimes dangerous (e.g., explosive detection in baggage screening). Compared to manual X-ray testing, automated systems offer the advantages of objectivity and reproducibility for every test. Fundamental disadvantages are, however, the complexity of their configuration, the inflexibility to any change in the evaluation process, and sometimes the inability to analyze intricate images, which is something that people can generally do well. Research and development is, however, ongoing into automated adaptive processes to accommodate modifications.

Fig. 1.1
figure 1

Simple model of an X-ray computer vision system. In this example, a computer vision algorithm is used to detect a defect inside the test object automatically

X-ray testing is one of the more accepted ways for examining an object without destroying it. The purpose of this non-destructive method is to detect or recognize certain parts of interest that are located inside a test object and are thus not detectable to the naked eye. A typical example is the inspection of castings [70, 73]. The material defects occurring in the casting process such as cavity, gas, inclusion, and sponge must be detected to satisfy the security requirements; consequently, it is necessary to check 100% of the parts.

The principle aspects of an X-ray testing system is illustrated in Fig. 1.1. Typically, it comprises the following steps:

  • The test object is located in the desired position.

  • The X-ray source generates X-rays which pass through the test object.

  • The X-rays are detected and converted (e.g., by a flat panel or by an image intensifier and CCD-camera) in order to obtain a digital X-ray image.

  • Computer vision algorithms are used to evaluate the X-ray image.

         

In last decades, flat detectors made of amorphous silicon have been widely used as image sensors in some industrial inspection systems [38, 83]. In these detectors, the energy from the X-ray is converted directly into an electrical signal by a semiconductor (without an image intensifier). However, using flat detectors is not always feasible because of their high cost compared to image intensifiers.

The properties of the X-rays that are used in X-ray testing are summarized in the following:

  • X-rays can penetrate light blocking materials (e.g., metal) depending on a material’s thickness;

  • X-rays can be detected by photographic materials or electronic sensors;

  • X-rays can spread a straight line; and

  • X-rays can use many substances to stimulate fluorescence (fluoroscopy).

Fig. 1.2
figure 2

X-ray image of balance-weights in a closed box and a shotgun taken by Wilhelm Conrad Röntgen in the summer of 1896. Courtesy of the Deutsches Röntgen-Museum in Würzburg

1.2 History

The discovery of X-rays by Röntgen in November 1895 [90] defines the beginning of the X-ray testing of metallic parts. A couple of days after the discovery of the ‘X’ radiation, he made radiographs of balance-weights in a closed box and a chamber of a shotgun (see Fig. 1.2). Röntgen observed that using X-rays, one can look not only into the inside of a human body, but also into metallic articles, if the strength and intensity of the X-rays are strong enough [62]. The potential use in the detection of hidden defects within armor-plates and machine parts was already envisioned at Yale University in 1896 [88]. 

The industrial use of X-rays began in Germany only two decades after their discovery. X-ray testing took place at that time with the help of radiographic films [92]. Radioscopy with fluorescent screens was developed only toward the end of the 1930s and at the beginning of the 1940s. In the following years, closed cabinets were already being used for X-ray testing of aluminum castings in the automobile industry [82].   

In 1948 the image intensifier was developed, which converts X-rays into a visible light [106]. Image intensifier technology was originally developed as a low-light enhancer for military night-vision devices [41]. The introduction of the image intensifier led to considerable progress in the inspection technique, since otherwise the examiner would have to regard the X-ray image on a fluorescent screen. The brightness of the image was so small that the eyes needed a long time to adapt to the dark. Into the image amplifier an examiner could always look in the radiograph directly with the help of special optics. Image intensifiers, television equipment, and electrically controlled manipulators were developed further in the 1960s as radioscopic systems, which were widely used for casting and welding inspection in the 70s [88].

X-ray testing systems for baggage inspection were already developed in the 70s [25, 80] and the 80s [26, 58]. The object under test was scanned using fluoroscopy and the images were inspected on a a fluorescent screen.   

Computer Tomography (CT) was developed in 1972 [16, 106]. With 2D-CT cross-sectional pictures of the object computed from its projections. These slices, which represent a reconstruction of the local distribution of the absorption coefficients of the object, are processed in order to find objects of interest in the test object. However, one disadvantage of the procedure is the high time requirement: for the reconstruction of meaningful slice images, both a minimum gate time per object position is necessary for a sufficient signal/noise ratio along with a minimum number of projections. For this reason, the use of computer tomography is so far limited in X-ray testing to the material development and research range, as well as to the examination of particularly important and expensive parts [49]. Later 3D-CT was developed, with which the whole object is reconstructed as voxels. State-of-the-art industrial computer tomography used this kind of CT [34, 110]. 

Approaches to the automatic image evaluation as well as image restoration were already used in the 80s with the help of the image processing techniques and CCD-cameras [82]. The first fully automatic X-ray testing systems were installed in the industry at the beginning of the 90s. One example can be found in the quality control of aluminum wheels performed by Alumetall Co. in Nuremberg, in which an automatic casting part recognition is also integrated using bar codes for the adjustment of the image analysis algorithms for different types of wheel [88].    At the end of the 90s, flat panel detectors from amorphous silicon were industrially used in some test systems [9, 50]. With these detectors the X-rays are converted by a semiconductor directly into electrical signals (without image intensifier). However, the X-ray testing with flat detectors was not always profitable due to their high costs (in the comparison to the image intensifier).   

Before 9/11, X-ray testing of luggage mainly focused on capturing the images of their content: the reader can find in [74] an interesting analysis done in 1989 of several aircraft attacks in the world, and the existing technologies to detect the terrorists’ threats based on Thermal-Neutron Activation (TNA), Fast-Neutron Activation (FNA), and dual-energy X-rays (used in medicine since early 70). In the 90s, Explosive Detection Systems (EDS) were developed based on X-ray imaging [75], and computed tomography through elastic scatter X-ray (comparing the structure of irradiated [99] advanced image analysis) to improve the detection performance. Nevertheless, the 9/11 attacks increased the security policies at airports, which also produced the interest of the scientific community for researching topics related to security using advanced computational techniques using pseudocoloring of X-ray images, for example, [96]. It has not been easy for X-ray baggage inspection to deal with low-density, often organic, materials (very important in baggage and food inspection). This is because typical X-ray inspection systems use conventional photon integration detectors that are unable to record the incoming X-ray energy. However, state-of-the-art multicolor detector technology could assist to overcome this problem. Thanks to recent advances in the development of photon counting detectors, multicolour X-ray imaging has become possible. Today, novel X-ray detectors have been developed. For example, detectors based on new semiconductors like CdTe or CZT [48, 101] that can count photons at high rates by discriminating different energy channels, in which image noise can be decreased, contrast can be enhanced and specific materials can be imaged; or wafer-scale CMOS flat panels with a pixel size of 100 \(\upmu \)m \(\times \) 100 \(\upmu \)m in an array of 1220 \(\times \) 12000 pixels [21].    

In the last few decades, fully automatic and semi-automatic test systems have been used in many applications as we will cover in Chap. 9.

1.3 Physics of the X-rays

In general, X-rays are from same physical nature as visible light, radiowaves, microwaves, ultraviolet, or infrared. They are all electromagnetic waves, which spread at the speed of light, although with different wavelengths (see Table 1.1)

In the following, the formation of X-rays and their interaction with matter are explained. These principles of physics can be found in many textbooks (see, for example, [6, 64]). 

Table 1.1 Electromagnetic spectrum [56]

1.3.1 Formation of X-rays

The formation of X-rays is performed in an X-ray tube in five steps as shown in Fig. 1.3:

  1. 1.

    A high DC voltage U is applied between cathode and anode.

  2. 2.

    The cathode is strongly heated by the voltage \(U_h\), so that the kinetic energy of the heat is transferred to the mobile electrons in the cathode. The electrons are thus in a position to withdraw from the cathode.

  3. 3.

    The electrons emitted by the hot cathode are accelerated by high voltage U.

  4. 4.

    These high-energy electrons, which are called cathode rays, are incident on the anode.

  5. 5.

    X-rays are produced when electrons of sufficiently high-energy incident on the anode are suddenly decelerated.

There is a distinction     between discrete and continuous X-rays (commonly known as Bremsstrahlung).

Fig. 1.3
figure 3

Basic diagram of an X-ray tube

Discrete X-rays

These result in transitions of electrons in the inner shells of an atom (see Fig. 1.4a). This happens when a highly accelerated electron \(e^-\) knocks an electron \(e^-_1\) from the atomic shell. Since both electrons leave the atom , a hole is formed (where \(e^-_1\) was) that is immediately filled by an outer electron (e.g., \(e^-_2\)) . In an atom, the electrons may be shown only on certain bands with a precisely specified energy level. The deeper the band is in the atom, the greater is the energy of that electron. When jumping from the electron to a lower band (in our example \(e^-_2\)) the energy difference between the two energy levels is emitted as electromagnetic radiation. Energy transitions in the region of the inner electron shells which have high binding energies lead to the emission of X-rays . Therefore, the spectrum of this radiation consists of lines at specific wavelengths or energies that are exclusively dependent on the nature of the atom (see Fig. 1.4c). These are called characteristic X-ray lines.

Fig. 1.4
figure 4

X-ray formation and spectrum

Continuous X-rays (Bremsstrahlung)

In addition to the discrete X-rays, there is a continuos radiation called Bremsstrahlung. This occurs when a highly accelerated electron approaches the domain of attraction of the atomic nucleus of the anode and are deflected due to the Coulomb force (Fig. 1.4b). There is no collision between nucleus and electron. Since the electron interacts with the Coulomb force, the direction and velocity of the electron are changed. In this deceleration, the electron loses some or all of the kinetic energy that is emitted in the form of X-rays to the outside. The closer the electron is to the nucleus, the greater is the deceleration and thus the energy of the Bremsstrahlung. As electrons can come close to the nucleus at any distance, this electromagnetic radiation has a continuous spectrum with an upper cut-off frequency \(E_{\max }\) (see Fig. 1.4c). The maximum energy is obtained when an electron is completely decelerated, i.e., when the kinetic energy of the electron (\(E_{\text{ kin }}=e \cdot U\)) is converted entirely into photon energy (\(E_{\text{ photo }}=h \cdot \nu \)), where e is the electric charge, U the anode voltage, h Planck’s constant, and \(\nu \) the frequency of the electromagnetic wave. The smallest possible X-ray wavelength becomes of \( E_{\text{ kin }} = E_{\text{ photo }} (= E_{\max }) \) and \( c = \lambda \nu \) with:

$$\begin{aligned} \lambda _{\min } = \frac{h \cdot c}{E_{\max }} = \frac{h \cdot c}{e \cdot U} \end{aligned}$$
(1.1)

where c is the speed of light in vacuum. Changes to the heating of the cathode \(I_h\) (see Fig. 1.3) result in a proportional change of the energy flux density. An increase in the high-voltage U leads to the displacement of the maximum energy flux density to a higher energy.

1.3.2 Scattering and Absorption of X-rays

One aspect particularly important for X-ray testing is the attenuation of the intensity of X-rays when passing through matter. The attenuation is a function of X-ray energy and the material structure of the irradiated material (considerably in terms of density and thickness). The attenuation occurs by two processes: scattering and absorption. The scattering via classical scattering (Rayleigh scattering and Compton effect); and absorption through the photoelectric effect, pair production, and partly by the Compton effect. In the following, these are explained as interactions of X-rays with atoms.

Fig. 1.5
figure 5

Interaction of X-rays with matter

Rayleigh Scattering

In this process, there is a scattering of X-rays from their original path, in which the radiation loses no energy. The lower the energy of the radiation, the more they are deflected from the original path of the rays.

Photo Effect

The photoelectric effect that occurs is likely to happen when the radiation energy just exceeds the binding energy of the electron. In the photoelectric effect, the energy of the incident photon is completely transferred to an electron, and mainly on one of the inner electron shells. The electron takes over the energy that the quantum of radiation it emits as kinetic energy and leaves the atomic union (Fig. 1.5a). This effect increases proportionally to \(E^{-3}Z^5\), where E is the energy of the radiation and Z is the atomic number. The photoelectric effect plays a role in the small and medium energies of X-rays.

Compton Effect

In case the radiation energy is very much larger than the binding energy of the atomic electron, the X-ray radiation strikes out the electron from the atom. A portion of the energy of the X-ray radiation is transferred to the electron and converted into kinetic energy. The radiation is scattered and loses energy (see Fig. 1.5b). This results in a scattering due to the change of direction of the photons at the same time and absorption due to the energy loss. This effect is proportional to the atomic number of the atom Z and inversely proportional to the energy of the radiation to E.

Pair Production

In case the radiation energy is greater than 1.022 MeV and passes it straight into the proximity of the nucleus, the radiation can be turned into matter, producing an electron \(e^-\) and \(e^+\) positron (see Fig. 1.5c), whose masses are \(m_{e^-} = m_{e^+} =\) 511 keV/\(c^2\). The pair production is more frequent, the greater the quantum energy and the higher the atomic number of the irradiated material. In cases, where X-rays come from X-ray tubes there is no pair production, as the energy is always in the keV range.

Fig. 1.6
figure 6

X-ray image formation according to absorption law: a X-ray image of a homogenous object, and b X-ray image of an object with two different materials

Absorption and scattering can be described mathematically by the X-ray absorption law, which characterizes the intensity distribution of X-rays through matter:

$$\begin{aligned} \varphi (x) = \varphi _0 e^{-\mu x} \end{aligned}$$
(1.2)

with \(\varphi _0\) incident energy flux density, \(\mu \) absorption coefficient, x thickness of the irradiated matter and \(\varphi \) energy flux density after passage through matter with the thickness of x (see Fig. 1.6a). The absorption coefficient \(\mu \) depends on the incident photon energy and the density and atomic number of the irradiated material. It is composed of the coefficients of the classical dispersion \(\sigma _R\), the photoelectric effect \(\tau \), the Compton effect \(\sigma _C\), and the pair production \(\chi \):

$$\begin{aligned} \mu =\sigma _R+\tau +\sigma _C+\chi \end{aligned}$$
(1.3)
Fig. 1.7
figure 7

Absorption coefficient for aluminum [56]

Because of the continuous distribution of the energy of the Bremsstrahlung (see Fig. 1.4c) X-rays contain photons of different energies. In practice, therefore, the course of the absorption curve can only be determined empirically. In the case of aluminum, the course of the absorption coefficient in Fig. 1.7.

Fig. 1.8
figure 8

X-ray testing systems. There are two kinds of image acquisition system: based on image intensifiers (top) and based on flat panels (bottom). In this example, an aluminum wheel is inspected using a manipulator

1.4 X-ray Testing System

The essential components of an automatic X-ray testing system (see Fig. 1.8), such as X-ray source, manipulator, image intensifier, and CCD-camera, are explained below.

1.4.1 X-ray Source

There are six requirements for an X-ray source [42]:

  1. 1.

    Adjustable quantum energy.

  2. 2.

    Possible large adjustable dose rate.

  3. 3.

    Intensity of the radiation as uniform as possible in the field of the object to be irradiated.

  4. 4.

    Smallest possible intensity of radiation outside the area to be irradiated.

  5. 5.

    Acceptable price.

  6. 6.

    Long life with constancy of features.

In this section, we describe the essential components of an X-ray source that fulfill the conditions mentioned. An explanation of the formation of X-rays can be found in Sect. 1.3.1.

Hot Cathode

The cathode is made of a filament from which the electrons emerge through the thermoelectric effect in the vacuum of the X-ray tube. Usually, tungsten (W), also known as wolfram, is used because of its high melting point (about 3380\(^0\)C). An influence of the dose rate (independent of the quantum energy of the X-rays) is achieved by controlling the electron emission over the heating current (Figs. 1.3 and 1.9). The quantum energy is adjusted by the high voltage between electrodes. Using an aperture that surrounds the filament, a thin, sharply defined electron beam is generated.

Anode

At the anode surface, the kinetic energy of the cathode beam is converted 99% into heat and only 1% into the desired X-rays. To reduce the geometric blur of the imaging process a small focal spot is required. In the focal spot of an X-ray tube, however, so much heat is created that the anode material may melt if the heat is not dissipated quickly and effectively. In order to increase the performance of an X-ray source and at the same time to reduce the focal spot, the anodes are constructed as follows:

Anode Material

The surface layer should be made of materials with a high melting point, high atomic number, and high thermal conductivity. The element tungsten (W) best meets the three criteria. In order to reduce the roughening during the operation, as well as to avoid cracking, it is alloyed with rhenium (Re).

Fig. 1.9
figure 9

Basic structure of an anode

Line Focus

To reduce the optical focus, the electron beam strikes the anode surface in the focal spot inclined by about \(\alpha = 7^0 \sim 20^0\) from the vertical axis.

Rotating Anode

By rotating the anode the applied heat can be distributed over an entire ring without changing the size of the optical spot (see Fig. 1.9). The distribution of the high thermal load is better the larger the diameter of the ring and the higher the rotation speed.

Envelope

Given that between the electrodes the voltage is high voltage, anode, and cathode must be electrically isolated from each other. In addition, the tube envelope forms the vacuum vessel and the mechanical attachment of the tube components. Up until now, glass has been used for this purpose. However, in recent years envelopes made of metal and ceramics have been used.

1.4.2 Manipulator

Fig. 1.10
figure 10

X-ray system with a manipulator ABB-Picker: the manipulator can rotate and translate the test object to generate projections from different points of view

A manipulator is a device that can be handled with the test objects in the desired manner without the operator using his/her hands to touch [93]. In an X-ray computer vision system, the task of the manipulator is the handling of the test objects as illustrated in Fig. 1.10. Due to the possibilities of movement, degrees of freedom of the manipulator, the test object can be brought into the desired position. For a manual inspection, the axes of a manipulator are moved by means of one or more joysticks. When an automatic inspection of this task is undertaken, it is handled by a Programmable Logic Controller (PLC) or an industrial computer.

A manipulator consists of sliding elements and rotary elements with which a translation or rotation of the object test can be performed. Previously, the manipulator moved the test object through the X-ray beam [54]. This solution resulted in a complicated mechanical construction with a high mechanical load, wear, and increased maintenance. Today it is possible to move the X-ray tube and the detector that is rigidly connected to it by a C-arm manipulator. These manipulators are much easier to control and are faster and cheaper [9, 50]. An example of such a manipulator is described in Sect. 3.3.4 (see Fig. 3.15).

1.4.3 Image Intensifier

Fig. 1.11
figure 11

Schematic illustration of the operation of an image intensifier

The X-ray image intensifier has two functions: (i) possible lossless conversion of X-ray projection information into a visible image and (ii) its brightness gain [41]. On the basis of the structure of an X-ray image intensifier shown in Fig. 1.11, the operation is explained. The X-ray radiation enters through an input screen into a vacuum tube. As the radiolucent input screen has to withstand the atmospheric pressure, it should not be too thin. Here metals are used with low atomic numbers that are transparent to X-rays, in which the absorption and scattering are relatively small. Thereafter, the radiation incident on the X-ray fluoroscopy screen, in which the conversion of X-radiation into visible light takes place. The X-rays are absorbed and about 2000 photons per X-ray quantum are triggered. The light strikes the photocathode and sets photoelectrons. These electrons are accelerated by approximately 25 kV, which are represented with reduced electron optics on an output phosphor screen. The output image of the image intensifier is then captured by a CCD-camera.

The disadvantage of the image intensifier is the geometric distortion due to the curvature of the input screen; details for this can be found in Sect. 3.3.2.

1.4.4 CCD-Camera

CCD-cameras use solid-state imaging sensors based on Charge-coupled device (CCD) arrays. In these imaging sensors, the active detector surface is divided into individual pixels in the CCD-sensor, while incident light is converted and transported into an electrical charge. The principle of the charge transport is based on the charge transfer that takes place in the shift registers (Fig. 1.12).

The CCD-cameras are characterized by very good image geometry, high light-sensitivity and several megapixels for conventional cameras. In modern days, there are High Definition Television (HDTV) cameras up to 2,200,000 pixels. Furthermore, a CCD-camera can achieve a resolution of 46 megapixels and the exposure time can be in a range between seconds and 1/8,000 s.

Fig. 1.12
figure 12

Operation of a CCD-Array

Due to the low sensitivity of the CCD-image sensor for direct X-ray radiation, the radiation must be converted into visible light. In an X-ray testing system with CCD-camera, this conversion happens in the image intensifier (see Sect. 1.4.3).

1.4.5 Flat Panel

Fig. 1.13
figure 13

Flatpanel: a Basic structure [46] und b Example: Canon, model CXDI-50G (resolution: 2208 \(\times \) 2688 pixels and 4,096 grayscale image). In this example, the X-ray emitter tube is Poskom, model PXM-20BT

A second possible image acquisition system is the flat panel detector based on amorphous silicon (a-Si), in which the X-ray, without going through an image intensifier with CCD-camera, is converted from a semiconductor directly into electrical signals (see Fig. 1.13). In this technology, a thin view of a-Si is deposited on a glass plate as a support. As in a CCD-chip, a pixel array with switching elements is generated in the silicon layer so that the charge which is stored in the individual pixels can be read out serially and electronically [16].

The advantages of this detector are larger image receiving surface, no geometric distortion, a high gray level resolution (1\(2 \sim 16\) Bit/Pixel), that is very light and small. Due to the high gray level resolution and greater imaging surface less test positions are required for the inspection. The low weight allows for easier and faster mechanics [9, 50]. An flat detector is shown in Fig. 1.13.

1.4.6 Computer

In the context of X-ray testing, a computer system is typically used for the following tasks:

  1. 1.

    To control the image acquisition system.

  2. 2.

    To store acquired X-ray images.

  3. 3.

    To run computer vision algorithms that evaluate X-ray images.

  4. 4.

    To compute statistical analysis.

  5. 5.

    To display results.

  6. 6.

    To control the X-ray source.

  7. 7.

    To control the manipulator.

1.5 X-ray Imaging

In this section we present image formation, acquisition, and visualization.

1.5.1 X-ray Image Formation

In X-ray testing, X-ray radiation is passed through the test object, and a detector captures an X-ray image corresponding to the radiation intensity attenuated by the object.Footnote 2 According to the principle of photoelectric absorption (1.2): \(\varphi = \varphi _0 \exp (-\mu x)\), where the transmitted intensity \(\varphi \) depends on the incident radiation intensity \(\varphi _0\), the thickness x of the test object, and the energy dependent linear absorption coefficient \(\mu \) associated with the material, as illustrated in Fig. 1.6.

In a photographic image, the surface of the object is registered. On the contrary, in an X-ray image, the inside of the object is captured. In order to illustrate the formation, we simulate the X-ray image of the object of Fig. 1.1 in several positions (in this example we use the approach outlined in Chap. 8). In this case, we have a homogenous test object with a spherical cavity inside. The result is shown in Fig. 1.14. In this example, we can observe, on the one hand, the absorption phenomenon. The thicker the object the more attenuated the X-rays. In our visualization, bright gray values are used for high output energy (low attenuation), and dark gray values for low-output energy (high attenuation). On the other hand, we can see the phenomenon of the summation of shadows, i.e., the output intensity of an image point corresponds to the summation of all the attenuations the X-ray encountered. 

Fig. 1.14
figure 14

Simulation of an X-ray image of object of Fig. 1.1 from four different points of view. Each arrow represents the orientation of the X-ray projection where the beginning corresponds to the X-ray source

It is worth noting that if X-ray radiation passes through n different materials, with absorption coefficients \(\mu _i\) and thickness \(x_i\), for \(i=1, \dots n\), the transmitted intensity \(\varphi \) can be expressed as

$$\begin{aligned} \varphi = \varphi _0 \exp \left( -\sum _{i=1}^n \mu _i x_i \right) . \end{aligned}$$
(1.4)

This explains the image generation of regions that are present within the test object, as shown in Figs. 1.6 and 1.14, where a gas bubble is clearly detectable. The contrast in the X-ray image between a flaw and a defect-free area of the object test is distinctive. In such X-ray images, we can see that the defects, like voids, cracks, or bubbles, show up as bright features. The reason is that the absorption in these areas is shorter. Hence, according to the principle of differential absorption, the detection of flaws can be achieved automatically using image processing techniques that are able to identify unexpected regions in a digital X-ray image. A real example is shown in Fig. 1.15 which clearly depicts two defects. 

Fig. 1.15
figure 15

Image formation process: a X-ray image of a wheel with two defects, b 3D plot of the gray values of the image

Another example is illustrated in Fig. 1.16a, where a backpack containing knives and a handgun is shown. However, X-ray images sometimes contain overlapped objects, making it extremely difficult to distinguish them properly, as shown in Fig. 1.16b where a handgun (superimposed onto a laptop) is almost impossible to detect.

Fig. 1.16
figure 16

X-ray images of a backpack. (Left) It is easy to recognize a handgun (and two knives). (Right) It is extremely difficult to detect the handgun (see red rectangle)

1.5.2 Image Acquisition

In X-ray examination, X-ray radiation is passed through the material under test, and a detector senses the radiation intensity attenuated by the material(s) of the test object. The spacial distribution of the attenuation coefficients of the elements of the object test define the X-ray information that is acquired by the sensor.

Fig. 1.17
figure 17

Digital X-ray image

The X-ray image is usually captured with a CCD-camera (see Sect. 1.4.4) or a flat panel (see Sect. 1.4.5). The digitalized image is stored in a matrix. An example of a digitized X-ray image is illustrated in Fig. 1.17. The size of the image matrix corresponds to the resolution of the image. In this example the size is \(286 \times 384\) picture elements, or pixels. Each pixel has a gray value associated. This value is between 0 and 255 for a scale of \(2^8=256\) gray levels. Here, ‘0’ means 100% black and a value of ‘255’ corresponds to 100% white, as illustrated in Fig. 1.18. Typically, the digitized X-ray image is stored in a 2D matrix, e.g., \(\mathbf{X}\), and its pixels are arranged in a grid manner. Thus, element x(ij) denotes the gray value of the ith row of the jth column, pixel (ij), as shown in the matrix of Fig. 1.17

The eye is only capable of resolving around 40 gray levels [20], however for computer vision applications, gray level resolution must be a minimum of 256 levels. In some applications, \(2^{16} = 65,536\) gray levels are used [50], which allows one to evaluate both very dark and very bright regions in the same image.

Fig. 1.18
figure 18

256 gray level scale

1.5.3 X-ray Image Visualization

In many X-ray testing applications, it is necessary to display X-ray images. For example, when we present a result based on an X-ray image, or when a human evaluation of an X-ray image is required (e.g., baggage screening). In those cases, it is useful to have a suitable visualization of X-ray images.

A simple way to visualize an X-ray image is using a grayscale as shown in Fig. 1.17 that uses the grayscale of Fig. 1.18. Conventionally, X-ray images have been ‘black and white’ because of the gray nature of the radiographies and fluorescent screens. Usually, a common human eye can distinguish less than 50 gray values [20], however, a trained human eye is able to recognize up to 100 gray values[76].   

Nowadays, it is possible to assign colors to grayscale images. With today’s computing technology, especially with the ongoing advancements in displays, there is no reason to think that X-ray images must be visualized in grayscale only. In the seventeenth century, Newton said indeed rays, properly expressed, are not colored [3]. He was referring to light rays. Now, one can say that X-rays, properly expressed, are not gray... because they are not visible! We can just find a suitable way to visualize them. Thus, we can use the power of human vision that can distinguish thousands of colors [76]. 

In order to improve the visualization of an X-ray image, pseudocoloring can be used. In pseudocoloring, a gray value is converted into a color value. That is, we need a map function that relates the gray value x with a color value (R(x), G(x), B(x)) for red, green, and blue respectively if we use a RGB-based color map [35]. Some examples of the color maps are illustrated in Fig. 1.19 in which the transformations (R(x), G(x), B(x)) are shown for ‘jet’, ‘hsv’, ‘parula’, ‘hot’, ‘rainbow’, and ‘sinmap’ [35, 65, 76]. An example of a pseudocolored X-ray image is illustrated in Fig. 1.20.    

Fig. 1.19
figure 19

Color maps used in pseudocoloring

The mentioned transformations correspond to linear mappings that can be loaded from a lookup table. In addition, there are some interesting algebraic or trigonometric transformations that can be used in pseudocoloring [1]. One of them is the ‘sin transformation’ generally defined as 

$$\begin{aligned} \begin{array}{c c c c c} R(x) &{} = &{} | &{} a_R + k_R \sin (cos (\omega _R x) + \theta _R) &{}|\\ G(x) &{} = &{} | &{} a_G + k_G \sin (cos (\omega _G x) + \theta _G) &{}|\\ B(x) &{} = &{} | &{} a_B + k_B \sin (cos (\omega _B x) + \theta _B) &{}|, \end{array} \end{aligned}$$
(1.5)

where \(\omega _C\), \(\theta _C\), \(k_C\), and \(a_C\) are frequency, phase, amplitude, and off-set for channel \(C=R,G,B\). This color map is implemented in function of pyxvis Library.Footnote 3 An example of a pseudocolored X-ray image is illustrated in Fig. 1.20 for ‘rainbow’ and ‘sinmap’.

Fig. 1.20
figure 20

Different visualizations of an X-ray image. [\(\rightarrow \) Example 1.1 ]

figure c

The output of this code is in Fig. 1.20. We can see the use of a color map for pseudocolor representations. A very interesting visualization is the 3D representation, where the z-axis corresponds to the gray value, in which the screw of the sharpener is clearly distinguishable. The output of this example is obtained using and of pyxvis Library. The reader can experiment a different visualization using command of pyxvis Library, where a video of an X-ray image is presented. In this video, each frame is displayed using a different colormap that slightly varies from frame to frame.Footnote 4    \(\square \)  

1.5.4 Dual-Energy

In X-ray testing, dual-energy has been used successfully to provide information about the materials of the objects under test. Interesting applications can be found in baggage inspection and cargo inspection in the detection of organic or in-organic material [4, 7, 22, 52].

Coefficient \(\mu \) in (1.2) can be modeled as \(\mu / \rho = \alpha (Z,E)\), where \(\rho \) is the density of the material, and \(\alpha (Z,E)\) is the mass attenuation coefficient that depends on the atomic number of the material Z, and the energy E of the X-ray photons. The absorption coefficient varies with energy (or wavelength) according to [23]:

$$\begin{aligned} \frac{\mu }{\rho } = \alpha (Z,E) = k \lambda ^3 Z^3, \end{aligned}$$
(1.6)

       

Fig. 1.21
figure 21

Generation of a pseudocolor image using dual-energy. In this example the colors correspond to different materials. [\(\rightarrow \) Example 1.2 ]

where k is a constant. Values for \(\alpha (Z,E)\) are already measured and available in several tables (see [47]). In order to identify the material composition—typically for explosives or drug detection—the atomic number Z cannot be estimated using only one image, as a thin material with a high atomic number can have the same absorption as a thick material with a low atomic number [108]. For this purpose, a dual-energy system is used [86], where the object is irradiated with a High-energy level \(E_1\) and a low-level energy \(E_2\). In the first case, the absorbed energy depends mainly on the density of the material. In the second case, however, the absorbed energy depends primarily on the effective atomic number and the thickness of the material [97]. For two energies \(i=1,2\), we obtain from (1.2) and (1.6):

$$\begin{aligned} \varphi _i/\varphi _0 = \exp (-\alpha (Z,E_i) \rho z), \end{aligned}$$
(1.7)

Using dual-energy, it is possible to calculate the ratio:

$$\begin{aligned} R = \frac{\ln (\varphi _2/\varphi _0)}{\ln (\varphi _1/\varphi _0)} = \frac{\alpha (Z,E_2)}{\alpha (Z,E_1)}, \end{aligned}$$
(1.8)

where the term \(-\rho z\) is canceled out, Z can be directly found using the known measurements \(\alpha (Z,E)\) [43]. From both images, a new image is generated using a fusion model, usually a lookup-table that produces pseudocolor information [8, 31], as shown in Fig. 1.21.

figure e

The output of this code is in Fig. 1.21. We can see the use of a color map for pseudocolor representations. The output image is a grayscale image, however, the each gray value is displayed according to a 256 colors palette as shown in right bar. In this example we use of pyxvis Library.    \(\square \)

Some simple methods that deal with color X-ray images, based on dual-energy, have been developed to recognize objects in baggage inspection, see, for example, [22].

1.6 Computer Vision

Fig. 1.22
figure 22

General schema for X-ray testing using computer vision (see text)

Computer Vision is the science and technology of giving computers the ability to ‘see’ and ‘understand’ images taken by one or more cameras. The goal of computer vision is to study and develop algorithms for interpreting the visual world captured in images or videos. Typical topics of computer vision are detection and recognition, automated visual inspection, image stitching, image processing and analysis (enhancement, filtering, morphological operations, edge detection, and segmentation), video processing (optical flow and tracking), recognition of patterns, feature extraction and selection, local descriptors and classification algorithms, and finally, geometric vision topics such as projective geometry, camera geometric model, camera calibration, stereovision, and 3D reconstruction [11, 13, 27, 29, 30, 35, 36, 39, 51, 102].

In order to give an introduction to the topics of computer vision that have been used in X-ray testing and will be covered in this book, we follow Fig. 1.22 which illustrates an extended version of our simple model presented in Fig. 1.1.

In this general schema, X-ray images of a test object can be generated at different positions and different energy levels. Depending on the application, each block of this diagram can be (or not be) used. For example, there are applications such as weld inspection that uses a segmentation of a single mono-energetic X-ray image (black square), sometimes with pattern recognition approaches (red squares); applications like casting inspection that uses mono energetic multiple views where the decision is taken analyzing individual views (green squares) or corresponding multiple views (blue squares); applications including baggage screening that use dual-energy of single views (magenta squares) and multiple views (yellow squares); and finally, applications for cargo inspections that employ active vision where a next—best view is set according to the information of a single view (cyan squares). In each case, the blocks without the corresponding color square are not used.

1.6.1 Geometric Model

The X-ray image of a test object corresponds to a projection in perspective, where a 3D point of the test object is viewed as a pixel in the digital X-ray image, as illustrated in Fig. 1.22. A geometric model that describes this projection can be highly useful for 3D reconstruction and for data association between different views of the same object. Thus, 3D features or multiple view 2D features can be used to improve the diagnosis performed by using a single view.

As we will learn in Chap. 3, for the geometric model, four coordinate systems are used (see Fig. 1.22): 

  • OCS (XYZ): Object Coordinate System, where a 3D point is defined using coordinates attached to the test object.

  • WCS \((\bar{X},\bar{Y},\bar{Z})\): World Coordinate System, where the origin corresponds to the optical center (X-ray source) and the \(\bar{Z}\)-axis is perpendicular to the projection plane of the detector.

  • PCS (xy): Projection Coordinate System, where the 3D point is projected into the projection plane \({\bar{Z}} = f\), and the origin is the intersection of this plane with \({\bar{Z}}\)-axis.

  • ICS (uv): Image Coordinate System, where a projected point is viewed in the image. In this case, (xy)—axes are set to be parallel to (uv)—axes.

The geometric model OCS \(\rightarrow \) ICS, i.e., transformation \(\mathbf{P}:(X,Y,Z) \rightarrow (u,v)\), can be expressed in homogeneous coordinates as [67]:

$$\begin{aligned} \lambda \left[ \begin{array}{c} u\\ v\\ 1 \end{array} \right] = \mathbf{P} \left[ \begin{array}{c} X\\ Y\\ Z\\ 1 \end{array} \right] , \end{aligned}$$
(1.9)

where \(\lambda \) is a scale factor and \(\mathbf{P}\) is a \(3 \times 4\) matrix modeled as three transformations:

(i) OCS \(\rightarrow \) WCS, i.e., transformation \(\mathbf{T}_1:(X,Y,Z) \rightarrow (\bar{X},\bar{Y},\bar{Z})\), using a 3D rotation matrix \(\mathbf{R}\), and 3D translation vector \(\mathbf{t}\);

(ii) WCS \(\rightarrow \) (PCS), i.e., transformation \(\mathbf{T}_2:(\bar{X},\bar{Y},\bar{Z}) \rightarrow (x,y)\), using a perspective projection matrix that depends on focal distance f; and

(iii) PCS \(\rightarrow \) ICS, i.e., transformation \(\mathbf{T}_3:(x,y) \rightarrow (u,v)\), using scales factor \(\alpha _x\) and \(\alpha _y\), and 2D translation vector \((u_0,v_0)\).

The three transformations OCS \(\rightarrow \) WCS \(\rightarrow \) PCS \(\rightarrow \) ICS are expressed as

$$\begin{aligned} \mathbf{P} = \underbrace{ \left[ \begin{array}{c c c} \alpha _x &{} 0 &{} u_0\\ 0 &{} \alpha _x &{} v_0\\ 0 &{} 0 &{} 1 \end{array} \right] }_{\mathbf{T}_3} \underbrace{ \left[ \begin{array}{c c c c} f &{} 0 &{} 0 &{} 0 \\ 0 &{} f &{} 0 &{} 0 \\ 0 &{} 0 &{} 1 &{} 0 \end{array} \right] }_{\mathbf{T}_2} \underbrace{ \left[ \begin{array}{c c} \mathbf{R} &{} \mathbf{t}\\ \mathbf{0}^\mathsf{T} &{} 1 \end{array} \right] }_{\mathbf{T}_1}. \end{aligned}$$
(1.10)

The parameters included in matrix \(\mathbf{P}\) can be estimated using a calibration approach [39].

In order to obtain multiple views of the object, n different projections of the test object can be achieved by rotating and translating it (for this task a manipulator can be used). For the p-th projection, for \(p=1 \dots n\), the geometric model \(\mathbf{P}_p\) used in (1.9) is computed from (1.10) including 3D rotation matrix \(\mathbf{R}_p\) and 3D translation \(\mathbf{t}_p\). Matrices \(\mathbf{P}_p\) can be estimated using a calibration object projected in the n different positions [67] or using a bundle adjustment algorithm where the geometric model is obtained from the n X-ray images of the test object [69].

1.6.2 Single View Analysis

 

A computer vision system for single view analysis, as shown in Fig. 1.22, consists typically of the following steps: an X-ray image of the test object is taken and stored on a computer. The digital image is improved in order to enhance the details. The X-ray image of the parts of interest is found and isolated from the background of the scene. Significant features of the segmented parts are extracted. Selected features are classified or analyzed in order to determine if the test object deviates from a given set of specifications. Using a supervised pattern recognition methodology, the selection of the features and the training of the classifier are performed using representative images that are to be labeled by experts [27]. In this book, we will cover several techniques of image processing (Chap. 4), image representation (Chap. 5), and classification (Chap. 6) that have been in X-ray testing.

For the segmentation task, two general approaches can be used: a traditional image segmentation or a sliding–window approach. In the first case, image processing algorithms are used (e.g., histograms, edge detection, morphological operations, filtering, etc. [35]). Nevertheless, inherent limitations of traditional segmentation algorithms for complex tasks and increasing computational power have fostered the emergence of an alternative approach based on the so-called sliding–window paradigm. Sliding-window approaches have established themselves as state of the art in computer vision problems where a visually complex object must be separated from the background (see, for example, successful applications in face detection [105] and human detection [24]). In the sliding-window approach, a detection window is moved over an input image in both horizontal and vertical directions, and for each localization of the detection window, a classifier decides to which class the corresponding portion of the image belongs according to its features. Here, a set of candidate image areas are selected and all of them are fed to the subsequent parts of the image analysis algorithm. This resembles a brute force approach where the algorithm explores a large set of possible segmentations, and at the end the most suitable is selected by the classification steps. An example for weld inspection using sliding-windows can be found in Chap. 9.

1.6.3 Multiple View Analysis

It is well known that A picture is worth a thousand words, however, this is not always true if we have an intricate image as illustrated in Fig. 1.16b. In certain X-ray applications, e.g., baggage inspection, there are usually intricate X-ray images due to overlapping parts inside the test object, where each pixel corresponds to the attenuation of multiple parts, as expressed in (1.4).

In some cases, active vision can be used in order to adequate the viewpoint of the test object to obtain more suitable X-ray images to analyze. Therefore, an algorithm is designed for guiding the manipulator of the X-ray imaging system to poses where the detection performance should be higher [89] (see Fig. 1.22). 

In other cases, multiple view analysis can be a powerful option for examining complex objects where uncertainty can lead to misinterpretation. Multiple view analysis offers advantages not only in 3D interpretation. Two or more images of the same object taken from different points of view can be used to confirm and improve the diagnosis undertaken by analyzing only one image. In the computer vision community, there are many important contributions in multiple view analysis (e.g., object class detection [100], motion segmentation [112], Simultaneous Localization And Mapping (SLAM) [53], 3D reconstruction [2], people tracking [28], breast cancer detection [103] and quality control [19]). In these fields, the use of multiple view information yields a significant improvement in performance.

Multiple view analysis in X-ray testing can be used to achieve two main goals: (i) analysis of 2D corresponding features across the multiple views, and (ii) analysis of 3D features obtained from a 3D reconstruction approach. In both cases, the attempt is made to gain relevant information about the test object. For instance, in order to validate a single view detection—filtering out false alarms—2D corresponding features can be analyzed [71]. On the other hand, if the geometric dimension of a inner part must be measured a 3D reconstruction needs to be performed [77].

As illustrated in Fig. 1.22, the input of the multiple view analysis is the associated data, i.e., corresponding points (or patches) across the multiple views. To this end, associated 2D cues are found using geometric constraints (e.g., epipolar geometry and multifocal tensors [39, 68]), and local scale-invariant descriptors across multiple views (e.g., like SIFT [63]).       

Finally, 2D or 3D features of the associated data can be extracted and selected, and a classifier can be trained using the same pattern recognition methodology explained in Sect. 1.6.2.

Depending on the application, the output could be a measurement (e.g., the volume of the inspected inner part is 3.4 cm\(^3\)), a class (e.g., the test object is defective) or an interpretation (e.g., the baggage should be inspected by a human operator given that uncertainty is high).

1.6.4 Deep Learning

Originally, deep learning is inspired by ideas from neuroscience [40]. In recent years, deep learning has been successfully used in computer vision (see, for examples, in image and video recognition in [10, 59, 95]), and it has been established as the state of the art in many areas. The key idea of deep learning is to replace handcrafted features with features that are learned efficiently using a hierarchical feature extraction approach. There are several deep architectures such as deep neural networks, convolutional neural networks, energy-based models, Boltzmann machines, deep belief networks, and among others [10]. Convolutional Neural Networks (CNN), which were inspired by a biological model [60], is a very powerful method for image recognition [55]. In this book, we dedicate Chap. 7 to deep learning approaches that can be used in X-ray testing, namely convolutional neural networks, pre-trained models, transfer learning, generative adversarial networks, and detection methods.

1.6.5 Computed Tomography

Another method used in X-ray testing is Computed Tomography (CT) [18, 34], which produces a cross section of the object under test. The test object (or the X-ray source) can be rotated in order to obtain projections at different angles \(\theta \). As shown in Fig. 1.23, for each angle \(\theta \) a new X-ray intensity profile \(I(r,\theta )\) is obtained, where r is the distance to the origin of the object. According to the absorption’s law (1.2) and a parallel-beam geometry, we obtain

$$\begin{aligned} I(r,\theta ) = I_0 \exp \left( -\int _l \mu (x,y)ds \right) \end{aligned}$$
(1.11)

in which (rs) is a new coordinate system obtained by rotating (xy) through \(\theta \) with \(x = r\cos \theta -s\sin \theta \) and \(y=r\sin \theta +s\cos \theta \). Straight line l is the line of the X-ray beam from the X-ray source to the detector. Thus, the attenuation distribution \(\mu (x,y)\) can be computed from all profiles \(I(r,\theta )\).

Fig. 1.23
figure 23

Computed Tomography (CT) [72]: a Result of a CT reconstruction. b Projection slice theorem

In computed tomography, in general, a new function \(P_{\theta }(r) = -\ln (I(r,\theta )/I_0)\) is used to calculate the object’s cross-sectional plane from the measured projections [18]. The reconstruction of the object function \(\mu (x,y)\) from it’s projections presents a typical inverse problem [17]. A great number of algorithms are available, which can be classified into three groups:

  1. 1.

    Back-projection [57, 78]: This is the most basic method because it simply ‘smears’ each projection along the path of the X-rays. It allows for a crude reconstruction of the test object.

  2. 2.

    Projection-Slice theorem [20]: As illustrated in Fig. 1.23b, this theorem states that a one-dimensional Fourier transformation of a projection \(P_{\theta }(r)\) at the angle \(\theta \) is equal to the two-dimensional Fourier transformation of the object function along a straight line through the origin in Fourier coordinates at the angle \(\theta \) [15, 84]. A projection \(P_{\theta }(r)\) is obtained through parallel-beam geometry, e.g., by shifting the radiation emitter-detector arrangement radially after each measurement.Footnote 5 In practice, however, these ideal conditions cannot be realized. Only a limited number of projection measurements are available for reconstruction, and these are generated from a limited number of line integrals. As such, a two-dimensional function cannot be uniquely defined.

  3. 3.

    Filtered back-projection: In order to avoid the aforementioned problems, this method uses filters with low-pass characteristics. This has a negative impact, especially on high spatial resolution reconstructions, since great discontinuities in the measured values result from the object edges in the projections (highly absorptive material next to hollow spaces in the design). This leads to large artefacts, which can make image analysis impossible.

The aforementioned reconstruction problems have been addressed as an ill-posed problem [37]. There are diverse approaches for regularization and optimization algorithms that ensure their convergence. Some consider different a-priori information using probabilistic models [14] and geometric models. For example, some models have established a region of interest [61, 111] considering limited angles [32, 85, 98] or sparse representations [12, 32, 98], restricting the scope to a binary construction [5, 87], reconstructing faults in homogeneous material [5], or preserving borders [104, 109], to name just a few. The work of Retraint et al. [87] merits special interest because the authors conducted a binary reconstruction of the 3D image from just three X-ray projections (not necessarily orthogonal) using an Ising model [33].

Computed tomography provides cross-sectional images of the target object so that each object is clearly separated from any others, however, CT imaging requires a considerable number of projections to reconstruct an accurate cross-sectional image, which is time consuming. 

1.7 Code and Data

The book provides supporting material at an associated website,Footnote 6 including a database of X-ray images and a Python Library, called pyxvis Library, for use with the book’s many examples.

1.7.1 Pyxvis Library

In this book, we use many commands of pyxvis Library, i.e., an open source PythonFootnote 7 library that we developed for X-ray testing with computer vision.Footnote 8 pyxvis Library contains more than 150 functions for image processing, projective geometry, multiple view analysis, feature extraction, feature transformation, feature analysis, feature selection, classification, convolutional neural networks, pre-trained models, transfer learning, generative adversarial networks, performance evaluation, and simulation (see Fig. 1.24).

figure f
Fig. 1.24
figure 24

pyxvis Library: developed Python library for this book

The output of Example 1.3 is the following:

figure g

The reader can check the correct use of in Example 1.2.

A quick reference for pyxvis Library and all of the examples of this book can be found in our repository (see footnote 8).

1.7.2 \(\mathbb {GDX}\)ray+Database

We developed an X-ray database that contains more than 23,100 X-ray images.Footnote 9 The database is described in detail in Chap. 2 and Appendix A. The database includes five groups of X-ray images: castings, welds, baggage, natural objects, and settings. Each group has several series, and each series several X-ray images.

Most of the series are annotated or labeled. In those cases, the coordinates of the bounding boxes of the objects of interest or the labels of the images are available in standard text files. The size of \(\mathbb {GDX}\)ray+is 4.5 GB.

1.8 General Methodology for X-ray Testing

In computer vision for X-ray testing, we identify three main areas:

  • 1. X-ray energies: there is enough research evidence to show that multi-energy X-ray testing must be used when material characterization is required (e.g., to detect organic products). In other cases, such as inspection of castings, mono-energetic X-ray imaging is enough.

  • 2. X-ray multi-views: the performance of the examination of a complex object can be better when analyzing multi-views (because a single view could present an unrecognizable pose). In othercases, such as inspection of welds, a single view is enough.

  • 3. X-ray computer vision: there is a plethora of computer vision algorithms that can address many recognition/detection/inspection problems. There are cases (e.g., size of a fruit) in which a simple algorithm is enough, whereas in other applications (e.g., baggage inspection), more complex algorithms are required.

Fig. 1.25
figure 25

3\({\mathbb X}\)-strategy: In \(3{\mathbb X}\)-space, a baggage inspection solution is defined as a combination of X-ray energies (\({\mathbb X}_1\)), X-ray multi-views (\({\mathbb X}_2\)) and X-ray computer vision algorithms (\({\mathbb X}_3\))

This taxonomy is called ‘3\({\mathbb X}\)-Strategy’, as illustrated in Fig. 1.25. Each solution corresponds to a point in the 3\({\mathbb X}\)-space, which is defined as a combination of X-ray energies (\({\mathbb X}_1\)), X-ray multi-views (\({\mathbb X}_2\)) and X-ray computer vision algorithms (\({\mathbb X}_3\)).

Table 1.2 Information on possible combination of energies, views and algorithms for categories of objects

In X-ray testing, three main factors can have an impact on the solution:

  1. 1.

    The type of X-ray image, which depends on the X-ray energies used in the image acquisition process.

  2. 2.

    The point of view, that means the occlusion, which depends on whether or not other objects are superimposed over the target object, and the pose, which is related to the rotation of the object.

  3. 3.

    The image complexity, which depends on the number of objects present and how they are placed in the bag.

These factors have been addressed using a \(3{\mathbb X}\)-strategy: it is clear that certain objects of interest require more than one X-ray energy, more than one view, and more than a simple algorithm. Thus, for X-ray testing there is a general methodology that can be understood as an ad-hoc combination of \({\mathbb X}_1\) for energies, \({\mathbb X}_2\) for views and \({\mathbb X}_3\) for algorithms that can be used. Table 1.2 provides possible \(3{\mathbb X}\)-combinations for certain applications. For example in baggage inspection, if we want to identify a flammable liquid in an uncluttered bag (i.e., low-image complexity) we need at least dual-energy, possibly only one view, and a simple computer vision algorithm. However, if we want to detect a handgun in a cluttered bag (i.e., high image complexity), we need several views, possibly a computed tomography, and a complex computer vision algorithm. If we want to detect a metallic handgun, dual-energy will be required. A \(3{\mathbb X}\)-strategy is to be designed for each kind of object to be detected.

1.9 Summary

In this book, we present a general overview of computer vision approaches that have been used in X-ray testing. In this chapter, we gave an introduction to our book by covering relevant issues of X-ray testing.

X-ray testing has been developed for the inspection of materials or objects, where the aim is to analyze—nondestructively—those inner parts that are undetectable to the naked eye. Thus, X-ray testing is used to determine if a test object deviates from a given set of specifications.

Typical applications are

  • Inspection of automotive parts,

  • Quality control of welds,

  • Baggage screening,

  • Analysis of food products,

  • Inspection of cargo,

  • Quality control of electronic circuits.

In order to achieve efficient and effective X-ray testing, automated and semi-automated systems based on computer vision algorithms are being developed to execute this task.

We gave an introduction to some physic and geometric principles related to computer vision. Following this, an overview of single and multiple view analysis, deep learning, and computed tomography was presented. Finally, we introduce a general methodology for computer vision for X-ray testing.