Stanford AA274A Principles of Robotic Autonomy | Autumn 2019 | Classic Visual Recognition
Stanford Online
Perception goals 0:05
The lecture turns from sensing to extracting information that helps localization and higher-level scene understanding. Robots do not always need a deep model of the world. A fast flying robot may need only geometry, while a manipulation task like pouring water into a glass needs a richer grasp of object relations and task order.
Line fitting in polar form 4:01
The focus then narrows to geometric primitives, especially line extraction for localization. A line is written in polar coordinates by its distance r from the origin and angle alpha, with every point on it satisfying rho cos(theta - alpha) = r. This form avoids the unbounded slope m of Cartesian lines, and the lecture notes that lines through the origin create a singular case.
Line fitting basics 22:31
The line fit is given in polar form because the measurements already come as range and angle, and because that form is better conditioned than slope and intercept. The coefficients have a closed form solution. When all weights are one, the solution reduces to simple averages. The distance term rho cos theta minus alpha is treated as the offset from the line, so the fitted r is the average offset over the measurements.
Segmenting points into lines 26:00
Before fitting, you still have to decide which points belong together. Split and merge starts by fitting one line to all points, then finds the point farthest from it. If that distance is above a threshold, the set is split and the process repeats. A later merge step joins pieces that were split too far apart. RANSAC is more robust: it samples pairs of points, builds a line, counts inliers within a distance gamma, and keeps the line with the most inliers.
RANSAC iteration count 42:01
RANSAC uses a rough estimate of w, the chance that a chosen point is an inlier. You never know w exactly, so you use it to guide how many runs you need. The number of iterations is chosen so the chance of missing a valid pair of inliers drops below a target like 1 percent. That gives a formula with log terms, and the key point is that the iteration count depends on w, not on the total number of points.
Hough transform basics 47:00
The Hough transform finds a line by moving from point space to parameter space. In slope-intercept form, each image point gives a line of possible m and b values. Points that lie on the same real line produce parameter lines that meet at one intersection. You grid the parameter space, let each point vote in the cells it supports, and then pick the cell with the highest count. A polar form avoids the problem that slope can grow without bound.
Template matching and scale
Object detection starts with a simple case: you already know what you are looking for, like Waldo in a crowded picture. The image is treated as the input, and the object becomes a template or filter. You slide that mask across the image and compute a correlation, which is just a dot product between the template and each local patch. When the patch looks like the template, the score is high, and you place a bounding box at the peak. The method works, but it assumes you know the object’s size. To handle different scales, you build an image pyramid. You blur first with a Gaussian filter, then subsample to avoid losing the chicken or mouse in the example, and you can also upscale with interpolation. Then you repeat template matching at each scale.
AI-generated summary. It can be wrong or incomplete - check anything that matters against the original.

