Main Page | Modules | Alphabetical List | Class List | Directories | Class Members

Image filtering functions


Functions

cpl_image * cpl_image_filter_linear (const cpl_image *in, const cpl_matrix *ker)
 Compute a linear filtering.
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_median (const cpl_image *in, const cpl_matrix *ker)
 Apply a spatial 3x3 median filter to an image.
cpl_image * cpl_image_filter_stdev (const cpl_image *in, const cpl_matrix *ker)
 Standard deviation filter.

Detailed Description

This module provides functions to filter images.

The filtering functions (linear, median, morphological filtering) take the bad pixels map (bpm) into account to avoid them to corrupt their neigbours.

Synopsis:
   #include "cpl_image_filter.h"

Function Documentation

cpl_image* cpl_image_filter_linear const cpl_image *  in,
const cpl_matrix *  ker
 

Compute a linear filtering.

Parameters:
in The image to filter
ker The kernel
Returns:
The filtered image or NULL in error case
The function take the bad pixels in account to avoid bad pixels corrupting their neighbours.

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_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the kernel size is not as requested
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is not supported

cpl_image* cpl_image_filter_median const cpl_image *  in,
const cpl_matrix *  ker
 

Apply a spatial 3x3 median filter to an image.

Parameters:
in Image to filter.
ker the kernel
Returns:
1 newly allocated image or NULL in error case
The function take the bad pixels in account to avoid bad pixels corrupting their neighbours.

Apply a spatial 3x3 median filter to an image, return a newly allocated image which 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_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the kernel size is not as requested
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is not supported

cpl_image* cpl_image_filter_morpho const cpl_image *  in,
const cpl_matrix *  ker
 

Filter an image in spatial domain with a morpho kernel.

Parameters:
in Image to filter.
ker Filter definition.
Returns:
1 newly allocated image or NULL in error case.
The function take the bad pixels in account to avoid bad pixels corrupting their neighbours.

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_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the kernel size is not as requested
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is not supported

cpl_image* cpl_image_filter_stdev const cpl_image *  in,
const cpl_matrix *  ker
 

Standard deviation filter.

Parameters:
in input image
ker the kernel
Returns:
a newly allocated filtered image or NULL in error case
The function take the bad pixels in account to avoid bad pixels corrupting their neighbours.

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:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the kernel size is not as requested
  • CPL_ERROR_TYPE_MISMATCH if the passed image type is not supported


Generated on Mon Sep 26 14:38:17 2005 for Common Pipeline Library Reference Manual by  doxygen 1.4.1