Lens correction (ffmpeg K1 K2)

From 3Denlive
(Redirected from Lens correction)
Jump to: navigation, search

Purpose: this processor can be used to correct for radial distortion as can result from the use of wide angle lenses (fish-eye), and thereby re-rectify the image.

Keyframable: YES. This processor can be used as a video effect to change progressively the image geometry in an animation.

Parameters: K1 and K2 may be set either with the sliders or by editing the displayed numeric values.

Remark: searching the web with keywords "ffmpeg lenscorrection K1 K2" and the model of your camera may provide you with possible correct ready to use values.

Calibration procedure:

  1. open 3De
  2. click somewhere in the media panel (left panel of the 3De window) to display the main empty monitor (center panel of the 3De window).
  3. click on the grid button ButtonGrid.png and choose value 30.
  4. click on the full-screen preview button ButtonFullScreen.png.
  5. take a shot of your screen with your camera, paying attention to be as centered and as aligned with your screen as possible.
  6. open the resulting image in 3De (as a not-stereo view).
    LensCorrectionCalibrationShot.jpg
  7. double-click on the new media in the media panel (left panel of the 3De window) to add it in the timeline (bottom panel of the 3De window).
  8. click on the new clip in the timeline (bottom panel of the 3De window).
  9. double-click on the Lens correction processor in the processor library (right panel on the 3De application) to add it to the clip.
  10. adjust K1 to get the lines as straight as possible. The lines may be not fully parallel, nor fully horizontal, nor fully vertical, because of a bad camera alignment with the screen, but they should be as straight as possible.
  11. adjust K2 together with K1 to refine the result. K2 is supposed to change the outermost part of the picture, while K1 has more effect on the middle part.
    LensCorrectionCalibrationShotCorrected.jpg
  12. take a note on the K1 and K2 values to set it later on your real scene pictures.

Remark: ffmpeg lenscorrection doesn't use an anti-aliasing processing. You may experiment some staircase effects on objects borders. This should be of minor impact using a processing resolution higher than the final rendering resolution.