To find out more about the project, check out the Jira Ticket and the repositories: application and LensFileEditor.

Click on the links for detailed documentation about the API and about the program.

This project leverages the pattern recognition and camera calibration capabilities of OpenCV to automate the lens calibration workflow. We decided to use Charuco (Chessboard pattern with Aruco Markers) patterns for our calibration patterns as calibration using chessboards is proven to be precise. Additionally, with Aruco Markers (which are basically visual codes to recognize an ID) even occluded or partially visible boards are recognized and useable for calibration.

Example patterns can be found here which can be printed and placed on a flat surface. You can print the pdfs which should ensure a standardized size. If you print the pngs be sure to measure the length of the tiles and markers in meters once they are printed. Multiple patterns can be detected simultaneously, provided they belong to different "dictionaries" (aruco-codes with different dimensions such as 4x4 or 5x5). If you want to generate your own charuco-patterns, you should have a look at the opencv/modules repository, specifically at this example. This programm uses "SMURF" to grab the distorted "pure" camera frames using shared memory. Hence why this repository is based on the SHM examples repository.

Setup

  1. In Viz Artist, make a scene with your live-input channel. Make sure that when you go to Media > Live Channel > Aux >SHM Aux Mode is set to Send and Undistort is unchecked.

  2. In Config >Video Input: Live Input you need to set a different channel to SHM - SMURF and write down the Shm Key und Shm Settings.

  3. Look up externalSyncKey in \ProgramData\vizrt\VizEngine\VizEngine-0.cfg under SHMSyncMasterKey.

Workflow

  1. To start, you should print out and measure your patterns as described before or just use the template PDFs to print them out.

  2. Start Viz Engine with a scene containing your live-input setup for SHM.

  3. Start Tracking Hub and the LensFileEditor within.

  4. Click on Start Application in the Lens File Editor under Automation.

  5. Now enter the required parameters as seen:

    image-20240926-122143.png
  6. Click on Detectors to access the detectors list:

    then Add Detector.

    Now select your preset or enter the measurements and the used dictionary as seen here:

  7. Close the detector list dialog.

  8. 300pxIn the "Point Matrix" of the LensFileEditor click on "AutoCatch" in the top right corner. This enables automatic selection of your zoom/focus points if you adjust them correctly.

  9. Afterwards, position your camera towards the patterns, ensuring they are at least partially visible, while maintaining a consistent zoom and focus setting.

  10. Now click on Start Calibration. This opens a window showing you your current captures points (red is not captured, green is captured), captured percentage, if you have calibrated this point or not, a button to calibrate the current point, a button to discard the current progress of that point and a view of the Point Matrix.

    image-20240926-122223.png
  11. The program automatically captures calibration points every two seconds.

  12. When you are satisfied with the coverage click on Calibrate. If you make a mistake, click Discard.

  13. Calibrate your points until you are satisfied (You can calibrate points later as well as it saves your progress).

  14. If you are done click on Stop Calibration which closes the calibration window.

  15. If you are absolutely sure you won't calibrate it anymore, click on Stop Application.

Research Resources