David Bernard

Humans love modifications, but over time they can add up to false comparisons.

“To gild refined gold, to paint the lily ... is wasteful and ridiculous excess.” – William Shakespeare, “The Life and Death of King John”

We are used to editing, cropping and modifying cellphone photos to improve and enhance the original images. This is often achieved by adjusting their contrast and brightness, and applying software filters that could, for example, sharpen or otherwise change the look and details. Why should images taken for x-ray inspection be any different? They are not, of course. The images you see in my columns, as well as in probably every other piece of technical literature, together with virtually every other image seen in today’s media, are likely modified on some level. While we may accept this situation intellectually, I would suggest we often too implicitly trust what our eyes see, and therefore any inherent image manipulation is often taken as fact. This can cause the details we see and accept to possibly mislead us as to the reality of the original. As we use such images to make value judgments on the quality and possible faults in electronics manufacture, is this an issue we should be concerned with, or is it a manipulation we need, but also need to understand why we do it, so we can make the best analysis?

In my view, for image analysis by the human eye, image enhancement is necessary. By using the appropriate image modifications, we can assist the eye’s inherent limitations in viewing the grayscale images produced by x-ray systems. However, do these modifications introduce false artefacts into what we see? In the case of adjusting the contrast (often called contrast stretch) and brightness of the image, then no. With other enhancements? Possibly.

The image produced by an x-ray system contains a number of gray levels that graduate the difference from black to white. The available levels for a particular x-ray system are shown in the technical literature by the number of bits the system detector provides. For example, an 8-bit detector will provide 256 gray levels and a 10-bit detector 1,024. However, and depending on which literature source you check, the typical human eye can only discriminate ~30 to 60 gray levels (perhaps not even 50 shades of gray!), far fewer than the detectors provide. In comparison, with the same caveat as above, we can see ~1 million different colors (shades of color). Therefore, a method that improves our limited ability to perceive differences in gray levels in an image is helpful. This is achieved by applying a contrast stretch. Using an 8-bit detector as an example, where black is level 0 and white is level 255, most images we produce will not have all 256 gray levels present. Usually it is far fewer. For example, the minimum black level could be level 10, rather than level 0, and the maximum white level 160, not 255. Applying a contrast stretch to such an image takes the actual gray levels seen (150 in this case) and redivides and presents them across the full 8-bits. In other words, the boundary between where one gray level ends and the next starts is widened in the contrast shown, hopefully allowing the eye a better chance of discriminating differences and observing more detail in that image (FIGURE 1). As the range of available levels in an image reduces, the greater the effect on the stretched image, allowing what might originally might have been a dark, almost monochrome, image to now appear to have a much larger contrast variation (FIGURE 2). Most x-ray systems permit the contrast stretch function to be applied and allow manual changing of the start, end and midpoint of the levels used, which can enable further contrast adjustment. Changing the midpoint means that gray level 128 can be moved closer to either the black or white end of the spectrum. Moving it closer to black, for example, will narrow the 128 levels in the black end of the spectrum but further broaden the 128 levels at the white end, which may pull out yet more information to the eye. Using a contrast stretch does not alter the underlying original image; it just pulls out subtlety what it already contains for the eye to see. When looking for variations in images that will help identify failures, applying a contrast stretch usually helps.

9 test figure 1



































Figure 1. X-ray image showing “before and after” application of a contrast stretch and edge enhancement.

9 test figure 2



















Figure 2. X-ray images showing “before and after” application of a contrast stretch to the whole image and an edge enhancement to the central portion.

The other type of image manipulation often used for electronics inspection applications is edge enhancement. There are many types of such filters, and, as the name suggests, they can help to specifically sharpen and delineate edges between light and dark features (Figures 1 and 2). For example, they can provide better definition to BGA solder balls and the clarity of traces on and within the board (FIGURE 3). These filters help the eye better discern the difference between specific features. This is particularly necessary, as the resolution of an x-ray image is on the order of microns compared with that of nanometers for optical images. Therefore, all x-ray images appear blurred compared to an optical image. Applying edge filters makes the x-ray image appear clearer. However, these filters modify the original image, so what you see is not a true representation of what was originally captured. The changes may be minor in nature, but may also bring in the possibility for, and presence of, artefacts into the “corrected image.” The creation of “artificial” features by the enhancement process may lead to false interpretation or analysis. Other more complex filters are also available from many x-ray system suppliers. Try them. Do they help you see what you need to?

9 test figure 3

































Figure 3. X-ray image of BGA showing “before and after” application of a contrast stretch and an edge enhancement.

The images presented in my columns for this magazine have been predominantly white on black. This is the reverse of the image convention typically used for hospital x-rays. I do not believe that for analytical purposes one convention is better over the other, but I think an experiential bias causes any preference. Most x-ray systems allow the conversion of one format into the other, if required. I find a brighter image, like Figures 1 to 3, is more pleasing and easier to see. However, I believe hospital radiologists, with over a century of film-based x-ray history behind them, where a darker image is the norm, would argue the reverse. See FIGURE 4 and decide for yourself!

9 test figure 4

































Figure 4. Comparison of inverse x-ray images with and without enhancements applied.

Making appropriate image enhancements allows us to create the best or “golden” image. This is certainly helpful when explaining to one’s clients and superiors the issues that have been captured, particularly if knowledge and expertise of x-ray may not be their primary concern. However, what presents best to a customer, like editing your own photos, might take some time to achieve and, in reality, may not be needed for the experienced operator, who may be able to correctly analyze from an unenhanced image during production. But the capability is there if required.

The application of image filters is really beneficial for human operation and analysis. When it comes to automated machine analysis, however, filters are more likely to be a disbenefit. This is because enhancements are applied to each captured image prior to analysis. Unless you have similar, and consistently exposed, original images, the resulting “modified” image will not necessarily be the same time after time. Unlike the human eye, the computer can differentiate and analyze over the whole grayscale range. Therefore, potentially small changes in grayscale levels for key features in enhanced images, created by small differences in the original image, could result in erroneous, or missed, analysis. Automated x-ray inspection equipment suppliers have to consider system performance drift over time and make great efforts to achieve consistency of image quality, and permit a range of grayscales as the pass/fail threshold, such that similar images of the same product are consistent whenever testing is required over time. However, these necessary adjustments can impact throughput, as “system optimization” must be completed without product being present. Thus, unenhanced images are, in principle, easier to maintain for consistency and, as such, typically used for automated analysis. To the human eye the images for automated analysis look poor, but because the computer can effectively use all the grayscale levels in the image, good analysis can still be achieved.

A good image from x-ray inspection tells us what we need to know, but be cautious that this good image, however modified, has not hidden rather than enhanced what we need to see.

Au.: Images courtesy Peter Koch, Yxlon International.

David Bernard, Ph.D., is an expert in use and analysis of 2-D and 3-D (CT) x-ray inspection techniques for electronics; dbc@bernard.abel.co.uk.

Submit to FacebookSubmit to Google PlusSubmit to TwitterSubmit to LinkedInPrint Article
Don't have an account yet? Register Now!

Sign in to your account