Princeton Intro to Robotics (Fall 2026) | Lecture 9: Optical Flow
Overview
Optical flow estimates the apparent motion of image features and can help a drone infer its velocity, complementing noisy position estimates from integrated accelerometer readings. The lecture derives the Lucas-Kanade method from intensity constancy and small-motion assumptions, explains the aperture problem and spatial-coherence assumption, and shows how least squares estimates flow while failing on textureless regions or single edges.
Key takeaways
- A downward-facing drone camera can estimate motion relative to the ground from optical flow; combined with a height measurement, that flow can provide speed and direction.
- Optical flow measures apparent image motion: a textureless surface can hide real movement, while changing illumination can create apparent movement without physical motion.
- The optical-flow constraint Ix u + Iy v + It = 0 supplies only one equation for two motion components, leaving motion perpendicular to the image gradient unobservable.
- Lucas-Kanade addresses that ambiguity by assuming a local window, often 5×5 or 7×7 pixels, shares one flow vector and solving its overdetermined constraints with least squares.
- Lucas-Kanade fails or becomes unstable in textureless regions and along single edges because the local image gradients do not provide independent directional information.
- Bird corridor experiments and honeybee navigation illustrate biological uses of optical flow: birds adjust speed and position based on perceived motion, while bees encode route distance through accumulated flow.
Chapters
- The course shifts from motion planning and feedback control to sensing, state estimation, localization, and mapping.
- A drone can integrate accelerometer measurements twice to estimate position, but sensor noise compounds through integration.
- A downward-facing optical-flow camera measures apparent scene motion and can help the drone correct deviations from planned waypoints.
- An optical-flow field assigns image locations vectors indicating the apparent direction and magnitude of motion.
- In the forward-camera example, the flow pattern suggests the drone is primarily turning left.
- With a downward-facing pinhole camera and a height measurement, optical flow can estimate the drone's speed and direction relative to the surface.
- Optical flow describes perceived image motion, not necessarily the true motion of the camera or objects.
- A drone moving over a perfectly textureless carpet may experience physical motion without measurable optical flow.
- Changing illumination can create apparent optical flow even when the camera and environment are physically still.
- Corridor experiments found that birds flew more slowly beside vertical stripes, which generated stronger apparent motion.
- With vertical stripes on one wall and horizontal stripes on the other, birds flew closer to the horizontal-striped wall, apparently balancing flow between their eyes.
- When the opposite wall was blank, birds sometimes collided with it, showing that flow-based navigation depends on visual texture.
- A honeybee's waggle duration indicates distance to nectar, while its dance angle communicates direction relative to the sun.
- The distance signal reflects accumulated optical flow along the route, rather than a direct measurement in meters.
- Changing visual texture along a bee's route altered how far another bee traveled while retracing it.
- The model-based method estimates a motion vector for each image pixel from consecutive grayscale frames.
- Intensity constancy assumes a moving image patch retains approximately the same appearance between frames.
- The small-motion assumption requires image features to move only a little between frames, enabling a first-order approximation.
- For pixel location (x, y), intensity constancy is written as I(x, y, t) = I(x + u, y + v, t + 1), where (u, v) is flow.
- A first-order Taylor expansion produces the constraint Ix u + Iy v + It = 0.
- Spatial and temporal derivatives can be estimated from neighboring pixels and consecutive frames using finite differences.
- The optical-flow constraint gives one scalar equation for the two unknowns u and v at each pixel.
- Motion perpendicular to the local image gradient is unobservable from that equation alone.
- The barber-pole-style aperture demonstration shows how perceived motion changes when the viewed region expands, revealing the need for additional assumptions.
- Adding any motion component perpendicular to the image gradient preserves the optical-flow constraint, so that component cannot be uniquely recovered.
- The ambiguity is fundamental to the local intensity-based equation, not merely a weakness of a particular numerical solver.
- Resolving it requires assumptions about the scene or neighboring pixels beyond intensity constancy and small motion.
- The Lucas-Kanade method assumes neighboring pixels move together and share the same optical-flow vector.
- Spatial coherence is often reasonable inside a moving object but breaks down at object boundaries where foreground and background motions differ.
- A local window, commonly 5×5 or 7×7 pixels, supplies multiple flow constraints for one shared motion estimate.
- For a 5×5 window, the method stacks 25 equations of the form Ix u + Iy v = -It.
- The shared flow vector has two unknowns, while the 25 pixel constraints make the system overdetermined.
- Window size depends on image resolution and must balance the number of constraints against the assumption that nearby pixels share motion.
- Writing the windowed constraints as A d = b, with d = [u, v]ᵀ, gives the least-squares estimate d = (AᵀA)⁻¹Aᵀb when the inverse exists.
- Repeating the calculation around each image location produces an optical-flow field.
- The 2×2 matrix AᵀA is invertible only when the window's image gradients provide enough independent directional information.
- A textureless patch has near-zero spatial gradients, so motion cannot be inferred from its image intensities.
- A single edge constrains motion across the edge but leaves motion along the edge ambiguous, making AᵀA singular or poorly conditioned.
- Lucas-Kanade can produce jitter and inconsistent vectors; learned optical-flow models may improve accuracy but still have errors.
- Integrating an imperfect velocity estimate to recover position compounds error, motivating sensor fusion and measurement aggregation in later state-estimation lectures.
Transcript excerpt
0:10 All right. Uh let's get started. So the plan today is to to start a new module. So we're done with the the first module on motion planning and feedback control. Uh the second one is going to be on sensing, state estimation, localization, and mapping. Uh so I guess roughly speaking, how does the robot know where it is in the environment? uh that's the sensing and localization part and how does it know what the environment looks like where are the obstacles what's the geometry of the obstacles uh and so on so we'll have uh yeah I guess a sequence of lectures on this topic and maybe just to motivate this second module let's go back and and think about what we did with planning and control so we developed different algorithms for motion planning so starting from some initial state or configuration and planning a trajectory to get you to some
0:59 goal while avoiding obstacles and maybe minimizing some objective function like the total amount of control effort. So one concrete maybe question for you to think about let's say when you implemented the RRT lab what was the method by which the drone was localizing itself. So somehow in order to track the sequence of way points that you gave it from your RT algorithm uh it's not yeah it's going to be able to mostly track this trajectory by just applying the control inputs that are necessary but there's also a waypoint following control something that corrects for deviations from the planned trajectory. If the drone finds itself slightly off the planned path, uh it needs to apply some corrective action
1:48 to bring it back to the the planned trajectory. So yeah, I guess the the question for you is is what do you think
This is the start of the transcript. Save this video free for the whole transcript, searchable and time-coded.
In this course
Related notes
Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Introduction to Robotics @ Princeton.