|
CR2RE Pipeline Reference Manual 1.6.7
|
Algorithms to detect bad pixels on a single image. More...
Functions | |
| hdrl_parameter * | hdrl_bpm_2d_parameter_create_filtersmooth (double kappa_low, double kappa_high, int maxiter, cpl_filter_mode filter, cpl_border_mode border, int smooth_x, int smooth_y) |
| Creates BPM_2D Parameters object for HDRL_BPM_2D_FILTERSMOOTH. | |
| hdrl_parameter * | hdrl_bpm_2d_parameter_create_legendresmooth (double kappa_low, double kappa_high, int maxiter, int steps_x, int steps_y, int filter_size_x, int filter_size_y, int order_x, int order_y) |
| Creates BPM_2D Parameters object for HDRL_BPM_2D_LEGENDRESMOOTH. | |
| cpl_error_code | hdrl_bpm_2d_parameter_verify (const hdrl_parameter *param) |
| Verify basic correctness of the BPM_2D parameters. | |
| cpl_boolean | hdrl_bpm_2d_parameter_check (const hdrl_parameter *self) |
| Check that the parameter is a BPM_2D parameter. | |
| cpl_filter_mode | hdrl_bpm_2d_parameter_get_filter (const hdrl_parameter *p) |
| Access the filter in the BPM_2D parameter. | |
| cpl_border_mode | hdrl_bpm_2d_parameter_get_border (const hdrl_parameter *p) |
| Access the border in the BPM_2D parameter. | |
| double | hdrl_bpm_2d_parameter_get_kappa_low (const hdrl_parameter *p) |
| Access the kappa_low in the BPM_2D parameter. | |
| double | hdrl_bpm_2d_parameter_get_kappa_high (const hdrl_parameter *p) |
| Access the kappa_high in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_maxiter (const hdrl_parameter *p) |
| Access the maxiter in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_steps_x (const hdrl_parameter *p) |
| Access the steps_x in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_steps_y (const hdrl_parameter *p) |
| Access the steps_y in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_filter_size_x (const hdrl_parameter *p) |
| Access the filter_size_x in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_filter_size_y (const hdrl_parameter *p) |
| Access the filter_size_y in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_order_x (const hdrl_parameter *p) |
| Access the order_x in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_order_y (const hdrl_parameter *p) |
| Access the order_y in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_smooth_y (const hdrl_parameter *p) |
| Access the smooth_y in the BPM_2D parameter. | |
| int | hdrl_bpm_2d_parameter_get_smooth_x (const hdrl_parameter *p) |
| Access the smooth_x in the BPM_2D parameter. | |
| hdrl_bpm_2d_method | hdrl_bpm_2d_parameter_get_method (const hdrl_parameter *p) |
| Access the method in the BPM_2D parameter. | |
| cpl_parameterlist * | hdrl_bpm_2d_parameter_create_parlist (const char *base_context, const char *prefix, const char *method_def, const hdrl_parameter *filtersmooth_def, const hdrl_parameter *legendresmooth_def) |
| Create parameter list for the BPM_2D computation. | |
| hdrl_parameter * | hdrl_bpm_2d_parameter_parse_parlist (const cpl_parameterlist *parlist, const char *prefix) |
| Parse parameter list to create input parameters for the BPM_2D. | |
| cpl_mask * | hdrl_bpm_2d_compute (const hdrl_image *img_in, const hdrl_parameter *params) |
| Detect bad pixels on a single image with an iterative process. | |
Algorithms to detect bad pixels on a single image.
The routines in this module can be used to detect bad pixels on a single image. The algorithm first smoothes the image by applying different methods. Then it subtracts the smoothed image and derives bad pixels by thresholding the residual image, i.e. all pixels exceeding the threshold are considered as bad.
The calculation is performed by calling the top-level function hdrl_bpm_2d_compute() and the parameters passed to this function can be created by calling hdrl_bpm_2d_parameter_create_filtersmooth() or hdrl_bpm_2d_parameter_create_legendresmooth(), depending on the method one would like to use.
| cpl_mask * hdrl_bpm_2d_compute | ( | const hdrl_image * | img_in, |
| const hdrl_parameter * | params | ||
| ) |
Detect bad pixels on a single image with an iterative process.
| img_in | input hdrl image |
| params | BPM_2D computation parameters - see below |
The algorithm first smoothes the image by applying the methods described below. Then it subtracts the smoothed image and derives bad pixels by thresholding the residual image, i.e. all pixels exceeding the threshold are considered as bad. To compute the upper and lower threshold, it measures a robust rms (a properly scaled Median Absolute Deviation), which is then scaled by the parameter kappa_low and kappa_high. Furthermore, the algorithm is applied iteratively controlled by maxiter. During each iteration the newly found bad pixels are ignored. Please note, that the thresholding values are applied as median(residual-image) 
Two methods are currently available to derive a smoothed version of the image:
Applying a filter like e.g. a median filter to the image. The filtering can be done by all modes currently supported by cpl and is controlled by the filter-type filter, the border-type border and by the kernel size in x and y, i.e. smooth_x and smooth_y. The corresponding BPM_2D parameter is created by hdrl_bpm_2d_parameter_create_filtersmooth()Fitting a Legendre polynomial to the image of order order_x, in x and order_y in y direction. This method allows you to define steps_x 
Definition at line 1136 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_verify(), and hdrl_image_get_image_const().
| cpl_boolean hdrl_bpm_2d_parameter_check | ( | const hdrl_parameter * | self | ) |
Check that the parameter is a BPM_2D parameter.
| self | The parameter to check |
Definition at line 301 of file hdrl_bpm_2d.c.
Referenced by hdrl_bpm_2d_parameter_create_parlist(), and hdrl_bpm_2d_parameter_verify().
| hdrl_parameter * hdrl_bpm_2d_parameter_create_filtersmooth | ( | double | kappa_low, |
| double | kappa_high, | ||
| int | maxiter, | ||
| cpl_filter_mode | filter, | ||
| cpl_border_mode | border, | ||
| int | smooth_x, | ||
| int | smooth_y | ||
| ) |
Creates BPM_2D Parameters object for HDRL_BPM_2D_FILTERSMOOTH.
| kappa_low | Low kappa factor for thresholding algorithm |
| kappa_high | High kappa factor for thresholding algorithm |
| maxiter | Maximum number of iterations |
| filter | filter mode |
| border | border mode |
| smooth_x | Smoothing kernel X size |
| smooth_y | Smoothing kernel Y size |
The method creates a parameter for the method HDRL_BPM_2D_FILTERSMOOTH
Definition at line 137 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_verify().
Referenced by hdrl_bpm_2d_parameter_parse_parlist().
| hdrl_parameter * hdrl_bpm_2d_parameter_create_legendresmooth | ( | double | kappa_low, |
| double | kappa_high, | ||
| int | maxiter, | ||
| int | steps_x, | ||
| int | steps_y, | ||
| int | filter_size_x, | ||
| int | filter_size_y, | ||
| int | order_x, | ||
| int | order_y | ||
| ) |
Creates BPM_2D Parameters object for HDRL_BPM_2D_LEGENDRESMOOTH.
| kappa_low | Low kappa factor for thresholding algorithm |
| kappa_high | High kappa factor for thresholding algorithm |
| maxiter | Maximum number of iterations |
| steps_x | Number of sampling coordinates in x-dir |
| steps_y | Number of sampling coordinates in y-dir |
| filter_size_x | size of the median box in x-dir |
| filter_size_y | size of the median box in y-dir |
| order_x | order of polynomial in x-dir |
| order_y | order of polynomial in y-dir |
The method creates a hdrl parameter for the method HDRL_BPM_2D_LEGENDRESMOOTH
Definition at line 191 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_verify().
Referenced by hdrl_bpm_2d_parameter_parse_parlist().
| cpl_parameterlist * hdrl_bpm_2d_parameter_create_parlist | ( | const char * | base_context, |
| const char * | prefix, | ||
| const char * | method_def, | ||
| const hdrl_parameter * | filtersmooth_def, | ||
| const hdrl_parameter * | legendresmooth_def | ||
| ) |
Create parameter list for the BPM_2D computation.
| base_context | base context of parameter (e.g. recipe name) |
| prefix | prefix of parameter, may be an empty string |
| method_def | default used method |
| filtersmooth_def | defaults for filtersmooth method |
| legendresmooth_def | defaults for legendresmooth method Creates a parameter list with the BPM_2D parameters:
|
Definition at line 798 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_check(), and hdrl_join_string().
| cpl_border_mode hdrl_bpm_2d_parameter_get_border | ( | const hdrl_parameter * | p | ) |
Access the border in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 327 of file hdrl_bpm_2d.c.
| cpl_filter_mode hdrl_bpm_2d_parameter_get_filter | ( | const hdrl_parameter * | p | ) |
Access the filter in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 313 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_filter_size_x | ( | const hdrl_parameter * | p | ) |
Access the filter_size_x in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 411 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_filter_size_y | ( | const hdrl_parameter * | p | ) |
Access the filter_size_y in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 425 of file hdrl_bpm_2d.c.
| double hdrl_bpm_2d_parameter_get_kappa_high | ( | const hdrl_parameter * | p | ) |
Access the kappa_high in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 355 of file hdrl_bpm_2d.c.
| double hdrl_bpm_2d_parameter_get_kappa_low | ( | const hdrl_parameter * | p | ) |
Access the kappa_low in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 341 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_maxiter | ( | const hdrl_parameter * | p | ) |
Access the maxiter in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 369 of file hdrl_bpm_2d.c.
| hdrl_bpm_2d_method hdrl_bpm_2d_parameter_get_method | ( | const hdrl_parameter * | p | ) |
Access the method in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 495 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_order_x | ( | const hdrl_parameter * | p | ) |
Access the order_x in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 439 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_order_y | ( | const hdrl_parameter * | p | ) |
Access the order_y in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 453 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_smooth_x | ( | const hdrl_parameter * | p | ) |
Access the smooth_x in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 481 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_smooth_y | ( | const hdrl_parameter * | p | ) |
Access the smooth_y in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 467 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_steps_x | ( | const hdrl_parameter * | p | ) |
Access the steps_x in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 383 of file hdrl_bpm_2d.c.
| int hdrl_bpm_2d_parameter_get_steps_y | ( | const hdrl_parameter * | p | ) |
Access the steps_y in the BPM_2D parameter.
| p | The BPM_2D parameter |
Definition at line 397 of file hdrl_bpm_2d.c.
| hdrl_parameter * hdrl_bpm_2d_parameter_parse_parlist | ( | const cpl_parameterlist * | parlist, |
| const char * | prefix | ||
| ) |
Parse parameter list to create input parameters for the BPM_2D.
| parlist | parameter list to parse |
| prefix | prefix of parameter name |
Reads a parameter list in order to create BPM_2D parameters.
Expects a parameter list containing:
Definition at line 896 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_create_filtersmooth(), hdrl_bpm_2d_parameter_create_legendresmooth(), and hdrl_join_string().
| cpl_error_code hdrl_bpm_2d_parameter_verify | ( | const hdrl_parameter * | param | ) |
Verify basic correctness of the BPM_2D parameters.
| param | BPM_2D parameters |
Definition at line 232 of file hdrl_bpm_2d.c.
References hdrl_bpm_2d_parameter_check().
Referenced by hdrl_bpm_2d_compute(), hdrl_bpm_2d_parameter_create_filtersmooth(), and hdrl_bpm_2d_parameter_create_legendresmooth().