Shape-from-Shading: The role of the right lighting technology

 

The reliable automated inspection of problematic surfaces is a technical tour de force for Machine Vision. This includes both the detection of surface defects as well as the identification of test criteria. Yet what a human can often make out merely by glancing at an object presents a Machine Vision system with a monumental challenge. Identifying miniscule defects and characteristics on a surface is a demanding enough task on its own, but is made much more difficult by a diversity of shapes, textures, colours, surface variations and reflection properties. Where conventional Machine Vision starts to meet its match is where shape-from-shading takes over: the perfect symbiosis of a Machine Vision system and lighting.


Shape-from-shading is based on the demarcation of texture and topography on the test object. This is achieved by examining the region to be tested with multiple images captured from a variety of directions. Each image faithfully captures the orientation-dependent shading of the surface. These areas of light and shade present us with the height and depth data that we need for further processing. The individual images are then fed into an aggregate computation whose output supplies the topographic information for the test object. This creates an almost three-dimensional representation of the surface of interest.


In a conventionally acquired image, colour differences, changes in brightness, textural features and surface blemishes such as rust will work to alter the evaluation. With shape-from-shading, these disturbance factors are rendered virtually invisible – leaving only the surface’s 3D information. Even defects or characteristics a few microns high or deep become visible. The output image can be evaluated quickly and reliably with standard Machine Vision algorithms such as OCR detection or edge detection software.

Video about Shape from Shading

Typical applications for shape-from-shading include:

  • Surface inspections on highly reflective backgrounds
  • Checking stamped numbers, embossing and engravings
  • Reading dot-peened or laser-cut characters and codes
  • Edge inspection
  • Assembly inspection – e.g. when joining various plastic pieces
  • Type and position checks

By separating topographical and colour information, for example, Braille dots on a printed medicine packaging can be clearly distinguished from a multi-coloured background and therefore checked for correctness:

But even more challenging surfaces, such as cast parts and highly reflective or polished metals, can also be represented by shape-from-shading so that features such as embossing or stamped numbers can be reliably evaluated.

At the heart of the method lies a sophisticated Machine Vision algorithm. As the name shape-from-shading suggests, light and shade have a decisive role to play here – as they so often do in Machine Vision in general. Despite specialised software algorithms, lighting is and will remain one of the most important elements in producing an image. For this method in particular, which determines height and depth information by using a range of shadow images, the arrangement of the lighting to the camera and the test object is decisive to achieve an optimum result. 
 

Various types of reflected-light setups can be deployed here. One precondition is that the lighting must consist of individual switchable segments around the test object
After considering the material, the surface properties and the size of the test object, plus the working distance, the following kinds of   lighting are typically utilised:

  • Bar lighting arranged in a square or rectangle
  • Ring, dark field or dome lighting, as an array of switchable segments

Bar lighting is a very flexible option to choose. These systems can be arranged freely and adjusted easily as regards, positioning, distance and angle for the task in hand. 
A lighting setup of this kind – consisting perhaps of 4 Mini Bar Lights from the LSB series – offers maximum flexibility while ensuring the lighting has a high luminous intensity. Thanks to the very flat beam angle, sharp shadows are thrown even by very small variations in the surface. If the features are hidden – such as inside a ring, for example – then the lighting can be raised up and also arranged at a steeper angle.
 

Example: milled characters inside a metal part

Some surfaces cannot be optimally lit with this kind of arrangement, however. Very shiny and reflective surfaces will mirror the butt joints between the edges of the individual bar lights. In these cases, having a contiguous lighting system is advantageous.

A ring-shaped lighting system with 4 or more individually controllable segments, and which can be equipped with diffusors of various strengths depending on the reflexivity of the test surface, is a good alternative here. Dome lighting is another excellent choice for illuminating very shiny or reflective parts. Equally, the highly directional light offered by dark field lighting systems are ideal for surface variations with very little depth or height

Due to the complexity of the topic and the difficulty of estimating potential results from the outset without conducting tests, the optimal lighting arrangement should be determined for each project in a Machine Vision laboratory. Not least because many Machine Vision problems can be resolved quickly and reliably only when the light is right.


Find out about further interesting fields of application in industrial image processing below: