11
Analysis of compatibility between lighting devices and descriptive features using Parzen’s kernel: application to flaw inspection by artificial vision Pierre Geveaux Sophie Kohler, MEMBER SPIE Universite de Bourgogne Laboratoire Le2i IUT Le Creusot 71200 Le Creusot, France Johel Miteran Universite de Bourgogne Laboratoire Le2i Aile des Sciences de I’Ingenieur BP 400 21011 Dijon Cedex, France Frederic Truchetet, MEMBER SPIE Universite de Bourgogne Laboratoire Le2i IUT Le Creusot 71200 Le Creusot, France Abstract. We present a supervised method, developed for industrial in- spections by artificial vision, to obtain an adapted combination of de- scriptive features and a lighting device. This method must be imple- mented under real-time constraints and therefore a minimal number of features must be selected. The method is based on the assessment of the discrimination power of many descriptive features. The objective is to select the combination of descriptive features and lighting system best able to discriminate flawed classes from defect-free classes. In the first step, probability densities are computed for flawed and defect-free classes and for each tested combination. The discrimination power of the features can be measured using the computed probability of error. In the second step, we obtain a combination that gives a low probability of errors. This leads us to choose each feature individually and then build a multidimensional decision space. A concrete application of this method is presented on an industrial problem of flaw detection by artificial vision. The results are compared with those given by classical multiple discrimi- nant analysis (MDA) to justify the use of our method. © 2000 Society of Photo-Optical Instrumentation Engineers. [S0091-3286(00)00412-8] Subject terms: flaw detection; Parzen’s kernel; lighting device; feature selection; artificial vision. Paper 990381 received Sep. 24, 1999; revised manuscript received Feb. 25, 2000 and July 6, 2000; accepted for publication July 7, 2000. 1 Introduction Quality control by artificial vision is widely used in several fields, especially in industrial control. The classical scheme of a vision control system consists of several steps and it can be described as follows. 1,2 The first step, termed acqui- sition, includes illumination, 3,4 cameras and settings, 5,6 po- sitions of parts under inspection, etc. This step provides a signal that is usually a 2-D image, a 3-D image, or a se- quence of images. The second step, termed processing, is a computation phase. The purpose is to improve the image quality ~pre- processing! and/or to select specific information ~descrip- tive features! used in the next step. In 2-D image process- ing, descriptive features are generally computed in the neighborhood of a pixel and provide information such as the local mean of luminance, local repartition of luminance, local edges, etc. The classification step sorts out the infor- mation in terms of quality control. For instance, if the lu- minance of a pixel is representative of a type of flaw, the use of a threshold on the luminance could be considered as a classification scheme. The classification leads to the final decision about the quality of the object examined. The efficiency of the deci- sion depends strongly on the previous steps. One optimiza- tion scheme improves each step independently, leading to a good-quality control system. An alternative is to use a more global view of the system. The method presented in this paper seeks to improve both the acquisition step and the process step jointly. Our supervised method was developed to compare the discriminating power of combinations of descriptive fea- tures and lighting devices, and it yields a combination that is appropriate for flaw detection. The method and the clas- sical principal component analysis 2,7 ~PCA! do not provide similar information. The object of PCA is to find a lowest dimensional representation that accounts for the variance of features. However, each axis of the new space is a linear combination of the most significant features. As a result, the number of features to be computed does not necessarily decrease. Another approach similar to PCA is multiple dis- criminant analysis 2,7–10 ~MDA!. The object of MDA is to find the lowest dimensional representation that accounts for the correlations among features. The MDA method finds the new feature space that maximizes the interclass vari- ances and minimizes the intraclass variances. To emphasize the differences between the two approaches, our method is compared to MDA at the end of this paper. This study is based on an application of quality control by artificial vision on textured industrial parts. The parts are cylindrical ~height58 mm, diameter52 mm! and the sys- tem must inspect their circular top, which presents a granu- lar texture ~Fig. 1!. 3165 Opt. Eng. 39(12) 31653175 (December 2000) 0091-3286/2000/$15.00 © 2000 Society of Photo-Optical Instrumentation Engineers

Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

Analysis of compatibility between lightingdevices and descriptive features usingParzen’s kernel: application to flaw inspectionby artificial vision

Pierre GeveauxSophie Kohler, MEMBER SPIEUniversite de BourgogneLaboratoire Le2iIUT Le Creusot71200 Le Creusot, France

Johel MiteranUniversite de BourgogneLaboratoire Le2iAile des Sciences de I’IngenieurBP 40021011 Dijon Cedex, France

Frederic Truchetet, MEMBER SPIEUniversite de BourgogneLaboratoire Le2iIUT Le Creusot71200 Le Creusot, France

Abstract. We present a supervised method, developed for industrial in-spections by artificial vision, to obtain an adapted combination of de-scriptive features and a lighting device. This method must be imple-mented under real-time constraints and therefore a minimal number offeatures must be selected. The method is based on the assessment ofthe discrimination power of many descriptive features. The objective is toselect the combination of descriptive features and lighting system bestable to discriminate flawed classes from defect-free classes. In the firststep, probability densities are computed for flawed and defect-freeclasses and for each tested combination. The discrimination power of thefeatures can be measured using the computed probability of error. In thesecond step, we obtain a combination that gives a low probability oferrors. This leads us to choose each feature individually and then build amultidimensional decision space. A concrete application of this methodis presented on an industrial problem of flaw detection by artificial vision.The results are compared with those given by classical multiple discrimi-nant analysis (MDA) to justify the use of our method. © 2000 Society ofPhoto-Optical Instrumentation Engineers. [S0091-3286(00)00412-8]

