A Comprtive Anlysis of Algorithms for Determining the Pek Position of Stripe to Sub-pixel Accurcy D.K.Nidu R.B.Fisher Deprtment of Artificil Intelligence, University of Edinburgh 5 Forrest Hill, Edinburgh EH1 2QL, UK. Abstrct This pper provides comprtive nlysis offivelgorithms for determining the pek position in lser rnging system to sub-pixel ccurcy. The exercise ws crried out in order to determine the most suitble method in terms of ccurcy nd robustness, for determining the loction of the pek of n observed lser stripe to sub-pixel resolution. 1 Introduction This pper describes comprtive nlysis of the efficcy of five lgorithms in determining the pek position of lser stripe to sub-pixel ccurcy. It is necessry in mny pplictions to mke detiled mesurements which re outwith the scope of system which relies on loctionl ccurcy to the nerest pixel. It is, therefore, worthwhile to use lgorithms tht estimte feture positions to sub-pixel ccurcy by interpolting the sensor response function (e.g.fl], [2]). In n imging system which relies on ccurcies to the nerest pixel while trnslting from 2-D cmer coordintes to 3-D world coordintes, the ccurcy of determintion of the 3-D coordintes of point in spce will be limited by the resolution of the imge from the cmer. In our rnge sensor (working volume 20cm on side), ech pixel imges bout lmm of the scene. In order to determine the stripe to sub-pixel ccurcy, the imge of the stripe must be blurred. This is lmost lwys the cse becuse lthough it is possible opticlly to focus the stripe to less thn single pixel width, the opertive response of individul sensor elements often leds to mesurement tht is severl pixels wide. The y-coordinte of the observed pixel is determined by the verticl distnce of the scn line from the top of the imge. The x-coordinte is determined by the loction of the pixel cross prticulr scn line. Therefore, when we refer to the sub-pixel position of the pek of the stripe, we re discussing the x- coordinte of the pixel. Becuse of tringultion clcultion, greter ccurcy in determintion of pek position in 2D will utomticlly result in more ccurte determintion of the loction of the pek in 3D coordintes. BMVC 1991 doi:10.5244/c.5.28
218 2 Description of Algorithms In ll lgorithms discussed below, the clcultions use intensity vlues tht hve hd the bckground intensity subtrcted. 2.1 pproximtion The computtion uses the three highest, contiguous intensity vlues round the observed pek of the stripe nd ssumes tht the observed pek shpe fits profile. This ssumption is superficilly resonble s the lignt incident on the sensor is known to be nerly distributed nd the pixels hve n overlpping, nerly response. However, becuse ech pixel integrtes light over its field of view nd becuse the physicl sensor pds of the solid-stte cmers we use hve gp between them, the distribution will not be exctly. None the less, while we do not know the exct form of the distribution, we ssume tht the composition of ll these effects cn be modelled by distribution. If, b nd c re the intensity vlues observed t pixel positions x 1, x nd x + 1 with b hving the highest vlue, then the sub-pixel loction (X) of the pek is given by : In (c)-in () = x - - ( 2 U where x is the ^-coordinte of the centre of the pixel with intensity vlue b. As, b nd c re integers in the rnge 0-255, the log clcultion cn be performed by tble lookup. 2.2 Centre of Mss The centre-of-mss() lgorithm lso ssumes tht the spred of intensity vlues cross the stripe conforms to distribution. Thus, the loction of the pek cn be computed by simple weighted-verge method. Suppose gin tht the three highest intensity vlues re given by, b nd c. Also suppose the x-coordinte of b is x, then the sub-pixel loction of the pek is given by : - (x - l) + bx + c{x + 1) --'. X = +b+c = x + +b+c The extension of the lgorithm for 5 nd 7 points(clled nd ) is obvious. Algorithms to use ll points long the rster scn[3] lso exist. 2.3 Interpoltion This method ssumes tht simple, liner reltionship defines the spred of intensity vlues cross the stripe. Thus, if the three highest intensity vlues re identified s before, then : If c >, X = x - i ^ else, X = x - ^ 2.4 Estimtor A continuous version of the pek finder is derivble from the Tylor series expnsion of the signl intensity ner the pek. If the pek is t f(x + 6) nd we observe the signl t f(x), then we hve: f'(x + S) = 0 = fix) + Sj"(x) + O(S 2 )
219 Neglecting the higher order terms, nd estimting the derivtives discretely : 5-1 f"(x) This estimtor is lso tht found by fitting prbolic function to the points f(x 1), f(x) nd f(x+l). In the experiments below, we cll this the prbolic estimtor. 2.5 Blis nd Rioux Detectors Blis nd Rioux[4] introduced fourth nd eighth order liner filters: 3i(x) = f to which we lso dd second order filter: These opertors ct like form of numericl derivtive opertor. The pek position is estimted s bove by: 5 = Their results showed tht the 4 th order opertor hd better performnce thn the 8 th order opertor over the stripe widths tht we re interested in here, so we only nlyze it (clled below) nd the simplified 2 nd order opertor (clled below). The 8 th order opertor hs better performnce for stripe widths with gussin width prmeter lrger thn 2. 3 Mximum Error of Estimtors Assuming tht the observed stripe hs form nd the true pek position is ner to n observed pixel, we determine the reltionship between the estimted nd true pek positions (ie. offsets from tht pixel), for ech of the pek detectors. Assume tht the continuous stripe is modeled by: (»-f)3 f(n) = e 2T 2 where ^ < 6 < ^ is the true pek position nd / is smpled t n = 2,-1,0,1,2,... We ignore the problems of pixels integrting their inputs over their sptil extent, s well s ny shping functions the cmer nd digitizer my pply. We might sk wht is the mximum devition 6 8 over the rnge < 6 < for ech estimtor. We generted smpled stripes for vlues of 6 over this intervl nd clculted the estimted 6. Figure l(left) shows the error versus S for the estimtor for cr 1.0. By weighting the estimtor (8' est imtor6) we cn, for given, reduce the mximum error by spreding the error cross the full rnge. Figure 1 (right) shows the error for the resulting estimtor when 1.006. When using the modified estimtors, we cn reduce the mximum errors to (using n chosen to mximlly reduce the error when 1.0):
220 Error x 10~ 3 Error x 10" 6 3.OO 300.00-2.00 200.00 1.00- ioo.o 0.00-0.00- -1.00-100.00- -200.00- -2.00-3.00-300.00- rue Pe X 10',-3-500.00 0.00 500.00-500.00 True Pek x 10 0.00 500.00 Figure 1: Error vs 6 For Unbised (left) nd Bised (right) C0M7 Estimtor 0.5 1.0 1.5 0.0 0.0 0.0 1.0 0.380 0.005 0.239 1.85 0.041 0.002 0.150 1.093 0.021 0.000 0.057 1.006 0.103 0.030 0.049 0.93 0.156 0.029 0.034 1.08 0.026 0.024 0.022 0.95 0.023 0.013 0.011 0.975 This shows tht, in t lest the cse of = 1.0, we cn tune the estimtor to hve very low error; however, setting the vlues for one <x my produce reduced performnce t other s. 4 Non-ity of Estimtors Using the stripe model in Section 3, we cn determine n nlytic model of the estimted pek offset 6 for smll, rel offset, S. Our nlysis ssumes first-order pproximtions, so: We cn now determine the form of 6 for ech pek estimtor: Estimtor Locl Estimte 6 6 e~~& " (l-e-±») S e~i^ 26 e~& Estimtor Locl Estimte 26 e~& " 2 (l+2e~2*) 26 e~i^t+4e"i^ 26 e 2^+4e 2^+9e i^5 " (l+2e~27 5 +2e"2^+2e"2? 5 ) 26 e~^ +2e~2^ The estimtor hs the idel form for smll 6. From these results, we see tht the prbolic opertor gives one hlf the results of the liner opertor. However, in light of the results from Section 3, we use the estimtor
221 bis to chnge the linerity ccording to the lgorithm. When = 1.0 (s pproximtely in our cse), the resulting 5 is: Estimtor 5 Guss 1.005 1.015 1.05 1.05 1.405 0.835 1.335 1.175 Hence, only the nd estimtors re resonbly non-liner. Overll, this noise-free theoreticl nd empiricl nlysis suggests tht the, nd estimtors re not prticulrly good. However, given typicl sensor substructure, pixel sptil integrtion nd cross-tlk, non-gussin stripe formtion nd non-liner sensor trnsfer functions, errors of less thn 5% seem unlikely in ny cse. Hence, the Guss,,, nd estimtors still seem like good cndidtes. 5 Errors in the Presence of Noise In line with the experiments of Blis nd Rioux[4], we investigted how error in the stripe dt ffected the estimted stripe position. These experiments were conducted by generting synthetic stripe dt with known, but rndomly chosen stripe offset bout n exct pixel position, nd then corrupting the observed stripe intensity with noise. The min controlled vrible ws the stripe width. Uniform noise ws dded (following the model of Blis nd Rioux). Point mesurements were generted by: s(m, x, <r,f3) = e + /?n where: x U[ 0.5, +0.5] is the stripe position. m G { 3, 2, 1, 0,1, 2, 3} re the mesured pixel positions. n G U[0,1] is the noise vrible. is the stripe width prmeter (rnge 0.8 to 1.8). P ws the mgnitude of the noise, nd ws considered for /? = 0.0, 0.1, 0.25, which bounded our observed noise level. We mesured both RMS error (/j? J2( x i -*i) 2 ) n d mximum devition xi - i ) s function of for N = 10,000 smples. Figure 2 shows the RMS error for /? = 0.1. Immeditely, we see tht the nd estimtors re problemtic. Wht is surprising is the error of the estimtor t low stripe widths. However, this is understndble s, when the stripe width is low, the stripe intensities fll quickly t non-centrl pixels, cusing the noise to more quickly dominte the signl nd hve greter effect. To compre the lgorithms, we lso summed the RMS error for = 0.8 1.8 (by 0.05) for the three vlues of/?. 0 0.00 0.10 0.25 0.00 1.07 2.49 3.71 3.90 4.25 1.36 1.86 2.67 0.31 1.32 2.63 0.87 1.36 2.62 0.49 1.23 2.61 0.39 0.93 2.12 0.24 0.77 1.86
222 Error x 10 200.00 150.00 100.00 / _ COM3--".. Li ner. Guss CoM"5 CoMT LI ner" PrboTic 50.00 1.00 1.50 Sigm Figure 2: RMS Error Versus IT For The Estimtors, Noise = 0.1 6 Empiricl Testing The experiments used three different test objects. These were cube, trpezoid with its top surfce t n ngle of 10 to the horizontl, nd n equilterl prism (see Figure 3) to test the effect of surfce orienttion on pek loction. In ll cses, the object ws oriented so tht ll rnge vlues long the stripe were equl. The experiments obtined series of rnge imges comprising 100 Figure 3: Detil of experimentl objects rnge stripes ech. A single dt point ws chosen from ech stripe, such tht ll the dt points chosen ly long line prllel to the x-xis. Secondly, the stripes were tken with very smll micro-stepper step size (0.2mm for the prism nd 0.3mm for trpezoid nd the cube), thereby leding to high dt density. Also, the depth resolution ws kept high (0.03mm), so tht the errors being mesured would be of lrger mgnitude thn the quntistion errors. With ech of the surfces, ech lgorithm ws used to detect the pek, nd then the depth clculted from ech cmer ws noted nd their verge
223 computed. In the cse of the trpezoid nd the prism, the direction of the slope ws lternted to eliminte the effect of the imge of the stripe creeping cross from one pixel to the next on the imging surfce of the cmers. The experiments with the prism were performed with the norml of the prism in the x z plne. A liner lest-squres fit ws computed for ech set of dt points. The slope of this fitted line (z = + bx) ws computed, nd the minimum nd mximum vlues of the errors from the fitted line were recorded. The vrince of the errors ws lso computed. The comprtive sttistics re shown below. Surfce Flt Surfce Algorithm 49.7680 49.6466 49.7025 49.6239 49.7878 49.7397 49.6804 49.6808 b 0.000112 0.000006 0.000130 0.000036 0.000090 0.000297-0.000171-0.000411 Min. -0.12762-0.06152-0.10121-0.09555-0.07676-0.14026-0.21498-0.13912 Error(mm) Mx. 0.09815 0.08812 0.09972 0.09658 0.08499 0.14496 0.11769 0.16080 Vrince 0.00249 0.00122 0.00156 0.00156 0.00120 0.00271 0.00323 0.00343 Surfce 10 slope, left to right 10 slope, right to left Algorithm 57.2598 57.7386 57.6771 57.6287 57.6665 57.7211 57.8916 57.8261 51.3929 51.8246 51.7356 51.6648 51.7305 51.7699 50.9346 50.9251 b -0.05306-0.05443-0.05466-0.05478-0.05391-0.05436-0.05389-0.05382 0.05424 0.05257 0.05321 0.05277 0.05263 0.05281 0.05460 0.05439 Min. -0.24558-0.45631-0.37467-0.29864-0.30376-0.23738-0.27106-0.28686-0.31441-0.43193-0.34414-0.32581-0.35943-0.35278-0.33865-0.30189 Error(mm) Mx. 0.38329 0.56070 0.31389 0.34434 0.31999 0.37868 0.28737 0.33492 0.51424 0.47276 0.41777 0.42064 0.40299 0.41456 0.48187 0.47461 Vrince 0.02463 0.05423 0.03110 0.02416 0.01737 0.01899 0.01836 0.02110 0.03381 0.04573 0.03457 0.03128 0.03645 0.03496 0.03299 0.03184 Surfce 60 slope, left to right 60 slope, right to left Algorithm 70.2352 70.3217 70.3418 70.1715 70.2851 70.3154 70.1493 70.1202 23.5725 23.5071 23.5518 23.3997 23.5029 23.5249 23.5494 23.5244 b -0.34806-0.34726-0.34816-0.34771-0.34810-0.34841-0.34781-0.34813 0.34834 0.34925 0.34852 0.34865 0.34894 0.34873 0.34841 0.34870 Min. -0.43505-0.42918-0.37187-0.39819-0.43443-0.39460-0.46431-0.47256-0.34344-0.33353-0.31148-0.40910-0.38680-0.39773-0.31710-0.34116 Error(mm) Mx. 0.45969 0.51835 0.55610 0.51866 0.42978 0.50010 0.51234 0.47195 0.44277 0.41938 0.35788 0.48459 0.47643 0.44770 0.46174 0.52795 Vrince 0.04737 0.05024 0.04146 0.04106 0.04897 0.04764 0.05624 0.04401 0.03918 0.03397 0.03213 0.03624 0.03994 0.03675 0.03628 0.02985 The mesured vlues for re not prticulrly relevnt. The vlues of b re of interest, becuse they specify the slope of the surfce s mesured by the lgorithms used. The true vlue of b is 0 in the cse of the cube, ±0.0538 in the cse of the trpezoid, nd ±0.3464 for the prism. These vlues were derived by creful, physicl mesurements of the objects, but re still subject to the usul mesurement errors.
224 Figure 4 shows the vrition of the residuls from the line of best fit pplied to the mesured dt. The plots hve ech been offset by different mount so tht they re pper together on one grph. The mximum bsolute vrition of the plots from the line of best fit is bout 0.5mm. Note the periodic structure of the residuls resulting from lising between the pixel spcing, inter-pixel gps nd the stripe width. 0 20 40 60 80 100 Position cross mesured surfce Figure 4: Comprtive depth profiles cross 10, right-to-left slope The results from the trpezoid clerly show systemtic errors in the system, cused by the imge of the pek creeping from one pixel to the next, cross the inter-pixel gp. The performnce with the prism is even worse. This is becuse the cute ngle of the object, which is very close to the ngle of the cmer xis to the horizontl, cuses the stripe to move cross the imging sensors more quickly. In effect, the cmers re virtully sighting long the slope of the prism. The nd lgorithms pper to show the lest mount of perturbtion. We estimte the inter-pixel gp to be lmost s wide s pixel. 7 Conclusions The empiricl results show tht the lgorithm hs poor performnce. The other methods disply performnce within the sme rnge probbly becuse of fctors such s sensor structure, inter-pixel gps, cross-tlk, nd integrtion of the sensor response over the width of the pixel. The nd methods hve been shown to possess high non-linerity (Section 4). When we consider the errors produced, the sum of the RMS errors re highest for the nd lgorithms. They re joined by the lgorithms when we consider the mximum errors. This leves us with only the, nd lgorithms s suitble cndidtes. The lising gives periodic structure to the estimtors. This could be estimted nd n pproprite model used to correct for the effects. In the cse of lgorithms like the nd, which rely on lrge number of points round the pek, we notice tht speculr reflections nd trnsprency my cuse problems since the outlying pixels hve substntil effect on the computtion of the loction of the pek. Also, in the cse where the object hs holes in it, cusing internl reflections nd mutul illumintion, the weighted
225 verge method of the CoM lgorithms will deliver skewed estimte of the pek position. We cn see good performnce over rnge of nd j3 for the estimtor. This is lso cler in Figure 2; however, the estimtor hs obvious benefits s the noise level or stripe width decreses. It is lso interesting tht the figures show to wht extent the choice of estimtor is linked to the specific stripe width nd noise level. For our striper, the noise seems to be bout 2-3 qunt, or bout 1-5% of the pek intensity. When compring the speeds of the lgorithms, The is the slowest by bout fctor of 2 over the lgorithm. However, the pek detection sub-process tkes up only smll percentge of the totl rnge imge cquisition nd pek detection time, so the speed of the lgorithms is not fctor in their comprison. These results pply to digitised video signls, wheres some lgorithms, nmely the centre-of-mss lgorithm, cn be pplied directly to the video signl[2], [3]. An lterntive pproch to producing rel-time stripe detection nd sub-pixel loction is to scn for the pek s the digitized intensity is clculted. Both pproches hve been implemented in hrdwre nd thus remove computtionl expense s considertion, becuse one hs to wit for the complete video scn nywy, when using stndrd video equipment. 8 Acknowledgements The uthors grtefully cknowledge the generous ssistnce of the University of Edinburgh nd the Europen Institute of Technology (Grnt EIT-061) for funding the reserch described in this pper. References [1] P. J.Mc Vicr-Wheln & T.O.Binford, "Intensity Discontinuity Loction to Sub-pixel Precision", Proc. 7th Int. Conf. on A.I., pp 752-754, 1981. [2] D.Brggins, "Achieving sub-pixel precision", Sensor Review, 1990. [3] S.J.White, "Method nd Apprtus for Locting Center of Reference Pulse in Mesurement System", U.S.Ptent No. 4,628,469, December 1986. [4] F.Blis k M.Rioux, "Rel-Time Numericl Pek Detector", Signl Processing 11, pp 145-155, 1986.