Functions | |
| cpl_image * | cpl_image_filter_linear (const cpl_image *in, const cpl_matrix *ker) |
| Compute a linear filtering. | |
| cpl_image * | cpl_image_filter_median (const cpl_image *in, const cpl_matrix *ker) |
| Apply a spatial median filter to an image. | |
| cpl_image * | cpl_image_filter_morpho (const cpl_image *in, const cpl_matrix *ker) |
| Filter an image in spatial domain with a morpho kernel. | |
| cpl_image * | cpl_image_filter_stdev (const cpl_image *in, const cpl_matrix *ker) |
| Standard deviation filter. | |
The filtering functions (linear, median, morphological filtering) take the bad pixels map (bpm) into account to avoid them to corrupt their neigbours.
#include "cpl_image_filter.h"
| cpl_image* cpl_image_filter_linear | ( | const cpl_image * | in, | |
| const cpl_matrix * | ker | |||
| ) |
Compute a linear filtering.
| in | The image to filter | |
| ker | The kernel |
The input kernel should have an odd number of rows and columns. The maximum size of the kernel is 31x31. The output image has to be deallocated with cpl_image_delete(). Images can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
| cpl_image* cpl_image_filter_median | ( | const cpl_image * | in, | |
| const cpl_matrix * | ker | |||
| ) |
Apply a spatial median filter to an image.
| in | Image to filter. | |
| ker | the kernel |
Apply a spatial median filter to an image, return a newly allocated image which must be deallocated using cpl_image_delete(). The kernel number of elements must be lower than or equal to 81. Images can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
| cpl_image* cpl_image_filter_morpho | ( | const cpl_image * | in, | |
| const cpl_matrix * | ker | |||
| ) |
Filter an image in spatial domain with a morpho kernel.
| in | Image to filter. | |
| ker | Filter definition. |
The input filter is defined by a square matrix whose size is smaller than 5x5. The first element is applied to the min pixel in the neighborhood, the second to the second-to-min, etc. and the last coefficient is applied to the max pixel. The returned image is a newly allocated object, it must be deallocated using cpl_image_delete(). Images can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
| cpl_image* cpl_image_filter_stdev | ( | const cpl_image * | in, | |
| const cpl_matrix * | ker | |||
| ) |
Standard deviation filter.
| in | input image | |
| ker | the kernel |
For each pixel, compute the standard deviation of a local zone. The image borders are set to 0. The returned image must be deallocated using cpl_image_delete(). Images can be CPL_TYPE_FLOAT or CPL_TYPE_DOUBLE.
Possible _cpl_error_code_ set in this function:
1.5.1