Optimization of Optical Inspections Using Spectral Analysis

The purpose of this book is to present new concepts, state-of-the-art techniques and advances in quality related research. Novel ideas and current developments in the field of quality assurance and related topics are presented in different chapters, which are organized according to application areas. Initial chapters present basic ideas and historical perspectives on quality, while subsequent chapters present quality assurance applications in education, healthcare, medicine, software development, service industry, and other technical areas. This book is a valuable contribution to the literature in the field of quality assurance and quality management. The primary target audience for the book includes students, researchers, quality engineers, production and process managers, and professionals who are interested in quality assurance and related areas.


Introduction
Machine vision is proving its potential to be an efficient tool for increasing product quality and for decreasing manufacturing costs.Many applications use automated optical inspection systems for measuring mechanical dimensions and for monitoring quality features of manifold products.Optical inspection systems consist mainly of a handling system, a vision system and a user interface.The vision system can be divided into an acquisition and processing part.While there exists much literature about image processing there is less attention spent for designing an image acquisition system.The system accuracy and processing speed correlates directly to image quality defined as the contrast between the different features (e.g.objects) in the image.Caused by the increasing complexity and difficulty of the inspection tasks and the demand for increasing throughputs, image quality gets more important for reliable vision systems.This chapter deals with spectral methods for the selection of hardware components within the acquisition system to optimize image quality.We show that our analytical methods will increase image quality and decrease classification error rates of a vision system.
The outline of this chapter is as follows.The chapter is divided into four sections.Section 2 gives a short introduction into image acquisition and introduces the components involved and the modelling of their spectral characteristics afterwards.This includes the lightsource, the reflection behavior of materials, the optics and the sensor.The section concludes with a model developed to describe the feature of image pixels due to the acquisition chain.Section 2.2 explains the methods developed how to select the acquisition components for the visible and infrared wavelength range.This optimization is done by using different statistical approaches resulting in two types of image quality measures.
Experimental results for simulated and real data are presented in Section 4. It will be shown that our approach of selecting the hardware components leads to a much lower error rate of the respective inspection task.
This chapter concludes with a summary and discussion of the results.

Image acquisition
incident light is emitted by a lightsource which has a specific spectral power distribution.The observed scene includes different objects reflecting the incident light depending on spectral reflection behavior.The reflected light is focussed by optic components transmitting the light according to their optical transmission characteristics.Finally the camera generates an image using a sensor element which has a wavelength dependent degree of efficiency.
In Sections 2.1 to 2.4 the different types of these components and their characteristics with respect to their spectral behavior are shown.Section 2.5 introduces a model for the acquired image with respect to the components included in the image acquisition chain.