Subject terms: flaw detection; Parzen’s kernel; lighting device; feature selection;artificial vision.

Paper 990381 received Sep. 24, 1999; revised manuscript received Feb. 25,2000 and July 6, 2000; accepted for publication July 7, 2000.

almed ii-

s ase-

tio

s-theas

ce,foru-hed a

theci-izato

ore

histhe

thea-hatas-

ste ofear

ult,arilyis-

fordsari-sized is

rolre

nu-

1 Introduction

Quality control by artificial vision is widely used in severfields, especially in industrial control. The classical scheof a vision control system consists of several steps ancan be described as follows.1,2 The first step, termed acqusition, includes illumination,3,4 cameras and settings,5,6 po-sitions of parts under inspection, etc. This step providesignal that is usually a 2-D image, a 3-D image, or aquence of images.

The second step, termed processing, is a computaphase. The purpose is to improve the image quality~pre-processing! and/or to select specific information~descrip-tive features! used in the next step. In 2-D image procesing, descriptive features are generally computed inneighborhood of a pixel and provide information suchthe local mean of luminance, local repartition of luminanlocal edges, etc. The classification step sorts out the inmation in terms of quality control. For instance, if the lminance of a pixel is representative of a type of flaw, tuse of a threshold on the luminance could be considerea classification scheme.

The classification leads to the final decision aboutquality of the object examined. The efficiency of the desion depends strongly on the previous steps. One optimtion scheme improves each step independently, leadinggood-quality control system. An alternative is to use a m

Opt. Eng. 39(12) 3165–3175 (December 2000) 0091-3286/2000/$15.00

t

n

-

s

-a

global view of the system. The method presented in tpaper seeks to improve both the acquisition step andprocess step jointly.

Our supervised method was developed to comparediscriminating power of combinations of descriptive fetures and lighting devices, and it yields a combination tis appropriate for flaw detection. The method and the clsical principal component analysis2,7 ~PCA! do not providesimilar information. The object of PCA is to find a lowedimensional representation that accounts for the variancfeatures. However, each axis of the new space is a lincombination of the most significant features. As a resthe number of features to be computed does not necessdecrease. Another approach similar to PCA is multiple dcriminant analysis2,7–10 ~MDA !. The object of MDA is tofind the lowest dimensional representation that accountsthe correlations among features. The MDA method finthe new feature space that maximizes the interclass vances and minimizes the intraclass variances. To emphathe differences between the two approaches, our methocompared to MDA at the end of this paper.

This study is based on an application of quality contby artificial vision on textured industrial parts. The parts acylindrical ~height58 mm, diameter52 mm! and the sys-tem must inspect their circular top, which presents a gralar texture~Fig. 1!.

3165© 2000 Society of Photo-Optical Instrumentation Engineers

Page 2: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

pss.hav

he

e-atinnd

her-ncn.

wivem

tionra-

ndartheata

lsom-ad-

over-ess ofn arix

ioning

per-

wedingb-is

hethe

ers.esti-s.

Geveaux et al.: Analysis of compatibility between lighting devices . . .

Four types of flaws are present in the samples: bumsmooth surfaces, lacks of material, and hollow surface11

The system must detect flaws but does not necessarilyto classify them.

The first part of our method consists of defining tdifferent areas to be distinguished~flaws and defect-freeareas! and choosing descriptive features and lighting dvices. Then a computation step assesses the discriminpower of each combination of descriptive features alighting system and enables their comparison. Otinvestigations7,10,12 have dealt with the choice of descriptive features. They are often based on interclass distamaximization and intraclass dispersion minimizatioThese are well-established procedures~e.g., PCA, MDA,etc.!. Figure 2 presents two projections of the different flaclasses in our industrial problem on different descriptfeature spaces. We can see that certain distributions seebe multimodal~lacks of material, for example!. In this case,

Fig. 1 Top of a part to be inspected.

3166 Optical Engineering, Vol. 39 No. 12, December 2000

,

e

g

e

to

we could not apply those methods based on maximizaof the interclass dispersions and minimization of the intclass dispersions without a bias.

The first part of this paper describes the method aprovides a justification for our approach. The second pillustrates results obtained with our method. Finally, tMDA method is compared to our method using the dderived from the same industrial application.

2 Description of the Method

In industrial applications with artificial vision, it is oftenimportant to choose an adapted lighting system. It is aimportant to minimize the number of features to be coputed, especially under severe real-time constraints. Wedress these issues by proposing a method based on anestimation of the minimal error rate according to Bayrules in the feature space. This feature space consistdescriptive features used for the classification step icomplete system for flaw detection. Unlike the cost mattheory,13 or the methods of Celeux and Lechevallier14 orDeogun et al.,15 this description space enables the selectof a set of appropriate descriptive features without takinto account any classifier.

2.1 Overall Description

The principle of our method is to find an acceptable uplimit of the probability of error obtained with a given feature set between the defect-free class and the flaclasses. This limit is then used to evaluate discriminatproperties of this set for flaw detection. Note that the proability of error obtained with the complete feature setlinked to the probability of error obtained between tdefect-free class and each flawed class resulting fromuse of each descriptive feature, indepently of the othFigure 3 presents a diagram of the procedure used tomate the upper limit of errors for several lighting system

