4
Synthesis and detection of log-spiral codes Stefan M. Karlsson, Josef Bigun Halmstad University, IDE SE-30118 Halmstad, Sweden Telephone: (0046) 35167200, Fax: (0046) 35120348 Email: {Stefan.Karlsson, Josef.Bigun}@hh.se Abstract—Simultaneous positioning and identifying ob- jects accurately and reliably is a fundamental problem in computer vision. General solutions to this problem is still challanging. For certain applications to achieve high accuracy and reliability in both tasks can be achieved if the objects can be labeled, e.g. multiple simultaneous robot tracking and navigation. We suggest a labeling technique using spiral patterns for optimal position estimation and identity recognition using the generalized structure tensor and tresholds. The technique adapts the synthesis of the labels to the frequency characteristics of the detection method. The approach has been implemented and tested by an over-head camera to track and control 8 robots in real-time. I. I NTRODUCTION This paper investigates the use of smooth differentiable log-spiral patterns for computer vision and image analysis tasks, such as robot navigation, tracking and bar-code like encoding. We are concerned with synthesized visual patterns observed by still and video cameras 1 ; specifically how to construct spiral patterns for marking objects, and to efficiently detect their position as well as the twist-angle of the spirals, which also comprises chirality (left/right handedness). As computation time is a scarce resource the synthesis of spirals can be influenced such that detection becomes easy and reliable. Here we will present a synthesis technique that yields detection by tresholding using the same treshold to detect all spirals, regardless their twist-angle. The detection part of this work is in line with the theory of the generalized structure tensor [2], [3], [9], [4] suggested in the context of general shape detection, comprising, moment invariants, [8], [11], Generalized Hough Transform [7], [1], Fourier Descriptors [6], [5], specifically the symmetry derivative differential operators [4] which also presents a more detailed review of the subject. The synthesis part by contrast concerns [12], and is to be viewed in the context of artificial marking and labeling of objects, comprising barcodes[10]. In the general formulation of these operators, they can be used to to detect a wider range of patterns than just spirals. The algorithm suggested here will be specifically tuned to the spirals generated by a Log(z) coordinate transformation of the sinusoids exp(i(ω x y + ω y y)). Fig. 1 illustrates both the original sinusoid(left) and its corre- sponding spiral pattern. 1 This is distinctly different from the so-called 2D spiral pattern recognition problem, wherein observed data from different sources follow intertvined spiral probability distributions. Fig. 1. Illustration of spiral patterns(left) for patterns of L =4 with corresponding sinusoid(right). Top row: θ =3 π 8 , bottom row θ =1 π 8 ). II. THE GENERALIZED STRUCTURE TENSOR AND SPIRALS The full set of spirals is defined by the (integer) number of legs (L) and twist angle (θ) (twist is related to the spiral pitch by θ - π/2). These can be detected using only symmetry derivative operations at different scales[4]. The symmetry derivative of order n 0 is defined as (D x + iD y ) n and (D x - iD y ) -n for n< 0. Symmetry derivatives of Gaussians, SDG, becomes: Γ {n,σ 2 } (x, y)= M (n) 1 2πσ 2 exp(- x 2 + y 2 2σ 2 ) (1) where M (n)=(- x+iy σ 2 ) n for n 0, and M (n)= (- x-iy σ 2 ) -n for n< 0 To detect and identify spirals, we will make use of the following framework for (the generalized structure tensor)[4]: I 20 = Γ {n,σ 2 2 } * {12 1 } * f ) 2 (2) I 11 = |Γ {n,σ 2 2 } |*|Γ {12 1 } * f | 2 (3) We shall henceforth use use n= -2. The magnitude of I 20 then represents the presence evidence for a spiral and its argument the twist-angle of the spiral (in double angle). Additionally the inequality |I 20 |≤ I 11 holds with equality iff the image is a spiral pattern. Thus one can treshold |I 20 | if its dynamic range is known. If the dynamic range is unknown, then a convenient bounded measure for the occurrence of spirals is given