Lightsource
The lightsource within a vision system plays an important role.Primary properties of lightsources are intensity, propagation direction, frequency or wavelength spectrum, and polarization.Lightspeed in vacuum, ≈ 3 • 10 8 meters per second, is one of the fundamental constants of nature.With respect to machine vision tasks the relevant information of the light emitted by a lightsource is the total radiant intensity I total and the spectral radiant intensity distribution p I total at a point x, y, z of the observed scene resulting in the wavelength dependent radiant energy I L of the incident light: I L (λ; x, y, z) = p I total (λ) • I total (x, y, z) . (1) The assumption that p I total is spatially invariant is valid in most of the machine vision tasks.
If the intensity of light is graphed over the corresponding wavelengths, the spectral behavior of a lightsource can be analyzed.Fig. 2 shows the spectrum of light that is emitted by the sun.The figure shows that the human eye can only perceive a small amount of the radiation emitted by the sun.The visible spectrum for a typical human eye corresponds to a range from about 390nm to 750nm (Wald (1945)).A rendering of this spectrum is shown in Fig. 3. Sunlight is rarely used as a primary lightsource in a vision system.The most common lightsources are incandescent light bulbs, gas-discharge lamps and light emitting diodes.Light emission by incandescence can be designed to have the same type of emission by which sunlight is created.Both the surface of the sun and the metal filament in an incandescent light bulb glow because of their high temperature (thermal radiation).All materials glow if they are above a temperature of 0K, but below the Draper Point (798K) the intensity is too small to be perceived with the human eye.A model of the emitted thermal radiation can be found by using an idealized material called a black body.A black body is both a perfect absorber and emitter of radiation.The spectrum of the emitted radiation depends on the temperature only and can be expressed by Planck's Law: The intensity of the emitted light u at a certain wavelength λ and temperature T can be calculated as shown above with h as Planck's constant, c as the speed of light in a vacuum and k as the Boltzmann constant.Fig. 4 shows the spectra of blackbody radiation at different temperatures.These spectra show the general characteristics for the spectrum emitted by the sun (T = 5500K) and that of an incandescent bulb (T = 3500K).The spectrum emitted by thermal radiation is always continuous and covers all frequencies of the visible spectrum and beyond.In vision systems, incandescent bulbs are used as a lightsource with a broadband spectrum.This means that the intensity of the light reflected from the object is mostly dependent on the material of the object and not on the spectrum of the lightsource only.
Another type of lightsource often used in vision systems is the gas-discharge lamp.Several different types of these lamps exist, such as neon lamps, sodium-vapor lamps and fluorescent lamps.All of these lamps emit radiation due to the same principle.The atoms of the gas inside the lamp are ionized by electrical energy.This means that some of the electrons are free to move from their atoms.These free electrons are accelerated by an electrical field within the lamp and will collide with other atoms.Some electrons in the atomic orbitals of these atoms are excited to a higher state of energy by these collisions.When the excited atom falls back to a lower state of energy, it emits a photon of a characteristic energy, resulting in infrared, visible, or ultraviolet radiation.Since the wavelength λ of a photon is related to it's energy these lamps can emit light in very specific parts of the spectrum.
The spectrum of a low pressure sodium-vapor lamp is given as an example for this smallband emission of radiation in Fig. 5.The light emitted by this lamp is almost monochromatic and has a characteristic yellow-orange color.The characteristic energy which is responsible for this behavior can be altered by using different gases in the lamps.Fluorescent lamps use a mercury vapor that emits radiation in the ultraviolet part of the electromagnetic spectrum.This radiation will excite a fluorescent coating inside the lamp, which in turn emits light over a broader part of the visible spectrum.The spectrum of such a fluorescent lamp is shown in Fig. 6.The spectrum is characterized by many spectral lines, some of which are due to the mercury vapor, while others are due to the fluorescent coating.In total the light emitted by this lamp is perceived as white.
Light emitting diodes (LED) are used more and more frequently in vision systems.This type of lightsource uses the recombination of electrons and holes in a semiconductor to emit radiation.The wavelength of the emitted radiation depends on the energy gap between the electron-energy and the hole-energy.Using different materials, this gap can be designed to specific values.By this, the color of the LED can be influenced.The first LEDs developed in the 1960s were red or infrared types.Modern LEDs are available in several colors across the visible spectrum, ultraviolet and infrared wavelengths.The resulting spectra of these different LEDs usually have small bandwidths.Fig. 7 shows the spectra of several color LEDs.
White LEDs can be designed in two different ways.The combination of three LEDs (blue, green and red) with the spectra shown in Fig. 7 will make the LED appear white.If all three LED types can be electrically contacted individually, the color of the LED can be changed during use, which can be beneficial in certain applications.
The other way to design a white LED is to use a phosphor coating.The phosphor coating shifts a part of the emitted light to a higher wavelength.This is shown in Fig. 8, where the small peak at the shorter wavelength is the original light emitted by the LED, and the broader peak at longer wavelengths is due to the phosphor coating.Fig. 7. Spectra of different single colour LEDs Fig. 8. Spectrum of white LED with original peak at lower wavelengths and broader, shifted peak at higher wavelengths (Philips (2011))

Observed scene
An observed scene includes one or more objects that have to be inspected by the vision system.The knowledge of the reflection behavior of these objects will give us the possibility to choose optimal components for the vision system.In this Section different models for the reflection of surfaces are introduced.

