Snake terrestrial locomotion synthesis in 3D virtual environments

Download Snake terrestrial locomotion synthesis in 3D virtual environments

Post on 14-Jul-2016

214 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

<ul><li><p>Visual Comput (2006) 22: 562576DOI 10.1007/s00371-006-0035-1 O R I G I N A L A R T I C L E</p><p>Costas PanagiotakisGeorgios Tziritas</p><p>Snake terrestrial locomotion synthesis in 3Dvirtual environments</p><p>Published online: 12 July 2006 Springer-Verlag 2006</p><p>C. Panagiotakis () G. TziritasComputer Science Department, Universityof Crete,Greece, P.O. Box 2208{cpanag, tziritas}@csd.uoc.gr</p><p>Abstract We present a methodfor a 3D snake model constructionand terrestrial snake locomotionsynthesis in 3D virtual environmentsusing image sequences. The snakeskeleton is extracted and partitionedinto equal segments using a newiterative algorithm for solving theequipartition problem. This methodis applied to 3D model constructionand at the motion analysis stage.Concerning the snake motion, thesnake orientation is controlled bya path planning method. An anima-tion synthesis algorithm, based ona physical motion model and tracking</p><p>data from image sequences, describesthe snakes velocity and skeletonshape transitions. Moreover, theproposed motion planning algorithmallows a large number of skeletonshapes, providing a general methodfor aperiodic motion sequences syn-thesis in any motion graph. Finally,the snake locomotion is adaptedto the 3D local ground, while itsbehavior can be easily controlled bythe model parameters yielding theappropriate realistic animations.</p><p>Keywords Snake motion modeling Graph exploration Snake animation</p><p>1 Introduction</p><p>The analysis of image sequences containing moving an-imals in order to create a 3D model of the animal andits physical motion is a difficult problem because of theunpredictable and complicated (most of the time) animalmotion. On the other hand, there are many techniques andmethods in character modeling. We can distinguish themin canned animation from motion capture data and numer-ical procedural techniques such as inverse kinematics [11].Canned animations are more expressive, but less inter-active than numerical procedural techniques, which oftenappear as robotic creatures and require parameter tuningby hand.</p><p>Motion capturing can be performed by means ofimage analysis. Ramanan and Forsyth [23] present a sys-tem that builds appearance models of animals fromimage sequences. Many systems use direct motion cap-ture technology [5] having high accuracy on tracking tar-</p><p>gets. Motion graphs [15] constructed from motion capturedata generate different styles of locomotion by build-ing walks on the graph. The motion graph consists bothof pieces of original motion and automatically gener-ated transitions. Our motion planning algorithm is ex-ecuted in a similar graph. The computer vision basedtechniques in specific environments can also give highaccuracy tracking data using predefined 2D [22] or 3Dmodels [26], or without using explicit shape models [25].One of the first attempts to reconstruct animal motionfrom videos was Wilhelms work [29]. Deformable con-tours (snakes) are used to extract the 2D motion ofeach limbs contour in a video sequence of a runninghorse. However, the active contours methods are verysensitive to noise and have parameters that are diffi-cult to tune. Favreau et al. present a 3D animal mo-tion reconstruction method from segmented video ob-jects [6]. The user provides the object pose in somekey frames and the other poses are computed usinginterpolation.</p></li><li><p>Snake terrestrial locomotion synthesis in 3D virtual environments 563</p><p>In robotics, a lot of work has been done on the con-struction of snake-like robots with elegant and flexiblemotion, which can move in two or three dimensions [4, 24,27]. Usually, these robots have many degrees of freedomin order to achieve the flexibility of the real snake and theirmotion is periodic. Snake-like robots can move in rugged,sandy, terrestrial environments, such as rough or muddyterrains, where wheeled mechanisms are not effective.</p><p>To date, a lot of work has been done in 3D animal mod-eling. A 3D animal model and its texture mapping can becomputed using images captured from specific views anda predefined animal model. This methodology has beenapplied successfully in snake, lizard and goat 3D modelconstruction [21]. A.J. Ijspeert [9] designed the 3D modelof a salamander using neural controllers. Nougaret et al.describe an approach for the design of simple proportionalderivative controllers for dynamic locomotion applying itin fish locomotion [18]. Miller [16] simulates muscle con-tractions of snakes and worms by animating spring ten-sions. In [30] a physics-based method for synthesis of birdflight animations is described. A set of wing-beats is com-puted, which enables a bird to follow a specified trajectory.The most recent works try to model the muscle system ofa character getting realistic results. Morphing techniquescan be applied for creating and controlling the metamor-phosis of two animated and textured models [2]. A lot ofwork has been done on human animation. Albrecht et al.present a deformation algorithm to create hand animationsfrom images using muscle models [1]. Yang et al. simulatea human swimmer attempting to follow a dynamic user-defined target by augmenting cyclic stroke control witha set of pre-specified variations, based on the current stateof the character and its environment [31].</p><p>The motion planning capability in the obstacle avoid-ance problem supports the autonomy of a virtual character.It has been studied using probabilistic roadmap methods(PRM) [13]. Under PRM, a random sample of configura-tion space constructs an accessible point graph (roadmap),which is used to search for a path during the planningstage, yielding good performance. In [7], a motion plan-ning method, based on finite state machines, is used tosolve the path planning problem under dynamic obstacleavoidance for virtual humans without knowledge of theenvironment topology.</p><p>Realistic snake movement depends on the mode of lo-comotion used by the snake. When snakes encounter dif-ferent environments, they are remarkably adept at chang-ing their pattern of movement so that they can propelthemselves effectively. Gray [8] provides a good review ofhis earlier papers, some of which emphasized modeling,while others made direct observations of snake movement.In [10] the first quantitative kinematic analysis of the ma-jor modes of terrestrial snake locomotion using lateralbending of the vertebral column to generate propulsiveforces is presented. In [17] the muscular basis and propul-sive mechanism of terrestrial lateral undulation in gopher</p><p>snakes are examined using patch electrodes. The snakemass center trajectory depends mainly on the snake orien-tation. Thus, depending on exactly how periodic motionis defined, most of the modes of snake locomotion in-volve some sort of periodic motion or repetitive pattern.In both aquatic and terrestrial locomotion, a given point onthe body periodically moves to the left (L) and then to theright (R). During swimming, the frequency of L, R move-ments is constant along the entire length of the snake.During terrestrial lateral undulation, which is the kind ofundulation that we are going to animate, the amplitudeand wavelength of the wave of bending can be variablealong the length of the snake. Thus, the duration of a cycleof L, R movement can be variable, producing aperiodicmotion. During concertina locomotion, snakes moving ata steady speed periodically (at regular time intervals) stop,although the pattern of left and right movement is highlyvariable. As our experiments show, the most impressiveresults are provided when the motion sequence is aperi-odic, since if the snake motion is periodic, the motion willbe predictable. For this reason, the proposed motion plan-ning algorithm obtains aperiodic motion sequences.</p><p>A preliminary version of our work was presentedin [21]. In this paper, motion synthesis has been sig-nificantly improved by adding a model of acting forces,modifying the motion planning algorithm, using mathe-matical models on skeleton shape transitions derived bytracking data from image sequences, adding the snake be-havior control module and by better fitting the snake 3Dshape into the 3D virtual world. The basic purpose of ourwork is to create simple and accurate 3D models and re-alistic animations of terrestrial snakes in any 3D virtualenvironments. We study the curve equipartition problem,whose solution is used in the creation of the 3D model andon motion analysis stage. The proposed snake model co-efficients can be distinguished as those that describe therotation, translation, and scaling of the snake, and as thosethat describe the snakes shape. Moreover, the minimalnumber of proposed snake model coefficients, without ac-curacy loss, provide an easily tuned method that controlsthe snake behavior. Thus, the proposed snake model co-efficients and the motion planning algorithm are the maincontributions of this work.</p><p>The rest of the paper is organized as follows. Section 2presents the proposed method. The experimental resultsare presented in Sect. 3. Finally, in Sect. 4 we summarizeand discuss the results.</p><p>2 Methodology</p><p>2.1 System overview</p><p>The main stages of the proposed method for computing3D snake animations are the following:</p></li><li><p>564 C. Panagiotakis, G. Tziritas</p><p>Fig. 1. a Snake image, b background image and c extracted snakesilhouette</p><p> Creation of a 3D snake model State graph construction Motion Synthesis</p><p>Initially, a 3D animal model is produced using segmentedimages obtained by background subtraction. For the 3Dmodel construction process, a set of points located on theskeleton of the snake is extracted. These points are here-after called skeleton points. During the motion analysisstage, the skeleton points are tracked through time in thevideo sequence. Then a graph of snake skeleton states iscreated. Each state describes only the snake shape inde-pendent of position and global orientation. During the mo-tion synthesis stage, a motion planning algorithm basedon a set of possible states is executed on the graph allow-ing a large number of skeleton shapes and ensuring ape-riodic motion sequences. Mathematical models, derivedby tracking data, describe the skeleton shape transitions.The user selects some points of the outer environment inorder to specify the trajectory that the animal will trace.However, it is possible that several obstacles appear in theouter world. In addition, the trajectory may not be smoothenough, which results in a zigzagging type of motion. Inorder that all of the above issues be tackled, an obstacleavoidance algorithm is proposed that yields a safe ani-mal trajectory. Finally, since initially the snake locomotionis computed to be a plane displacement, this locomotion istransformed to fit the 3D virtual environment.</p><p>2.2 Creation of a 3D snake model</p><p>Generally, perfect 3D body reconstruction using only 2Dimages as input is a difficult task due to the complexity ofthe animals 3D shape. So instead, making use of a pri-ori knowledge about the snakes anatomy, we assume thatits body cross sections are ellipses (see Fig. 2b). This waythe number of modeling parameters is minimized, which</p><p>Fig. 2. a Skeleton points (greenpoints) and snake boundary (redcurve). b 3D wire-frame modelof the snake</p><p>increases the robustness of the reconstruction. Therefore,the proposed method is simple and yields accurate resultsusing priori knowledge about the snake anatomy. More-over, we can use the estimated snake skeleton points at themotion synthesis stage, applying the method to the wholeimage sequence.</p><p>The snake body is reconstructed using the followingskeleton points extraction procedure. Two images aregiven as input to a background subtraction method forextracting the boundary of the snake body (Fig. 1): a back-ground image and a top view image of the snake. Equallyspaced points from the medial axis of the boundary, skele-ton points, are then chosen as the centers of these ellipses(Fig. 2a). We propose an iterative curve equipartition algo-rithm that segments any 2D curve to equal segments, giventhe first and the last point of the curve (see Sect. 2.3). Thetexture mapping is done at the same time using the mirror-ing technique; each couple of antisymmetrical ellipse cen-ter points corresponds to the appearance of a snake imagepixel. The ellipse size at a point pn is determined basedon the distance dn between its center and the boundary.Its eccentricity can be given as a known constant param-eter, as it is almost the same for all ellipses. Otherwise,it can be computed using an input image instead of a topview image and a side view image of the snake. All ofthe produced ellipses make up the final 3D model of thesnake.</p><p>2.3 Curve equipartition</p><p>The skeleton points extraction procedure is based oncurve equipartition (EP), and it is used on 3D snakemodel creation (Sect. 2.2) and on the motion analysisstage (Sect. 2.4). The EP problem can be defined for any2D continuous curve. Let A and B be the start and endpoints of the curve, respectively. The EP problem is to lo-cate N 1 consecutive curve points, so that the curve canbe divided into N equal length chords, under the constraintthat the first starts at A and the last ends at B (see Fig. 3).We have proved [19, 20] that the above problem alwayshas at least one solution that provides algorithms that solvethe problem.</p><p>The above problem can have more than one solution,depending on the curve shape and number N. As N tendsto infinity the problem solution (equal chords) will beunique and it will provide an approximation of the curve(see Fig. 3). Next, we present a steepest descent based EPalgorithm (see Algorithm 1) that converges to a solution</p></li><li><p>Snake terrestrial locomotion synthesis in 3D virtual environments 565</p><p>Fig. 3. EP examples for different N. The higher the N, the better the curve approximation</p><p>and is efficient for large N. Let Pi = C(ti), i = 0, . . . , N,P0 = A, ti &lt; ti+1 be the curve points computed at an itera-tion. In each iteration, point Pi is computed based on theconstraint that the length of the line segments (|Pi1 Pi |)is constant. Finally, Pi will converge to a solution, whichmeans that PN B. The first N 1 segments will haveexactly the same length. Let T and r be the convergenceerror and the algorithm learning rate (r &lt; 1), respectively.The final solution computed by the above algorithm willbe very close to the real one because the length of eachchord will be exactly the same.</p><p>Algorithm 1. Steepest descent based curve EP</p><p>P0 = As = curve length</p><p>Nrepeat</p><p>for i = 1 to N do</p><p>Pi = C(ti) : ti &gt; ti1 |Pi1 Pi | = s/* If there is no solution, we compute point Pi usinga mirroring technique, then Pi will be out of curve.*/</p><p>end</p><p>s ={</p><p>s +r |BPN |N , PN is curve points r |BPN |N , PN is being out of curve</p><p>until |PN B| &lt; T</p><p>2.4 Motion analysis stage</p><p>In this section, the motion analysis stage is described.The skeleton points are tracked with pixel accuracy in thewhole image sequence using the skeleton points extrac-tion procedure. The tracking accuracy has been improvedusing a stable camera and a high contrast background...</p></li></ul>