|
CR2RE Pipeline Reference Manual 1.6.10
|
Algorithms to detect bad pixels on a stack of identical images like e.g. bias images. More...
Functions | |
| hdrl_parameter * | hdrl_bpm_3d_parameter_create (double kappa_low, double kappa_high, hdrl_bpm_3d_method method) |
| Creates BPM Parameters object for the imagelist method. | |
| cpl_error_code | hdrl_bpm_3d_parameter_verify (const hdrl_parameter *param) |
| Verify basic correctness of the BPM_3D parameters. | |
| cpl_boolean | hdrl_bpm_3d_parameter_check (const hdrl_parameter *self) |
| Check that the parameter is a BPM_3D parameter. | |
| double | hdrl_bpm_3d_parameter_get_kappa_low (const hdrl_parameter *p) |
| Access the kappa_low in the BPM_3D parameter. | |
| double | hdrl_bpm_3d_parameter_get_kappa_high (const hdrl_parameter *p) |
| Access the kappa_high in the BPM_3D parameter. | |
| hdrl_bpm_3d_method | hdrl_bpm_3d_parameter_get_method (const hdrl_parameter *p) |
| Access the method in the BPM_3D parameter. | |
| cpl_parameterlist * | hdrl_bpm_3d_parameter_create_parlist (const char *base_context, const char *prefix, const hdrl_parameter *defaults) |
| Create a parameter list for the BPM_3D computation. | |
| hdrl_parameter * | hdrl_bpm_3d_parameter_parse_parlist (const cpl_parameterlist *parlist, const char *prefix) |
| Parse a parameterlist to create input parameters for the BPM_3D. | |
| cpl_imagelist * | hdrl_bpm_3d_compute (const hdrl_imagelist *imglist, const hdrl_parameter *params) |
| detect bad pixels on a stack of identical images | |
Algorithms to detect bad pixels on a stack of identical images like e.g. bias images.
The routines in this module can be used to detect bad pixels on a stack of identical images like bias or dark images. The algorithm first collapses the stack of images by using the median in order to generate a master-image. Then it subtracts the master image from each individual image and derives the bad pixels on the residual-images by thresholding, i.e. all pixels exceeding the threshold are considered as bad. Please note, that the algorithm assumes that the mean level of the different images is the same, if this is not the case, the master-image as described above will be biased.
The calculation is performed by calling the top-level function hdrl_bpm_3d_compute() and the parameters passed to this function can be created by calling hdrl_bpm_3d_parameter_create().
| cpl_imagelist * hdrl_bpm_3d_compute | ( | const hdrl_imagelist * | imglist, |
| const hdrl_parameter * | params | ||
| ) |
detect bad pixels on a stack of identical images
| imglist | input hdrl imagelist |
| params | BPM_3D computation parameters |
The algorithm first collapses the stack of images by using the median to generate a master-image. Then it subtracts the master image from each individual image and derives the bad pixels on the residual-images by thresholding, i.e. all pixels strictly exceeding the threshold are considered as bad.
Three methods are currently available to derive the bad pixels on the residual images and can be set when creating the BPM_3D parameter via hdrl_bpm_3d_parameter_create():
method = HDRL_BPM_3D_THRESHOLD_ABSOLUTE: It uses kappa_low and kappa_high as absolute thresholdmethod = HDRL_BPM_3D_THRESHOLD_RELATIVE: It scales the measured rms on the residual-image with kappa_low and kappa_high and uses it as threshold. For the rms a properly scaled Median Absolute Deviation (MAD) is used.method = HDRL_BPM_3D_THRESHOLD_ERROR: It scales the propagated error of each individual pixel with kappa_low and kappa_high and uses it as threshold.For a Gaussian distribution the Median Absolute Deviation (MAD) is a robust and consistent estimate of the Standard Deviation (STD) in the sense that the STD is approximately K * MAD, where K is a constant equal to approximately 1.4826
Definition at line 409 of file hdrl_bpm_3d.c.
References hdrl_bpm_3d_parameter_verify(), hdrl_collapse_median_parameter_create(), hdrl_image_delete(), hdrl_image_get_image(), hdrl_image_get_mask(), hdrl_image_get_pixel(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_sub_image_create(), hdrl_imagelist_collapse(), hdrl_imagelist_get(), hdrl_imagelist_get_const(), hdrl_imagelist_get_size(), hdrl_imagelist_new(), hdrl_imagelist_set(), hdrl_imagelist_unset(), and hdrl_parameter_delete().
| cpl_boolean hdrl_bpm_3d_parameter_check | ( | const hdrl_parameter * | self | ) |
Check that the parameter is a BPM_3D parameter.
| self | The parameter to check |
Definition at line 170 of file hdrl_bpm_3d.c.
Referenced by hdrl_bpm_3d_parameter_create_parlist(), and hdrl_bpm_3d_parameter_verify().
| hdrl_parameter * hdrl_bpm_3d_parameter_create | ( | double | kappa_low, |
| double | kappa_high, | ||
| hdrl_bpm_3d_method | method | ||
| ) |
Creates BPM Parameters object for the imagelist method.
| kappa_low | Low kappa factor for thresholding algorithm |
| kappa_high | High kappa factor for thresholding algorithm |
| method | used method |
It needs to be deallocated with hdrl_parameter_delete()
Definition at line 108 of file hdrl_bpm_3d.c.
Referenced by hdrl_bpm_3d_parameter_parse_parlist().
| cpl_parameterlist * hdrl_bpm_3d_parameter_create_parlist | ( | const char * | base_context, |
| const char * | prefix, | ||
| const hdrl_parameter * | defaults | ||
| ) |
Create a parameter list for the BPM_3D computation.
| 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 BPM_3D parameters:
Definition at line 231 of file hdrl_bpm_3d.c.
References hdrl_bpm_3d_parameter_check(), hdrl_bpm_3d_parameter_get_kappa_high(), hdrl_bpm_3d_parameter_get_kappa_low(), hdrl_bpm_3d_parameter_get_method(), and hdrl_join_string().
| double hdrl_bpm_3d_parameter_get_kappa_high | ( | const hdrl_parameter * | p | ) |
Access the kappa_high in the BPM_3D parameter.
| p | The BPM_3D parameter |
Definition at line 196 of file hdrl_bpm_3d.c.
Referenced by hdrl_bpm_3d_parameter_create_parlist().
| double hdrl_bpm_3d_parameter_get_kappa_low | ( | const hdrl_parameter * | p | ) |
Access the kappa_low in the BPM_3D parameter.
| p | The BPM_3D parameter |
Definition at line 182 of file hdrl_bpm_3d.c.
Referenced by hdrl_bpm_3d_parameter_create_parlist().
| hdrl_bpm_3d_method hdrl_bpm_3d_parameter_get_method | ( | const hdrl_parameter * | p | ) |
Access the method in the BPM_3D parameter.
| p | The BPM_3D parameter |
Definition at line 210 of file hdrl_bpm_3d.c.
Referenced by hdrl_bpm_3d_parameter_create_parlist().
| hdrl_parameter * hdrl_bpm_3d_parameter_parse_parlist | ( | const cpl_parameterlist * | parlist, |
| const char * | prefix | ||
| ) |
Parse a parameterlist to create input parameters for the BPM_3D.
| parlist | parameter list to parse |
| prefix | prefix of parameter name |
Reads a parameterlist in order to create BPM image parameters. Expects a parameterlist containing:
Definition at line 314 of file hdrl_bpm_3d.c.
References hdrl_bpm_3d_parameter_create(), and hdrl_join_string().
| cpl_error_code hdrl_bpm_3d_parameter_verify | ( | const hdrl_parameter * | param | ) |
Verify basic correctness of the BPM_3D parameters.
| param | BPM image parameters |
Definition at line 128 of file hdrl_bpm_3d.c.
References hdrl_bpm_3d_parameter_check().
Referenced by hdrl_bpm_3d_compute().