Synthesis and detection of log-spiral codesdexal2.hh.se/staff/josef/public/publications/karlsson11... · 2011. 3. 15. · Synthesis and detection of log-spiral codes Stefan M. Karlsson,

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Synthesis and detection of log-spiral codesdexal2.hh.se/staff/josef/public/publications/karlsson11... · 2011. 3. 15. · Synthesis and detection of log-spiral codes Stefan M. Karlsson,

Synthesis and detection of log-spiral codesStefan M. Karlsson, Josef Bigun

Halmstad University, IDE SE-30118 Halmstad, SwedenTelephone: (0046) 35167200, Fax: (0046) 35120348

Email: {Stefan.Karlsson, Josef.Bigun}@hh.se

Abstract—Simultaneous positioning and identifying ob-jects accurately and reliably is a fundamental problemin computer vision. General solutions to this problem isstill challanging. For certain applications to achieve highaccuracy and reliability in both tasks can be achieved ifthe objects can be labeled, e.g. multiple simultaneous robottracking and navigation. We suggest a labeling techniqueusing spiral patterns for optimal position estimation andidentity recognition using the generalized structure tensorand tresholds. The technique adapts the synthesis of thelabels to the frequency characteristics of the detectionmethod. The approach has been implemented and testedby an over-head camera to track and control 8 robots inreal-time.

I. INTRODUCTION

This paper investigates the use of smooth differentiablelog-spiral patterns for computer vision and image analysistasks, such as robot navigation, tracking and bar-codelike encoding. We are concerned with synthesized visualpatterns observed by still and video cameras1; specificallyhow to construct spiral patterns for marking objects,and to efficiently detect their position as well as thetwist-angle of the spirals, which also comprises chirality(left/right handedness). As computation time is a scarceresource the synthesis of spirals can be influenced suchthat detection becomes easy and reliable. Here we willpresent a synthesis technique that yields detection bytresholding using the same treshold to detect all spirals,regardless their twist-angle.

The detection part of this work is in line with thetheory of the generalized structure tensor [2], [3], [9],[4] suggested in the context of general shape detection,comprising, moment invariants, [8], [11], GeneralizedHough Transform [7], [1], Fourier Descriptors [6], [5],specifically the symmetry derivative differential operators[4] which also presents a more detailed review of thesubject. The synthesis part by contrast concerns [12], andis to be viewed in the context of artificial marking andlabeling of objects, comprising barcodes[10].

In the general formulation of these operators, they canbe used to to detect a wider range of patterns than justspirals. The algorithm suggested here will be specificallytuned to the spirals generated by a Log(z) coordinatetransformation of the sinusoids exp(i(ωxy + ωyy)). Fig.1 illustrates both the original sinusoid(left) and its corre-sponding spiral pattern.

1This is distinctly different from the so-called 2D spiral patternrecognition problem, wherein observed data from different sourcesfollow intertvined spiral probability distributions.

Fig. 1. Illustration of spiral patterns(left) for patterns of L = 4 withcorresponding sinusoid(right). Top row: θ = 3π

8, bottom row θ = 1π

8).

II. THE GENERALIZED STRUCTURE TENSOR ANDSPIRALS

The full set of spirals is defined by the (integer) numberof legs (L) and twist angle (θ) (twist is related to thespiral pitch by θ − π/2). These can be detected usingonly symmetry derivative operations at different scales[4].The symmetry derivative of order n ≥ 0 is defined as(Dx + iDy)n and (Dx − iDy)−n for n < 0. Symmetryderivatives of Gaussians, SDG, becomes:

Γ{n,σ2}(x, y) = M(n)

1

2πσ2exp(−x

2 + y2

2σ2) (1)

where M(n) = (−x+iyσ2 )n for n ≥ 0, and M(n) =

(−x−iyσ2 )−n for n < 0To detect and identify spirals, we will make use of

the following framework for (the generalized structuretensor)[4]:

