Camera lenses are not perfectly flat, and distort the image they capture. This effect is stronger on the fisheye lenses needed to capture the viewing area of larger lasers. To use your camera effectively, you'll need to calibrate the camera. This takes a little effort, but once your camera is calibrated well, it's not a process you'll need to repeat often.
Calibration Image Details
In order to work properly, the calibration image must be:
- perfectly flat
- surrounded by a 6mm (1/4") or larger margin
- About 1/3 of the size of the camera's viewing area, when viewed through the camera
Older versions of this guide gave a specific size for the calibration image, but that will vary based on the size of your work area and the height of your camera. You want the image to take up about 1/3 of your camera view. You can scale the image up or down when printing it, as well as raising or lowering the image to adjust how much of the camera view it takes up.
- Download and print the following image: Calibration-Circles.png.
- If your laser has a honeycomb bed or other surface with a lot of visible circles, you should cover it with something to block that pattern.
- Make sure the bed of your laser has good, consistent lighting and the camera is in focus.
- In the "Laser Tools" menu, open the "Camera Lens Calibration" wizard.
- Mount the calibration image to something stiff and flat, such as cardboard, foam board, wood, or a clipboard.
- Follow the directions in the Camera Lens Calibration wizard. For more help, continue below.
Camera Lens Calibration Walkthrough¶
Note on camera placement
This process only depends on the camera's lens, not on its placement in your machine - as long as the camera and calibration pattern are perfectly still, you do not need to mount the camera in the machine to perform the lens calibration.
Camera Lens Calibration walks you through capturing multiple images of the calibration image 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 in the list, and you'll see the view from the camera in the area to the left. With the correct camera 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 leave 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 (2592 x 1944) : Pattern found - Score: 0.31 - Not bad! Click Next
This tells you:
- The image was successfully captured
- The resolution of the captured image is 2592 x 1944 (higher is better)
- The calibration pattern was found in this image
- 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.31 pixels - That's pretty good, and just barely outside our target score of 0.3 pixels of error.
You may find that although the circles themselves are clear and undistorted, the background around them is noticeably worse. This is temporary and is the result of only having a single calibration image to work with. As you continue, your computer will collect more information about your camera's lens distortion and the rest of the image will clear up.
If the calibration pattern is not found, LightBurn will tell you so. Make sure the calibration image faces directly toward the camera and occupies roughly the same amount of view area shown in the "suggestion" image. It is okay if the calibration image is rotated within the view if that makes it easier to place.
As you advance through the captures, the suggestion image will update. The first five images are the center of view, followed by 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. This is ok.
The final four images are the corners, and these can be difficult to capture with high-distortion cameras. If your first 5 images score very well (below 0.3) you are allowed to skip the final four images (the 'Next' button will shows 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 - We don't verify that your placement matches what we're suggesting.
Even after only a few good captures, the image on the right should appear to 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 in the final page to take you to the next wizard automatically.