00632980

Upload: rimzakhama

Post on 04-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 00632980

    1/13

    IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997 1199

    A Discrete Expression of Cannys Criteriafor Step Edge Detector

    Performances EvaluationDidier Demigny and Tawfik Kaml

    AbstractOn one hand, optimal filters used for edge detection are usually developed in the continuous domain and thentransposed by sampling to the discrete domain. On the other hand, the simpler filters like the Sobel filter are directly defined in thediscrete domain. Most of the previous works on edge detection were made to elaborate optimal filters. But, few works presentmethods to compare them. In this paper, we define criteria to compare the performances of different filters in their application area:the discrete domain. Canny has defined three criteria to derive the equation of an optimal filter for step edge detection: (1) gooddetection, (2) good localization, and (3) low-responses multiplicity. These criteria seem to be good candidates for filters comparison.Unfortunately, they have been developed in the continuous domain, and their analytical expressions cannot be used in the discretedomain. Unlike previous works, our approach is based on a direct computation in the discrete domain. We establish three criteriawith the same meaning as Cannys. Some comparisons with experimental results confirm the validity of our approach. This study

    highlighted the existence of two classes of derivative operators that are distinguished by whether or not the impulse response of thefilter in continuous space domain is continuous on its center. These classes exhibit very different properties for the second and thirdcriteria. We extend the use of the first and third criteria to the smoothing filters. We also define an optimal continuous filter accordingto the continuous third criterion and an optimal discrete filter according to the discrete third criterion. We compare the performancesof the sampled version of the continuous filter to those of the optimal discrete filter. It appears that the sampled version of the continuousoptimal filter is not optimal for the sampled data even in the case where the spectrum overlapping due to the sampling is reduced.

    Index TermsEdge detection, Canny criteria, edge operators, localization criterion.

    1 INTRODUCTION

    ESPITEthe high number of different approaches [1] that

    have been applied to edge detection, such as mathe-matical morphology, Markov fields, or surface models, themost commonly used method is the derivative approach bylinear filtering. Many derivative filters have been studiedand used to compute the intensity gradient of the gray-levelimages: Roberts, Sobel, or Prewitt operators [2]; finite im-pulse response filters with large kernel, such as Canny filter[3]; the first-order recursive filter, Shen filter [4]; the second-order recursive filter, Deriche filter [5]; and the first deriva-tive of the Gaussian function.

    Some of these filters (Canny, Deriche, and Shen) havebeen developed from optimality criteria. The best definedones are based on Cannys theory: good detection,good local-

    ization, low-responses multiplicityof the response to a singlestep edge. Many improvements have been made to adaptCannys criteria to enable the detection of roof edges andramp edges [6] or to include resolution [7]. A new measurefor localization has been proposed by Tagare and de-Figueiredo [8]. The sole aim of these works was to discoveroptimal filters assuming some constraints on the form ofthe impulse response and of the input signal.

    These criteria, expressed in the continuous domain,

    could be very useful to compare performances of differentfilters, to choose parameters of a given filter, or to measurethe performance degradation between theoretical and im-plemented filters (recursive or not, with or without specialwindowing or coefficient approximation). Unfortunately,the analytical expressions of these continuous criteria andthe hypothesis used to build them do not allow a directcomparison of the filters for at least two reasons.

    Continuous criteria cannot be applied to the discretefilters like the Sobel filter.

    The impulse response of many filters does not fulfillthe hypothesis. For example, the localization and thelow responses multiplicity cannot be computed forthe first-order recursive filter (5) or for the Differenceof Boxes (DOB) filter (2), which exhibits a discontinu-ity in the middle of their impulse response. This ar-gument is developed in Section 2. As an example, ac-cording to Canny, the DOB filter is the best, and, ac-cording to Tagare, it is the worst! Experimental results(see Section 5) clearly indicate that the truth liessomewhere between these two extremes.

    But, the main reason for the use of the discrete criteria isthat all the filters are used in the discrete domain.

    Furthermore, the direct transposition to the discretedomain starting with the analytical expressions of the

    continuous criteria is not possible. The reason is that thecriteria use the first and second derivatives of the impulse

    0162-8828/97/$10.00 1997 IEEE

    The authors are with ETIS-ENSEA, 6 avenue du Ponceau, 95014 CergyPontoise Cedex, France. E-mail: [email protected].

    Manuscript received 28 Nov. 1994; revised 28 July 1997. Recommended for accep-

    tance by K. Boyer.For information on obtaining reprints of this article, please send e-mail to:[email protected], and reference IEEECS Log Number 105501.

    D

  • 8/13/2019 00632980

    2/13

    1200 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    response (see (9) and (11)). It is well known that the defini-tion of a discrete equivalent to the derivation is an ill-posedproblem.

    Our approach is based on a direct computation in thediscrete domain. An edge is still a local maximum of thefilter output. It is not defined by the location where the de-rivative of the filter output is null, but by the location where

    the output value is greater than those of its neighbors.Therefore, we establish analytical expressions of the threeCanny criteria in the discrete domain.

    The continuous to discrete domain transposition and theill-posed problem of derivative disappeared. On the otherhand, it should be verified that when the sampling rate ishigh, some of the discrete analytical expressions drift tocontinuous ones. But this is not relevant for the resolutionsusually used.

    Ben-Arie and Rao [9] recently defined a new criterion:the discriminative signal-to-noise ratio. Their criterioncombines detection and localization criteria. It can be used

    in the discrete domain. According to this criterion, theauthors prove that the optimal filter for step-edge detectionis the Shen filter. We prove here that this filter gives poorresults for the last Canny criterion: the low-response multi-plicity. Our work completes the approach of Ben-Arie andRao by the definition of a discrete version of the low-responses multiplicitycriterion.

    Even if the main goal of this paper is to define criteria tocompare edge detectors, most of the previous works wereoriented to the definition of an optimal filter. One of theremaining questions is: Is an optimal filter for the continu-ous domain also optimal for the discrete domain?

    It is clear that the result of sampling is not the same for

    low or large sampling rate. One of the differences betweencontinuous and discrete domains comes from the spectrumoverlapping. For the Deriche filter (4), which is commonlyused with scale parameter between 1 and 0.5, the spec-trum energy over the Nyquist frequency is 14 percent for= 1 and 7 percent for = 0.5. The frequency response ofthe continuous and discrete filters is different. Then, it isclear that the continuous and discrete filters do not have thesame behavior. Our work helps to measure the differences.Nevertheless, other differences are induced by the criteriausing the derivative of the filter impulse response. Since itis not easy to discuss this last point, we have computed the

    analytical expressions of the optimal filter for the thirdcontinuous Canny criterion, low-responses multiplicity, andof the discrete optimal filter for the corresponding thirddiscrete criterion. Then, we have compared the perform-ances of the optimal discrete filter to those of the sampledversion of the continuous optimal filter. These results werebased on the third discrete criterion, because it is the onlyone that gives valid results according to the experimenta-tion with sampled data. This study proves that the sampledversion of a continuous optimal filter is not optimal forsampled data. The third criterion permits measuring theloss in performance.

    At the end of the current section, we list commonly used

    derivative filters. Section 2 explains Cannys criteria in thecontinuous space domain. Section 3 discusses briefly twopossibilities of sampling a continuous filter and looks at

    some resulting properties of the response to a step in thediscrete domain. Section 4 is the major part of this paper.The framework is the discrete domain. We define a gooddetection criterion, compute the probability for exact local-ization, and derive from this calculus the probability fornoise maxima. We show some similarities between con-tinuous and discrete expressions of the criteria. We define

    the third criterion, which is equal to the distance betweentwo noise maxima, and prove that it is the true sense oflow-responses multiplicity. By the study of the asymp-totic behavior of this last criterion, we define two classes ofderivative filters whether or not the value of the third crite-rion has a finite limit when the scale of the filter increases.We express an upper bound for this limit. We also give anexpression for the localization criterion. Section 5 givessome experimental results for different filters. Section 6gives a comparison between continuous and sampled op-timal filters regarding the third Canny criterion. An optimalfilter for this criterion is defined. In the last section, we

    comment on results of real images. A more applicable pa-per [10] explains how these criteria can be used to definethe filter-scale parameter and the threshold of an edge de-tector as a function of the resolution and of the signal-to-noise ratio on real images.

    Regarding notation, in this paper, for convenience, wecall CSD and DSD the continuous and discrete space do-main, respectively; IR the impulse response, and CIR andDIR the impulse response in the continuous and discretedomains, respectively.

    1.1 Derivative Part of Some Filters

    The gradient is computed from the first derivatives on the

    orthogonal directions. Most of the directional derivativesare obtained by a 2D separable filter. Noise smoothing isadded in the orthogonal direction of the derivative to im-prove the signal-to-noise ratio. The smoothing and the de-rivative parts can be treated independently. We give somecriteria for smoothing performances in Section 4. It is forthis reason that only the derivative part is examined here.The directional derivative can therefore be studied in onedimension, as in Cannys theory. We give here the IR ofsome operators.

    Sobel

    1 0 1 (1)

    DOB filter with size N

    1 1 1 1 1 0 1 1 1 1

    N

    (2)

    Canny [3]

    for x 0 h(x) = a1exsinx + a2e

    xcosx

    and +a3exsinx + a4e

    xcosx + c

    for x 0 h(x) = h(x) (3)

    h(x) is the CIR of the derivative filter deduced fromCannys criteria. The finite DIR of the filter of size 2W+ 1 is built by the sampling of h(x). The constants a1,

  • 8/13/2019 00632980

    3/13

    DEMIGNY AND KAML: A DISCRETE EXPRESSION OF CANNYS CRITERIA FOR STEP EDGE DETECTOR PERFORMANCES EVALUATION 1201

    a2, a3, a4, care defined by: h(0) = h(W) = h(W) = 0.

    and are functions of the scale and of the relativeweight of the three criteria.

    Deriche [5]

    h x x e x (4)

    It is the Canny filter when W + . The DIR of the

    filter is built by sampling of h(x). Shen [4]

    x > 0 h(x) = ex

    x < 0 h(x) = ex

    x = 0 h(x) = 0

    (5)

    As the DOB filter, this filter exhibits a discontinuity atthe origin (for x = 0).

    First derivative of Gaussian

    h x x ex

    2

    2 2 (6)

    In this paper, this filter is called FDOG to avoid confu-sion with the DOG filter: Difference of Gaussiansused to ap-proximate the second derivative.

    2 CANNYS CRITERIA

    In this section, we examine Cannys criteria as he presentedthem in his thesis [11]. We prove that it is impossible toapply the second criterion, localization,to filters that have adiscontinuity of their impulse response.

    To differentiate continuous and discrete filter responses,the first ones are subscripted by the letter c and the sec-

    ond ones by the letter d.Canny wanted to define a one-dimensional derivative

    operator with a finite IR hc(x) different from zero only in theinterval [W, W]. The signal to detect is a single step buriedwith a white Gaussian noise I(x),

    I x Au x n x 1 (7)

    where Au x 1 is the Heaviside function with amplitudeA,and n(x) is the noise:

    Au xx

    A x

    1

    0 00

    forfor

    and

    E{n(x)} = 0, E{n2(x)} = n0

    2

    Canny assumes that signal transitions are given by the de-tection of local maxima of the filter output. Then he estab-lishes three criteria.

    Good detection or maximization of the signal-to-noise ratio (snr) at the filter output. The signal is de-fined as the amplitude for x = 0 of the response to thestep (without noise). This criterion expression in-cluded two terms: The first one is the snrat the input,and the second one is Cc1, which is only dependent ofthe filter IR.

    SNRA

    nC C

    h x dx

    h x dx

    c c

    cW

    cW

    W

    0

    1 1

    0

    2

    12

    with (8)

    Good localization. In presence of noise, the transitionmust be detected as close as possible to the true lo-

    cation x = 0. The localization L can be defined asthe inverse of the mean distance between the theo-retical and the detected location. Canny has proved[11, pp. 16-17] that:

    LA

    nC C

    h

    h x dx

    c cc

    cW

    W

    0

    2 22

    012

    with (9)

    Like the first criterion, it is composed of a first term(the snrat the input) and a second term (Cc2functionof the filter IR). The expression (9) has been based onsome hypotheses: oddness of the IR, continuity, and

    derivability for x = 0, which allow Canny to write:hc(x) x hc 0 (10)

    The oddness of IR is a property of all derivative fil-ters, but the continuity in zero is very restrictive. InSection 4, we prove that a discontinuity in zero canimprove localization (e.g., Shen filter). It is also clearthat the Taylor expansion (10) has no sense when thesampling is sparse and that, consequently, this ap-proach cannot be employed for discrete filters. Thetransposition of the criteria to the frequency domaincould help the change from continuous to discretedomain, because, for both of them, the spectral func-

    tion is continuous. However, the approximation (10)is not valid, and the transposition of (9) to the fre-quency domain has no interest.

    Low-responses multiplicity. For the response to asingle step, the detector may not produce multiplemaxima. xmaxis the mean distance between two noisemaxima. The greater xmaxis, the lower the probabilityof multiple maxima in the window of size W.

    x Ch x dx

    h x dxc

    cW

    W

    cW

    Wmax

    3

    2

    22

    12

    (11)

    As for the second criterion, because the derivative ofh(x) is not clearly defined in the discrete domain, thiscriterion cannot be transposed easily. In Section 4, weprove that this expression is wrong for sampled fil-ters, and we give the correct one.

    These three criteria can be extended without any prob-lem to W+in the continuous domain.

    3 THE SAMPLING OF THE CIR

    Edge detector filters (also named derivative filters) werebuilt in the CSD: Shen, Deriche[12],orFDOG gives the dis-

    crete filters synthesized by the sampling of the CIR.

  • 8/13/2019 00632980

    4/13

    1202 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    3.1 Input Signal

    For the definition of the input signal, we use the discreteversion of the input signal defined by Canny (7).

    The input signal Iis a step sequence Uwith amplitudeAcombined with a white Gaussian noise N (zero mean andstandard deviation n0).

    k I k U k N k ,where

    k U kk U k A

    0 00

    ,,

    (12)

    3.2 Impulse Response of Derivative Filters

    hc(x) is the CIR of the continuous filter where xis real, andhd(k) is the DIR of the discrete filter where k is an integer.We define hcas the support functionof hd. hd(k) is obtained bythe sampling of hc(x):

    hd(k) = hc(x = k)

    Because hc(x) is an odd function, the value of hd(0) is zero.Thus, the response of the discrete filter to a step has twomaxima located on k = 1 and k = 0. The same observa-tion is possible for the FIR filters with an odd number ofcoefficients.

    In the case of a noisy step input I(k), the output samplesS(1) and S(0) have the following values,

    S A h k h k N k

    S A h k h k N k

    d dkk

    d d

    kk

    1 1

    0

    1

    1 (13)

    Since the noise contribution in k = 1 and k = 0 is differ-ent, the noise will decide the maximum location. It is possi-ble to remove this phenomenon by a translation of the CIRby a half-space period to the right or to the left side. A

    translation to the right hd(k) = hc(x = k 12

    ) gives a unique

    maximum at x = 0. Note that the FIR filters with an evennumber of coefficients have similar behavior. The choicebetween these two kinds of sampling influences the valuesfor the second and third Cannys discrete criteria. In orderto simplify the discussion and to limit the size of this paper,

    we work only with the common form of sampling (hd(0) = 0).

    This work can easily be extended to the other form.

    4 DISCRETE CRITERIA

    We work on infinite impulse responses, but results will alsobe available for finite impulse responses.

    4.1 Discrete Criterion for Good Detection

    The good detection criterion (8) can be immediately trans-posed to the discrete case:

    C

    h k

    h k

    d

    d

    d

    1

    0

    2

    12

    (14)

    The improvement of the signal-to-noise ratio for thesmoothing filters with a DIR hld(k) can be formulatedsimilarly:

    C

    h k

    h k

    ld

    ld

    ld

    1

    2

    12

    (15)

    4.2 Exact Localization Probability

    We saw in Section 2 that the localization and the low re-sponses multiplicity criteria cannot be directly transposedto the discrete world in a simple manner. In this para-graph we introduce the probability for exact localizationof the maximum in response to a single step. Themaximum is located at the position where the ampli-tude is greater than the amplitude of the nearest neighbors:local maximum.

    The input signal is defined by (12). The maximum is welllocated in k = 0 if and only if:

    S(0) S(1) > 0

    and

    S(0) S(1) > 0 (16)

    We assume that the edge is well localized if the maximumis at k = 1 or k = 0. This is justified in Section 2. These twopossibilities are incompatible and by symmetry have thesame probability.

    From (16), we immediately have:

    S S c X

    S S c X

    0 1

    0 11 1

    2 2

    where

    X h k h k N k

    X h k h k N k

    d dk

    d dk

    1

    2

    1

    1

    (17)

    and

    c1 =Ahd(0) = 0, c2 =Ahd(1) = Ahd(1) (18)

    N(k) is a Gaussian random sequence. In the general case, X1and X2 are two random variables with zero mean and the

    same variance x2 , and they are correlated.

    x d dk

    n h k h k 2 02 21

    (19)

    Since samples of the input white noise are not correlated,the deterministic covariance of X1and X2can be written:

    Cov X X n h k h k h k h k d d d dk

    1 2 02 1 1,

    (20)

    We can define the correlation coefficient between X1

    and

    X2as = Cov(X1, X2) / x2 .

  • 8/13/2019 00632980

    5/13

    DEMIGNY AND KAML: A DISCRETE EXPRESSION OF CANNYS CRITERIA FOR STEP EDGE DETECTOR PERFORMANCES EVALUATION 1203

    h k h k h k h k

    h k h k

    d d d dk

    d dk

    1 1

    12

    (21)

    Then we compute the join density probabilityp(x1, x2) to

    obtain X1[x1, x1 + dx1[ and X2[x2, x2 + dx2[.

    p x xx

    x xdx dx

    x x

    x

    1 2 2 2

    12

    2

    2

    2 12

    1 2

    1

    2 1 2

    1

    2 1

    , exp

    exp

    (22)

    The probability Pmaxfor a maximum at k = 0 is:

    P p X c X c

    p x x dx dxcc

    max ,

    ,

    1 1 2 2

    1 2 1 221

    (23)

    Renaming yi = xi/x, we introduce the normalized func-tion [13] L(a, b, ) defined as:

    L a by

    y ydy dy

    ba, , exp

    exp

    1

    2 1 2

    2 1

    2

    12

    2 12

    2 1 2

    (24)

    The probability PLto accurately localize (at k = 0 or k = 1)

    a step of amplitudeAin a white Gaussian noise of variance

    n02 taking into account (18), (23), and (24) is:

    P LAh

    Ld

    x

    2 0

    1, ,

    (25)

    4.3 Noise Maximum Probability

    In the absence of signal (A = 0), Pmaxexpression can be usedto compute PB: The probability to obtain a maximum in-duced by noise that can be located anywhere (stationarityproperty). In this case, the integral (24) has an analyticalexpression:

    P LB

    0 02

    , ,arccos

    (26)

    When becomes close to 1, PBapproaches zero. There-

    fore, the distance between two maxima increases. On the

    other hand, PL(25) is an increasing function of andAhd

    x

    1

    .

    Increasing increases PL but decreases the noise maxima

    distance, a trade-off must be found between exact localiza-tion of the step edge and noise maxima detection.

    4.4 Similarity of Form With Cannys ContinuousCriteria

    In this part, we discuss the similarity of form. The expres-sions of continuous and discrete criteria are different. We

    introduced two sequences h kd and h kd that we canqualify as the first and the second derivativesof the sequencehd(k).

    h kd = (hd(k + 1) hd(k))

    and

    h k h k h k d d d1 (27)

    The first parameter that appears in PL (25) can be re-written:

    Ah An

    kd

    x

    10

    2 (28)

    with

    kh

    h k

    d

    dk

    2

    2

    012

    (29)

    Expression (29) presents similarity of form with the secondCanny criterion (9). We can also rewrite:

    k

    h k

    h k

    d

    k

    dk

    3

    2

    2

    1

    2 1

    (30)

    which can be compared to Cannys third criterion (11).

    4.5 Mean Distance Between Noise Maxima

    We now establish the exact value of the mean distance be-tween noise maxima Cd3 and prove that the simple exten-sion of Cannys third criterion is false even if the similarityof form is a real temptation! The mean distance betweennoise maxima is the exact conceptual equivalent to the thirdCannys criterion (11): low-responses multiplicity.

    Later, we can prove that: If the filter has a continuous CIR at x = 0, when the

    scale factor increases (or the resolution decreases), theexpression Cd3 becomes identical to Cc3. This is thecase for the Deriche (4) and the FDOG filters (6).

    For these filters, Cd3 is not bound and increases in-definitely as the scale factor increases.

    If the filter has a discontinuous CIR at x = 0, when thescale factor increases, Cd3 approaches a finite limit,which is lower than an upper bound that we willcompute. This is the case for the Shen (5) or the DOBfilters (2).

    4.5.1 Cd3 Expression

    Starting with the expression of the probability for a noisemaximum to be located anywhere (26), we derived the ex-pression of the mean distance between noise maxima. De-tails are given in Appendix A.

    Then, the mean distance between two noise maxima Cd3is:

    Cd32

    arccos (31)

    4.5.2 Asymptotic Behavior of Cd3.We now study Cd3behavior when the scale factor increases(i.e., parameter of Shen (5) or Deriche filters (4) decreases,parameter of FDOG filter (6) increases). Details are givenin Appendix B.

  • 8/13/2019 00632980

    6/13

    1204 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    In the case of filters with a continuous CIR at x = 0, wehave proved that when the scale factor increases:

    1

    3Cd

    When the filter is large enough,

    arccos

    h k

    h k

    d

    d

    2

    2

    12

    (32)

    and

    Cd3Cc3 (33)

    For the filters for which the CIR is discontinuous at x = 0,we find that when the scale factor increases:

    1 263Cd

    Filters have a very different behavior according towhether the CIR is continuous or not at x = 0. Filters with acontinuous CIR can enlarge the gap between noise maximaas far as desired by increasing the scale factor. But for filterswith a discontinuous CIR, the largest gap between noisemaxima is bound. This defines two classes of derivativefilters.

    Equation of Cd3 is correct whatever the shape of the im-pulse response. This extends the result obtained by Rice[14] to the discrete domain. Cd3 can also be used to add anew quality criterion to the smoothing filters. If his the im-pulse response of a smoothing filter, (27), (30), and (31) canbe used to compute the mean distance between noisemaxima at the smoothing filter output.

    Looking at Fig. 1 for the Deriche filter and Fig. 2 for theShen filter, we see the differences between using k3(30) +

    or Cd3 solid line to compute the distance between noisemaxima. o with error bar corresponds to experimentalresults (10 measures on a sequence of 10

    4noise samples for

    each filter). For the Deriche filter, we also give the resultobtained with the continuous criterion Cc3 * that cannotbe used for the Shen filter. On both of the figures, the tracesare functions of a scale factor that corresponds to the filter

    parameter given on the horizontal axis. When de-creases, the filter width increases. In Fig. 1, we see that Cc3is erroneous but that the use of k3is a good approximation.The CIR of the Deriche filter is continuous at the origin.Then, Cd3increases indefinitely as the filter width increases.In Fig. 2, we see that Cd3 reflects experimental results andthat the approximation k3is erroneous. We also see that Cd3saturates at the value of six when the filter width increases.Filters, like the Shen filter, with a discontinuous CIR at theorigin have the same properties.

    4.6 The Localization Criterion Cd2Equations (16) and (25) can easily be generalized to com-

    pute the probability P(i) for a maximum to be located at adistance of isamples from the origin.

    P i LAh i Ah id

    x

    d

    x

    , ,1

    (34)

    Fig. 3 presents the aspect of P(i) for different snr. The as-pect is qualitatively independent of the filter.

    Tagare and deFigueiredo in [8] obtained a curve with acertain similarity with ours. However, the use of continu-ous space associated with a correlation coefficient alwaysequal to one induces P(0) = P(). This is a strange resultknowing that P(0) is signal and noise dependent and that

    P() is only noise dependent. It is clear that when the dis-tance to the step increases, the probability P(i) has to beclose to PB (26). This result is obtained with (34): i +

    Fig. 1. The mean distance between noise maxima for the Deriche filter.It is computed from expressions of the continuous criterion Cc3(symbol (11)), of the approximated criterion k3 (symbol + (30)), of the

    discrete criterion Cd3 (solid line (31)) and compared to experimentalresults (symbol o and error bar). The horizontal axis is the scale pa-rameter . The CIR of the Deriche filter is continuous at the origin.Then, Cd3 increases indefinitely as the filter width increases ( de-creases). k3is a good approximation of Cd3.

    Fig. 2. The mean distance between noise maxima for the Shen filter. Itis computed from expressions of the approximate criterion k3(symbol+ (30)) or Cd3(solid line (31)) and compared to experimental results

    (symbol o and error bar). The horizontal axis is the scale parameter. TheCIR of the Shen filter is not continuous at the origin. Then, Cd3saturate at the value of six when the filter width increases ( de-creases). The relative error when the approximation k3is used is morethan 10 percent.

  • 8/13/2019 00632980

    7/13

    DEMIGNY AND KAML: A DISCRETE EXPRESSION OF CANNYS CRITERIA FOR STEP EDGE DETECTOR PERFORMANCES EVALUATION 1205

    induces hd(i) 0. We see that when the snr increases, alarger area with a null probability (a better local snr) is cre-ated between the location of the edge and the area domi-nated by the noise of probability PB.

    Based on (34), it is possible to compute the width of thearea where we are sure to detect the step.

    We compute the value of N:

    N I P ii

    I

    min .5for which 00 (35)The value 0.5 is used because symmetry allows us to cal-

    culate the sum only on one side. Therefore, we are sure thatthe step is detected in the following area [(N + 1), N].

    In order to keep the part of P(N) necessary to obtain aprobability of 0.5 for one side, we define Q(i) as:

    i N Q i P i

    i N Q N P i

    i N Q iiN

    0 1

    0

    1 00

    1

    ,

    .5

    , (36)

    We can now compute the standard deviation of the dis-

    tance between the detect maximum and the true edge.

    x i Q ii

    02 2

    0

    2

    (37)

    We have supposed that the detections at locations 0 and1 are at a distance 0. Cd2 is always defined as the local-ization criterion from Canny.

    Cn

    A xd2

    0

    02

    (38)

    In Fig. 4, we study the localization of the Deriche filter as afunction of the scale parameter when the snris fixed at three.

    All the traces correspond to snr x 02

    (the inverse of thelocalization) but are computed in different ways. First, anexperimental measure was made represented by the sym-

    bol o and by an error bar for the standard deviation. Tenmeasures on 500 edge responses for each one and for each

    value were made. A histogram of the distance from themaxima to the true location was calculated, and (35), (36),and (37) have been used to compute the result. The solid

    line is associated with our measure of Cd2. It is clear that

    this approach is confirmed by the experimental results. Be-cause we have used the same algorithm and definition ofthe localization for experimental and analytical parts, thisproves the correctness of our analytical results. The symbol

    * represents Cannys continuous results snr x 0

    2 12

    ,

    which can be computed with (9). The symbol + is used torepresent the version of the same equation when continu-ous integrals and derivatives of h(x) are replaced by a dis-crete sum and a discrete approximation of the derivatives.

    Two observations can be made:

    For the large values of , the sampling is sparse andthe Taylor expansion (10) cannot be used because the

    distance between samples is too large. In addition,approximation of the derivatives does not work inthis case.

    For the small values of , the sampling is closer, butthe Taylor expansion again does not work because the

    value of x02 is too large: Maxima are not sufficiently

    near the true edge.

    Cannys localization criterion works only when delo-calization is small, but in the discrete world, when thedelocalization exists, the distance is at least one pixel!

    In Fig. 5, for the Deriche filter, we have fixed the scalefactor = 0.5 and used different snr. The same computa-tions and the same legends of the curves as in the previousfigure were used. The symbol corresponds to experi-mental results where we considered only the nearest

    Fig. 3. Probability of a maximum detection as a function of the distanceto the origin (number of samples). A noisy step edge is placed at x = 0.o snr= 1, + snr= 2, * snr = 4, x snr = 10, solid snr = 100. When the snrincreases, an area of low probability value is created near the origin.When the distance increases, the probability becomes the probabilityto detect a maximum due to the noise.

    Fig. 4. Different measures of the localization for the Deriche filter as afunction of the filter width. The snr is fixed at the value of three. The

    vertical axis is the inverse of the localization. Our expression of thecriterion (solid line) is confirmed by the experimental results (symbolo and error bar). We see that the continuous criterion (symbol *, (9))and the classical discrete approximation of the derivative (symbol +,(29)) give erroneous results.

  • 8/13/2019 00632980

    8/13

    1206 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    maximum to the true edge (located at the origin). We seethat for the value of the snrgreater than three, this inducesa small difference. The main parts of the maxima detectedin the area of probability less than 0.5 are first maxima. Firstmaxima are defined as the maxima nearest to the step loca-

    tion. The area where the sum of probability of the firstmaxima is less than 0.5 is larger than those of the no neces-sary first maxima. Then, when the snr is less than three,using only first maxima increases the delocalization. Thegreat disappointment about these results is that Cannyconcluded that Cc2 is independent of snr, but we clearlysee that it is not the case for the discrete filters. There-fore, it is possible to state that the optimal discrete filter issnrdependent.

    5 FILTER COMPARISONS

    5.1 Simple Filters

    Table 1 gives results for simple edge detectors and associ-ated smoothing filters.

    The first line gives Cd3for the identityfilter, which copiesthe input to the outputy(n) = x(n). Here, we used it to com-pute the distance between noise maxima of a white Gaus-sian noise. The second line corresponds to the DOB filter (2)with a size N > 1. The associated smoothing filter is the av-erage filter with 2N + 1 coefficients.

    The third line corresponds to the Sobel filter (1). The de-rivative part is a DOB filter with N = 1, and the smoothingpart has coefficients [1 2 1].

    This is the first time where it is possible to compute val-

    ues of the third Canny criterion Cd3 and Cl3 for sampledfilters. This allows the comparison of these simple filterswith more complex filters.

    5.2 Scale Factor

    To compare the filters when the resolution depends on a pa-rameter, we need to define a scale factor that binds parame-ters of the different filters: for Shen (5) and Deriche (4), for FDOG (6).

    We have used the scale factor defined by Poggio [15].For a derivative filter, the scale is the mean width of theresponsefc(x) to a step. This scale factor corresponds to theparameter value of the FDOG filter. In the CSD:

    scx f x dx

    f x dxc

    c

    c

    2

    1

    2

    (39)

    and in the DSD:

    sc

    n f n

    f nd

    d

    d

    12

    2

    12

    (40)

    5.3 More Complex FiltersWe have tested the filters defined in Section 1.1 of this pa-per: DOB filter (2), Shen filter (5), Deriche filter (4), andFDOG filter (6).

    Fig. 6 shows the three criteria as a scale factor function.Cd2has been computed for snr = 1. We see that Cd3criterionfor the filters with a discontinuous CIR tends to a finitelimit when the scale factor increases (six for the Shen filterand 4.77 for the DOB filter).

    The delocalization increases with the scale factor forthe filters characterized by a continuous CIR at the ori-gin. The delocalization is almost independent of the scalefactor for the filters with a discontinuous CIR at the origin.

    The filters that have good localization performance obtain apoor score for the last criterion: mean distance betweennoise maxima. This demonstrates a tight link between Cd3and Cd2. We should conclude that the filters with a dis-continuous CIR at the origin are always better because Cd1can be increased without loss of localization accuracy.This confirms the results obtained by Rao and Ben-Arie [9]with their optimal filter (the Shen filter in the case of astep-edge detection) according to the discriminative sig-nal-to-noise ratio criterion. The Deriche filter is a better ex-tension of Cannys filter than the FDOG filter becauseFDOG has a higher delocalization than the Deriche filter.

    We see also that the aspect of Cd1 is the same for all thefilters, and, thus, this criterion should be a good definitionfor a scale factor.

    Fig. 5. Different measures of the localization for the Deriche filter as afunction of the snr. The filter width is fixed at the value =0.5. The

    vertical axis is the inverse of the localization. Our expression of thecriterion (solid line) is confirmed by the experimental results (symbolo and error bar). We see that the continuous criterion (symbol *, (9))and the classical discrete approximation of the derivative (symbol +,(29)) give erroneous results. At the opposite of Cannys result, we seethat the localization criterion is snrdependent. On other experimentalresults (symbol ), only the nearest maximum to the origin is takeninto account. This changes the results only for low snrvalues.

    TABLE 1CRITERIA VALUES FOR SIMPLE DERIVATIVE

    AND SMOOTHING FILTERS

    Filter Cd1 Cd3 Cl1 Cl3

    Identity 1 3

    DOB N 2 4.77 2N 1 4

    Sobel 1 2 3.44 1.63 4.77

  • 8/13/2019 00632980

    9/13

  • 8/13/2019 00632980

    10/13

    1208 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    tan tanN N

    1

    22 1

    2

    The choice of the root is made to obtain only one maxi-mum on the impulse response on each side.

    is then defined to obtain: DO(N) = 0.The equation of this optimal filter was computed consid-

    ering Cd3 as a scalar function of the coefficients vector.Then, we have determined the antisymmetrical vector thatannuls the gradient of Cd3. We have verified that this vec-tor corresponds to a global maximum of the function Cd3.

    Table 2 gives values of and for some values of N.

    TABLE 2PARAMETERS OF THE OPTIMAL DISCRETE FILTER

    N 3 4 6 10 25

    o74.1 57.4 39.7 24.5 10.1

    0.224 0.191 0.141 0.091 0.038

    The mean distance between noise maxima for the DO

    filter depends almost linearly on the Nvalue.

    Cd3(DO) = (2N + 1)

    0.696

  • 8/13/2019 00632980

    11/13

    DEMIGNY AND KAML: A DISCRETE EXPRESSION OF CANNYS CRITERIA FOR STEP EDGE DETECTOR PERFORMANCES EVALUATION 1209

    criterion Cd3defines the best filter (DO) with regard to thefalse detections. This confirms that the optimal filter for theCd3 criterion is the discrete optimal filter and not the dis-crete version of the continuous optimal filter. No error onlocalization is observed in these pictures. This phenomenon

    appears only with lower input signal-to-noise ratio.A desk picture is shown in Fig. 11. The same detectors

    are used as for the cross image. The parameters are chosento obtain the same Cd1 = 1.33 value for the four filters. Table 5gives the corresponding parameters and Cd3values.

    TABLE 5FILTERS PARAMETERS AND Cd3 VALUES FOR

    THE DETECTION OF THE DESK

    Figure 12 13 14 15

    Filter Deriche Shen D DO

    Param. 1 0.6 9 9

    Cd3 5.1 4.5 7.7 7

    Fig. 12. Edges detected with the Deriche filter.

    Fig. 13. Edges detected with the Shen filter.

    Fig. 14. Edges detected with the discrete version of the continuousoptimal filter (D) for the Cc3criterion.

    Fig. 10. Images of the edges detected. (a) Shen filter. (b) Deriche filter.(c) Discrete version of the optimal continuous filter for the criterion Cd3.(d) Discrete optimal filter for the criterion Cd3.

    Fig. 11. Image of a desk.

  • 8/13/2019 00632980

    12/13

    1210 IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE, VOL. 19, NO. 11, NOVEMBER 1997

    Results for the Shen and the Deriche filters are similar. Itis also true for the D and the DO filters. This last group offilters offers the best results for the noise reduction. This isdue to the higher value of Cd3.

    8 CONCLUSION

    We have suggested three criteria for discrete filters equiva-lent to Cannys criteria. They allow the comparison of theperformances of step edge detector filters whether they areinitially defined in the continuous or in the discrete do-main. The discrete criteria have the advantage of allowing acomparative study of the derivative filters and measureingdegradations induced by the implementation (impulse re-sponse truncating, coefficients approximation). We haveproved that original continuous Canny criteria cannot beused for these comparisons. We highlighted the existence oftwo classes of derivative filters, according to whether theimpulse response in the continuous domain is continuousor not at x = 0. For a filter with a discontinuous CIR, wehave computed an upper bound for the criterion of low-responses multiplicity. On the other hand, criteria for gooddetectionand low-responses multiplicitycan be used with thesmoothing filters. Finally, these criteria can be used to com-

    pute an optimal filter directly in the discrete domain. Wehave proved that the sampled version of an optimal filter isnot optimal for the same criterion transposed in the discretedomain. Future works could combine the discriminativesignal-to-noise ratio discrete criterion from Ben-Arie andRao and the mean distance between noise maxima discretecriterion to develop an optimal filter. We have suggestedthat the shape of this filter will be dependent on the signal-to-noise ratio. The main reason is that the localization crite-rion is signal-to-noise dependent.

    APPENDIX A

    We note p pk0 is the probability for a noise maximum atlocation k0. We know that this probability is independentof k0.

    Therefore:

    p k k p k k p

    p k k p k k p

    k k k

    k n k

    0 0 0

    0 0 0

    1 0 0 0 0

    1 0 0 0 0

    1 1

    1 1

    (44)where (k0 + 1 k0) is the probability for a noise maximum atk0 + 1, assuming that there is one at k0, etc.

    Since two maxima cannot be neighbors, (k0 + 1 k0) = 0

    and (k0 1 k0) = 1, we deduce:

    10 0 0

    00 0 0

    11

    11 2

    1

    k kp

    p

    k kp

    p

    (45)

    The probabilityp1Nfor a first maximum at the distanceN 2 from k0is:

    p NN

    i k

    k N

    1 10 00 10 002

    1

    1

    0

    0

    (46)

    and the mean distance between two maxima Cd3is:

    C N ppd N

    N3

    2

    11

    (47)

    which can be rewritten with (26):

    Cd32

    arccos (48)

    APPENDIX B

    We study the Cd3

    behavior when the scale factor increases(i.e., parameter of the Shen (5) or the Deriche filters (4)decrease, parameter of the FDOG filter (6) increases). Westart by studying the behavior of R(),

    R

    h n

    h n

    dn

    dn

    2

    2

    (49)

    and by giving an approximation of R() when is large.We assume that a support functionf(x) exists such as h(k) =

    f(k) and thatf(x) is continuous on ], 0[ and ]0, +[.

    We can rewrite h(0) = h(0+

    ) + h(0) = 0. This means thatwe can replace the null sample at zero by two opposite val-

    ues h(0+) and h(0), where h(0

    +) = lim

    x 0

    f(x) and so on.

    We deduce that:

    h k h k h k

    h h h h

    d2 2

    0

    2

    2 1

    2 0 4 0 1 0 (50)

    When is large (the sampling is sufficiently close),

    h(k + 1) =f(k + 1)f(k) + f (k)

    where f is the continuous first derivative off.Then

    Fig. 15. Edges detected with the discrete optimal filter (DO) for the Cd3criterion.

  • 8/13/2019 00632980

    13/13

    DEMIGNY AND KAML: A DISCRETE EXPRESSION OF CANNYS CRITERIA FOR STEP EDGE DETECTOR PERFORMANCES EVALUATION 1211

    h k h k f k f x dx

    1 20

    2

    0

    2

    0

    and

    h h f1 0 1

    Expression (50) becomes:

    h k f x dxd2 202

    2 0 4 0 12h h f (51)

    In the same way

    h k h f x dxd 2 2 212 0 (52)and, therefore:

    h k

    h k

    h f x dx h f

    h f x dx

    d

    d

    2

    2

    2 2

    0

    2 2

    1

    0 2 0 1

    0

    (53)

    If we rewrite f(x) = g x , with g independent of

    (normalized support function), we obtain:

    Rh g u du g

    h g u du

    2 1 2 1 2 1

    0

    2 3 2

    0 2

    01

    (54)

    We now examine the case of the filters for which the CIRis continuous at x = 0. Then h(0

    +) = 0 and:

    Rg u du

    g u duw

    2 2

    0

    2

    0

    (55)

    R

    Cd

    1

    3

    When is large enough,

    arccos

    h k

    h k

    d

    d

    2

    2

    12

    (56)

    and

    C Cd c3 3

    (57)

    For the filters for which the CIR is discontinuous at x = 0,we have h(0

    +) 0, from (54) we deduce that when +

    R

    Cd

    11 263

    ACKNOWLEDGMENTSThe authors would like to thank Dr. R. Deriche for hiscomments on early drafts of this paper.

    REFERENCES[1] N. Pal and S. Pal, A Review on Image Segmentation Tech-

    niques, Pattern Recognition, vol. 26, no. 9, pp. 1,277-1,294, Mar.1993.

    [2] J.M.S. Prewitt, Object Enhancement and Extraction, PictureProcessing and Psychopictorics, B. Lipkin and A. Rosenfeld, eds.,pp. 75-149. New York: Academic, 1970.

    [3] J. Canny, A Computational Approach to Edge Detection, IEEE

    Trans. Pattern Analysis and Machine Intelligence, vol. 8, no. 6, pp. 679-698, Nov. 1986.

    [4] J. Shen and S. Castan, An Optimal Linear Operator for Step EdgeDetection, Computer Vision Graphics Image Processing, vol. 54, no. 2,pp. 112-133, Mar. 1992.

    [5] R. Deriche, Using Cannys Criteria to Derive a Recursively Im-plemented Optimal Edge Detector, Intl J. Computer Vision,pp. 167-187, 1987.

    [6] M. Petrou and J. Kittler, Optimal Edge Detectors for RampEdges, IEEE Trans. Pattern Analysis and Machine Intelligence, vol. 13,no. 5, pp. 483-491, May 1991.

    [7] S. Sarkar and K.L. Boyer, On Optimal Infinite Impulse ResponseEdge Detection Filters, IEEE Trans. Pattern Analysis and MachineIntelligence, vol. 13, no. 11, pp. 1,154-1,171, Nov. 1991.

    [8] H.D. Tagare and R.J.P. deFigueiredo, On the Localization Per-formance Measure and Optimal Edge Detection, IEEE Trans. Pat-

    tern Analysis and Machine Intelligence, vol. 12, no. 12, pp. 1,186-1,190, Dec. 1990.

    [9] K.R. Rao and J. Ben-Arie, Optimal Edge Detection Using Expan-sion Matching and Restoration, IEEE Trans. Pattern Analysis and

    Machine Intelligence, vol. 16, no. 12, pp. 1,169-1,182, Dec. 1994.[10] D. Demigny and M. Karabernou, An Effective Resolution Definition

    or How to Choose an Edge Detector, Its Scale Parameter and theThreshold, Proc. IEEE Intl Conf. Image Processing, vol. 1, pp. 829-832,Lausanne, Sept. 1996.

    [11] J. Canny, Finding Edges and Lines in Images, Artificial Intelli-gence Lab., M.I.T., Cambridge, Mass, Tech. Rep. 720, June 1983.

    [12] R. Deriche, Fast Algorithms for Low-Level Vision, IEEE Trans.Pattern Analysis and Machine Intelligence, vol. 12, no. 1, pp. 78-87,

    Jan. 1990.[13] National Bureau of Standards, Handbook of Mathematical

    Functions, Abramowitz and Stegun, eds., chapter 26, pp. 936-939.

    Washington, D.C.: Government Printing Office, 1970.[14] S.O. Rice, Mathematical Analysis of Random Noise, Bell Systems

    Technical J., vol. 24, pp. 46-156, 1945.[15] V. Torre and T.A. Poggio, On Edge Detection, IEEE Trans. Pat-

    tern Analysis and Machine Intelligence, vol. 8, no. 2, pp. 147-163,Mar. 1986.

    Didier Demigny received his PhD in electricalengineering from the French Fondamental Elec-tronical Institute (IEF), Orsay University. Histhesis discussed architectural design of RISCmicroprocessor dedicated to Lisp language.Since 1988, he has been with the signal andimage processing team (ETIS) at the NationalSuperior School for Electronic Applications(ENSEA), where he founded a research group

    on real-time image processors. His current re-search interests include segmentation, hardwarearchitectures for real-time edge closing, and reconfigurable hardwarearchitectures for image processing.

    Tawfik Kaml obtained his PhD in 1994. Histhesis research subject was the hardware im-plementation of recursive and no recursive 2Dfilters on reconfigurable architecture for low-levelimage processing. He is with the signal and im-age processing team (ETIS) at the National Supe-rior School for Electronic Applications (ENSEA).