I20 = Γ{n,σ22} ∗ (Γ{1,σ

21} ∗ f)2 (2)

I11 = |Γ{n,σ22}| ∗ |Γ{1,σ

21} ∗ f |2 (3)

We shall henceforth use use n= -2. The magnitude ofI20 then represents the presence evidence for a spiral andits argument the twist-angle of the spiral (in double angle).Additionally the inequality |I20| ≤ I11 holds with equalityiff the image is a spiral pattern. Thus one can treshold|I20| if its dynamic range is known.

If the dynamic range is unknown, then a convenientbounded measure for the occurrence of spirals is given

Page 2: Synthesis and detection of log-spiral codesdexal2.hh.se/staff/josef/public/publications/karlsson11... · 2011. 3. 15. · Synthesis and detection of log-spiral codes Stefan M. Karlsson,

Fig. 2. Magnitude of the filter Γ{−2,σ22} used in outer convolution in

Eq. 2

by:|I20|I11∈ [0, 1]

However, we applied (the same) threshold to detectall spirals |I20| here. This is because we are able tocontrol the dynamic range of |I20| for various twist-angles by designing the spirals such that they fit to thefrequency characteristics of the detection filters. We notethat according to our definition of spirals, concentriccircles(θ = π/2) as well as radial line patterns (θ = 0)are included. This has implications that will be discussedlater. The twist of the spiral detected is given by:

θ =∠I20

2(4)

The method employs complex valued filters, and haverecently been investigated in a multi-scale, view-pointvariant setting[12]. In this paper some more practicalconsiderations for spiral detection will be addressed, anda working example from robot navigation and trackingprovided.

We note by Fig. 1 that the frequency content of spiralswill increase as θ → 0. The filters should then be ideallytuned for the contents of the patterns, yet that contentchanges with both θ and L, a relation we will describe indetail, and is crucial to the synthesis of such patterns forautomatic numeric encoding (bar-code like) and trackingand navigation.

We also note that for the filters suggested, the weightingpolynomial will be of magnitude: |M(−2)| ∝ x2 + y2.The filter will be a parabola weighted with a gaussian.This is effectively an annulus, as Fig 2 illustrates, andconsequently the center of the synthesised spirals areirrelevant for their detection.

III. A CONSTRAINED ROBOT TRACKING PROBLEM

Cylindrical wheeled robots are to be tracked and ana-lyzed based on an overhead view in a controlled environ-ment (a flat square area). The camera is mounted roughly3 meters above the floor, the visible circular top of therobots are 25 cm in diameter. This layout is currently usedas an integral part of post-graduate courses in roboticsat Halmstad University, Sweden. The detection algorithmapplies a threshold on |I20| with the suggested adaptationof the synthesis of the spirals(described in section IV).This has been found to work very robustly.

The lower pane of fig. 3 illustrates a typical image forthe system, and fig 4 illustrates the synthesized image

Fig. 3. Top: two robots from the real scene(zoomed). Bottom: theestimated θ by Eq. 4. Hue represents estimation angle, intensity is themagnitude of |I20|.

Fig. 4. Illustration of two distinct robot quadruple spirals(left and rightpane resp.). The digits 1 and 2 are the identifiers determined by thecombination of spirals. The digits are situated at the (center) positionsof the robots in the figure. The orientations of the robots are indicatedby the red arrows(in this case, equal).

in detail. The coloured disks at the center of the spiralsrepresent two differnt θ values(mapped to the hue colorcomponent). The Hue component of the disk gives acomplementary cue to the information relayed at thatpoint, and will in fact not effect the spiral detection forthe problem we have here (the filter magnitude is anannulus, as seen in fig. 2). For more general problems, onecould leave the spiral intact, and instead colour the entirepattern. Accordingly, we chose to color the centers forpedagogical reasons, and could confirm experimentallythat the procedure has no bearing on spiral detection andidentification using the method summarized above.

