Skip to main content

Vision-Doctor

Camera

The eye of the inspection system

Creation of color information

Colour cameras are essential for industrial image processing. They provide the user not only with images containing intensity data in the form of greyscales, but also with additional colour information, which is of great importance in many applications.

The information provided by a monochrome image, which can only distinguish between 256 different shades of grey with 8-bit grey levels, is entirely suitable for many defect detection, presence checking and measurement applications, as long as there is a sufficient difference in brightness/contrast between the inspection areas. In the image below, for example, the fruit can be clearly distinguished from the background. The grey tone in the resulting image depends on the saturation and luminance of the colour, but also strongly on the reflectance of the surface.

Grey scale information

However, difficulties quickly arise when neighbouring areas of similar brightness need to be inspected and differentiated. Coloured inspection features that might have produced the same grey value with a monochrome camera (e.g. a light blue and a light green) can now be clearly distinguished with the additional colour information.

Single-chip colour cameras are a simple, low-cost solution to this problem: They can provide much more information with 3* 8-bit RGB. Theoretically, this results in 16.7 million different colour gradations.

Colour information

How are colour images created?

Monochrome and colour cameras have the same number of pixels and usually cost the same.

The difference is that colour cameras have an additional colour filter matrix attached to the pixels. This matrix enables the cameras to produce colour images by capturing only one colour per pixel. The other colour information must be reconstructed by a process called debayering.

Typical applications for colour cameras

  • Constantly changing colours of test objects
  • Many different colours in the image at the same time, which would otherwise be unidentifiable
  • Display, reproduction and acquisition of images as close as possible to how a person would see them
  • Colour control, colour coding test and hue measurement on objects
  • Printing industry/printed products
  • Medical applications
  • Food & Agriculture

Kamera-Sensor

Bayer mosaic

Colour filters on sensor pixels

Colour cameras differ from monochrome cameras by the presence of a colour filter matrix on the sensor. This matrix, known as a Bayer pattern, consists of red, green and blue colour filters arranged in a specific 2x2 arrangement on the sensor's pixels. This arrangement ensures that each pixel captures only one of the three colours.

The challenge of colour reconstruction

Since each pixel only provides one colour information, the missing colour values for each pixel must be reconstructed to create a complete colour image. This process is called debayering or demosaicing. Bayer interpolation is a method where the missing colour values are calculated by interpolating the neighbouring pixels.

Colour filter layout

The Bayer Mono8 raw image

However, the actual colour image produced by a single chip colour camera is always a greyscale image with a grey raster. The brightness of the grey tones corresponds to the respective intensities of the colours red, green or blue. Taking into account the respective pixel neighbours, the missing R/G/B values can be obtained and calculated for all pixels, as you don't just want to know the red, green or blue values at each point, but the full RGB information for each pixel.

Bayer8 raw image

RGB image (reconstructed)

Debayering

Since each pixel provides only one piece of colour information, the missing colour values for each pixel must be reconstructed to create a complete colour image. This process is called debayering or demosaicing. Bayer interpolation is a method where the missing colour values are calculated by interpolating the neighbouring pixels.

The interpolation of the missing colour values from the surrounding pixel values can be done in a number of ways, all of which are computationally intensive in different ways, but all of which have a major impact on the resulting colour image. For example, 2x2 or 3x3 kernels or complex multi-stage software calculations can be used to suppress artefacts. Interpolation perpendicular to the edges of colour patches is typically particularly difficult. Depending on the algorithm (nearest neighbour, linear, cubic...), this can result in comb-like jagged or smooth edges.

Colour reconstruction

Transmission of colour information

Modern industrial colour cameras can often send their data in different "colour formats":

  • RGB24 (or RGB32 etc.): With an RGB camera, the Bayer colour conversion of the image already takes place in the FPGA of the camera electronics, so the camera sends 24-bit colour information.
  • YUV: For data reduction, in some cases a YUV encoded signal can be sent, which requires only 16 bits for transmission.
  • Bayer8 mono: The lowest data rate for signal transmission is when the monochrome Bayer raw image is sent and converted back into colour information on a frame grabber card or using software on a PC.

Important for machine vision

Loss of resolution and intensity

However, simple debayering can result in significant loss of resolution and intensity. For example, simple algorithms using only a 3x3 pixel matrix can lose up to 30-50% of resolution. This is particularly problematic in applications where high image quality is critical.

High-quality debayering algorithms

Modern, high-quality debayering algorithms use more complex calculation methods and larger pixel matrices to minimise resolution loss. These algorithms analyse not only the immediately adjacent pixels, but also take into account larger areas of the image to reconstruct more accurate colour values. These advanced methods can significantly improve image quality while largely preserving colour depth and sharpness.

Inspection only in VIS

Colour camera sensors are usually fitted with a daylight band-pass filter that blocks UV and IR radiation to avoid false information. For example, lighting with a halogen lamp (due to the high IR component) would produce an extremely reddish image, as the IR radiation would be interpreted as extra 'red'. If such a filter glass is not fitted, you can screw it onto your optics.

Large amount of data

Depending on the data format, the image transfer rate and data volume is usually much higher than with a monochrome camera. Instead of 8 bits, at least 3x 8 bits = 24 bits of data are usually generated.

Need to buy the right camera?

Vision-Doctor.com is a private, independent, non-commercial homepage project and not a technology provider or system integrator. Suitable technologies and further professional support can be obtained from the companies & partners listed below.

If necessary, I will be happy to provide a quick recommendation, contacts and brief information.

Industrielle Kamera fuer Bildverarbeitung