Lambert's model
Lambert's Model, which was advanced by Johann Heinrich Lambert in 17th century (Lambert (1760)), is the basic of the most reflection models and remains one of the most widely used models in computer graphics (Oren & Nayar (1994)).If a surface reflects the incoming light equally in all direction, the surface is called a Lambertian reflector (a perfect diffuse reflector).This means the luminosity of the surface is independent of angle of the observation.
According the Lambert's cosine law, the reflected luminosity I d depends on the cosine of the angle α between the direction of the incoming light L and the normal of the surface N (see Fig. 9).With increasing angle the intensity of the reflected light decreases: Hence, the luminosity of a Lambertian surface depends on the normal vector N and the direction of the normalized vector L in the direction between the light and the surface, and also from the diffuse reflection material coefficient k d .
Using (4) and ( 5) assuming that |L| = 1, |N| = 1 leads to This model can be extended by regarding indirect light with an ambient term.The ambient component is independent from the direction of the incoming light and the direction of the viewer.The term depends on an ambient light I a and the ambient-material coefficient k a and is homogeneous over the complete scene

Blinn-Phong model
Since the introduction of computers and in particular 3D graphics, the light models became more and more important.Bui-Tuong Phong extended the Lambert's light model with a component that simulates light that is reflected in a certain direction (Eriksson (2006)).This component is called specular The Blinn-Phong Model is derived from the Lambert's Model by adding a specular term to ( 7) Where I a and I d are the ambient and the diffuse components from the Lambert's model.The effect of the specular term I s can be seen for example when a billiard ball is illuminated by single non-diffuse light.The light source produces a spot on the ball, which varies with the position of the viewer.Reason for this effect is that surfaces are not perfect mirrors.A perfect mirror would reflect the incoming light only in one direction, so that a viewer would see the reflection only in one direction.In practice the light intensity is a more complicated function of the angle φ between the reflected light ray R and the view angle (Eriksson (2006)).
Phong expressed an empirical approach to model the amount of reflected light that is described by 405 Optimization of Optical Inspections Using Spectral Analysis www.intechopen.comPhong's original equation is also often written (Duff (1979), Lewis (1994), Kajiya (1989)) as: with k s as specular material coefficent and This leads to under the assumption that |V| and |R| = 1.
The Phong light model was extended by James Frederick Blinn 1977.He reformulated the Phong model by a physically based light model.He introduced the half-vector H, instead of the R. H is defined as the vector halfway between the incoming light-and the viewer vector: In addition Blinn defines φ ′ as the angle between the normal vector of the object surface and the halfway vector which is proportional to the angle φ.Thus the angle φ could be replaced by the angle φ ′ (see Fig. 10): 406 Quality Assurance and Management www.intechopen.com with ( 14) resulting in: Reason for this substitution is that the halfway vector can be simpler calculated than the reflection vector.
The overall reflected intensity can hence be determined by:

