Calibrate Camera Lens
Don't forget about alignment!
Calibration and alignment are both essential to proper camera setup. Don't forget to go through the alignment process after completing calibration.
Camera lenses are not perfectly flat, and distort the image they capture. This effect is stronger on the fisheye lenses needed to capture the working area of larger lasers.
To use your camera, you must compensate for this distortion using the Lens Calibration Wizard. This process takes a little effort, but once your camera is calibrated well, it's not something you'll need to repeat often.
To begin the calibration process, go to Laser Tools → Calibrate Camera Lens or right-click in the Camera Control window and select Calibrate Camera Lens from the context menu.
WeCreat Camera Calibration and Alignment
If you have a WeCreat Vision Laser, follow the instructions in our WeCreat Camera Calibration and Alignment guide.
Calibration Presets
If you're using an official LightBurn camera, you can use a preset instead of calibrating manually. Select the appropriate preset for your camera from the Use Preset dropdown menu on the first page of the Lens Calibration Wizard.
After selecting a preset, click Next then Finish to close out of the Lens Calibration Wizard and save the calibration information, or Align Camera to move immediately on to the Camera Alignment Wizard.
Manual Camera Lens Calibration
Overview
Calibration Pattern Details
In order to work properly, the calibration pattern must be:
- undistorted
- perfectly flat
- surrounded by a 6 mm (¼") or larger margin
- About ⅓rd of the size of the camera's viewing area in both directions (1/9th of the its total field of view)
The size of the printed calibration pattern is not important, as long as it is positioned to take up about 1/9th of your camera view which each capture. You can scale the image up or down when printing it, as well as raise or lower the printed pattern to adjust how much of the camera view it takes up.
-
Download and print one of the following images:
- AprilTags in PDF or LBRN2 format (recommended)
- CalibrationCircles.png
- You'll need to select the corresponding Calibration Pattern in the Lens Calibration Wizard later.
-
Mount the printed image to something stiff and flat, such as cardboard, foam board, wood, or a clipboard.
-
If your camera is already positioned in your laser, and the laser has a honeycomb bed or other surface with a lot of visible circles, cover it with a patternless material (cardboard, paper, or bedsheets all work).
Note on camera placement
It is not necessary to mount the camera in the machine to perform the lens calibration. This process depends only on the camera's lens, not its placement in your machine — as long as the camera and calibration pattern are perfectly still, calibration can be performed anywhere.
-
Make sure the bed of your laser has good, consistent lighting and the camera is in focus.
Focusing a LightBurn camera
Most offical LightBurn cameras can be manually focused by gently twisting their lenses.
-
In the Laser Tools Menu, select Camera Lens Calibration.
-
Follow the directions in the Lens Calibration Wizard. For more help, continue below.
Walkthrough
The Lens Calibration Wizard walks you through capturing multiple images of the Calibration Pattern you've printed out. The software analyzes how the pattern appears in the images, and compares that against its internal knowledge of how the pattern should look. It determines the amount and shape of distortion produced by the lens of the camera, and computes a lens correction that is accurate for your camera.
After following the steps from the overview above, you should be ready for the calibration process and looking at a screen like this one:
Choose your camera from the list, and you'll see the view from the camera in the area to the left.
Choose the same Calibration Pattern as the one you downloaded and printed earlier.
With the correct camera and Calibration Pattern selected, click Next.
The view will change to include a Capture button, and a diagram to show you how to position the printed pattern. For the first capture, place the pattern in the center of the field of view of the camera, with the printed face of the card pointed directly at the camera, as shown in the small view up top. If you cannot easily match your capture image with the suggested image, you may need to adjust the scale of your printed card, or take the camera out of the machine for lens calibration.
Click the Capture button and you should see something like this:
Above the image on the right you see:
Image 1 (3840 x 2160) : 54 Markers found - Score: 0.38 - Great! Click Next
If you used the circles pattern instead, you'll see a similar message:
Image 1 (2592 x 1944) : Pattern found - Score: 0.31 - Great! Click Next
This tells you:
Distorted images during the calibration process
You may find that early captures are strongly distorted. This is temporary and is the result of only having a single calibration capture to work with. As you continue, LightBurn will collect more information about your camera's lens distortion and the rest of the image will clear up.
- The image was successfully captured
- The resolution of the captured image is 3840 x 2160 (higher is better)
- All 54 Markers were identified in the April Tags pattern
- This image scored reasonably well — lower scores are better. In this image, after distortion removal, the positions of the dots in the image align with the positions of the real dots with an average error of only 0.38 pixels — that's great, and well below the target score of 0.5 pixels of error.
If the Calibration Pattern is not found, LightBurn will tell you so. Make sure the pattern faces directly toward the camera and occupies roughly the same amount of view area shown in the reference image. It is okay if the pattern is rotated within the view if that makes it easier to place.
As you advance through the captures, the reference image will update. The first five images are the center, bottom, left, right, then top. If your camera has a very strong fisheye effect, it may be necessary for you to move the non-center images inward a little to get a successful capture. That is ok.
The final four images are the corners, and those can be difficult to capture with high-distortion cameras. If your first 5 images score very well (below 0.3) you may skip the final four images (the Next button will show as Skip in this case). If you are having trouble capturing the last four images and don't have the option to skip, you can place the card anywhere within the view and capture that instead — the placement does not always need to match the suggested images to successfully complete this process.
Even after only a few good captures, the image on the right should be free of lens distortion, as shown here:
A poorly calibrated result will still show lens distortion, and may have other artifacts, like the "wobble" seen in the lower-left of the gray image below:
If you aren't getting good results, you can re-capture the current image, or just go back to the beginning and try again. It can take a few tries to get a feel for how to align the card with the camera to get the lowest score.
When you have advanced through all the steps, and you are satisfied that you have a good calibration result with a nicely undistorted image, click Finish to save the results. You can also click the Align Camera button on the final page to move immediately on to the Camera Alignment Wizard.
Troubleshooting
See Camera Troubleshooting for guidance on common camera issues.
Related Topics
- Calibrate Camera Alignment
- Camera Control window
- Camera Selection Helper
- Camera Installation and Focusing
For more help using LightBurn, please visit our forum to talk with LightBurn staff and users, or email support.