Lens Shading Calibration
Before and after the calibration
What is the lens shading effect we are talking about?
Sometimes when you replace the original lens of the Raspberry Pi V2 or HQ camera with an Arducam Lens, you will encounter a color issue where the outer side of the picture looks pink or magenta. That is a lens shading artifact, which is expected but can be solved.
It is expected because the default compensation is only valid for the stock lens of the Pi cameras, while different lens should have been compensated differently for their optical results. It can be solved because the file to alter the compensation – the lens shading table – can be overridden to match your own lens.
How should I tune the configuration file to match my lens?
Well, you don’t have to tune the compensation yourself because Arducam has already done the work for you. You just need to double check which Arducam lens you have on hand and know what the corresponding files you will be using.
Here is the matching relationship between the FoV, SKU, and Part number of the most used Arducam M12 lenses, and you will be referring to the FoV degree numbers in the first column for the target file.
|HFoV on 1/4″||Part Number||SKU|
Arducam lens matching relationship
How to use the Arducam presets for lens shading calibration?
We currently develop libcamera tools to calibrate the lens shading for the V2/HQ cameras. Please refer to the following content to calibrate the lens shading for IMX219 and IMX477 cameras in the new system of Raspberry Pi.
Use libcmaera calibration tool
1. Download and Save the JSON file locally on your Raspberry Pi
Please refer to the below link: Json file of IMX219 and IMX477
2. Run the command
3. Then you can get the great lens calibration
The expected results of the Calibration
- M12 FOV:10°
- M12 FOV:20°
- M12 FOV:40°
- M12 FOV:45°
- M12 FOV:55°
- M12 FOV:60°
- M12 FOV:65°
- M12 FOV:70°
- M12 FOV:80°
- M12 FOV:100°
- M12 FOV:120°
- M12 FOV:140°
- M12 FOV:160°
- M12 FOV:200°