O'Reilly logo

OpenCV 3 Blueprints by Utkarsh Sinha, Quan Hua, Steven Puttemans, Joseph Howse

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The math

Before we jump into the code, let's take an overview of the algorithm. There are four key components.

  • The first is the pinhole camera model. We try and approximate real world positions to pixels using this matrix.
  • The second is the camera motion estimate. We need to use data from the gyroscope to figure out the orientation of the phone at any given moment.
  • The third is the rolling shutter computation. We need to specify the direction of the rolling shutter and estimate the duration of the rolling shutter.
  • The fourth is the image warping expression. Using all the information from the previous calculations, we need to generate a new image so that it becomes stable.

The camera model

We use the standard pinhole camera model. This model is used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required