Functions
core/vil/algo/vil_median.h File Reference

Perform median filtering on images. More...

#include <vil/algo/vil_structuring_element.h>
#include <vil/vil_image_view.h>
#include <vcl_algorithm.h>

Go to the source code of this file.

Functions

template<class T , class Iter >
vil_sorted_value (const T *im, const vcl_ptrdiff_t *offset, Iter values, unsigned n, unsigned r)
 Return r-th sorted value of im[offset[k]].
template<class T >
vil_sorted_value (const vil_image_view< T > &image, unsigned plane, const vil_structuring_element &element, int i0, int j0, vcl_vector< T > &values, double r)
 Return (n*r)-th sorted value of pixels under element centred at (i0,j0).
template<class T >
void vil_median (const vil_image_view< T > &src_image, vil_image_view< T > &dest_image, const vil_structuring_element &element)
 Computes median value of pixels under structuring element.

Detailed Description

Perform median filtering on images.

Author:
Tim Cootes

Definition in file vil_median.h.


Function Documentation

template<class T >
void vil_median ( const vil_image_view< T > &  src_image,
vil_image_view< T > &  dest_image,
const vil_structuring_element element 
)

Computes median value of pixels under structuring element.

dest_image(i0,j0) is the median value of the pixels under the structuring element when it is centred on src_image(i0,j0)

Definition at line 15 of file vil_median.txx.

template<class T , class Iter >
T vil_sorted_value ( const T *  im,
const vcl_ptrdiff_t *  offset,
Iter  values,
unsigned  n,
unsigned  r 
) [inline]

Return r-th sorted value of im[offset[k]].

Values im[offset[k]] placed into values[k] then sorted. values should be a random access iterator into a container of T such that the range [values,values+n) is valid.

Definition at line 17 of file vil_median.h.

template<class T >
T vil_sorted_value ( const vil_image_view< T > &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0,
vcl_vector< T > &  values,
double  r 
) [inline]

Return (n*r)-th sorted value of pixels under element centred at (i0,j0).

Parameters:
rin [0,1].
valuesused to store values sampled from image before sorting Checks boundary overlap

Definition at line 33 of file vil_median.h.