In fact, the minimum probability of errorE12 is given byBayes decision theory and can be expressed2,16 in a two-

Fig. 2 Projection of samples on 2-D spaces where the mean of luminance (838) and the mean ofRobert’s gradient (838) are on the left and the median of luminance (838) and contrast (838) areon the right.

Page 3: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

Geveaux et al.: Analysis of compatibility between lighting devices . . .

Fig. 3 Diagram of the procedure used for lighting devices and descriptive features selection.

ssesini-tive

class case~C1 andC2! with a description spaceD:

E125Pr~C1! Pr~xPR2uC1!1Pr~C2! Pr~xPR1uC2!,

5ER2

Pr~C1! f 1~x! dx1ER1

Pr~C2! f 2~x! dx, ~1!

wherex is a random variable vector ofX; X is the base ofD composed ofn vectors describing the values ofn descrip-tive features,X5$X1 , . . . ,Xn%; Pr(Ci) is the a prioriprobability of classCi ; f i is the probability density func-tion of classCi in D; Ri is the set of vectorsx such asPr(Ci) f i(x) is maximum ~Bayes decision rule!; and Ri

5$xPD/Pr(Ci) f i(x)5 maxjP$1,2%

Pr(Cj ) f j (x)% ~see Fig. 4!.

The second equality of Eq.~1! can be expressed as

E125ER2

minj P$1,2%

@Pr~Cj ! f j~x!# dx

1ER1

minj P$1,2%

@Pr~Cj ! f j~x!# dx,

5ED

minj P$1,2%

@Pr~Cj ! f j~x!# dx. ~2!

According to the conditional density,17 Eq. ~3! is valid forany probability densityf on D:

Fig. 4 Description of the probability error.

;kPN1, k<n f~x!5 f ~ xk /xk!•ED

f ~xk ,xk!dxk , ~3!