Three main items are to be extracted (illustrated in Fig.4): Position, Orientation and Identity.

Position is the 2D coordinates of the center of the robot.It is the mean of all spiral centers within the quadruple.

Orientation is the reference direction along which therobot moves forward, assuming equal velocity of its leftand right wheel. To code this, the special spiral patternof θ0 = 0 was used (each robot has exactly one suchoccurrence). The offset from the center to the θ0 spiralgives the orientation.

Identity is a unique integer identifier, specific for anyagent on the field. It is determined by a clockwise orderingof the group of spirals, beginning with (and then exclud-

Page 3: Synthesis and detection of log-spiral codesdexal2.hh.se/staff/josef/public/publications/karlsson11... · 2011. 3. 15. · Synthesis and detection of log-spiral codes Stefan M. Karlsson,

ing) the θ0 spiral. The resulting triplet of {θ1, θ2, θ3}defines the identity. We used only two identifying spirals:θi = ±π4 , and thresholded this into a three digit binarynumber by the logical: θi > 0 thus reaching the goal ofhaving 8 unique identifiers for this setup.

With only two possible identities for each spiral, thisparticular implementation yields the ordinary binary num-ber encoding. One could also implement any numbersystems with arbitrary basis at the expense of sensitivity tonoise: one quantizes θ. For clarity, in the problem abovethree quantization levels were used in total (θi = ±π4and θ0 = 0), but only θi = ±π4 was used for encodingidentity.

IV. SYNTHESISING INDIVIDUAL SPIRALS

We will present the exact relation between L and θ,and show how θ should determine L. We wil also derivethe relationship between σ1 and a suggested minimum σ2(the scales of Eqs. 2 and 3).

First we investigate the filters used in detail. Thealgorithm of Eqs. 2 and 3, needs Γ{1,σ

21} and Γ{−2,σ

22} as

linear filters. The first of these filters with n = 1 has peaksensitivity: at the frequency ω = 1

σ1. However, there is a

squaring applied to the result of the convolution with thefirst filter meaning that the output will be convolved withitself and thereby the frequency of peak sensitivivity willbe doubled2 to ω0

ω0 =2

σ1(5)

The second filter has an effective anulus (fig. 2) inwhich it is active, with a maximum at r0

r0 =√

2σ2 (6)

For the spirals, it can be shown that their local fre-quency is a function of L and θ

ω =L

r| sin(θ)|

At a fixed radius r0 of a spiral, we want the frequencyto be fixed as ω0, so ω0r0 should be made constant.Accordingly,

Constant = ω0r0 =L

| sin(θ)|

so that, we should vary L as a function of θ to keep theproduct ω0r0 roughly constant,

Lθ = round(ω0r0| sin(θ)|) = round(L0| sin(θ)|)

Evidently, one could optimize the used filters such thatthey are maximally sensitive to the frequency ω0 prevail-ing at a certain radius r0 of one’s choice. This is done bysubstituting the known r0 into (6) and obtaining σ2

σ2 =r0√

2(7)

2Here the pattern is locally a sinusoid. In general, squaring yieldsmore complicated transformations than Eq. (5).

Likewise σ1 is obtained by substituting ω0 = L0/r0 into(5)

σ1 =2r0L0

(8)

V. RESULTS

Fig. 3 shows two robots with different identities. Onlythe spirals of the one on the right are synthesized suchthat they are adapted to the detection filters as suggestedabove. Below are the I20 responses are represented as animage (color encoding the computed twist-angle, i.e. theargument). Note that the magnitudes on the left imageare different (compare to θ = 0) from each other whereason the right side they are approximately the same for allθ. Uniform response simplifies detection as it allows asingle treshold to detect all spirals at once. To be preciseeight student-groups (participating to the course Designof Embedded Intelligent Systems at Halmstad University)could automatically steer eight different robots (as above)labeled with spiral patterns, the GST (Matlab implemen-tation), and a single wlan-IP camera (serving all) in real-time.

