Functions for loading, adjusting, or reading from the Picamera2 tuning file.
The functions that edit the tuning files edit them in place. This will change in the future.
| Function | ce |
Whether the ce_enable flag is disabled. |
| Function | copy |
Return a copy of tuning_file with the lens shading correction from another file. |
| Function | find |
Return the parameters for the named algorithm in the given camera tuning dict. |
| Function | geq |
Whether the green equalisation is set to static. |
| Function | get |
Get a copy of the the rpi.ccm section of a camera tuning dict. |
| Function | load |
Load the default tuning file for the camera. |
| Function | lst |
Whether the lens shading table is set to static. |
| Function | set |
Set ce_enable in rpi.contrast to zero to disable adaptive contrast enhancement. |
| Function | set |
Update the rpi.alsc section of a camera tuning dict to use a static correction. |
| Function | set |
Update the rpi.geq section of a camera tuning dict. |
| Function | set |
Update the rpi.alsc section of a camera tuning dict to use a static correction. |
| Function | _as |
Flatten array, round, and then convert to list. |
| Function | _index |
Find the index of an algorithm's section in the tuning file. |
dict, copy_alsc_from: dict) -> dict:
(source)
¶
Return a copy of tuning_file with the lens shading correction from another file.
All parameters are keyword only for clarity.
| Parameters | |
basedict | The tuning file to copy. |
copydict | The tuning file to take the alsc section from. |
| Returns | |
dict | A deep copy of base_tuning_file with the alsc section copied in from the other tuning file. |
Return the parameters for the named algorithm in the given camera tuning dict.
This is the same methodolgy used in the PiCamera2 library but is provided here so it can be tested independently of installing picamera2
| Parameters | |
tuning:dict[ | The camera tuning dictionary |
name:str | The key for the algorithm in the tuning file |
| Returns | |
dict[ | The algorithm from the tuning dictionary. Editing this will edit the original dictionary. |
Load the default tuning file for the camera.
This will load the tuning file based on the specified sensor model.
Set ce_enable in rpi.contrast to zero to disable adaptive contrast enhancement.
| Parameters | |
tuning:dict | The raspberry pi camera tuning file. |
| Returns | |
dict | A deepcopy of the input file with ce_enable set to 0. |
dict, col_corr_matrix: tuple[ float, float, float, float, float, float, float, float, float]) -> dict:
(source)
¶
Update the rpi.alsc section of a camera tuning dict to use a static correction.
tuning will be updated in-place to set its shading to static, and disable any adaptive tweaking by the algorithm.
Update the rpi.geq section of a camera tuning dict.
| Parameters | |
tuning:dict | the raspberry pi tuning file. This will be updated in-place to set the geq offset to the given value. |
offset:int | The desired green equalisation offset. Default 65535. The default is the maximum allowed value. This means the brightness will always be below the threshold where averaging is used. This is default as we always need the green equalisation to averages the green pixels in the red and blue rows due to the chief ray angle compensation issue when the the stock lens is replaced by an objective. |
| Returns | |
dict | Undocumented |
dict, luminance: np.ndarray, cr: np.ndarray, cb: np.ndarray) -> dict:
(source)
¶
Update the rpi.alsc section of a camera tuning dict to use a static correction.
tuning will be updated in-place to set its shading to static, and disable any adaptive tweaking by the algorithm.