where x is a random variable vector ofX; xk is the kthrandom variable ofx associated with the descriptivekthfeature: xk is the complementary set$xj% j Þk of xk on x;*Df (xk ,xk!dxk is the marginal density off, which is a func-tion of xk and is referred to asf k(x); and f ( xk /xk) is theconditional densityf of xk , given xk . Note f ( xk /xk) is aprobability density and verifies

;kPN1, k<n f~ xk /xk!<1. ~4!

Equations~3! and ~4! lead to

;kPN1, k<n f~x!< f k~x!⇔ f ~x!<mink

f k~x!. ~5!

Equation~5! ensures that a probability density functionffor a given random variable vectorx is equal to or less thanthe minimum of its marginal densities.

Using the preceding result, Eq.~2! and the fact thatapriori probabilities are positive, we obtain

;kPN1, k<n E12<ED

minj P$1,2%

@Pr~Cj ! f jk~x!# dx. ~6!

We introduce the following notation:

E12k 5E min

j P$1,2%

@Pr~Cj ! f jk~x!# dx,

whereE12k is the error obtained between two classesC1 and

C2 for the descriptive featurexk . Consequently, Eq.~6!becomes

;kPN1, k<n E12<E12k ⇔E12<min

kE12

k . ~7!

These results show that the error made between two claon each descriptive feature is equal to or less than the mmum of the error obtained on each class on each descripfeature.

3167Optical Engineering, Vol. 39 No. 12, December 2000

Page 4: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

to

an

to

e,b

res

en

diveata

ofep-ted

ereas

asethe

edges.udy.

free

. Adge

-on

ss.n-

tion

Geveaux et al.: Analysis of compatibility between lighting devices . . .

In our case, the first class, termedCn , represents thedefect-free class, and the second oneCf regroups allq flawclasses, withq, the number of flaw classes being equal(Nc21). HereCf ,i is defined as thei th flaw class, andAn f ,i is defined as the set of conditions which induceserror betweenCn andCf ,i . ThusAn f ,i verifies

En f ,i5Pr~An f ,i !. ~8!

The error betweenCn andCf is obtained with

En f5Pr~An f!5PrS øi 51

q

An f ,i D . ~9!

The formula demonstrated in the Appendix is appliedEq. ~9! to obtain the following relation:

En f<(i 51

q

En f ,i . ~10!

Finally, using Eqs.~7! and ~10!, an upper limit of theEn f error is given by the relation

En f<(i 51

q

mink

En f ,ik . ~11!

Equation~11! indicates that, in a given description spacthe error between defect-free and flawed classes canoverestimated by the sum of minimum errors on featuover all flaw classes.

Marginal densities are computed on a set ofa priorifeatures for a set of parts and for each lighting device. Th

Fig. 5 Images of parts with bumps.

Fig. 6 Images of parts with smooth surfaces.

3168 Optical Engineering, Vol. 39 No. 12, December 2000

e

the overestimation of errorEn f is used to choose a goolighting system and an appropriate subset of descriptfeatures. Section 3 describes the interpretation of the dobtained.

2.2 Learning Phase

2.2.1 Flaw definition

The first point in this method is to work on a large setparts with and without representative flaws. Images of rresentative flaws of our industrial application are presenin Figs. 5–8.

After selecting typical examples of flawed parts, somareas must be defined on the resulting images. These aare classified into flawed zones~four categories of flawedzones! and defect-free zones, as shown in Fig. 9. In the cof Fig. 9, the flawed zone is the smooth area whereasdefect-free zone is the textured area.

This step of definition is important because the flawand defect-free areas are located on the learning imaThese areas will later be used as references in the stFor the industrial application, 80 parts were chosen~16parts for each flawed class and 16 parts for the defect-class!.

2.2.2 Definition of descriptive features

This step is the most critical one in the learning phaseselection of features must be made based on the knowleand the appearance of flaws.12,18 To have a good description of image regions, preferred features are definedsliding local windows as they are in a convolution proce

In our industrial application, for instance, the local cotrast@Eq. ~12!# and the local mean of Robert’s gradient@Eq.~13!# seem to be interesting features for the characteriza

Fig. 7 Images of parts with lacks of material.

Fig. 8 Images of parts with hollow surfaces.

Page 5: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

sent

en

en-.

ps.

anur-

n-is

as

Geveaux et al.: Analysis of compatibility between lighting devices . . .

of smooth surfaces~Figs. 10 and 11!. Indeed, compared toa smooth surface~flawed zone!, the defect-free areapresent a very different contrast and a different gradidensity. The local contrastC( i , j ) in an n3m neighbor-hood of pixelsA( i , j ) can be expressed as follows:

C~ i , j !5Amax2Amin

Amax1Amin, ~12!

with

Amax5maxH A~ i 1k, j 1 l !,2 bn21

2 c<k< bn2c,2 bm21

2 c< l< bm2 c J ,

Fig. 9 Selection of flawed zones and defect-free zones.

Fig. 10 Image of the local contrast (12312 neighborhood) per-formed on Fig. 9.

Amin5minH A~ i 1k, j 1 l !,2 bn21

2 c<k< bn2c,2 bm21

2 c< l< bm2 c J ,

and wherebxc refers to the integer part ofx ~floor operator!.The local mean of Robert’s gradientG( i , j ) in an n

3m neighborhood of pixelsA( i , j ) can be written as

G~ i , j !51

mn (k5p~n!

q~n!

(l 5p~m!

q~m!

g~ i 1k, j 1 l !, ~13!

with p(n)52 bn21/2c, q(n)5 bn/2c, and whereg( i , j ) isthe Robert’s gradient norm of the pixelA( i , j ).

In our description, 15 descriptive features were chosand computed in the 838, 12312, and 16316 neighbor-hoods of pixels to bring out the four types of flaws.

These features were chosen for various reasons:

1. The local mean of pixel luminance seems to be ssitive to flaws such as lacks of material or bumps

2. The median value of pixel luminance11 seems to besensitive to flaws such as lacks of material or bum

3. The local mean of Robert’s gradient representsedge density and therefore is sensitive to smooth sfaces.

4. The local entropy is sensitive to local disorder, eabling us to quantify the texture. Local entropydefined as follows:

e~i,j!5(g

pvij~g! ln @pvij

~g!#, ~14!

where v i j is the neighborhood of the pixelA( i , j )under consideration,g is a gray level, andpv(g) isthe probability of gray levelg in the neighborhoodv.

5. The local contrast is sensitive to flaws suchsmooth surfaces.

Fig. 11 Image of the local mean of the Robert’s gradient (12312neighborhood) performed on Fig. 9.

3169Optical Engineering, Vol. 39 No. 12, December 2000

Page 6: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

sem-

ofse

t aea-set

,a-

nce

teddingine

ob-ct-es

neurestedamtheconen-onata

ity

l.n-ial

ede

e

the

utedts

Geveaux et al.: Analysis of compatibility between lighting devices . . .

The size of the neigborhood is a multiple of 4 becaucomputations of features are optimized on a 32 bits coputer and pixels of images are one byte in depth.

To simplify the description in this paper, the numberselected features was reduced to 15, while the completeof selected features in the industrial application is abouhundred. With the complete set, the description of all ftures represent a lot of work. In fact, this completeconsists of simple morphological calculations~erosion, di-latation, opening, closing, etc.!, as well as calculationsbased on histogram repartitions~max-min filters, momentsetc.!. The restriction of this analysis to a subset of 15 fetures, however, does not diminish in any way the relevaof the method.

2.3 Calculation Phase

This step must be performed on each lighting device tesThe set of descriptive features was defined in the precestep. Therefore, images of representative parts obtawith one lighting device are tested with this set.

The calculation phase consists in estimating the prability of error between each class of flaws and the defefree class for each descriptive feature. To estimate therrors, three steps are achieved.

2.3.1 Random sampling

A sample is drawn randomly from pixels of each class zodefined in the learning phase. Then the descriptive featvalues obtained from the selected pixels and with the telighting device are stored. The purpose of the random spling is to reduce the amount of data. The size ofsample is proportional to the surface area of the zonessidered. In our industrial application and for each represtative part, 1000 samples are drawn from zones with a cstant surface of 2000 pixels. This leads to 80,000 dpoints represented in a 15-D feature space~16,000 samplesper class!.

2.3.2 Estimation of probability densities

The probability density function of each classj is estimatedbased on these data points for each featurexk . These den-sities are estimated using Parzen’s kernel,7,19 which is com-monly used to estimate the underlying probability densfunction of a data set. It can be described as follows:

f jk~x!5(

i 51

nj F~xk2xki /h!

njhd , ~15!

where

nj 5 number of samples in classj

h 5 Parzen coefficient~the larger the valueh, thestronger the smoothing effect!

d 5 dimension of the feature space~in this cased51!

xki

5 value of thekth feature on samplei

F 5 Parzen’s kernel, which verifies.

3170 Optical Engineering, Vol. 39 No. 12, December 2000

t

.

d

e

s

-

-

-

E2`

1`

F~u! du51, ~16!

and;uPR, F(u)>0. For example, in a monodimensionaspace this function can be the one presented in Fig. 12

Figure 13 represents an example of two probability desities obtained with Parzen’s kernel on lacks of materand defect-free areas.

The parameterh depends on the number of samples usfor the estimation.2,7,19 To ensure the convergence of thestimate, Fukunaga19 suggests choosing

h~nj !}nj2a/d 0,a,1. ~17!

The conditions imposed ona ensure the convergence of thestimate. If Eq.~17! is verified and if two probability den-sities f 1 and f 2 have to be estimated withn1 andn2 numberof samples, the ratio betweenh1 and h2 must verify therelation

h1

h25S n2

n1D a/d

. ~18!

In our application, each class is estimated usingsame number of samples. As a result, coefficienth is con-stant for each class. Furthermore, each feature is compwith a 1-byte depth per pixel due to real time constrain

Fig. 12 Example of Parzen’s function.

Fig. 13 Example of probability densities obtained with Parzen’sfunction of Fig. 12 with h53 on lacks of material and defect-freeclasses.

Page 7: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

reter

ed

ro-

ap-

disthe

the

e

w

stryn

tionto

ue-

ht-

ar

es.

f,

resst

aw.

h as-ig.the

the

tricac-f aas

se

re-rror

nggen-Sec.and

in

sA,

m

Geveaux et al.: Analysis of compatibility between lighting devices . . .

and computation simplifications. Feature values are discvalues in the@0, 255# range. The choice of a high value foh would lead to significant smoothing of the estimatprobability density. In our application, several tests onhlead to the value of 3, which represents a good compmise. Some research16,20,21dealing with the choice of thiscoefficient can help for a rational choice in numerousplications.

2.3.3 Calculation of errors Enf,ik

Based on the second equality of Eq.~2!, En f ,ik errors are the

sums of the minimum of Pr(Cn) f nk(x) and Pr(Cf ,i) f f ,i

k (x)on the description space. Since the description space iscrete, errors are calculated with discrete sums usingestimations of the probability densities determined inprevious step.

Eacha priori probability was computed according to thrate of flaws observed on the production line. Thea prioriprobability of defect-free class@Pr(Cn)# is about 0.96 andthe probability of the flaw class is about 0.04. The flaclasses@Pr(Cf ,i)# are assumeda priori to be equally likelybecause no precise information is available in the induconcerned by this study. Then, for four flaw classes, aapriori probability of 0.01 is assumed.

2.4 Choice of Lighting and Features

After computing all of theEn f , jk errors for all illuminations

tested, lighting systems comparison and feature selecare possible. The choice of the lighting system is easyperform. The lighting system that gives the minimum valfor Cr5( i 51

q minkEnf,i

k is selected. According to this crite

rion Cr, the chosen illumination is not necessarily the liging system which gives the smallestEn f error, but it en-sures an error that is less than Cr.

To choose the features, the subset of features whichinvolved in criterion Cr is defined. This subsetS1 of fea-tures can be described as

S15$XjPX/' i P$1, . . . ,q%, j 5argmink

En f ,ik %. ~19!

This leads to a choice of very efficient descriptive featurA priori probability min@Pr(Cf ,i),Pr(Cn)# is the upper

limit of En f ,ik @Eq. ~2!#. Obviously, if there is one class o

flaw i where minkEnf,i

k is an important value, for example

20% of its upper limit, it means that the selected featuare not efficient enough to bring out this flaw. One muselect other suitable features for the detection of this flThese selections are illustrated in the next section.

3 Concrete Example

This section highlights an application of the method.

3.1 Compared Lighting Systems

Figures 14 and 15 show images of the same part witsmooth surface obtained with two different lighting sytems. The description of these illuminations is given in F16. The camera, the lens, and the relative positions ofparts remain unchanged in both acquisitions. Only

-

e

lighting systems are different. The adjustment of geomeand photometric parameters is done manually to obtainceptable images of parts. Lighting system A consists ocircular fluorescent tube of 180 mm in diameter, wherelighting system B consists of high-luminosity LEDs. TheLEDs are set around an 80-mm-diam ring.

3.2 Results

Application of the described method yielded the results psented in Tables 1 and 2. The two tables describe the eEn f ,i

k (3104) computed on the four classes of flaws usi15 features for each lighting systems. These results areerated using 80,000 samples obtained, as described in2.3. In both tables, the columns represent flaw classesthe rows represent descriptive features~described in Sec.2.2.2!. The smallest value in each column is highlighteditalics. In a given columni, the value indicated in italics isthe minimum ofEn f ,i

k for the set of features. Criterion Cr ithe sum of all italics across columns. For lighting deviceCr is equal to 188.331024. For lighting device B, Cr isequal to 5.931024. These values ensure that the maximu

Fig. 14 Image obtained with illumination A.

Fig. 15 Image obtained with illumination B.

3171Optical Engineering, Vol. 39 No. 12, December 2000

Page 8: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

Geveaux et al.: Analysis of compatibility between lighting devices . . .

3172 Optical Engi

Fig. 16 Comparative description of the two lighting systems.

swe

ics.d

(12

lect aisnts

henceari-

of En f error obtained with lighting system B is 32 timelower than that obtained with lighting system A. Hence,select lighting system B.

The choice of features lays with subsetS1 . This set ismade of the features that match the rows displaying italIt follows that, for lighting system B, the set of selectefeatures is composed of the local mean of luminance312), the local mean of Robert’s gradient (12312), andthe local contrast (12312).

3.3 Comparison with feature selection obtained withMDA

To compare our results with other classical feature setion methods, MDA was performed on the same data sethat obtained with lighting system B. The object of MDAto find the lowest dimensional representation that accou

neering, Vol. 39 No. 12, December 2000

-s

for correlations existing between features. MDA finds tnew feature space that maximizes the interclass variaand minimizes the intraclass variance. The interclass vance matrixB is commonly defined by Eq.~20!.

B51

n (i 51

Nc

ni~ xi2 x! t~ xi2 x!. ~20!

The total variance matrixT is given by

T51

n (i 51

n

~xi2 x! t~xi2 x!, ~21!

wherexj is the feature vector of a samplei, xk is the vectorof features means of samples belonging to classCk , x is

Table 1 Values of Enf,ik 3104 obtained with lighting system A.

Parameters/Flaws BumpsSmoothSurfaces

Lacksof Material

Hollow KnockedSurfaces

Mean of luminance (838) 60.6 100 32.8 79

Mean of Robert’s gradient (838) 99.9 59.1 91.4 95.4

Contrast (838) 99.8 48.4 60 96

Median of luminance (838) 62 100 28.3 78.8

Entropy (838) 99.4 44.6 87.4 96.7

Mean of luminance (12312) 73.5 98 41.4 78.9

Mean of Robert’s gradient (12312) 99.8 45.5 87.6 92

Contrast (12312) 99.7 35.2 44.3 91.5

Median of luminance (12312) 75.9 100 33.2 80.5

Entropy (12312) 88.8 27 70.4 92.7

Mean of luminance (16316) 96.8 100 46.9 86

Mean of Robert’s gradient (16316) 99.6 37.5 84.6 88

Contrast (16316) 99.8 31.8 45.9 90.7

Median of luminance (16316) 97.8 100 39.1 88.4

Entropy (16316) 61.8 20.6 59.2 89.7

Page 9: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

Geveaux et al.: Analysis of compatibility between lighting devices . . .

Table 2 Values of Enf,jk 3104 obtained with lighting system B.

Parameters/Flaws BumpsSmoothSurfaces

Lacksof Material

HollowKnocked surfaces

Mean of luminance (838) 4 99.9 19.1 42.1

Mean of Robert’s gradient (838) 62 2.9 49.6 94.3

Contrast (838) 67.5 7.2 4.2 76.4

Median of luminance (838) 6.5 100 16.0 49.2

Entropy (838) 88.1 4.9 73.8 98.2

Mean of luminance (12312) 0.00 97.6 10.2 5.9

Mean of Robert’s gradient (12312) 50.6 0.00 43.9 79.8

Contrast (12312) 80.7 3.6 0.00 70.2

Median of luminance (12312) 0.2 99.4 8.4 14.7

Entropy (12312) 90.6 1.5 59.3 95.5

Mean of luminance (16316) 0.03 93.2 1.8 14.9

Mean of Robert’s gradient (16316) 42.2 0.2 35.4 60.3

Contrast (16316) 87.1 5.2 0.08 65.3

Median of luminance (16316) 0.5 95.8 3 20.5

Entropy (16316) 75.9 2.3 48 85.9

al-d

-ch

ri-s an

her

the

to

on

on

s inture

-im-as

st

ourres

al

r-

the vector of means of each feature,n is the total number ofsamples,nk is the number of samples of the classCk , andNc is the number of classes. With the constraint of normization of theT matrix, the new optimized space is defineby the base of eigenvectorsui of the matrixT21B:

T21Bui5l iui . ~22!

MDA is suitable for unimodal distributions. The information provided by MDA is relative to the importance of eafeature in the new features space.

MDA is used only for feature selection. Indeed, vaances of classes are functions of the lighting system. Aresult, MDA does not provide comparable informatiowhen using different lighting systems. According to tMDA, the rank of theT21B matrix depends on the numbeof classes Nc and is equal to (Nc21). Two classes aretaken into consideration: the defect-free class andflawed class~regrouping allq flawed classes!. This choiceenables the comparison with our criterion Cr. This leadsthe case of Fisher’s linear discriminant2 and the rank ofT21B matrix equals 1. Thus, only one eigenvalue (l1) isnot null. This value is representative of the discriminatipower of the vectoru15 t(u1

l , . . .u1k , . . . ,u1

n). The eigen-valuel1 is in the@0, 1# range. Then, ifl151, the discrimi-nation of classes is perfect. Ifl150, a discrimination axiscannot be found.

To illustrate the relative importance of each featurethe discriminant axis, Table 3 presents the valueAl1u1

k

associated with each featurexk . The third column of Table3 ranks the features on the obtained discrimination axidescending order of importance. The importance of feaxk on vectoru1 is given by the absolute value ofAl1u1

k .The value obtained forl1 is about 0.67. The discrimi

nation power of the combination does not seem veryportant in the present case. Features may be selected b

ed

on the order of importance obtained with MDA. If the firthree features are selected@mean of Robert’s Gradient (12312), mean of luminance (12312), and entropy (12312), the results seems to be closed to those ofmethod. The Cr criterion obtained with these three featuis about 16.131024. But the contrast (12312) ~selectedwith our method and very efficient for lacks of matericlass! is only ranked in the 10th position.

To see the evolution of the information provided by odered features of vectoru1 , the value( j 51

k uAl1u1ku of thek

Table 3 Results provided with MDA on lighting system B data forfeature selection.

Features/Al1u1k Al1u13102

DecreasingOrder of

Importance

Mean of Robert’s gradient (12312) 45.8 1

Mean of luminance (12312) 245.6 2

Entropy (12312) 27.8 3

Entropy (838) 20.1 4

Entropy (16316) 218.4 5

Mean of Robert’s gradient (16316) 216.7 6

Mean of luminance (16316) 16.3 7

Median of luminance (16316) 15.6 8

Mean of luminance (838) 210 9

Contrast (16316) 28.3 10

Contrast (838) 25.2 11

Mean of Robert’s gradient (838) 25.12 12

Contrast (12312) 24.4 13

Median of luminance (838) 2.6 14

Median of luminance (12312) 0.6 15

3173Optical Engineering, Vol. 39 No. 12, December 2000

Page 10: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

asred

d,toresou

temin-heby

einlyl-

s,ofA,

ndremse-

es.ul-

oter-r-edseial

rd

ndy

a-

s

‘‘Aect

a-l

a-r-

mes,

Geveaux et al.: Analysis of compatibility between lighting devices . . .

first ordered features is plotted in Fig. 17. It is calculateda percentage of the total sum obtained over all ordefeatures. This value is referred to as(. To reach a goodefficiency ~e.g., 90%!, the first 10 features are selectewhich is a very important number of features accordingour application. Indeed, the calculation of these 10 featuwould not respect the real time constraints, whereasmethod leads to the choice of 3 features.

4 Conclusions

We have proposed a supervised method for lighting sysand descriptive feature selection. When applied to ourdustrial application, this method yields good results. Tchoice of features obtained is close to the results giventhe frequently used MDA. If no discriminant descriptivfeatures were tested, however, this method would certagive worse results than MDA. If fact, the reduction of mutidimensional data to monodimensional data~features areanalyzed independently! could not be used. In most casehowever, this method can greatly reduce the numberselected features that must be calculated, unlike MDwhich gives a linear combination of original features areduces only the description space dimension. In otherspects, this method is independent of classifier algorithand is based on an estimation of probability of error indpendently of the shape of the probability density curvThus, it can be used with classes with an underlying mtimodal probability density function. This method is noptimal, but the results provided are closely linked to pformance in terms of error probability. This is often inteesting for industrial applications. Note that the proposmethod can be used in a similar manner to select and asall of the parameters of the acquisition stage in artificvision systems.

5 Appendix

Let V be a sample space and$Ai% l 5 i 5qq subsets ofV. Aproof for Eq.~23! is given next.

PrS øi 51

q

Ai D<(i 51

q

Pr~Ai !. ~23!

Proof: first, Pr(ø i 51q Ai) can be written as follows:

Fig. 17 Cumulated sum of Al1u1k for ordered features in percent.

3174 Optical Engineering, Vol. 39 No. 12, December 2000

r

-

ss

PrS øi 51

q

Ai D 5(i 51

q

Pr~Ai !2(j 52

q

PrFAjùS øk51

j 21

AkD G . ~24!

Equation~24! is verified forq52:

Pr~A1øA2!5Pr~A1!1Pr~A2!2Pr~A1ùA2!. ~25!

This is the well-known law of additive probabilities.Let us assume that this relation is true forq5n21:

PrS øi 51

n21

Ai D 5 (i 51

n21

Pr~Ai !2 (j 52

n21

PrFAjùS øk51

j 21

AkD G . ~26!

Let us show that it is true forq5n:

PrS øi 51

n

Ai D 5PrF S øi 51

n21

Aj D øAnG5PrS ø

i 51

n21

Ai D 1Pr~An!2PrFAnùS øi 51

n21

Ai D G .

With Eq. ~26!, this leads to

PrS øi 51

n

Ai D 5 (i 51

n21

Pr~Ai !1Pr~An!

2 (j 52

n21

PrFAjùS øk51

j 21

AkD G2PrFAnùS ø

i 51

n21

Ai D G5(

i 51

n

Pr~Ai !2(j 52

n

PrFAjùS øk51

j 21

AkD G . ~27!

Q.E.D.Since the probabilities are positive it is straightforwa

to obtain Eq.~23! from Eq. ~24!.

Acknowledgments

This research was co-financed by the Region of BurguCouncil, France.

References

1. D. Aluze, C. Coulot, F. Meriaudeau, P. Gorria, and C. Dumont, ‘‘Mchine vision for the control of reflecting non plane surfaces,’’Proc.SPIE3205, 180–186~1997!.

2. R. O. Duda and P. E. Hart,Pattern Classification and Scene Analysi,Wiley, New York ~1973!.

3. P. Geveaux, J. Miteran, S. Kohler, F. Truchetet, and E. Renier,lighting characterization by a reliable method: application to defdetection by artificial vision in industrial field,’’Proc. IEEE-IECON3, 1699–1702~1998!.

4. B. G. Batchelor,Automated Visual Inspection, Ifs, Bedford~1985!.5. C. Coulot, S. Hemmerlin-Kohler, C. Dumont, D. Aluze, and B. L

malle, ‘‘Lighting study for an optimal defect detection by artificiavision,’’ Proc. SPIE3029, 69–77~1997!.

6. C. Coulot, S. Hemmerlin-Kohler, C. Dumont, D. Aluze, and B. Lmalle, ‘‘Simulation of lighting for an optimal defect detection by atificial vision,’’ in Proc. QCAV, pp. 117–122~1997!.

7. B. Dubuisson, Diagnostic et reconnaissance des formes, HerParis~1990!.

Page 11: Analysis of compatibility between lighting devices …le2i.cnrs.fr/IMG/publications/gev00.pdfAnalysis of compatibility between lighting devices and descriptive features using Parzen’s

s,

a-d or

ect

on

-

ea-

-

a

den

Geveaux et al.: Analysis of compatibility between lighting devices . . .

8. L. Lebart, A. Morineau, and M. Piron,Statistique exploratoire multi-dimensionnelle, Dunod, Paris~1995!.

9. T. Foucart,L’analyse des donne´es, Presse universitaires de RenneRennes~1997!.

10. W. C. Lin and M. Michael, ‘‘Experimental study of information mesure and inter-intra class distance ratios on feature selection anderings,’’ IEEE Trans. Syst. Man Cybern.2, 172–181~1973!.

11. J. Miteran, P. Geveaux, R. Bailly, and P. Gorria, ‘‘Real time defdetection using image segmentation,’’Proc. IEEE-ISIE2, 713–716~1997!.

12. M. Unser, ‘‘Local linear transforms for texture measurements,’’Sig-nal Process.11, 61–79~1986!.

13. F. Dupont, C. Odet, and M. Carton, ‘‘Optimisation of the recognitiof defects on flat steel products with the cost matrix theory,’’Nonde-struc. Test. Eval. Int.3~1!, 3–10~1996!.

14. G. Celeux and Y. Lechevallier, ‘‘Me´thodes de segmentation nonparame´triques,’’ Rev. Statist. Appl.30~4!, 39–53~1982!.

15. J. S. Deogun, S. K. Choubey, V. V. Raghavan, and H. Sever, ‘‘Fture selection and effective classifiers,’’J. Am. Soc. Inf. Science49~5!,423–434~1998!.

16. G. Caraux and Y. Lechevallier, ‘‘Re`gles de de´cision de Bayes etmethodes statistiques de discrimination,’’Rev. Intel. Artif.10~2–3!,219–283~1996!.

17. H. Ventsel,Theorie des probabilite´s, Mir Moscow ed., Moscow~1973!.

18. J.-P. Coquerez and S. Philipp,Analyse d’image: filtrage et segmentation, Masson, Paris~1995!.

19. K. Fukunaga,Introduction to Statistical Pattern Recognition, Aca-demic Press, New York~1972!.

20. B. W. Silverman, ‘‘Choosing the window width when estimatingdensity,’’ Biometrika65, 45–54~1978!.

21. J. D. F. Habbema, J. Hermans, and J. Remme, ‘‘Variable kernelsity estimation in discriminant analysis,’’Proc. Comput. Statis., pp.101–110~1978!.

Pierre Geveaux received both his engi-neering degree and his DEA degree fromthe Ecole Nationale Superieure d’ingenieuren Mecanique et Microtechnique, Besan-con, in 1995. He received the PhD degreein image processing from the University ofBurgundy, Dijon, France, in May 2000. Hisresearch work, financed by the Conseil Re-gional de Bourgogne, has focused on theapplication of artificial vision for defects de-tection.

-

-

Sophie Kohler-Hemmerlin received herengineering degree from the Ecole Nation-ale Superieure d’Ingenieurs Electriciens deGrenoble (ENSIEG) and her DEA degreein 1990. She received her PhD in electricalengineering from the Institut National Poly-technique de Grenoble in 1993. Since1994, she has been with the Laboratoired’Electronique d’Informatique et d’Images(Le2i), Universite de Bourgogne, France.Her research focuses on applications of ar-ticifical vision for defect detection.

Johel Miteran received the PhD degree inimage processing from the University ofBurgundy, Dijon, France, in 1995. Since1996, he has been an assistant professorat Le2i, University of Burgundy. He is nowengaged in research on classification algo-rithms, face recognition and access controlproblems, and real time implantation ofthese algorithms on software and hardwarearchitectures.

Fred Truchetet received the master’s de-gree in physics at Dijon University, France,in 1973, and a PhD in electronics at thesame university in 1977. He was withThomson-CSF for two years as a researchengineer and he is currently full professorat Le2i, Universite de Bourgogne, France.His research interests are focused on im-age processing for artificial vision inspec-tion and particularly on wavelet transforms,multiresolution edge detection and image

compression. He is a member of SPIE, IEEE and ISIS (a researchgroup of the french National Scientific Research Committee).

3175Optical Engineering, Vol. 39 No. 12, December 2000