Cook-Torrance model
The disadvantage of the light models from Blinn and Phong is that the models have no physical basis.Robert L. Cook and Kenneth E. Torrance developed the Cook-Torrance light model in 1981 on a physical model.The model describes the surface by many little facets (mirrors), which allows to consider the refraction ratio, the roughness and shadowing.
Torrance describes the reflectivity in He ( 2001), as follows: In the equation I a,CT describes the ambient-, I d,CT the diffuse-and I s,CT the specular reflectivity.The following equations present the content of this three terms: a(λ) is the ambient term, which is like the other light models uniform diffuse over the scene.
The diffuse reflected light is expressed as: Parameter G is the geometry attenuation factor and S the shadowing function, both together describing the selfshadowing due to the microfacets.D is the distribution function of the roughness which is based on a physical model of microfacets distributions.D is dependent on the wavelength.k d,CT contains the influence of the material and its surface attributes.The ratio of refraction of the surface, will be described by the Fresnel function F, which presents the reflection and refraction of light at uniform planar interfaces.
The specular part is where g is the surface roughness function, which is also dependent on the wavelength.In (21) the parameter dω i describes the incident solid angle and Θ i is the polar angle, which is the angle between normal vector and the incident light vector.Δ describes the specular influence and is one if in specular cone otherwise it is zero (He (2001)

Optics
The optics of a vision system have strong influence on many image characteristics e.g. the spatial resolution, depth of focus, image intensity.Additionally the contrast between different objects depends on the spectral behavior of the optics.This Section will focus on the variation of spectral transmission for optical materials and lens types.In general two different aspects influence the spectral transmission of optics: the lens material and the lens alignment and coating.Hence the transmission of the optics t opt can be described as: While t mat is the transmission of the lens material, t alig includes the transmission influenced by the coating and alignment.x, y indicates the position of light beam entering the optical system.

Spectral transmission of different lens materials
In optics, transmission is the property of a medium allowing light to pass through the medium with some or none of the incident light being absorbed or reflected during the process.Different glass materials have different transmission ranges, allowing light to pass at different wavelengths.Standard optical glasses offer high transmission throughout the entire visible spectrum and also the near ultraviolet and near infrared range (Newport (2011)).In the following, the spectral transmission of different glass materials for optical lenses is shown.
As Table 1 and Fig. 11 show, the spectral transmission of different materials vary especially outside of the visible spectrum.When glass elements are combined to form a photographic lens, the spectral transmission changes.

Spectral transmission of different lens types
The degradation of spectral bandwidth is mostly due to antireflective coating, which is specifically designed to block ultraviolet or infrared radiation.A typical photographic lens is optimized for the visual spectrum of electromagnetic radiation.In the following, the spectral transmittance of different photographic lenses are shown by real-world examples.
Quality Assurance and Management www.intechopen.com First, the spectral transmission of a Schneider Optics Cinegon 1.4/8mm is shown in Fig. 12 (a).The Cinegon is used as an example for all standard purpose photographic lenses.The diagram shows a relatively flat transmittance between 400nm and 700nm.Since this is a prime lens with a fixed focal length, a relatively simple design with six glass elements can be used.The transmittance of a more complex photographic lens will usually show a different characteristic, caused by an increasing number of glass elements.In comparison it can be seen, that the peak transmittance is about 15% lower than that of the simpler lens design.Also the transmittance has a smaller bandwith, with lower transmittance values below 450nm or above 600nm.
For optical imaging outside the visual spectrum, special photographic lenses should be used.These are usually optimized on the infrared or the ultraviolet part of the electromagnetic spectrum.Fig. 13 (a) shows the spectral transmittance of a Jenoptik CoastalOpt UV 4.5 105mm lens.The usable transmission range starts at 250nm and declines again at 650nm.This lens mostly covers the ultraviolet spectrum, which can be useful for defect detection (Richards (2006)).
Next, an example for a lens covering the infrared spectrum is given.The lens in this example (Fig. 13 (b)) is a Jenoptik CoastalOpt Hyperspectral 2/25mm SWIR lens.The largest part of usable transmittance is above the usable range of UV lens mentioned before.Usable range with a transmittance above 80% starts at 400nm and ends at 1650nm.

Camera
Finally the image is generated by a camera using an image sensor.Depending on the wavelength, different types of sensors are used.The appropriate sensor types for ultraviolet to infrared wavelengths are introduced in this Section.Some differences between sensor types as well as the variation for equal sensor types are shown.The key aspect for the spectral behavior of an image sensor is its quantum efficiency (QE).The QE (λ) is an attribute which describes how many photons are transformed to electrical charge carriers depending on the wavelength: n e is the count of electrical charge carriers, generated by n ph photons with a wavelength λ.

Quantum efficiency of image sensor materials
Digital image sensors are based on the transformation of electromagnetic waves energy transported by photons to electrical energy.The energy E ph of a photon can be described by where λ is the corresponding wavelength, h is Planck's constant and c is the speed of light.
This means that different wavelengths of light have different energies, with the infrared part of the spectrum being lower in energy than the ultraviolet part.( 23) and ( 24) can be combined for describing the energy efficiency (EE) of a sensor: Digital image sensor cells use semiconductors to detect energy in different parts of the electromagnetic spectrum and hence different wavelengths of light.The part of the spectrum where a sensor cell is sensitive to light energy is determined by the material (Fig. 14) This diagram shows the quantum efficiency for different materials.A high quantum efficiency over a large frequency range is desirable, so that as much energy as possible can be converted from light to electrical charge.As with lenses, the properties of the sensor materials will determine the maximum range in which a sensor is applicable.

Quantum efficiency of different sensor types
While the quantum efficiency of a single image sensor cell is determined by the factors above, the efficiency for a whole chip is additionally influenced by the fill rate.The fill rate states the percentage of the sensor surface is used to detect light.The fill factor only influences the quantum efficiency as a constant factor.
In the following, the quantum efficiency of different image sensors is shown by real-world examples.First, the quantum efficiency of a Basler A622f camera (Basler ( 2011)) is shown in Fig. 15 (blue curve).The diagram shows, that the quantum efficiency peaks at 25% between 500nm and 600nm wavelength.This corresponds roughly to the green and orange parts of visible light.While the maximum efficiency of 25% is rather low, this can be countered by increasing the light intensity on the object.In contrast to this, Fig. 15 (yellow curve) shows the quantum efficiency diagram of a Basler A601f camera.This diagram shows a higher quantum efficiency over the whole wavelength range, with a peak of over 30% at 600nm.Not only the peak efficiency is higher, the bandwidth is also higher.Though these two cameras can be considered as relatively common and state of the art, the better quantum efficiency of the latter model has a great impact on image noise in low light situations.

Image output model
This Section introduces the image output model which will describe the image with respect to the components of the image acquisition chain.Our image output model assumes that the incident light of the observed scene is homogeneous in spectral intensity distribution and total radiant intensity.While the first is nearly common, requires the ladder a light source which illuminates the field of view homogeneously and the distance of the lightsource to the observed scene is nearly constant with z as mean object distance.This simplifies (1) to Considering only passive objects without any light emission the ambient term of the reflected light has negligible influence.Since the specular reflection is mainly concentrated in a narrow cone small changes in the surface direction will lead to a high variation in the reflected amount of light.This is not appropriate for machine vision solutions.Hence we concentrate on diffuse reflection and ( 18) using ( 27) of the Cook Torrance model leads to: Further we assume that the roughness of each object is a material constant which does not vary significantly within the object region leading to: ĨRe f l λ; N, V, L; x, y = I L (λ) • kd,CT (λ; x, y) The dependency on x, y of k d,CT is caused by different objects in the observed scene depending on the position.Hence different objects may result in varying k d,CT .The reflected intensity I Re f l is attenuated by the optics.In case of optics which can be described by small lens model the spatial dependency in ( 22) has negligible influence.This reduces the intensity transmitted by the optics I Opt combining ( 29) and ( 22) to I Opt λ; N, V, L; x, y = I Re f l λ; N, V, L; x, y • topt (λ) .( 30) Combining the transmitted intensity to the image sensor (30) with the energy efficiency of the image sensor ( 25) leads to the sensor output signal (I sensor ) and the transmitted intensity: With C being a constant including specific camera parameter like pixel area, fill factor, gain settings and exposure time.λ min and λ min are the wavelength limits of the regarded wavelength range given by the QE of the camera.
If the alignment of illumination, objects in the observed scene and camera is chosen to assure that the vectors N, V, L are approximately constant, (31) simplifies to

Spectral analysis
The spectral analysis is the determination of the spectral behavior of different objects.As written in Section 2.5 the sensor output depends on the lightsource, the reflection behavior of the observed scene, the transmission of the optics and the quantum or energy efficiency of the camera.Spectral characteristics for the components of an acquisition system are often provided by its manufacturers.On the contrary the spectral reflection behavior of objects in the observed scene are almost always unknown.In Section 3.1 a measurement setup for the spectral reflection behavior is described and in Section 3.2 is the measurement procedure explained.In Section 3.3 the procedure for analyzing spectra is introduced.

Measurement setup
A block diagram of the measurement setup is shown in Fig. 16.The different components will be introduced in the following Sections.

Lightsource
As written in Section 2.1 there exists a high variation of different lightsources.The main aspects for a lightsource within a spectral measurement setup are the amount of intensity, the spectral range and the flatness of the spectrum.Our setup is equipped with a 150 Watt Xenon lightsource (XE) with a spectrum similar to the spectra shown in Fig. 17.The advantages of the XE lightsource is the wide wavelength range (from 250nm to at least 2000nm) and its high intensity.Its disadvantage are narrow and high peaks between 800nm to 1100nm.lightsource is a nearby collimated circular light beam of 8mm diameter and the core diameter of single mode lightguides is only up to 1.5mm.Hence the light beam of the lightsource has to be focussed to the lightguide input.This is accomplished by a parabolic mirror and a three axis adjustment.

Lightguides
Depending on the wavelength range that has to be measured two different types of lightguides are used.One which is optimized for a wavelength range from 200nm to 1100nm and another which is optimized for the wavelength range from 900nm to 2200nm.These two different configurations are used depending on the spectrometer type.

Lightguide to probe coupling element
The light beam transmitted by the lightguide has to illuminate the probe area of interest.In order to measure the diffuse reflection behavior an integrating sphere is used.Advantages of the integrating sphere are the reduction of specular reflection and the angle independent collection of diffuse reflected light.The integrating sphere is coated with a material which has a high reflection (>98%) in the desired wavelength range.While the diffuse reflected light of the probe is reflected several times within the integrating sphere and finally coupled into the output port the specular reflection is absorbed.The probe area is limited to a diameter of 8mm.

Spectrometer
The spectral measurement system can be equipped with two different spectrometers.The first spectrometer includes a charge coupled device sensor which is sensitive from 220nm to 1100nm.It can be used for measuring the spectral reflection behavior in the ultraviolet, visible and near infrared range (NIR).The second spectrometer uses an extended indium gallium arsenide sensor to cover wavelengths from 900nm to 2200nm.This spectrometer can measure NIR and short wave infrared wavelengths.

Measurement sequence
spectral measurements are used to calculate the relative reflection coefficients for the different wavelengths.The following procedure has to be accomplished: 1. optimization of the integration time 2. measuring the black and white reference 3. gathering measurement readings of all objects 4. compensation and normalization of the measurement readings.
All of these points are explained in the sections below.

Optimization of the integration time
The integration time of the respective spectrometer has to be chosen with respect to high signal to noise ratio (SNR).In general the SNR increases with higher integration times.The optimal integration time lead to a high reflection signal of the white reference without saturation.

Measuring the black and white reference
The usage of two different reflection standards is required to optimize the resolution and reproduceability of the system.The first standard is a specular black standard which has very less diffuse reflection.The measurement of this standard leads to information of noise influences that are generated by the measurement setup itself.The second standard is the diffuse white reference with a high diffuse reflection.This is used to determine the spectrum of an approximately optimal reflective object including all attenuation given by the measurement system.

Gathering measurement readings
Multiple reflection measurements are gathered for all different objects in the scene.It is important that the measurements are representative for the objects reflection behavior.So the set of measurements has to include all variations given by the object surfaces.Although having objects with low reflection variation the count of total measurements has to be high enough for using the data within a statistical context.

Compensation and normalization of the measurement readings
After taking the measurement readings of the different objects they have to be compensated in terms of degradation caused by the measurement system.This is done by subtraction of all object and white reference measurements R by the spectrum of the black reference R black : R comp is the compensated spectrum.Further the object measurements has to be normalized.They are divided by the spectrum of the compensated white reference R white,comp resulting in the relative reflection spectra for the objects, called normalized spectra R norm : For all R white,comp (λ) ≤ 0 the normalized spectrum R norm is not valid.

Image quality with respect to segmentation
As written in Section 1 the main task of spectral optimization is to increase the image quality.This includes the increase of the segmentation ability between different objects.If there exist at least two objects (e.g.foreground and background) the segmentation task is the clustering of regions which contain one single object.In literature there exist several image quality measures driven by the need of compression algorithm benchmarking (see Wang (2002) and Eskicioglu (1995) for details).Due to the fact that we are aiming at the segmentation of an image those measures are not suitable in our case.The following sections introduce two measures for image quality with respect to segmentation.

Signal to noise measure
The first measure is based on standard signal to noise measure SNR.
The assumption for the two signals s 1 , s 2 to be separated is that their values are outcomes of normal distributions.
The signal to noise ratio includes the distance between the mean of two signals μ 1 , μ 2 and the 416 Quality Assurance and Management www.intechopen.com In our case the signals include intensity information and hence are energy based signals.It is also common to use the decibel notation: The maximum of the SNR will lead to a maximum of image quality.

Classification error estimation
Another measure for the image quality with respect to segmentation is the classification error including information of the rate between pixels assigned to the wrong object and pixels assigned to the correct object.The estimation of this error requires the probability density for the respective feature (e.g.greyvalue) of the different objects.The total error ε tot for two objects ω 1 , ω 2 with their respective probability density function p 1 , p 2 can be determined by: The first integration term is in the range R ω 1 where the classification decides for ω 1 and for ω 2 in the second integration term.Due to the fact that p 1 and p 2 are unknown they have to be estimated.Two different approaches that are implemented in our analysis software are introduced briefly in the following paragraphs.For further information see (Duda (2001), Scott (1992), Wand (1995)).
The classification error is negative correlated to the image quality.

Parametric density estimation
The parametric density estimation assumes that the probability density can be described by a certain number of parameters.The most commonly used parametric description of a density is the unimodal Gaussian distribution N with its parameters mean μ and variance σ 2 .Given N samples X i the expected mean value can be determined by and the expected unbiased variance value by Using ( 38) and ( 39) the probability density estimation can be expressed as: (40)

Nonparametric density estimation
As written in Section 3.3.2.1 the parametric density estimation is only suitable for unimodal Gaussian distributed signals.To overcome this another approach of density estimation, the nonparametric density estimation, was developed.There exist several types of nonparametric density estimators like histogram, polygonal and kernel density estimators.This section focusses on the kernel density estimators also known as kernel smoothing.The principle of kernel smoothing is a convolution of the sample values with a kernel: This kernel is configured by the type K and bandwidth h.While the type has limited influence on the estimation the bandwidth plays an important role.Different selection methods are common: normal scale bandwidth, oversmoothed bandwidth, least square cross validation bandwidth and plug-in bandwidth.We focus on the least square cross validation (LSCV) bandwidth h LSCV while the LSCV is defined as (Wand (1995)) p−i is the density estimate based on the sample set without X i .The LSCV bandwidth is found by

Simulated data
In this section the spectral analysis is used on simulated data.These contain the simulated behavior of lightsources, objects, optics and cameras.In the next Sections the spectral analysis and the simulated image data using an optimized and a non-optimized configuration are given.

Spectral analysis
The simulated data of the different hardware components and objects are shown in Fig. 18.We simulated two different lightsources (daylight and an LED), two different objects represented by three spectra each, two optics optimized for different wavelength and two cameras with the maximum energy efficiency at 500nm and 670nm respectively.This lead to eight different configurations.The image sensor signals were calculated according to (32).
The parameters describing the intensity value (mean and variance) are determined and the classification errors are estimated for each object as shown in Table 2.It is obvious that the selection of the lightsource plays an important role.The classification error is for the LED approximately constant at 0.03%, while for daylight the error varies from 2.72% to 36.3%.This high variation is impressive regarding the small differences between the spectra of different optics and camera types.As a result the 8th configuration can be regarded as optimal setup while the 5th configuration as worst setup.

Real data
In this section we will show experimental results using spectral optimization of the lightsource only.The objects used within this experiment are shown in Fig. 20 using daylight illumination in combination with a color camera.First the results of the spectral analysis are provided and then the results are verified by using a real hardware setup optimized by these results and a non-optimized setup are compared in terms of image quality for segmentation as described in Section 3.3.

Spectral analysis
The spectral optimization is aiming at the separation of paperboard A from paperboard B and C. As explained in Section 3.2 we take several spectra (20 for each paperboard) and calculate the normalized spectra for each object.These spectra are shown in merged spectra diagrams in

Conclusion
In this Chapter we introduced a method for optimization of hardware component selection based on spectral analysis with respect to image quality.The complete image acquisition chain including lightsource, observed scene, optics, camera and the influence on the resulting image was illustrated.The spectral behavior for different types of all components were provided.Models of the spectral characteristics were derived.This lead to an image output model which describes the sensor output signal depending on the components.
Furtheron a spectral analysis measurement setup and its usage was explained focussing on the diffuse reflection behavior of different objects.Two measures for image quality according to segmentation were introduced afterwards: the first is based on signal to noise ratio and the second uses the estimation of classification error by means of analyzing different density estimators.
experimental results for simulated and real data are provided.The first contains eight different setups of simulated components including lightsources, objects, optics and cameras.All combinations of these components were evaluated and resulted in a big variation of image quality as shown by quality measures and simulated images.For the experiments with real data three different types of paperboards with similar appearances were analyzed and an optimal configuration in terms of lightsources was compared with a non-optimal configuration.The spectral optimization increases image quality significantly.Both experiments proved the advantages of hardware component selection due to its spectral characteristics and the spectral behavior of objects in the observed scene.

Acknowledgement
This work is part of a project which is supported by the European Union, the European Funds for Regional Development (EFRE), the German Federation and the Federal Land Schleswig-Holstein.

Fig
Fig. 9. Lambert law component of light reflection.The model was presented 1975, nearly two hundred years after the publication of Lambert's model.The main aspects of the Phong model are • light sources are point-like • the geometry of the surfaces unless the surface normal is ignored • diffuse and specular reflection are modeled locally • ambient reflection is modeled globally.

Fig. 10 .
Fig. 10.Halfway vector HWhere W(α) is the ratio of reflected light and incident light as function of the incident angle α.Phong determined the range of W(α) in percent, varying from 10 to 80 percent.φ presents the angle between the reflected light R and the vector V (the direction of the viewer).The parameter n describes the characteristics of the surface, Phong used values between one and ten.For a highly reflecting surface the parameters n and W(α) are large.C p is the reflection coefficient of an object at Point P for a certain wavelength.

Fig. 12
Fig. 12 (b)  shows the spectral transmittance of a Schneider Optics Variogon 1.8/12.5-75zoom lens.This lens uses an array of 16 glass elements instead of the six elements used in the Cinegon 1.4/8mm shown above.This transmittance diagram is used as an example of a more complex photographic lens, that has not been optimized for a greater transmission bandwidth.In comparison it can be seen, that the peak transmittance is about 15% lower than that of the simpler lens design.Also the transmittance has a smaller bandwith, with lower transmittance values below 450nm or above 600nm.

Fig. 16 .
Fig. 16.Blockdiagram of the measurement setup 3.1.2Lightsource to lightguide coupling element One important challenge of designing a spectral measurement setup is the coupling of the lightsource to the lightguide without loosing too much light intensity.The output of the XE

Fig. 18 .
Fig. 18.Merged spectra of two spectra describing different hardware components: lightsources (A), objects (B), optics (C), and cameras (D)4.1.2Simulated image dataUsing the estimated greyvalue distributions of Section 4.1.1two images are calculated and shown in Fig.19.It is obvious that the 8th hardware configuration results in higher contrast image (Fig.19 (A)) than the 5th hardware configuration (Fig.19 (B)).The SNR according to (36) is 5dB for the optimized setup and −50dB for the worst setup.

Fig. 21 .
All diagrams show similar reflection behavior with just small variances within one object as shown in Fig.21(A), (B), and (C).The diagram showing the mean spectra in Fig.21 (D) illustrates only little differences between A and B, C in wavelength ranges from 350nm to 450nm and from 550nm to 600nm.This is confirmed by the classification error estimated parametric (see Fig.22 (A)) and nonparametric (see Fig.22 (B)) which show small classification error rates for those wavelength ranges.Low classification error rates indicate that the hardware component selection optimized for this wavelength ranges would be appropriate in order to achieve high image quality for segmentation.

Table 1 .
). Transmission range and further features of different glass materials

Table 2 .
Classification error for different hardware configurations

Table 3 .
SNR of the different configurations

Table 4 .
Statistical parameters for different hardware configurations