← Computer Vision for EveryoneToolsInVisionLearning Center
Depth and Motion · Lesson 40

Separate Object Motion from Camera Motion

A swaying camera pole makes parked cars appear to move.

Read the full lesson and open its transcript below. A narrated video will be added after production.

Lesson overview

What you will learn

A swaying camera pole makes parked cars appear to move.

  1. A practical question
  2. The useful idea
  3. Work through the example
  4. Limits and next step
01

A practical question

The pole carrying our parking camera sways in the wind. In the video, parked cars now appear to move slightly even though they haven't changed spaces. We need to estimate the camera's own image motion before calling every pixel shift a vehicle event.

02

The useful idea

Track stable background features such as building corners and painted fixtures. Their shared motion can describe much of the camera shift. Compare a moving car against that background motion. This separation is imperfect when the background has little texture or a large moving object covers it.

03

Work through the example

Watch a short clip with a stable wall and one car pulling out. Overlay both raw motion arrows and a motion-compensated view. Does the wall settle while the car still moves? Use held-out background features to check the compensation. The camera pole sways while one vehicle pulls out. Use corners on the stationary wall and parking lines to estimate the shared camera shift. After compensating for that shift, ask whether the departing car still moves relative to the wall. Try the same calculation with a few landmarks held aside as a check. If those points fail to settle, do not trust the residual motion on the car. Depth differences and a poor background estimate can also leave artifacts, so keep the original clip next to the compensated view. Now check the idea on a concrete example: Compensate wall and parking-line motion before inspecting a car that pulls out. A possible trap is worth naming: An incorrect background model can turn camera motion into false object motion. This supports a careful conclusion: Estimate or compensate camera motion before interpreting residual object motion. Compare the compensated clip with the raw one when the car pulls out. The wall should become steadier while the vehicle retains motion relative to it. If both freeze, the correction may have removed real movement; if neither settles, the camera estimate needs revision.

04

Limits and next step

Record the camera motion estimate and its failures. Next, we'll detect cars separately in each frame before trying to connect identities over time.

Worked example

Compensate wall and parking-line motion before inspecting a car that pulls out.

Knowledge check

Quick check: test your understanding

Try it yourself: Consider this case: Compensate wall and parking-line motion before inspecting a car that pulls out. Explain how you would check the result. In your answer, address this limitation: An incorrect background model can turn camera motion into false object motion.

Check the reasoning

Estimate or compensate camera motion before interpreting residual object motion. An incorrect background model can turn camera motion into false object motion.

What is the main idea behind separate object motion from camera motion?

Estimate or compensate camera motion before interpreting residual object motion.

How is it used in the example?

Compensate wall and parking-line motion before inspecting a car that pulls out.

What limitation should be checked?

An incorrect background model can turn camera motion into false object motion.

Further reading

Programming Computer Vision with Python — Jan Erik Solem.

Original ToolsInVision teaching examples. Editorial approach · Suggest a correction

Accessible referenceLesson 40 transcript337 words · Narration ready for the upcoming videoOpen transcript

The pole carrying our parking camera sways in the wind. In the video, parked cars now appear to move slightly even though they haven't changed spaces. We need to estimate the camera's own image motion before calling every pixel shift a vehicle event.

Track stable background features such as building corners and painted fixtures. Their shared motion can describe much of the camera shift. Compare a moving car against that background motion. This separation is imperfect when the background has little texture or a large moving object covers it.

Watch a short clip with a stable wall and one car pulling out. Overlay both raw motion arrows and a motion-compensated view. Does the wall settle while the car still moves? Use held-out background features to check the compensation. The camera pole sways while one vehicle pulls out. Use corners on the stationary wall and parking lines to estimate the shared camera shift. After compensating for that shift, ask whether the departing car still moves relative to the wall. Try the same calculation with a few landmarks held aside as a check. If those points fail to settle, do not trust the residual motion on the car. Depth differences and a poor background estimate can also leave artifacts, so keep the original clip next to the compensated view. Now check the idea on a concrete example: Compensate wall and parking-line motion before inspecting a car that pulls out. A possible trap is worth naming: An incorrect background model can turn camera motion into false object motion. This supports a careful conclusion: Estimate or compensate camera motion before interpreting residual object motion. Compare the compensated clip with the raw one when the car pulls out. The wall should become steadier while the vehicle retains motion relative to it. If both freeze, the correction may have removed real movement; if neither settles, the camera estimate needs revision.

Record the camera motion estimate and its failures. Next, we'll detect cars separately in each frame before trying to connect identities over time.