+ All Categories
Home > Documents > PAMI Subpixel Measurement

PAMI Subpixel Measurement

Date post: 05-Apr-2018
Category:
Upload: peter-wu
View: 239 times
Download: 0 times
Share this document with a friend

of 17

Transcript
  • 8/2/2019 PAMI Subpixel Measurement

    1/17

    I E E E T R A N S A C T I O N S O N P A T T E R N A N A L Y S IS A N D M A C H I N E I N T E L L I G E N C E . V O L . 11 . NO I ? . D E C E MB E R 198) 1293

    Subpixel Measurements Using a Moment-Based EdgeOperator

    E D W A R D P. LYVERS, OWEN ROBERT MITCHELL, SENIOR MEMBER, IEEE,MARK L . AKEY, M E M B E R , I E E E , A N D ANTHONY P. REEVES, SENIOR MEMB ER, IEEE

    Abs t rac t -Th i s pape r p resen t s recen t resu l t s i n prec i s ion measu re-ment s us ing computer v i s ion . An edge opera to r based on two-d imen-s ional spa t i a l moment s i s p resen ted . T he opera t o r can be implementedfo r v i r tua l ly any s i ze window and has been shown to loca te edges indigi t ized images to a twentieth of a pixel . This accuracy is unaffectedby add i t ive o r m ul t ip l i ca tive chan ges to the d a ta va lues . Th e p rec i s ioni s ach ieved by correc t ing fo r many o f the de termin i s t i c e r ro rs causedby non ideal edge p ro f i l es us ing a look-up t ab le to c o rrec t t he o r ig ina les t imates o f edge o r i en ta t ion and locat ion . T h i s t ab le i s genera ted us inga synthesized edge which is located at various subpixel locat ions andvar ious o r i en ta t ions . The opera to r i s ex tended to accommodate non-ideal edge p rof i l es and rec tangu lar ly sampled p ixel s. T he app l i ca t ionof th is t echn ique to the measurem ent o f imaged m ach ined meta l par t si s a lso p resen ted . Add i t ional ly, bo th theor t i ca l an d exper imen ta l no i seanalyses show the opera to r ha s a re l a t ive ly smal l b i as in the p resenceof noise.

    Index Terms-Edge detec t ion , edge locat ion , face t model , Hueckel ,image p rocessing , La p lac ian o f a Gauss i an , spa t i a l moment s , subp ixelm e a s u r e m e n t .

    I . INTRODUCTIONNTI L recently, the location of features in digital im-U gery to within a pixel has seemed adequate. Forthose cases which require higher precision, the primarysolution has been to increase the sampling rate. How ever,there are applications in the digital image processing fieldthat need better accuracy. T hese include photogrammetryand industrial inspection, w here measurement accuracy is

    at a premium.Up to this point few edg e locators have been capab le ofsubpixel accuracy. Frei and Chen [l] , Roberts [2], andSobel [3] have all proposed edge detection scheme s whichuse some digital approximation to the gradient. Thesemethods are very fast and deliver acceptab le results; how-ever, the locations are not sub pixel and the derivative op-eration is very sensit ive to noise. M acvicar-Whelan andBinford [4] have proposed a method which utilizes thegradient operation after the data has been smoothed withinan arbitrary odd-sized window. The subpixel edge loca-Manuscript received September 30, 1984; revised July 20, 1989. Rec-E. P. Lyvers is with MIT Lincoln Laboratory, Lexington, MA 01273.0 . R. Mitchel l is with the Department of Electrical Engineering, Uni-M. L. Akey is with Magnavox Electronics System Company, FortA. P. Reeves is with the School of Electrical Engineering, Cornel1 Uni-IEEE Log Number 893 1117 .

    ommended for acceptance by W . E. L . Gr imson.

    versity of Texas at Arl ington, A rl ington, TX 76019.Wayne, IN 46808.versity, Ithaca, N Y 14853.

    tions are determined by linearly interpolating the locationwithin a rise-fall-rise region of the g radient. Th is methodis much less sensitive to noise in comparison to the othergradient op erators; how ever, precision is limited to inter-polation between a few points. Machuca and Gilbert [5 ]have proposed a method which integrates the region con-taining the edge. This method uses the moments found inthe region to determine the position of the edge. Nevatiaand Babu [6] have designed a linear feature extractor usingedge detection and line thinning . The ir edge detector con-volves windowed data with six edge masks. The maxi-mum response from this matched filter is chosen as thecorrect edge orientation of an edge centered in the win-dow. Hueckel [7]-[9] has developed an algorithm to de-termine the presence of edges and lines by fitting a regionof data to a Hilbert space with 9 parameters. T he locationsare to subpixel accuracies; however, no analysis of theoperator in the presence of noise is documented. Tabata-bai and Mitchell [l o] have developed an operator whichlocates edges by fitting the first three gray level momentsto the data. Again, the edge locations are to subpixel ac-curacies as well as being much less sensitive to noise whencompared to the Hueckel operator. Huertas and Medioni[ l 11 have developed a subp ixel operator using the facetmodel combined with Laplacian of Gaussian masks. Eng-lander [12] describes a subpixel operator based on imageresampling using Whittakers theorem.This paper presents a new edge operator (detector)which uses the spatial moments of a gray level edge todetermine the location of th e edg e. Section I1 defines theone-dimensional edge operator. The ope rator is evaluatedfor subpixel accuracy as well as performanc e in the pres-ence of noise. The Tabatabai operator is implemented inone dimension and compared to the moment based edgeoperator. Section I11 defines the two-d imension al edge op-erator. Ag ain, the op erator is tested for subpixel accuracyin addition to performance in the presence of noise. TheTabatabai, the Hueckel, and a modified version of theHuertas and Medioni edge operators are compared to themoment based edge operator. A confidence measu re is de -veloped for the two-dimensional operator. In add ition, re-cent tests of the method on precision edge contrast andorientation estim ation [131 show this new mom ent methodto outperform Sobel, Nevatia-Babu, facet model, andGaussian smoothed gradient techniques.

    0162-8828/89/1200-1293$01 OO 0 989 IEEE

  • 8/2/2019 PAMI Subpixel Measurement

    2/17

    1294 I E E E T R A N S A C T I O N S O N P A T T E RN A N A L Y S I S A N D M A C H I N E I N T E L L I G E N C E . V O L . 1 1 . NO . I? . D E C E M B E R 1989

    11. ONE-DI MENSI ONALDGEOPERATORThe new edge operator uses the spatial moments of thediscrete edge data to determine the position of an edg e.The moments o f an ideal edge in a continuous domain aredeterm ined and the position of the edge is mathematicallyderived from these mom ents. Th e position results are thenmodified to correct for deterministic errors due to the

    sampling. The ed ge operator is then applied to noisy data.Theoretical and empirical statistics are determined.Lastly, a one-dimensional gray level moment edge op er-ator developed by Tabatabai and Mitchell [lo] s imple-mented and its performance is compared to the spatialmoment edg e operator results.A . Derivation of the One-Dimensional Edge O perator

    An ideal one-dimensional edge model is shown in Fig.1 . The model is characterized by three parameters: back-ground intensity h, edge contrast k, and edge translation1. The edge is simply the step transition from gray levelh to gray level h + k. The ed ge translation 1 is defined tobe the length from the center of the edge model to the steptransition and is confined to the range of - to + 1 .

    The moments of a continuous functio nf(x) of order pare defined byM p = 1 p f ( x )ah. (1 )

    Since the model edg e is completely ch aracterized by threeparameters, three suitable moments of the edge in termsof h, k, an d 1 are required to solve for each parametersimultaneously. The desired moments can be found using( l ) , where f (x) s the edge function.MO = h i l l a h + k ! a h = 2 h + k(l - ) ( 2 )1

    1 1M I = h 1 x d x + k [ ah = ik(l - 1 ) ( 3 )-1 IM2 = h 1 x 2 a h + k 1 x 2 a h = j h + ik(1 - 1 3 )

    - I I(4 )

    The equations (2), ( 3 ) , an d (4) may now be combined tosolve for 1.( 5 )

    The parameter k may be obtained by substituting the valueof 1back into ( 3 ) , an d h obtained from ( 2 )using the valuesk an d 1.

    Thus, sample moments can be used to estimate M O , M I ,an d M 2 , and then ( 5 ) used to estimate the edge location.

    h+kI 1

    -1 0 1Fig . 1, Ideal continuous, on e-dimension al, edge model characterized byh , k , an d 1.B . Bias Efec ts Due o Pixel Sampling

    In the previous section, the moments of an ideal edgein a continuous domain were solved for the parameters ofthat edge ( h , k, 1 ) . However, the edge model does notallow for the sampling effects due to finite pixel width inreal data; i.e. , the gray value is assumed constant overeach pixel in real data. This results in a bias error in thecalculated edge location. Fig. 2 shows this bias error be-tween the calculated edge location and the actual edgelocation. The sampled edge is generated from an idealcontinuous edge that is sampled with a square aperture ofwidth one pixel. Th e plot shows the bias error when theideal edge location is vaned from - .5 to 1.5 pixels fromthe center of a window of width 5 pixels.For comparison, the edge operator developed by Ta-batabai and Mitchell [lo] as implemented. I t, too, hasthe ability to locate edges to subpixel accuracy. It shouldbe noted that the edge operator developed in this papergenerates moments using spatial information. The posi-tion of the pixel is used in the moment kernel functionsand the gray value of the pixel simply weights those func-tions. On the oth er hand, the Tabatabai operator generatesmoments from the gray value only. No spatial informa-tion is used in determining these moments. T o avoid con-fusion when refem ng to these two operators, the moment-based operator will be called the spatial mom ent edge op-erator. The Tab atabai operato r will be called the gray levelmoment edge operator. The bias error for the gray levelmoment operator is also shown in Fig. 2 .For both operators, when the edge location perfectlymatches pixel boundaries the error is zero. In these in-stances, the sampled edge is identical to the continuousedge. How ever, when the ed ge lies between pixel bound-aries, the sampled edge actually contains three distinctgray values rather than tw o. T he intermediate gray valueis determined by the position of the continuous edge. Themoments generated from these two edge types differ .Thus, the length calculation produces an error in the ac-tual length to the edge.To furthe r understand these differences, for the spatialmoment operator, consider the case of the sampled edgein Fig. 3 . Note that the variables lI an d l 2 are measuredto pixel boundaries and thus are discrete functions of Iwith l 1 I I 2 . The moments M O ,MI , an d M 2 are cal-culated to be

    12M O = j l l h a k + jI A k d x + j k d xZ

    = 2 h + Ak(Z2 - 11 ) + k( 1 - Z2) ( 8 )

  • 8/2/2019 PAMI Subpixel Measurement

    3/17

    LY V ERS er a l . : SUBPIXEL MEA S U REMEN TS USING A N EDGE OPERATOR 1295

    -1.5 -1.0 -.50 0.0 .50 1.0 1.5EdgeTranslation, p ixels

    Fig. 2 . Edge translation error. The spatial moment operator is shown as asolid line while the gray level moment operator is shown as a dashedline.

    h+k

    - 1 0 1Fig. 3. Sampled ideal edge characterized by h , A k , k, l , , and 1 2 .

    M ~ = 1 hx 2 dr + A,, Akx'dr + J,,kx2- 1

    = $h + fAk(1; - :) + f k ( 1 - 1 ; ) . ( 1 0 )Substitution of (8) , (9), an d (IO) into the length solu tion,( 5 ) , gives

    3M2 - MOI,,., = 2M lAk[ZI(l - 1 : ) - 12(1 - l ; ) ] + k12(1 - 1 : )

    Ak(1: - 1 : ) + k ( 1 - 1 ; )-(11)

    Equation (11) is the length result when the operator isapplied to sampled edges.To determine the bias associated with the length givenin (11) and the ideal length, an im age formation model isneeded. Let the ideal sampled edge be generated by thelinear equation

    which shows the incremental step gray value Ak is pro-portional to the normalized distance that 1 is from the up-

    per step 1, . The sampling aperture is f lat with a width ofone pixel. Th e constant ( 2 - 1 is the length of one pixel.Solving (12) for 1 gives( 1 3 )Akk= 12 -- & - 1 1 ) .

    The bias error is simply the actual length 1 minus the mo-ment calculated length l,,.,,B ( l l , 1 2, Ak, k ) = 1 - 1M. ( 1 4 )

    Substituting (1 1) an d (12) into the bias equation and sim-plifying yields

    where(16)Akp = - o r p 5 1 .k '

    The bias error is zero for all roots of the numerator of(13, i . e . ,P(1, - 11)2(Z, + 1 2 ) ( P - 1 ) = 0. ( 1 7 )

    When Ak = 0 (0 0 ) o r Ak = k (0 1 ) the lengthequations agree and the bias error is zero. This cond itionoccurs when the edge coincides with a pixel boundary andthe three-level edge is reduced to a two-level edge. Atevery pixel b oundary, the bias error is zero.The other situation where the length equa tions match iswhen l1 = -12 . This occurs when the length is near thecenter of the window. It should be noted that the differ-ence l 2 - Zl remains constant and is equal to one pixelwidth. For a window of 5 pixels, the lengths l I an d 1,equal -0.2 an d 0.2, respectively, when the edge is lo-cated within the center pixel of the w indow . All edg e po-sitions within this range produce no bias error from thelength equation, as can be seen in Fig. 2 .The location error is well behaved and it was empiri-cally verified that the calculated edge location versus trueedge location is a monotonic function . Therefore, to elim-inate the bias error that is present when the edge locationis not within the center pixel and not centered on pixelbounda ries, a look-up table procedure can be used. In thisparticular imp lementation, th e bias table was created fromedge locations spaced at 0.05 pixel intervals. Linear in-terpolation was used to determine the bias between theintervals. Use of the bias table to co rrect the calculatedlength resulted in a reduction of the maximu m error overthe -1.5 to +1.5 pixel range from 0 . 1 0 1 to 0.0016 pix-els. No te that although this result is for a range of - .5I I . 5 pixels, the most critical range is -0.5 I I0.5 pixels because for I 1 > 0.5 pixels the edge is closerto a window centered on an adjacent pixel. Note that for1 1 I .5 pixels, the spatial moment operator has no er-ror, and therefore a bias co rrection table is not necessary.

  • 8/2/2019 PAMI Subpixel Measurement

    4/17

    ~

    1296 J E E E T R A N S A C T I O N S O N P A T T E RN A N A L Y S I S A N D M A C H l N E I N T E L L I G E N C E . V O L . I I . NO. 1 2 . DE CE M BE R 1989

    Other effects may also be incorporated into the errorbias table. For instance, the sampling effects caused by aGaussian-type aperture, rather than the square apertureused here, could be accounted for in the bias table. Non-symmetric edges which are caused by cylindrical surfacescan also be located precisely with the bias table. How-ever, this requires the nonsymmetric edge to be well mo d-eled so that the appropriate bias table may be determined.Three-Level Model: Some thought has been directedtoward establishing the three gray level edge as an edgemodel and finding the solution for the length using thenew models mom ents. In this implementation, the lengthsolution would not be in error. However, due to the in-creased complexity of the edge mod el, five parameters ar eneeded to describe it sufficiently. The five parameters areh , Ak, k , 1 1 , and 1 ,. If the operator is applied only to edgesblurred over one pixel, l 2 - I will be known. Therefore,the first four moments of the edge need to be calculatedand solved for h , A k , k , I , , and 12 . The solution, however,is not readily apparent. The additional length variable in-creases the complexity, prohibiting a closed form solu-tion. F or this reason, the three level edge model is droppedin favor of the original edge model.The location error for the gray level operator was alsowell behaved and a look-up table procedure was used forit too. The bias table was created from edge locationsspaced at 0.05 pixel intervals. Use of the bias table tocorrect the calculated len gth resulted in a reduction of themaximum error over the - 1 .5 to + 1.5 pixel range from0.136 to 0.045 pixels .C . Efects of Noise on Edge Location

    The effects of noise on the e dge location determined bythe operator will now be considered. The bias correctionis not considered in the theoretical noise analysis. Incor-porating the correction given in (15) into a noise modelwould complicate the analysis significantly.Assume additive, independent, identically distributed,Gaussian noise is added to the pixel gray values of a sam-pled ideal edge. The calculated length ( 5 ) now becomesa random variable, i .e .,

    Analysis is simplified if the length is consid ered to be thequotient of two random variables, g N and g o , such thatg N = 3m , - mo and go = 2 m l . ( 1 9 )

    Mp = .x p ( i > f ( i ) ( 2 0)The moments of a discrete function f ( ) are given by

    Kr = l

    where c, ( i ) is the pth order moment weighting for thepixel region indicated by i. The moments from a sampled,noisy edge,f ( i ) = f ( i ) + a ( i )

    are given byK

    m p = c c , ( i ) [ f ( i ) + rqi)]i = IK K

    r = I i == C c , ( i > f ( i > + C c , ( i ) A ( i )= M, + r i p . ( 2 2 )The random moment, therefore, can be viewed as a de-terministic part plus a random part. Furthermore, li, issimply the weighted sum of K independent, zero-meanGaussian random variables. The resulting random vari-able ti,, is Gaussian distributed and is well documented inthe literature [141.In the case where K is of moderate value, the distribu-tion of each A ( i ) need not even be Gaussian, but onlyreasonably concentrated about the mean. This conditionstems from the well known central-limit theorem. Themean of the resulting Gaussian density is zero and thevariance is the sum of variances from each random vari-able. Each individual variance is the weighted variance ofthe additive noise, i .e .,

    a i p= [ c ; ( l ) + * . * + c ; ( K ) ] a 2 ( 2 3 )where is2 s the variance of the additive noise. Fo r a win-dow size of 5 pixels the num erator and denominator s tan-dard deviations are

    oN = 0.71840 an d aD = 1.01190. (24)The Gaussian random variables g N an d go can now be pa-rameterized,

    giy = 3 ( M 2 f A 2 ) - (MO + A())= 3M2 - MO f 3A2 - i o ( 2 5 )

    ( 2 6 )( 2 7 )

    wherec1.N = 3M2 - MOK0; = a2 = l [ 3 c 2 ( i ) - co(i)12

    andgo = 2 ( M , + A , ) = 2M1 + 2Al ( 2 8 )

    P D = 2M 1 ( 2 9 )where

    K

    The random length (18) can now be viewed as the quo-tient of two, nonzero mean Gaussian random variables.To com pletely parameterize this relationship, the covari-ance between the numerator and denominator randomvariables must be determined. T he summ ation of (20) ca nbe viewed as the inner product of a row and a columnvector. Th e numerator and deno minator random variables

  • 8/2/2019 PAMI Subpixel Measurement

    5/17

    LYVERS et al.: SUBPIXEL MEA S U REMEN TS USING AN EDGE OPERATOR 1297

    can be modeled asg N = dTR + b , = C T R + d ( 3 1 )

    whered T = [3c2(1) - CO( l ) , . * , C 2 ( k ) - cO(k)]C T = [ 2 c l ( ) , * * , 2 c l ( k ) ]RT = [ R ( l ) , R ( 2 ) , * . , i ( k ) ]b = 3Mz - MOd = 2M1.

    The expectation of g N g D sE { g N g D }= E ( ( d T R + b) (E . f + d ) }

    = E{nT2 i ; Z + dnf + bcT.f + b d }= E { d T f X T C }+ bd= d T E { R . f T } E bd= d T C a i + b d . ( 3 2 )

    The covariance is given by( g N g D ) = E ( g N g D } - E { g N } E( g D }

    = ~ C U ;+ bd - bd = ~CO: . ( 3 3 )Since the moment weightings are implemented using asymmetrical window centered at zero, is even-valuedan d C is odd-valued. Thus, their inner product, dTC, iszero. If the two Gaussian variables are uncorrelated, thenthey are necessarily independent. Therefore, the lengthequation is the quotient of two nonzero independentGaussian random variables. For the special case wheneach random variable has zero mean, the random variablefi s Cauchy. This case arises only when the deterministicpart of the windo w input is a flat field of zeros. In gen eral,however, both rand om variables have nonzero mean.A closed form solution of the density function for thelength variable does not exist. An integral form of thedensity [14] has the form

    IY I

    (34)I t should be noted that the m eans of the Gaussian randomvariables are determined by the actual position of the edg e,1. After a fair amount of mathematical manipulation, theabove integral can be expressed in terms of an error func-tion as

    whereer f (x ) =- xp ( - y 2 / 2 ) d y .G Os

    Note that if ,uN= pD = 0 the above density reduces to aCauchy density as would be expected.Fig. 4 shows the density functions for edges located atthe center of the window and at f .O pixels from thecenter of the window where the window is 5 pixels longand the signal-to-noise ratio is 30 dB. Note that the den-sities for 1 = +_ 1 O pixel are not centered around * .O .This shift is due to the determinsitic error. The mean shiftdue to noise and standard deviation of the edge locationestimation versus true edge location for SN Rs of 30 dB ,40 dB, and 50 dB are shown in Figs. 5and 6 . These val-ues were derived by numerical integration from the den-sity function in ( 3 5 ) using values of uN an d uDfrom (24)and values of pN an d pD obtained empirically from ( 2 6 )an d (29) . Most notably, the mean error shows virtually nobias due to noise for lengths 1 .O pixel from the centerof the window.The spatial moment-based edge operator was applied tonoisy data in an empirical test. T he data consisted of zero-mean Gaussian random noise added to square aperturesampled edges. The window size was 5 pixels and thesampled edges location was vaned from - . 5 to 1. 5 pix-els in 0.05 pixel steps. The parameter h was set to 100while h + k was set to 200 . For each edge location,10,000 different noise cases were added to the samplededge. Although 10,0 00 may seem like a large number ofcases, the agreement between the empirical results andthe theoretical results improved as the number of casesincreased. The sigma of the noise samples added to theedges is determined by the signal-to-noise ratio as [121:

    ( 3 6 )kSN R 20 log10 - dBUwhere k is the edge height difference and U is the standarddeviation of the additive noise. The empirical mean andstandard deviation of the edge location estimation versustrue edge location for SNRs of 30 dB, 40 dB, and 50 dBwere also calculated. Th e empirical results matched thetheoretical results within a ma ximu m absolute error of lessthan 1 percent and an average absolute error of 0.05 per-cent verifying proper m odeling of the system. Because ofthis close agreement, the empirical mean and standard de-viation plots are not shown here.Figs. 7 an d 8 compare the performance of the spatialmoment operator and the gray level moment operator. Fig.7shows the empirical R MS ed ge location estimation errorversus true ed ge location for SNR s of 30 dB, 40 dB, and50 dB without table lookup correction. Fig. 8 shows theempirical RMS error when a bias correction table is used.

  • 8/2/2019 PAMI Subpixel Measurement

    6/17

    1298

    .I4

    .13-

    lEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE. VOL. I I . NO . 12. DECEMBER 1989

    OperatorGray Level Moment

    7.0

    6.0]

    Deterministic In Noise for an SNR ofMax RMS 50dB 4OdB 30dB11.62 I 8.18 8.19 I 8.25 I 8.90

    Edge Translation, pixelsF ig .4. Theoretical edge translation estim ation density function for 1 =-1.0 pixels (dotted), 1 = 0.0 pixels (solid) , 1 = 1.0 p ixe ls (dashed) ,and SNR = 30 dB .

    Gray Level Moment w/TableSpatial Moment

    -3.0-Y3.66 1.56 1.61 1.94 4.070.00 0.00 0.60 1.91 6.04

    4.0-1.5 -1.0 -.M 0.0 .M

    3 :3m.m.01-0.0

    1.0 1.5

    _ _ - ---..~..._....._.-__rn..-..-1

    Edge Translation, pixelsF ig . 5 . Theoretical mean translation estimation shif t due to noise for SNR'sof 30 dB ( so l id) , 40 dB (dashed), and 50 dB (dotted).

    Table I summarizes the performance of both operatorswith and without bias correction tables. Maximum andrms error for the noise-free (deterministic) case and alsorms error for SNR's of 50 dB, 40 dB, and 30 dB are given.The range of I used in each measurement was -0.5 II .5 pixels.

    1

    0.01.5 -1.0 -.M 0.0 .M 1.0 1.5Edge Translation, pixels

    F ig . 7 . Empirical RMS ed ge translation estimation erro r for the gray leveloperator (solid) and the spatial moment operator (dashed ), both withoutcorrection tables, for SNR's of 30 dB , 40 dB, and 50 dB .

    Edge Translation, pixelsF ig . 8. Empirical RMS e dge translation estimation error for the gray leveloperator (solid) and the spatial moment operator (dashed ), both with cor-rection tables, fo r SNR's of 30 dB , 40 dB, and 50 dB .

    T A B L E IE D G E O C A T I O NS T I M A T I O NRROR, BOTHD E T E R M I N I S T I CN D I N TH EPRESENCE OF A D D I T I V E A U S S I A NOISE OR -0.5 I 1 I .5 PIXELS

    1 Edge Location Error (hundredthsof a pixel) II

    111. TWO-DIMENSIONALDGEOPERATORThe one-dimensiona l operator presented in the last sec-tion can be extended to two dimensions by multiple ap-plications to the rows and/or columns of two-dimensionaledge data, and then fitting a line to the calculated edge

    locations. One possible problem with this idea is that,even for step edges, there is an effective blur which is astrong function of orientation. Also, an a priori estimateof the orientation is needed to determine whether to applythe operator to the rows or the column s. This implem en-tation yielded less than impressive results. Even when

  • 8/2/2019 PAMI Subpixel Measurement

    7/17

    LYVERS et al.: S U B P I X E L M E A S U R E M E N T S U S I N G A N EDGE OPERATOR 1299

    using the one-dimensional bias correction table, the edgetranslation estimation error was as high as 0 .12 pixels forideal data, and the edge orientation error is as high as6 .2" . A plot of edge translation error versus true transla-tion and orientation is shown in Fig. 9. For these reasons,this implementation was abandoned. Next, the derivationof the spatial moment edg e operator in two dimensions isconsidered. Many of the concepts and solutions are sim-ple extensions of those found in the one-dimensional case.A length equation is determined from the two-dimen-sional moments of a continuous two-dimensional edge.As in the one-dimensional case, a bias correction table isused to remove the effects of pixel quantization. Theoret-ical noise analysis on the angle of orientation is comparedto empirical results. Lastly, a two-dimensional version ofthe Tabatabai, the Hueck el and a modified version of theHuertas and Medioni ed ge operators are compared to thespatial moment operator.A . Derivation of the Two-Dimensional Edge Operator

    A continuous two-dimensional edge specified by h , k ,I , an d 8 is shown in Fig. 10. The first three parametersare as before. The additional parameter 8 specifies the an-gle the edge makes with respect to the y-axis. The edgeis defined to lie within the unit circle.The moments of a two-dimensional function f (x , y ) a regiven by

    M p q = 1 P Y 4 f ( X , Y) dY h. ( 3 7 )A closed moment set of order n is closed with respect tothe operations rotation, translation, and scale change andconsists of moments of order n and lower. A rotation ofthe circular window by -8 will align all moments con-taining edge information along the x-axis. This is done toreduce the dimensionality of the edge problem. The pa-rameters h , k , an d 1 can be solved along the x-axis inde-pendent of 8. A rotation of the window by an arbitraryangle 4 transforms the original moments as specified by

    ( 3 8 )

    M&J= M , ( 3 9 )M io = co s 4MIo+ sin +Mol ( 4 0 )

    (4 1 1( 4 2 )

    ( 4 3 )

    ( 4 4 )

    q f r - s(sin 4 ) M p + q - r - s , r + s .For the moments up to order two w e have:

    Mio = cos2 4Mz0 + 2 cos 4 s in 4M1 , + sin' Mo2Mhl = - s in 4Mlo + cos 4MolMh2 = sin2 M2, - 2 cos 4 sin +MI1+ cos2 4MO2M il = sin 4 cos 4 ( M O 2- M20)

    + cos^ 4 - sin2 4 ) .

    Fig . 9 . Edge translation estimation error for multiple application of 1- Dedge ope ra tor to 2-D edge da ta .

    F ig . 10. Two-dimensional ideal edge model characterized by h , k , I ,an d 0 .

    It is desired, therefore, to rotate the moments by the angle8 such thatMhl = 0 (45 1

    i.e . , the edge will lie parallel to the y-axis. The value of8 can be found from (42) and (45),Mhl = M O,co s 0 - Mlo in 8 = 0 ( 4 6 )

    MO Ie = tan- ' -.MI0 ( 4 7 )To obtain the rotated moments, the following relation-ships can be used:

    MI0 sin (8) = MO Ico s ( e ) = JMil + M:o JMi l + M?O.( 4 8 )

    These values can be used to obtain the rotated momentsby substituting them into (38 ):M& = M, (4 9 )M;, = JM&M : ~ ( 50 )

    To obtain the rotated moments all moments of secondorder and lower are needed. Therefore, six moments Moo,M l o , M o l ,MII ,MZo, nd MO2must be calculated from thedata. These moments are estimated by correlating the ele-ments in the window with a mask. E ach mask represents

  • 8/2/2019 PAMI Subpixel Measurement

    8/17

    1300 I E E E T R A N S A C T I O N S O N P A T T ER N A N A L Y S I S A N D M A C H I N E I N T E L L I G E N C E . VOL. 11. NO . 12. D E C E M B E R 1989

    the value resulting from performing the integration of (37)over each pixel assuming f ( x , y ) is constant over thatpixel. The circular limits are included in the integration.The region of this integration for a window size of 5 X 5pixels is shown in Fig. 11. Note that some of the pixelslie along the circular boundary while others lie entirelywithin it. The resulting set of masks is shown in Fig. 12.Solutions for h , k , an d 1 can be found in a mann er sim-ilar to the one-dimeilsional analysis. Expressing the ro-tated moments in terms of h , k , an d 1 :

    M& = 2 1-, 1 h d y d x + 2 1, k d y d xk Fig . 11 . A circular region defined on a 5 x 5 pixel matrix.= h n + - n - k sin- ' 1 - k l m2

    ,0219 ,1231 . 573 ,1231 .0219 -.0098-.a352 .oooO ,0352 .0098.I231 .I600 ,1600 ,1600 ,1231 -.0352 .0256 M100 ,0256 ,0352,1573 ,1600 .I600 .I600 ,1573 .oooO .oooO .oooO .oooO .oooO.I231 . I600 ,1600 ,1600 ,1231 ,0352 ,0256 .oooO .0256 -.0352,0219 ,1231 ,1573 1231 ,0219 ,0098 ,0352 .ooM) .0352 -.W8JT--;i d i 7

    Mi0 = 2 S h x d y d u + 2 1, S k x d y d w0= : k m

    h k k J - - -4 8 2= - n + - n + - ~ (1 - 1 2 ) 3

    -.a147 .0469 oooO ,0469 ,0147 ,0147 ,0933 .I253 .0933 ,0147-.0933-.mm0640 .0933 ,0469 .0640 .0640 .0640 .0469-.1253 &WO .WO ,0640 ,1253 .oooO .oooO .oooO .oooO .oooO-0933 -.0640 .m 0640 ,0933 -.0469 -.m.0640 -.W .0469,0147 .0469.oooO ,0469 .0147 -.0147 -0933 .I253 - E 3 3 -.0147

    The equations (53), (54), and (55) can be combined tosolve for 1:

    Once 1 is determined, k an d h may be obtained from (54)an d ( 5 3 , respectively,3 w 0k =

    2( 5 7 )

    12 7h = - 2M & - k ( n - 2 sin- ' 1 - 21-)].

    B. Bias Effects Du e to Pixel SamplingAs in the one-dimensional case, the edge operator isderived using a con tinuous two-gray level mo del. A gain,the model do es not allow fo r sampling effects present indigitized data. In general, the moments of the samplededge do not match those of a continuou s edge and thus anerror arises in the edg e location. Fig . 13 shows the bias

    Ml o Mask.0099 ,0194 0021 .a194 0099 .0099 .0719 ,1019 ,0719 .0099,0719 ,0277 0021 ,0277 ,0719 ,0194 ,3277 .0277 ,0277 ,0194,1019 ,0277 O21 .0277 ,1019 ,0021 .0021 ,0021 ,0021 .IO21,0719 .0277 0021 .0277 .0719 ,0194 .0277 ,0277 ,0277 ,0194.0099 ,0719 .I019 ,0719 ,00990099 ,0194 0021 .a194 0099

    Mm MaskFig. 12. The set of six masks used fo r moment operator with ws = 5

    Fig. 13. Edge translation estimation error for the spatial moment operatorwith a window size of 5 pixels.

    error of the two-dimen sional edge operator as the edge isvaried from 0 to 1.5 pixels and as the edge's orientationis varied from 0" to 45" in a circular window of size 5pixels. The error has even symmetry about the plane 8 =45" . This symmetry also exists about the planes 8 = 0" ,90", 135", etc. Although not sho wn here, it was empiri-cally verified that the error plot has odd symmetry aboutthe plane 1 = 0 . Due to this symmetry, performance overall orientations can be measured with the range of 0 5 85 4 5 " .The bias error can be derived theoretically. However,moment integration ov er an edge with an ang le not aligned

  • 8/2/2019 PAMI Subpixel Measurement

    9/17

    LYVERS et al.: SUBPIXEL MEA S U REMEN TS USING A N EDGE OPERATOR 1301

    with the rectangular sampling grid is difficult. Thereforerather than solving the bias error for an arbitrary angle,the bias error is derived for an edge oriented parallel tothe y-axis onl y. In this situation only three gray leve ls are

    where(63)Akk 'p = - 0 5 p 5 1 .

    present ( h ,A k , k ) n the pixel samp les. The momen ts are The length to the edge given a three-1eve1 (edgeoriented parallel to the y-axis) with a square aperturefunction is identical to that obtained for the one-dimen-sional case (15). Therefore, the bias error is

    JG3 AT7= 11, J0 dY dr + !:y 1 A k dY d x0+ 2 il :17 dy dr= ah + k - 2- - sin- '[ 2+ A k [ 1 2 m sin- ' l 2- 1,- - sin-' I ] ]

    A k x d y d x + 2 17x dy dx

    I , , I oh x 2 d y d x + 2* A k x 2 dy ah + 2 kx2 dy d x

    P ( P - 1 ) (&- 11 ) [./(1-I:,J-m]-(1 - 0)- + 0

    (59) (64)The bias error is zero when

    p(1 - 0) [m - = 0. (65)The above result is true when P = 0 or /3 = 1 whichoccurs when the edge is situated on the pixel boundariesand the three-level edge is reduced to a two-level edge.The other circumstance occurs when l2 = - I As in theone-dimensional case, this occurs when the edg e is nearthe center of the window. For a window of diameter 5pixels, 1' an d l 2 will equal -0.2 and 0 .2, respectively.A plot of estimated edge translation versus I an d 0 (notshown) shows that it is monotonically increasing with 1and hence it should be possible to generate a bias correc-tion table. Such a table was generated and is shown inFig. 14. Note th at it is a correction term versus estimatedtranslation an d estimated o rientatio n. Using this bias tableand bilinear interpolation, the maximum corrected esti-

    (60)

    12- sin- ' 1 2 ]

    1- ;in-'L

    (61Substitution of Moo, MIo,an d M2 0 into the length equationresults in

    ( 1 - P ) 1 2 4 i T q + 61( l - P ) r n + P r n

    l!M =

    mated edge translation error for 1 I \ 5 0.5 pixels is lessthan 0.0045 pixels.The two-dimensional gray level moment operator andthe Hueckel operator have been implemented and theirbias values are plotted in Figs . 15an d 16. The gray levelmoment operator bias has a large oscillating bias near 0"and near 45 . Oth er angles show oscillation, but at a muchreduced magnitude. Since the bias is smoothly varyingand of moderate v alue, a bias table ca n be used to reducethe bias. Using this bias table and bilinear interpolation,the maximum corrected estimated edge translation errorfo r 111 I .5 pixels is less than 0.052 pixels. Th e Hueckeloperator 's bias, on the other hand, shows some very se-rious problems at isolated location-angle positions. Theamount of bias at these positions range as high a s 1.6 pix-els error. Due to the high bias, the actual length versuscalculated length relationship is not monotonic. There-fore, a bias table cannot be implemented for the Hueckeloperator.The H uertas and Medioni operator detects edges as zerocrossings in the convolution of the im age with LOGmasks.Subpixel location of the zero crossings is obtained byusing a 2-D second order polynomial facet model on

  • 8/2/2019 PAMI Subpixel Measurement

    10/17

    1302 I E E E T R A N S A C T I O N S O N P A T T E R N A N A L Y SI S A N D MA C H I N E I N T E L L I G E N C E . V O L . 1 1 . NO 12. D E C E MB E R 19x9mm -2

    Fig. 16. Edge translation estimation error for the Hueckel operator with awindow size of 5 pixels .Fig. 14 . Edge translation bias corre ction table for the spat ial moment op -erator with a window size of 5 pixels . m-

    dIs ,0111

    3 .,MmE:.lo4820

    Fig. 17 . Edge translation estimation error for the Laplacian of a Gaussianopera tor using the facet model for subpixel resolution. Th e window sizeis 13 pixels.

    Fig. 15. E dge translat ion est imation error fo r the gray level moment op-erator with a window size of 5 pixels.t i o n f ( i 3 th e moments are as

    K LMp 4 = C C c p q ( i , ; ) f ( i , j ) . (6 6 )

    1 = 1 J = I3 x 3 regions of the filtered image. The resultant poly-nomial is used for image resampling of 2 X or 3 X reso- The noisy edge may be aslution improvement. ze ro crossings to pixel accuracy are J ; ( i , j ) = ffound in the resampled image, thus providing subpixelaccuracy in the original image.crossings are found directly from the second order poly-nomial, and a straight line is fit to them. The edge loca-tion and orientation are calculated from the line parame-operator requires a window size of 13 X 13 so that its

    and the moments asOur implementation is similar except that the zero K L

    f i p y = C C C p q ( i ,j = l j = lK L

    i = I j == c c c&,;ters. The result of this is shown in Fig . 17.Note that theperformance near comers would not be good.C . Effects of Noise on Edge Location

    For the two-dimensional noise analysis, additive, in-dependent identically distributed Gaussian noise wasadded to a sampled ideal edge. For a discrete edge func-The rotated moments M i q (6 ) ar e

    M&( e ) = M m= C C m ( i , j ) f ( i , j ) (69)

    ' J

  • 8/2/2019 PAMI Subpixel Measurement

    11/17

    LY V ERS et a l . : SUBPIXEL MEASUREMENTS U SI N G A N EDGE OPERATOR 1303

    Although the moments (68) are Gaussian random vari-ables, the rotated m oments, w ith the exception of M&,, renot. This can be seen from (69) , (70) , an d (71) . Theexpression for M io is quite complex. Due to this com-plexity, theoretical noise analysis for the length estimatewas not do ne. Instead, empirical noise analysis similar tothat of the 1-D case was done. The number of cases waslimited by computer time and wa s set to 1000. The sigmaof the noise samples was again determined by (36) andSNR's of 5 0 dB, 40 dB, and 30 dB were used. Empiricalmean-shift, st anda rd devia tion, and rms data versus edgelocation and orientation were generated. Th ese tests wereperformed o n the spatial momen t operator with and w ith-out a bias correction table. For comparison, these testswere also performed on the 2-D gray level moment op-erator [ l o ] both with and without a table, the Hueckel[7]-[9] opera tor, and the LOG operat or. Each of these datagenerate a 3-D plot. Due to space constraints, however,none of these plots will be sho wn here.Table I1 summarizes the performance of each operator.Maxim um and rms error for the noise-free (deterministic)case and also rms error for SNR's of 50 d B , 40 dB, and30 dB are given. The range of I used in each measurementwas 0.0 5 1 I .5 cos 8 pixels. This range of 1 corre-sponds to that of the given window being the closest tothe edge. N ote that the use of a bias correction table mark-edly improves the performance of both the gray level andthe spatial moment operators.D. Effects of Noise on Edge Orientation

    The two-dimensional moment operator also estimatesan edge's orientation. This estimate is necessary to fullyparameterize the edge and was investigated for its perfor-mance both in the noiseless case a nd in the presence ofnoise. Theo retical noise analysis of the angle estimate isstraightforward. The angle is determined by the first ordermoments in x an d y and is defined by (47) . As before, themoments fiol nd A?,, are random with Gaussian distr i-bution w hen Gaussian random noise is added to the data.I t can be shown [13] that the moment weightings causeMol an d fila to be independent of each other. The angleis simply a quotient of tw o independ ent Gaussian randomvariables with the added transformation of arc tangent.The density function for the angle [13] is given by:

    ( p X co s 8 + pv in 8)exp [ 2 a 2where

    4 P Xerf (x) = 1 ex p ( - y 2 / 2 ) dyJ G O

    TABLE I1EDGELOCATIONSTIMATIONRROR, OTHDETERMINISTICND IN TH EPRESENCE OF ADDITIVEAUSSIANOISE

    * Some sample windowsdid not convergeandare not include d in these slalisucs.

    where p y is the mean of the numerator, p , is the mean ofthe denominator, and U is the standard deviation of boththe numerator and the denomi nator (they are equal). Usingthe transfomation p X co s 8 + p J sin 8 = p cos ( 8 - 4 )where p2 = p: + p: an d 4 = t an- ' ( p , / p , ) we obtain:

    From (73) , it can be seen that the density function is sym-metrical about C# = tan- ' (p y / p X ) o that the mean valueof 8 is tan- ' ( p , / p X ) .Empirical tests on the orientation estimation using theparameters from above were also performed. Again, thespatial moment and the Hueck el operator were also tested.Table I11 summarizes these results.E. Nonideal Edges and Nonsquare Pixels

    In practice (due to optics, etc.) edges may not be ac-curately modeled as a step, but appear to make a slopedtransition from one gray level to another. B ias correctiontables can be designed to handle such edge profiles. Fo ra linear ramp edge there is the additional parameter oframp width . Bias correction tables for ramp widths of 0 . 3 5pixels and 0.70 pixels were generated and are shown inFigs. 18 an d 19, respectively. Note the similarity to Fig.14 and how the shape changes as the width of the rampedge increases.Up to this point square pixels have been assumed. Th eproblem with this assumption is that imaging devices(CCD c ameras, etc.) often have pixels that are not squarebut are rectangular. Assuming the pixels to be squarewhen they are actually rectangular can cause edge trans-lation estimation errors as well as edge orientation esti-mation errors. For example, if an edge were to passthrough the upper left comer and the lower right cornerof the middle pixel, an operator assuming square pixelswould estimate an edge orientation of 4 5 O . If the pixels

  • 8/2/2019 PAMI Subpixel Measurement

    12/17

    1304 IEEE TRANSACTIONS ON PATTERN ANALYSIS AN D MACHINE INTELLIGENCE. VOL II . N O. 12. DECEMBER 1989

    Operator

    TABLE 111EDGEORIENTATIONSTIMATIONRROR, OTHDETERMINISTICN D I N T H EPRESENCE OF ADDITIVE AUSSIANOISEEdge Angle EHOI degrees)

    Deterministic I RMS n Noise foran S N R ofMax 1 RMS I 5OdB I 4odB I 3-

    Gray Level MomentGray Level Moment wnab leHueckel*

    0.996 0.355 0.367 0.458 0.9810.125 0.0078 0.093 0.292 0.9240.753 0.335 0.335 0.335 0.335Laplacian of Gaussian

    SpatialSpatial wnabl e1 - I 1 I I I I

    3.70 2.52 2.52 2.55 2.800.996 0.355 0.367 0.458 0.9810.0058 0.0023 0.092 0.292 0.923

    * Some sample windows ~d no1convergeand arena twluded m hese staosucsmX.-

    Fig. 18 . Edge translation bias correction table for the spatial moment op-erator with a window size of 5 pixels, and an edge ramp width of 0.35pixels.

    Fig . 19 . Edge translation bias correction table for the spatial moment op-erator with a window size of 5 pixels, and an edge ramp width of 0.70pixe ls .

    were rectangular and the ratio of x-pixel size to y-pixelsize were 4 :3, then the true orientation would be 53.1"resulting in an error of 8 . 1 O . The moment-based operatorwas modified to accommoda te rectangular pixels.Since the circular region was defined on a sq uare pixelmatrix (Fig. 1 ) , his matrix can be modified to allow forrectangular pixels. Th e ratio of x-pixel size to y-pixel sizeare referred to as aspect ratio. A circular region definedon a 5 X 5 pixel grid with an aspect ratio of 4 3 is shownin Fig. 20. Note that the window diam eter is 3.75 x-pixelsor 5.0 0 y-pixels. This difference in pixel size can be con -

    Fig. 20. A circular region defined on a 5 X 5 pixel matrix. The aspectratio is 4 : 3 .

    fusing for quantities measured in pixels such as edgetranslation. Such parame ters will be m easured in x-pixelsto avoid confusion.The masks resulting from integration over the circularregion of Fig. 20 are shown in F ig . 21 . Similar to before,the moment operator using these masks was tested on asynthesized ideal step edge. Th e routine used to generatethe edge was modified to allow for a variable aspect ratio.Using the same parameters as before, an error plot wasgenerated and is shown in Fig. 22. A view of the plotrotated 180" is shown in Fig. 23. Note that the plot nowdoes not possess symmetry abou t the plane 8 = 45 " . Theerror for 8 = 0" is zero for 0 I 5 0.5 x-pixels and for1 = 0. 5 x-pixels, but for 8 = 90" the error is zero for 0I 5 0.375 x-pixels and for 1 = 1.125 x-pixels . How -ever, 0.3 75 x-pixels is equal to 0. 5 y-pixels and 1 .125x-pixels is equal to 1.5 y-pixels. This occurs because thedistances to pixel boundaries are different for edges oforientations of 0" an d 90" as can be seen from Fig. 20.Although not shown here, bias correction tables weregenerated for the 4 3 aspect ratio fo r step edges and rampedges with ramp widths of 0.35 and 0.70 x-pixels.F, Effects of Gray Level Quantization

    Up to this point, the edge data gray values have notbeen quantized, but have been allowed to take on an in-finite number of values. All computer simulation pro-grams used double precision floating-point numbers tosimulate this. Since subpixel operators use gray-level res-olution to obtain subpixel edge location, the number ofgray values has a direct effect on edg e location accuracy.Actual image data is quantized to a f inite number of lev-els, typically 256, ranging from 0 to 255. Consider anedge sample oriented at 8 = 0" . For this angle, each rowin the edge sample is identical. If the edge values arequantized (rounded) to integer values, they will remainconstant for variations in 1 of up to one over the numberof gray levels in the edg e height. T his places a theoreticallimit on edge location accuracy of the best possible edgeoperator as one part in twice the number of gray levelsbetween edge heights. The edge estimation error will be

  • 8/2/2019 PAMI Subpixel Measurement

    13/17

    L Y V E R S er a l . : SU B PI X E L MEA S U REMEN TS U SI N G AN EDGE OPERATOR 1305

    .Woo ,1202 ,2069 .I202 .Woo .oooO .0405 .oooO ,0405 .oooO,043 1 ,2133 .213 3 ,2133 .OK31 -.0128 4 4 5 5 .ME0 0 4 5 5 ,0128.0773 .2133 ,2133 .2133 ,0773 .oooO .oooO .oooO .oooO ,3300,0431 ,2133 .2133 .2133 ,0431 ,0128 .0455 .Woo -0455 -.0128.oooO ,1202 ,2069 .1202 .Woo .oooO ,0405 .oooO -.0405 .oooOMm Mask M II Mask

    .oooO .OS58 .oooO O S 8 .oooO .oooO ,0885 ,1643 ,0885 .oooO-.0373 -.1138 .oooO 1138 .0373 ,0149 .OW3 ,0853 ,0853 ,0149-0693 -.I138 .oooO 1138 ,0693 .oooO .oooO .oaoO .oooO .oooO-.0373 -.1138 .oooO 1138 ,0373 -.0149 -.OS53 -.0853 -.0853 s.0149.oooO .OS58 .oooO 0558 .oooO .Woo .0885 -.1643 - .OM5 .oooOMi0 Mask Mol Mask

    .oooO ,0279 ,0048 ,0279 .oooO ,0661 .I331 ,0661 .oooO,0324 ,0657 ,005 1 ,0657 ,0324 ,0055 .0370 ,0370 ,0370 ,0055,0624 ,0657 ,0051 ,0657 3624 ,0010 ,0028 ,0028 ,0028 .0010.0324 ,0657 ,005 1 ,0657 ,0324 ,0055 ,0370 .0370 ,0370 ,0055.oooO .0279 ,0048 ,0279 .oooO .oooO .0661 .1331 .0661 .oooOMm Mask %Mask

    Fig . 21 . T he set of si x masks used for moment operator with aspect ratioo f 4 : 3 .

    F ig . 22 . Edge translation estim ation error for the spatial moment op eratorwith a window size of 5 pixels, with an aspect ratio of 4: .

    a sawtooth function of true edge translation, so the RMSedge error will be one part in 2 h imes the number ofgray levels between the two edge heights. T his limitationwas analyzed assuming 8 = 0", so it may not be valid atother orientations. In fact, it can be seen that at other an-gles the rows will not be identical, so the limit of accuracymay be better .Empirical tests of gray value quantization on edge lo-cation accuracy were performed for the spatial momentoperator as well as for the gray level moment operator.These tests were performed using in teger valued edge datawith edge step heights of 100, 50, 20, and 10. Also, theeffect of ramp edges were studied using ramp widths of0.0 ( s tep edge) , 0.25 , 0.50, 0.75, 1.00, 1.25, and 1.50pixels. The max imum and rms ed ge location errors for 0I I .5 pixels (as a function of 8 ) were measured. Forthe spatial-moment operator and a step edge , the empiri-cal results for 8 = 0" were exactly as predicted for thebest possible edge operator. The error showed a strongdependence on 8, however . The rm s error was lowest for8 = 1 being less than one-third that at 8 = 0". The rmserror ove r all angles was approximately one-half that at 8= 0" . The effect of a ramp ed ge was a sm all increase inerror which was almo st linear with ramp width, being oneand one-third that of a step edge for a ramp width of 1.50pixels. The g ray level moment o perator did not performquite as well having an rms error that was two and one-half times that of the spatial with 100 gray levels.

    Fig . 2 3. Mirror image of Fig . 22.

    G. Selecting a Confidence MeasureAs with many other edge operators, some type of con-fidence testing is necessary to determine that the esti-mated edge parameters are accurate. Since the edge op-erator was developed assuming a single straight edge in

    its window , it might not give correc t results for other fea-tures such as lines and come rs. Em pirical tests show thatthe results for lines and comers indeed are not accurate.The image shown in Fig. 24(a) was generated to test aconfidence measure. I t includes com ers, ideal step edges,and lines, each with a step height of 100. A good confi-dence measure would be able to reject the comers andlines while detecting the step edges reliably. Magnitudethresholding is a well known method of edge detection,but often yields poor results. Fig. 24(b) shows the resultsof magnitude thresholding at a gray level of 20. Note thatthe results are very poor. Fig. 24(c) shows the results ofa thinning in the direction normal to the estimated edgeorientation by retaining only the pixel closest to and alsowithin one-half of a pixel from an edge. The results ofthis are better , but are still unacceptable.Another method of confidence testing is to compute thevariance of an ideal step edge having the same 1 , 8, an d k(step height) as those estimated and com pare it to the ac-tual variance of the image data. Agreement between thesetwo values would indicate a good edge. Comparison ofthe calculated and actual variance proved t o be a very poorconfidence measure. In m ost cases (even on com ers andlines) the two w ere very close, having n o apparent depen-dence on what type of feature was in the window. Ob-viously, another confidence measure is needed.Notice that Mh2 is not used in the calculation of edgeparameters. This value (47) can be co mpared to that of anideal step edge with the same 1, 8, an d k (step height) asthose calculated. This confidence measure was good atidentifying corners but failed to reject lines.Another method is to com pare the calculated edge pa-rameters to those of the next closest window. A consis-tency in the two sets of edge parameters would indicatethat the results were accurate. The e dge parameters of ori-entation, location, and step height were used. A deviationin the two o rientations of 3 " , the step heights of 15 per-

  • 8/2/2019 PAMI Subpixel Measurement

    14/17

    1306 Ik.EE T R A K S A C T I O N S O N P A T T E RN A N A L Y S I S .AKD h l A C H IK E I V T E L L I G t N C F . V O L I I . NO 17. DECEMBER 1989

    Fig . 24. (a ) Image for confidence test. (b) Result of magnitude threshold-ing. (c) Result of distance thinning. (d) Result o f confidence measurebased on consistency in estima ted edge parameters.

    cent, and edg e location of 0.15 pixel or less was consid-ered accepta ble. The result of this confidence test is show nin Fig. 24 (d). Notice that only the step edges are detectedand the comers and lines are rejected. The confidencemeasure w as also tested o n the image of 24(a) with whiteGaussian noise samples added. The signal-to-noise ratiowas set to 30 dB. T he result was the sa me as that withoutnoise, showing its robustness in moderate signal-to-noiseratios.H , Implementation

    In summary, to implem ent the two-dimensional edgeoperator the following steps must be performed to obtainprecision edg e location.I ) Generate circular moment masks. Sec tio n 111-A de-scribes the process for generating circular moment masksfor discrete data.2) Generate bias table. Generation of the bias erro r ta-

    ble is discussed in Sec tion 111-B.Steps 1 and 2 need to be performed only once and canbe done off-line. However, the moment masks and biastable may need to be changed for different window sizes,shapes , or edge blur .3) Compute the two-dimensional moments. The mo-ments of the window are computed ( M o o ,M o l ,Mlo,Mil,M O 2 , The moment masks permit this to be accom-plished by correlation with the edge d ata.4 ) Compute 8. This is accomplished with the two-di-mensional momen ts and (47).5) Rotate the moments. Rotate the two-dimensionalmoments by 8 , (49), (50),an d (51).6) Compute I , k , and h . These parameters are obtainedusing (56), ( 5 7 ) ,an d (58).7) Correct the bias. The length estimate ( 1 ) is cor-rected with bias table. The angle estimate may also becorrected using a similar table.8 ) Measure conjd ence as per Section I I I -G.Steps 3- 8 are repeated for each window of data. Theresult at each pixel location will be a subpixel edge lo-

    cation 1, edge heights h , k , angle of the edge 8, and aconfidence result.I . Subpixel Edge Location in Real Image Data

    The ed ge operato r developed in the last section was usedto locate edges in real image data to subpixel accuracy.The operator was shown to have an accuracy of betterthan 0.05 pixels for the image data used.A digitized imag e of a backl ighted rectangularly shapedpiece of 0.0625 steel was obtained using an Eikonixscanner. The rectangle was precision machined to 2 by 4inches within two ten-thousandths of an inch in each di-mension. T he image digitizer uses a 1-D photodiode arraywhich is mechanically positioned to scan in the y direc-tion. T he image obtained from this scanner had a resolu-tion of 1024 x 1024 8-bit pixels. A test image was gen-erated by averaging over 2 x 2 regions of the originalimage resulting in an image with a resolution of 512 x512 8-bit pixels and is shown in Fig. 25. The rectangleorientation is approximately 2 O from the coordinate axesof the digitizer. A blow-up of the upper left com er of F ig . 25 is shown in Fig. 26. Note how the pixels appear to fitthe square aperture sampled model. The signal-to-noiseratio in this image exceeded 40 dB, therefore noise wasnot the cause of inaccuracies in this data. One test of theoperators subpixel edge location accuracy is to apply itto a straight edge and check the subpixel location as theoperator moves along the edge. T he operator was appliedto the left vertical edge of Fig. 25. At each pixel alongthe edge the distance to the edge from each window centeralong the x direction was estimated. Since the operatorcalculates a normal distance to the edge, the estimatededge orientation was necessary to calculate this. The ac-tual edge location was calculated by adding this subpixeldistance to the pixels x location. This edge locationshould show a linear change along the edge.This test was performed using the ideal step edge biascorrection table shown in Fig. 14. The results were un-satisfactory. Errors of up to 0.08 pixels occurred. Theoperator underestimated the subpixel edge distance. Acloser look at the image data of Fig. 25 shows that theedge is more closely modeled as a ramp edge. The testwas performed again using a bias correction table for aramp edge of width 0.7 pixels. Sample results from thistest are shown in Table IV . Thc most significant infor-mation is found on the line of Table IV where the x lo -cation of the window center shifts one pixel to the rightand the subpixel fractional estimate changes sign frommaximum positive to maximum negative. This positionoffset varied by at most -0.02, +0.01 pixels over theentire image edge. This test was also performed on thethree remaining edges and gave similar results. This edgeerror of course depends on the window size used. For awindow size of 9 X 9, the error was kO.01 pixels; for a3 x 3 , i t was k 0. 02 pixels.Although an accurate operator would have a constantline-to-line difference, this in itself does not guaranteeoverall accuracy beca use it fails to show cum ulative error.

  • 8/2/2019 PAMI Subpixel Measurement

    15/17

    LYVERS er al . : SUBPIXEL MEASU REME NTS USING AN ED GE OPERATOR

    181 187 I -178.176 I -0.4497

    1307

    180.550 I 0.033

    TABLE 1VSTRAIGHTDG ELOCATIONESULTSN REALDATA WINDOWIZ E= 5 )

    181 190 -177.895

    Fig. 2 5. Digitized image of rectangular steel piece.

    -0.3422 180.658 0.036

    Fig. 26. Blowup of upper left comer of Fig. 25.

    90A est which shows both errors is to fit a straight line Ithe estimated e dge locations, and then calculate the dif-ference, on a line-by-line basis, between the estimatededge location and the position of the line. The result ofthis test for the im age data of Fig. 25 is shown in Fig. 2 7 . Note that the results are not as accu rate as was previouslythought. Fig. 27 shows accuracies of approximatelyk0.05 pixels.To test the operator 's performance on data with rect-angular pixels, a test ima ge of aspect ratio 4 :3 was gen-erated by averaging 4 X 3 regions of the original 1024 X1024 pixel rectangle image. The straight edge test of be-fore (Table 11) was performed. Best results were obtainedusing a bias correction table for a ramp width of 0 . 3 7x-pixels and are shown in Table V . Again, this test wasalso performed on the three remaining sides of the rect-angle and similar results w ere obtained.J . Relationship to the Sobel Operator

    Although this paper has addressed subpixel measure-ments, the moment based o perator presented can be mod-ified for use as a general purpose edge operator. Appli-cations of this include low signal-to-noise images where

    90 -178.380 0.4015 I 90.402 0.023

    I I I I I181 I 18 9 I -177.849 I -0.3784 I 180.622 I 0.035

    -.12s-""L.1Mim 147 174 mi 228 254 281 308 33s 362 389Line number

    Fig. 27. Edge location estimation error fo r data of Fig. 25

    TABLE VSTRAIGHT EDGELOCATIONESULTSN REALDATA ASPECT ATI O :3)x pixel I y pixel 1 theta est. I fract. x est. I total x est. I xdiff prev. line90 I 89 1 -178.151 I 0.3787 1 90.379 I 0.025

    subpixel measurem ents are not practical and also wheresubpixel measurements ar e not needed. Fo r this case, onlyM10 an d M O , need to be estimated as the orientation iscalculated by (47) and the edge step height is calculatedby (57) assuming 1 = 0. Setting 1 = 0 results in a sacrificein accuracy of less than 5 percent [13].Although throughout this paper a window size of 5 pix-els is used, the operator may be implemented for any win-dow size. Fig. 2 8 shows the Mlo an d MO, masks for awindow size of 3 pixels. The factor of 3 / 2 in (57) hasbeen incorporated into these masks. A comparison withthe Sobel reveals that the two are almost identical. Theedge orientation and steu height are estimated in the same

  • 8/2/2019 PAMI Subpixel Measurement

    16/17

    1308 I E E E T R A N S A C T I O N S O N P A T T E R N A N A L Y S I S A N D MA C H I N E I N T E L L I G E N C E . VOI.. 1 1 . N O. 12. D E C E MB E R 1989-0.1374 O.oo00 0.1374 0.1374 0.2840 0.1374-0.2840 O.oo00 0.2840 O.oo00 0.2840 O. o o 0 0-0.1374 O.oo00 0.1374 -0.1374 -0.0853 0.13 74

    Mi a Mask Mol MaskFig . 28 . M , , an d MO, asks used for general purpose operator with a win-dow siz e of 3 pixels.

    manner with M l o analogous to A x an d M O ,analogous toA y. In fact, the ratio of pixel weightings is 2.067 whereasfor the Sobel it is 2.0. Therefore, the general purpose mo-ment based operator provides a method of extending theSobel to arbitrarily large window sizes. Larger windowsizes allow significantly better edge orientation and stepheight estimations both in the noise-free case and in thepresence of noise [13]. In fact, the moment-based opera-tor with a window size of 5 pixels in the no ise-free casehas an orientation estimation error of less than 1 O whileits edge step height estimation error is less than 5.0 per-cent [131. Contrast this with the error of the extended So-bel (window size of 5 ) which h as an orientation estimationerror in excess of 2.0 [16].

    IV . SUMMARYA gray-level moment-based edge operator was devel-

    oped which operates on a window from a digitized imageto determine the location, angle, and gray level step heightof an edge. The operator can accommodate edges sampledwith rectangular pixels as well as ramp edg es.In the presence of noise, the operators location esti-mate was show n to have a relatively small bias and a smal lstandard deviation wh en an e dge is near the center of thewindow. In comparison, the Hueckel and Tabatabai edgeoperators were shown to have high edg e location estima-tion bias errors. The Hu eckel operator was also shown tohave a large edge location estimation length variation inthe presence of noise.Application of the operator to the digitized imag e of abacklit metal plate resulted in the location of the edge towithin 0.05 pixel and the determination of the angle towithin 0.3 degrees.

    REFERENCES[ l ] W. F re i and C . -C . Chen, Fas t boundary de tec t ion: A gene ra l iza t ionand a new algorithm, IEEE Trans. Comput. , pp. 988-998, O ct.1977.[2] L. G. Roberts, Mach ine perception of three-dimensional solids,in Optical and Electro-Optical Information Processing , J . T . Tippe t te t a l . , Eds.[3 ] R . 0 . Duda and P . E . Har t , Pattern Classification and Scene Analy-s i s . New York: Wiley , 1973.[4] P . J . M acvica r -Whe lan and T . 0 . Binford, Lin e f inding with sub-pixel precision, Proc. SPIE, vol . 281, 1981.[5 ] R. M achuca and A. L . Gi lbe r t , F inding edges in noisy scenes ,IEEE Trans. Pattern Anal. Machine Intell., vol . PAMI-3 , pp . 103-111, Jan . 1981.[6] R . Neva tia and K. R . Babu, Linea r f ea ture ex t rac t ion and desc r ip-t ion , Comput. Graphics Image Processing, vol . 13 , pp . 257-269,

    1980.[7] M . H. Hueck el, A n o perator which locates edges in digitized pic-tures, J . A C M , vol. 18, pp. 113-125, Jan. 19 71.[8 ] -, A local visual operator which recognizes edges and lines, J .A C M , vol 20 , pp . 634-647, Oc t . 1973.

    Cambr idge , MA: MIT Press , 1965.

    [9 ] -, Erratum for A local visual operator which recognizes edgesand lines, J. A C M , vol . 21 , p . 350, Apr . 1974.[ l o ] A . J . Taba taba i and 0 . R. Mitchell, Edge location to subpixel val-ues in digital imagery, IEEE Trans. Pattern Anal. Machine Intell.,vol. PAMI-6 , no . 2 , pp. 188-201, Mar. 1984.1111 A. Huertas and G. M edioni, D etection of intensity changes withsubpixel accuracy using Laplacian-Gaussian masks, IEEE Trans.Pattern Anal. Machine Intell. , vol . PAMI-8 , no . 5 , pp . 651-664,Sept . 1986.[ 121 A . Englan der, Expand ing machine vision gauging with sub-pixeltechniques , Sensors-J. Machine Perception , vol . 4 , no . 6 , pp . 9-18 , June 1987.[13] E. P. Lyv ers and 0 . R. M itche l l , P rec is ion edge contra s t and on -entation estimation, ZEEE Trans. Partern Anal. Machine Inrell., vol.PAMI-10, no . 6 , pp . 927-937, Nov. 1988.[141 A. Papoulis, Probab ility , Random Variables , and Stochastic Pro-cesses .[ I51 W. K. Pratt, Digital Image Processing. New York: Wiley , 1978,p . 4 9 8 .[16] A. Iann ino and S . Shapiro, A n iterative generalization of the Sobeledge detection operator , in Proc. ZEEE Con& Pattern Recognitionand Image Processing, Aug. 6-8, 1979, pp. 130-137.

    New York: McGraw-Hil l , 1965 , p . 65 .

    Edward P. Lyvers was born in Fort Wayne, IN.He rece ived the B .S .E.E. , M.S .E.E. , and Ph.D.degrees f rom Purdue Un ive r s i ty , West La faye t te ,IN, in 1978, 1980, and 1988, r e spec tive ly . Whi leworking toward the Ph.D. degree, he was spon-sored by an RCA Zworykin Fe l lowship and theEngineering Research Center at Purdue.He is now employed at MIT Lincoln Labora-tory, Lexington, MA. His current research inter-ests include many aspects of computer vision andimage urocessing. some of which are image ac-. -quisition, edge detection, and autom ated inspection using comp uter vision.Dr . Lyvers i s an ac t ive member of Eta Kappa Nu.

    Owen Robert Mitc hell (S64-M72-SM82) wasborn in Beaumont , TX, on Ju ly 4 , 1945. He re-ceived the B.S.E.E. degree from Lamar Univer-s i ty , Beaumont , in 1967 and the S .M.E.E. andPh.D . degrees from the Ma ssachusetts Institute ofTechnology, Cambr idge , MA, in 1968 and 1972,respectively.In 1972 he joined the faculty of Purdue Uni-versity where he served as Professo r of Electr icalEngineering, Assistant Dean of Engineering forIndustr ial Relations and Industr ial Research, andan Associate Director of the NSF Engineering Research Center for Intel-ligent Manufacturing S ystems. He spent two summ ers at White San ds Mis-sile Range, where he familiarized himself with the problems of real-timevideo tracking and pattern recognition. In 1 988 he became Chairman andProfessor of Electr ical E ngineering at the U niversity of Texas a t Ar l ington .He is currently active in teaching and research in th e areas of digital imageprocessing and compu ter vision, shape and texture analysis, and precisionmeasurements in images.

  • 8/2/2019 PAMI Subpixel Measurement

    17/17

    L Y V E R S et al.: S U B P I X E L M E A S U R E M E N T S U S IN G A N E D G E O P E R A T O R 1309

    Mark L. Akey (S84-M86) received B S.E.E ,M.S.E.E. , and Ph.D. degrees from Purdue Uni-versity, West Lafayette , IN, in 1980, 1982, an d1985, respectivelyHe is a Staff Mem ber of DAC E (Dec is ion sup-port systems Applied Center of Excellence), acorporate level IR&D group within MagnavoxElec t ronics Sys tem Company, For t W ayne , IN. Inthis capacity, he is manager of and specific inves-tigator in corporate-wide research efforts as theyrelate to the area s of decision support systems andartif icial intelligence Hi s technical contn bution s to the group typically en-compass research methodologies, concept development, and prototypicalimplementations. In addition to the abov e areas, his background and inter-ests include the areas of computer vision, statistical pattern recognition,neural networks, and chaos theory Prior to joinin g Magnavox, he con-sulted for a number of companies, pnncipally in the area of image pro-cessing Thes e companies included Battelle , Hughes Aircraft, ATT Elec-tronic Photography and Imaging Center , White Sands Missile Range,I-SCAN, and Product Research Organization. These efforts included FLIRdata target recognition, image compression of color images, and patternrecognition in multidimensional feature spaces.

    Dr . Akey is a member of Eta Kappa Nu, S igma P i S igma , AFCEA, andthe Corporation for Science and Technology of Indiana.

    Anthony P. R eeves (M76-SM84) received the B.Sc. deg ree (honors firstclass) in electronics and the Ph.D. degree from the University of Kent,Canterbury, England, in 1 970 and 19 73, respectively.He is currently an Associate Professor in the School of Electr ical En-gineering, Cornell University, I thaca, NY. Previously, from 197 6 o 1 982,he was an Assistant Professor in the School of Electr ical Engineering atPurdue University. H e has held visiting faculty positions at the Universityof Wisconsin , Madison; McGil l Unive rs i ty , Montrea l , P .Q. , Canada ; andPavia University, I taly. From 1987 to 1988 he was a m ember of the facultyof the Department of Comp uter Science, University of I llinois at Urbana-Champaign. His current research interests include parallel processing andcomputer vision. He developed the high level programming language, calledParallel Pascal, for NASAs Massively Parallel Processor and is now work-ing on dynamically adaptable programming environments for multicom-puter systems. Vision research is centered on the macro feature approachto three-dimensional object recognition.Dr. Reeves is a member of the Association for Computing Machinery,Sigma Xi, and Eta Kappa Nu.


Recommended