This module provides algorithms to compute a master flatfield. Several methods are available to deal with different flatfield characteristics.
More...
|
| hdrl_parameter * | hdrl_flat_parameter_create (cpl_size filter_size_x, cpl_size filter_size_y, hdrl_flat_method method) |
| | Creates FLAT Parameters object.
|
| |
| cpl_boolean | hdrl_flat_parameter_check (const hdrl_parameter *self) |
| | Check that the parameter is a FLAT parameter.
|
| |
| cpl_size | hdrl_flat_parameter_get_filter_size_x (const hdrl_parameter *p) |
| | Access the filter_size_x in the FLAT parameter.
|
| |
| cpl_size | hdrl_flat_parameter_get_filter_size_y (const hdrl_parameter *p) |
| | Access the filter_size_y in the FLAT parameter.
|
| |
| hdrl_flat_method | hdrl_flat_parameter_get_method (const hdrl_parameter *p) |
| | Access the method in the FLAT parameter.
|
| |
| cpl_parameterlist * | hdrl_flat_parameter_create_parlist (const char *base_context, const char *prefix, const hdrl_parameter *defaults) |
| | Create a parameter list for the FLAT computation.
|
| |
| hdrl_parameter * | hdrl_flat_parameter_parse_parlist (const cpl_parameterlist *parlist, const char *prefix) |
| | Parse a parameterlist to create input parameters for the FLAT.
|
| |
| cpl_error_code | hdrl_flat_compute (hdrl_imagelist *hdrl_data, const cpl_mask *stat_mask, const hdrl_parameter *collapse_params, hdrl_parameter *flat_params, hdrl_image **master, cpl_image **contrib_map) |
| | compute high or low frequency master flat with median filtering
|
| |
This module provides algorithms to compute a master flatfield. Several methods are available to deal with different flatfield characteristics.
The routines in this module can be used to derive a high frequency or a low frequency master flatfield.
- HIGH frequency algorithm:
- The algorithm first smoothes the input images by a median filter and divides each input image through the smoothed image. The smoothed images is considered to be noiseless i.e. the relative error of the resulting images is the same as the one of the input image. Then all residual images are collapsed into a single master flatfield. The collapsing can be done with all methods currently implemented in hdrl. Moreover, it is also possible to give a static mask to the algorithm which e.g. allows the user to distinguish illuminated and not illuminated regions. In this case the smoothing procedure is done twice, once for the illuminated region and once for the blanked region. This ensures that the information of one region does not influence the other regions during the smoothing process.
- LOW frequency algorithm:
- The algorithm multiplicatively normalizes the input images by the median of the image to unity. A static mask can be provided to the algorithm in order to define the pixels that should be taken into account when computing the normalisation factor. This allows the user to normalize the flatfield e.g. only by the illuminated section. Then all normalized images are collapsed into a single master flatfield. The collapsing can be done with all methods currently implemented in hdrl. Finally, the master flatfield is smoothed by a median filter. The associated error of the final masterframe is the error derived via error propagation of the previous steps, i.e. the smoothing itself is considered noiseless.
The calculation is performed by calling the top-level function hdrl_flat_compute() and the parameters passed to this function can be created by calling hdrl_flat_parameter_create(). Additional one has to pass also the collapse parameter created e.g. via hdrl_collapse_mean_parameter_create(), ... Note that the function will overwrite the input imagelist in order to conserve memory. Its contents after the call are undefined and it must be deleted by the caller.
◆ hdrl_flat_compute()
compute high or low frequency master flat with median filtering
- Parameters
-
| hdrl_data | input flats, will be overwritten! |
| stat_mask | input mask to select the regions for statistics or smoothing |
| collapse_params | parameter controlling the collapse algorithm |
| flat_params | parameter controlling the flatfield algorithm |
| master | returned masterflat |
| contrib_map | returned contribution map |
- The algorithms are described in the master flatfield module documentation
- Note
- the function will overwrite the input imagelist in order to conserve memory. Its contents after the call are undefined and it must be deleted by the caller.
◆ hdrl_flat_parameter_check()
Check that the parameter is a FLAT parameter.
- Parameters
-
| self | The parameter to check |
- Returns
- True or False
◆ hdrl_flat_parameter_create()
Creates FLAT Parameters object.
PRIVATE
- Parameters
-
| filter_size_x | Smoothing filter size in x-direction |
| filter_size_y | Smoothing filter size in y-direction |
| method | used method |
- Returns
- The FLAT parameters object.
It needs to be deallocated with hdrl_parameter_delete()
- See also
- hdrl_parameter_delete()
-
hdrl_flat_compute()
◆ hdrl_flat_parameter_create_parlist()
| cpl_parameterlist * hdrl_flat_parameter_create_parlist |
( |
const char * |
base_context, |
|
|
const char * |
prefix, |
|
|
const hdrl_parameter * |
defaults |
|
) |
| |
Create a parameter list for the FLAT computation.
- Parameters
-
| base_context | base context of parameter (e.g. recipe name) |
| prefix | prefix of parameter, may be empty string |
| defaults | default values |
Creates a parameterlist with the FLAT parameters:
- base_context.prefix.filter_size_x
- base_context.prefix.filter_size_y
- base_context.prefix.method The CLI aliases omit the base_context.
◆ hdrl_flat_parameter_get_filter_size_x()
| cpl_size hdrl_flat_parameter_get_filter_size_x |
( |
const hdrl_parameter * |
p | ) |
|
Access the filter_size_x in the FLAT parameter.
- Parameters
-
- Returns
- The filter_size_x
◆ hdrl_flat_parameter_get_filter_size_y()
| cpl_size hdrl_flat_parameter_get_filter_size_y |
( |
const hdrl_parameter * |
p | ) |
|
Access the filter_size_y in the FLAT parameter.
- Parameters
-
- Returns
- The filter_size_y
◆ hdrl_flat_parameter_get_method()
Access the method in the FLAT parameter.
- Parameters
-
- Returns
- The method
◆ hdrl_flat_parameter_parse_parlist()
| hdrl_parameter * hdrl_flat_parameter_parse_parlist |
( |
const cpl_parameterlist * |
parlist, |
|
|
const char * |
prefix |
|
) |
| |
Parse a parameterlist to create input parameters for the FLAT.
- Parameters
-
| parlist | parameter list to parse |
| prefix | prefix of parameter name |
- Returns
- Input parameters for the FLAT computation
Reads a parameterlist in order to create FLAT image parameters. Expects a parameterlist containing:
- prefix.filter_size_x
- prefix.filter_size_y
- prefix.method