Research / Master's thesis
Optical Flow Based Visual Simultaneous Localization and Map Building in Autonomous Mobile Robots
- Degree
- Master's, Control and Automation Engineering
- University
- Istanbul Technical University
- Year
- 2010
- Advisor
- Prof. Dr. Hakan Temeltaş
- Record
- YÖK thesis no. 291911
Used optical flow to estimate motion for visual SLAM, a method closely related to the UVW 2010 contribution.
From the academic CV.
The thesis, explained
Research problem
The laboratory's robots localised themselves with 2D laser scanners, which see one slice of the world and assume it does not move. A camera sees the whole scene and keeps continuity between frames through texture and brightness, but one camera alone gives no depth. The thesis asks how a robot with a single camera, odometry and an IMU can build a first 3D map of an unknown indoor environment, good enough to start an EKF-based SLAM.
Research questions
- Which points in an image can be tracked reliably from frame to frame, and why corners rather than edges?
- Can the optical flow of those points, combined with the robot's own motion from odometry corrected by the IMU, give their 3D positions through parallax?
- How should the resulting landmarks be matched to the map inside an EKF SLAM, given their uncertainty?
Technical approach
- Calibrate the camera (640 × 480 pixels, a 10 × 9 checkerboard) and correct every image for lens distortion; convert to grey levels and low-pass filter against noise.
- Pick trackable points with the Shi–Tomasi corner test and refine them to sub-pixel accuracy by curve fitting.
- Track them between frames with the hierarchical (pyramidal) Lucas–Kanade optical flow method.
- Estimate the robot's own motion by fusing wheel odometry and IMU data in a Kalman filter.
- Recover each point's 3D position from parallax: how far its image moves for a known motion of the camera, using epipolar geometry.
- Feed the 3D landmarks into an EKF SLAM as its initial map, and match observations to landmarks with Mahalanobis-distance compatibility tests.
How the thesis gets there, chapter by chapter
The camera model (Chapter 2)
The thesis starts from the pinhole camera, its intrinsic parameters (focal lengths, optical centre, lens distortion) and extrinsic parameters (where the camera sits and points), and calibrates the robot's camera with a 10 × 9 checkerboard held in front of it. The camera records 640 × 480 pixels on a 5.75 × 4.31 mm sensor; the calibrated parameters are then used to undo the lens distortion in every frame.
Image processing: what to track and how it moves (Chapter 3)
Motion in images raises two problems: correspondence (which pixels in one frame match which in the next) and reconstruction (turning matched points into 3D). With one camera, depth comes from the relative motion of tracked points rather than from a stereo pair. Points worth tracking are corners: along an edge every patch looks alike, so its motion along the edge cannot be told (the aperture problem). The Harris–Stephens and Shi–Tomasi tests make this precise with the eigenvalues of a small structure matrix: a corner needs both to be large, and Lucas–Kanade's least-squares solution exists exactly when that matrix can be inverted. The pyramidal version of Lucas–Kanade handles larger motions, and curve fitting gives sub-pixel positions, because distant points can move less than a pixel between frames. Finally, parallax turns image motion into depth: for the same camera motion, near points sweep across the image faster than far ones.
Corner: both eigenvalues clear the threshold, so Lucas–Kanade recovers the whole motion, (1.1, 0.8) px against the true (1.2, 0.8).
The square moves 1.2 px right and 0.8 px down between two frames (dashed rose arrow). The amber arrow is what Lucas–Kanade recovers from the 9 × 9 window, magnified. The bars are the eigenvalues of the window’s gradient matrix; the dashed line is the Shi–Tomasi threshold.
5 points in view. Depth error: near points 5%, far points 5%.
White dots are the real points; amber rings are where parallax puts them, joined by a rose line. In the camera strip, near points sweep a long way for the same robot motion and far points barely move, so the same tracking noise costs far points much more. Raise the odometry error and every depth scales with it: the camera can only be as good as the robot’s estimate of its own motion.
Two-view geometry (Chapter 4)
Epipolar geometry relates the two images of the same point taken from two camera positions. The essential matrix captures the rotation and translation between the views for a calibrated camera, and the fundamental matrix does the same in pixel coordinates. This is the geometry the parallax computation runs on.
Kalman filtering as a dynamic Bayesian network (Chapter 5)
The robot's motion is written as a dynamic Bayesian network: predict the next pose from the last one and the control input, then correct it with measurements. The prediction step always grows the uncertainty (dead-reckoning error), and the Kalman filter, linearised as an extended Kalman filter for the nonlinear robot, keeps it in check. Here it fuses wheel odometry with the IMU to give the camera motion that parallax needs.
Visual SLAM with an EKF (Chapter 6)
For SLAM the state vector is augmented with the 3D position of every landmark. The thesis compares cameras with 3D laser scanners: a scanner's measurement at one instant depends only on the robot pose and that scan, while a camera carries continuity between frames through brightness, colour and texture, which helps reset accumulated errors indoors where there is no GPS. The full pipeline: grey-level conversion, low-pass filtering, corner detection, sub-pixel refinement, pyramidal Lucas–Kanade, the Kalman-filtered robot motion, parallax to 3D, reconstruction into a global map, and the EKF. For data association it describes the individual compatibility test (ICT, a χ² test of each observation's Mahalanobis distance, for example at 95% confidence) and the joint compatibility test (JCT), which also uses the correlations between landmarks but costs O(n³) as their number grows. Its recommendation: ICT for building the global map from well-spaced tracked points, JCT when matching clustered points between frames.
- 1Camera images
- 2Lens distortion and noise correction
- 3Trackable points
- 4Optical flow + IMU-corrected odometry → 3D points
- 5Low-resolution map
- 6Initial guess for EKF SLAM
Experiments (Chapter 7)
A camera was mounted on one of the laser-equipped autonomous vehicles in the İTÜ Robotics Laboratory. In the first test the robot drove a half circle inside the laboratory; in the second it drove along a corridor, a simpler scene. In both, the optical-flow SLAM produced an approximate map of the surroundings along the robot's path. The thesis shows these maps as figures; it reports no error figures.
What the experiments show
- A working pipeline from raw camera images to an approximate 3D map, run on a robot in the İTÜ Robotics Laboratory.
- Two indoor experiments, a half-circle path in the laboratory and a corridor, each producing an approximate map along the robot's path. The results are shown as figures, without numerical accuracy.
Main contributions
- An optical-flow-based visual SLAM pipeline for a single camera, combining corner tracking, pyramidal Lucas–Kanade flow and odometry fused with an IMU to get 3D landmarks by parallax.
- A low-resolution 3D map used as the initial guess for EKF-based SLAM, so the filter does not start from nothing.
- A comparison of cameras and 3D laser scanners for SLAM, and of individual versus joint compatibility tests for data association, with a recommendation for when to use each.
- Indoor experiments on a laboratory robot.
Limits the thesis names
- Optical flow assumes constant brightness, small motions and surfaces that reflect light evenly; mixed indoor lighting breaks these assumptions.
- Depth from one camera depends on the robot's own motion estimate, which comes from noisy odometry and IMU, so errors in the motion become errors in depth, most of all for distant points.
- Joint compatibility matching grows as O(n³) with the number of landmarks.
- The map is deliberately coarse: its role is to seed the EKF, not to replace a laser scanner.
Where it points next
The thesis proposes using the camera's approximate map to help reconstruct the high-resolution, high-accuracy data of 3D laser scanners.
Thesis language: Turkish. Keywords in the national record: Image analysis, Image processing algorithms, Mapping, Robot navigation.
Related publications
Onur Sencan, Mert Turanli, Evangelos Sariyanidi, Hakan Temeltaş, Sefer Kurnaz, Seta Bogosyan · 2010
A Real-time SLAM Algorithm with Optical Flow based Motion Extraction for Autonomous Robot Navigation
International Workshop on Unmanned Vehicles (UVW 2010), Program and Abstract Book, p. 51