VI. CONCLUSIONS

We have presented a synthesis technique for a set ofspirals to be used as identifying tags. They can be used,for example, to track moving objects or to be used asnavigation beacons for visually navigating robots. Thesyntheis adapts the local frequencies of the spirals tothe complex filters such that the response (magnitude ofI20, and I11 if needed) dynamics is optimally uniformacross different members of the spiral family. We havehere not considered the problem of varying view pointsof the patterns. Spiral patterns are detected in a scale androtation3 invariant manner by our operators. They are notinvariant to affine transforms, but they have been shown todisplay a reasonable tolerance to it[12]. We have in thispaper only dealt with the synthesis of frontally viewedspiral patterns. One can assume a more general setting,where we have:• the maximum and minimum distance from the cam-

era any pattern is allowed(within depth of focus),• assumption of gaussian distributed noise, and a

known amount of it• the camera resolution• the maximum angle of obliqueness to the camera any

pattern is allowedThe issues of camera distance, noise and resolution,

are questions that regard the scale of the pattern which isa design parameter. The tolerance to oblique viewing ismore complicated, but if we assume that it is within a levelof tolerance, then we can analyze the oblique viewing asa scale change as well; thus outlining how our theoryabove is applicable to more general cases of synthesisingmarkers for object detection and numeric encoding.

3scaling a log z spiral is equivalent to rotating it

Page 4: Synthesis and detection of log-spiral codesdexal2.hh.se/staff/josef/public/publications/karlsson11... · 2011. 3. 15. · Synthesis and detection of log-spiral codes Stefan M. Karlsson,

VII. ACKNOWLEDGEMENTS

This work has been funded by the Swedish ResearchCouncil (Vetenskapsradet). We would like to thank UlfHolmberg, Tony Larsson, and Tommy Salomonsson forthe construction and cooperation with regards to the robotsystem at Halmstad University.

REFERENCES

[1] B.H. Ballard. Generalizing the Hough transform to detect arbitraryshapes. Pattern Recognition, 13(2):111–112, 1981.

[2] J. Bigun. Recognition of local symmetries in gray value images byharmonic functions. In Ninth International Conference on PatternRecognition, Rome, Nov. 14–17, pages 345–347. IEEE ComputerSociety, 1988.

[3] J. Bigun. Pattern recognition in images by symmetries and coordi-nate transformations. Computer Vision and Image Understanding,68(3):290–307, 1997.

[4] J. Bigun, T. Bigun, and K. Nilsson. Recognition by symmetryderivatives and the generalized structure tensor. IEEE-PAMI,26:1590–1605, 2004.

[5] H. Burkhardt. Transformationen zur lageinvarianten Merkmal-gewinnung. Habilitationsschrift, Universitat Karlsruhe, VDI-Verlag, 1979.

[6] G.H. Granlund. Fourier preprocessing for hand print characterrecognition. IEEE Trans. Computers, 21:195–201, 1972.

[7] P.V.C. Hough. Method and means for recognizing complexpatterns. U.S. patent 3,069,654, 1962.

[8] M.K. Hu. Visual pattern recognition by moment invariants. IRETrans. on Information Theory, pages 179–187, 1962.

[9] B. Johansson. Multiscale curvature detection in computer vision.Lic. thesis no. 877; LIU-TEK-LIC-2001:14, Linkoping University,2001.

[10] N. J. Ventnor N. J. Woodland and B. Silver. Classifying apparatusand method. In U.S. Pat. No. 2,612,994 (Filed 1949), 1952.

[11] S.S. Reddi. Radial and angular invariants for image identification.IEEE-PAMI, 3(2):240–242, 1981.

[12] D. Teferi and J. Bigun. Multi-view and multi-scale recognitionof symmetric patterns. In A.-B. Salberg, J.Y. Hardeberg, andR. Jenssen, editors, Scandinavian Conference on Image Analysis,SCIA-2009, LNCS 5575, pages 657–666. Springer, 2009.