components.photo.vignettecorrector
|
Vignette corrector. |
Vignette analysis. |
- class VignetteCorrector(config={}, **kwds)[source]
Bases:
TransformerVignette corrector.
Adjust the brightness of images with a radially varying gain function. This should be applied to ‘linear intensity’ image data before gamma correction is applied.
The
modeparameter sets the function to use. Theparam_nvalues set how the correction varies with radius. Their meaning depends on the function. TheAnalyseVignettecomponent can be used to generate optimised values.Config
modestr
Function to use. Possible values:
'power','poly2','poly3','lin2','lin3','invlin2','invlin3'.param_0float
First function parameter.
param_1float
Second function parameter.
param_2float
Third function parameter.
param_3float
Fourth function parameter.
param_4float
Fifth function parameter.
- class AnalyseVignette(config={}, **kwds)[source]
Bases:
TransformerVignette analysis.
Measures the average luminance of 50 circular bands of an input grey image, then calculates the optimum function parameters to correct it.
The
modeconfiguration selects the function to fit. If set tomeasureorinv_measureno function is fitted. Ininv_measuremode the output shows the vignetting instead of the required correction. Available functions are:- power
1.0 + (a * (r ^ b))- poly2
1.0 + (a * (r ^ 2)) + (b * (r ^ 4))- poly3
1.0 + (a * (r ^ 2)) + (b * (r ^ 4)) + (c * (r ^ 6))- lin2
2-segment piecewise linear- lin3
3-segment piecewise linear- invlin2
inverse 2-segment piecewise linear- invlin3
inverse 3-segment piecewise linear
The
functionoutput emits the measured and fitted gain values. It can be connected to aPlotDatacomponent.The
plot...parameters can be used to control the plot’s appearance. Running the component network several times with different options allows quite complex plots to be built up.Config
modestr
Function to fit. Possible values:
'measure','inv_measure','power','poly2','poly3','lin2','lin3','invlin2','invlin3'.methodstr
Curve fitting method:
lm,trf, ordogbox.plot_measurementbool
Include the measured input in the plot.
plot_errorbool
Include the residual error in the plot.
plot_label_measuredstr
Label for the ‘measured’ plot.
plot_label_fittedstr
Label for the ‘fitted’ plot. If left blank
modeis used.- outputs = ['output', 'function']
Comments or questions? Please email jim@jim-easterbrook.me.uk.