Skip to content

Example: finding projector lens intrinsics

John De Witt edited this page Mar 28, 2018 · 2 revisions

This document is intended to serve as reference for how to calibrate a projector lens. The motivation of this process is to be able to map each 2D projector pixel in the image plane to a 3D vector in a real world projector-centered coordinate system. In this example, the desired data is the following intrinsic calibration parameters:

  • 3x3 projector matrix
  • 5x1 projector radial/tangential distortion coefficients
  • 2x1 projector pixel resolution

These pieces of data together can relate projector pixels with the 3D real world light rays that they come out as. The projector is effectively an "inverted camera", and OpenCV's pinhole camera calibration model is used.

Setup

A flat chess pattern is needed as a calibration object. The expected setup is a camera and a projector mounted in a stereo configuration with overlapping fields of view. The camera and projector should be pointed such that their individual fields of view fully contain the chess pattern entirely, as well as overlap with one another. This can make getting good measurements near the edges of the projector challenging, which can affect calibration RMS error and output point cloud

Programs used

  • chess_gen
  • sldisp
  • mjpg-streamer
  • slcapture.py
  • slcontrol
  • slcrunch
  • slcalibrate

Procedure

  1. Run sldisp, drag output window to projector display and press 'f' to enable fullscreen. Adjust focus as needed.
  2. Run mjpg-streamer and confirm camera/projector framing. Try to maximize overlap of projector and camera fields of view. Adjust focus as needed.
  3. Run slcontrol and press return to start capture sequence, or press START_CAPTURE.
  4. Reposition/rotate calibration pattern so that it covers different parts of the fields of view of camera and projector, ensuring that it undergoes both rotation and translation.
  5. Repeat steps 3-4 until you've collected "enough" viewpoints of the calibration pattern. 10-20 or more is probably good (assuming chessboard has more than ~25 inner corners).
  6. Convert the image sequences of the chess calibration object into camera-chess-projector point correspondence data using slcrunch see slcrunch guide<todo>.
  7. Create a list of correspondence files to use for calibration with listcreator.
  8. Pass list of correspondence data to slcalibrate to calculate calibration data. Note RMS output. If less than 1 (pixel), then success was likely.
  9. Save calibration_XXXX.yaml to desired destination. Keep for future use with current camera/projector focus settings and arrangement.