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 > | |
T | 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 > | |
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. |
Perform median filtering on images.
Definition in file vil_median.h.
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.
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.
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).
r | in [0,1]. |
values | used to store values sampled from image before sorting Checks boundary overlap |
Definition at line 33 of file vil_median.h.