NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and...

21
NUS CS5247 Motion Planning for Motion Planning for Camera Movements in Camera Movements in Virtual Environments Virtual Environments By Dennis Nieuwenhuisen and Mark H. By Dennis Nieuwenhuisen and Mark H. Overmars Overmars In Proc. IEEE Int. Conf. on In Proc. IEEE Int. Conf. on Robotics and Automation 2004 Robotics and Automation 2004 Presented by Melvin Zhang Presented by Melvin Zhang

Transcript of NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and...

Page 1: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247

Motion Planning for Motion Planning for Camera Movements in Camera Movements in Virtual EnvironmentsVirtual Environments

By Dennis Nieuwenhuisen and Mark H. By Dennis Nieuwenhuisen and Mark H. OvermarsOvermars

In Proc. IEEE Int. Conf. on In Proc. IEEE Int. Conf. on Robotics and Automation 2004 Robotics and Automation 2004

Presented by Melvin ZhangPresented by Melvin Zhang

Page 2: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 2

Overview Motivation Related work Camera configurations Good cinematography Approach Handling the constraints Motion planning for camera movements

Creating a roadmap Finding shortest path Computing camera speed Computing viewing direction

Applications and experiments Summary

Page 3: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 3

Motivation Camera navigation in virtual

environments Computer games Architectural walkthrough Urban planning CAD model inspection

Drawbacks of manual control Difficult Ugly motions Requires attention of user

Solution: Specify start and goal Automatically generate smooth

collision free motion

Page 4: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 4

Related work Support motion generated by user

Virtual sidewalk Speed of motion adapted automatically

Computation of fixed camera positions Following a target

Third person view Trajectory may not be known beforehand Similar to target tracking

Page 5: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 5

Camera configurations Camera position - point in 3D Viewing direction - point in 3D Amount of roll - 1 parameter

Page 6: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 6

Good cinematography Camera not too close to obstacles Horizon should be straight Lower speed when making sharp turns Speed as high as possible Visual cues to future movements

Page 7: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 7

Approach1. Create probabilistic roadmap

2. For each query, connect start and goal nodes

3. Compute shortest path

4. Smooth path

5. Compute trajectory

6. Shorten path

7. Reduce number of segments

8. Compute viewing direction

Page 8: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 8

Handling the constraints Camera should not pass to close to obstacles

Model camera as sphere Horizon should be straight

Avoid rolling the camera Lower speed when making sharp turns

Compute speed base on radius of turn Speed as high as possible

Path should maximize speed of camera Visual cues to future movements

Viewing direction of time t set to position in time t+d

Page 9: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 9

Creating a roadmap Consider camera as

sphere Generate collision

free camera positions Connect position c, c’

by checking if cylinder is collision free

Page 10: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 10

Finding shortest path Wide turns may be preferred over sharp turns Use a penalty function, p(e,e’), which depends

on angle between e and e’ Distance for e arriving from e’ is

p(e,e’) + length(e) Compute shortest path

using Dijkstra’s algorithm Complexity is O(|V|log|V|)

Page 11: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 11

Smoothing the path (I) Path consist of straight line segments Smooth path must be first order continuous Replace vertices along path with largest collision

free circular arc using binary search

Page 12: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 12

Smoothing the path (II)

Page 13: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 13

Computing camera speed Smooth path is not sufficient for

smooth motion Speed should also change in a

continuous way Max speed determined by arc radius Use max acceleration and

deceleration to find actual speed Backtrack deceleration to guarantee

bottom corner Accelerate maximally up to threshold or

new edge Complexity is linear in number of

segments and arcs on path

Page 14: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 14

Shortening the path As roadmap is coarse, shortest path in graph may be

shortened Pick two random configurations

Check for collision free path between them Compute camera speed Accept if new time is lower

Remove nearby nodes to reduce number of segments

Page 15: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 15

Computing viewing direction (I) Viewing direction should also be first order

continuous Should indicate future motion At time t, look at position at time t+td

Proved to be first order continuous Nearer in sharp turns and further in wide turns

Page 16: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 16

Computing viewing direction (II)

Page 17: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 17

Applications and experiments

Implemented in CAVE C++ library Figure on the left is scene of Rotterdam

Preprocessing in 2D (fixed height) took 5s (Pentium 4, 2.4 Ghz) Query any pair of positions in 0.5s

Figure on the right is model of a building Preprocessing in 3D took 8s Query any pair of positions in 0.5s

Page 18: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 18

Demo video 1

Page 19: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 19

Demo video 2

Page 20: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 20

Future work Generating “human” path

Fixed height above ground Possibility of climbing starts/ladders

Following target with known trajectory Account for obstacle occlusions of target

Page 21: NUS CS5247 Motion Planning for Camera Movements in Virtual Environments By Dennis Nieuwenhuisen and Mark H. Overmars In Proc. IEEE Int. Conf. on Robotics.

NUS CS5247 21

Summary Contributions

Novel application of PRM approach for planning camera motions Formulated constraints imposed by theory of cinematography Developed various smoothing techniques to achieve a smooth

trajectory Further improvements

Penalty function p(e,e’) not defined, shortest path does not take into account camera speed

Collision check for circular arcs is time consuming, currently approximate arcs using number of short line segments

Path shortening needs to repeat adding of arcs and computing speed diagram

Approach base on iteratively applying several heuristics to improve the path, difficult to judge amount of improvement

Formulate path improvement as an optimization problem?