Public Member Functions | Private Attributes | Related Functions
vil_structuring_element Class Reference

Structuring element for morphology represented as a list of non-zero pixels. More...

#include <vil_structuring_element.h>

List of all members.

Public Member Functions

 vil_structuring_element ()
 vil_structuring_element (const vcl_vector< int > &v_p_i, const vcl_vector< int > &v_p_j)
 Define elements { (p_i[k],p_j[k]) }.
void set (const vcl_vector< int > &v_p_i, const vcl_vector< int > &v_p_j)
 Define elements { (p_i[k],p_j[k]) }.
void set_to_disk (double r)
 Set to disk of radius r.
void set_to_line_i (int ilo, int ihi)
 Set to line along i (ilo,0)..(ihi,0).
void set_to_line_j (int jlo, int jhi)
 Set to line along j (jlo,0)..(jhi,0).
const vcl_vector< int > & p_i () const
 i position of elements (i,j).
const vcl_vector< int > & p_j () const
 j position of elements (i,j).
int min_i () const
 Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].
int max_i () const
 Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].
int min_j () const
 Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].
int max_j () const
 Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].

Private Attributes

vcl_vector< int > p_i_
 i position of elements (i,j).
vcl_vector< int > p_j_
 j position of elements (i,j).
int min_i_
 Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
int max_i_
 Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
int min_j_
 Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
int max_j_
 Elements in box bounded by [min_i_,max_i_][min_j_,max_j].

Related Functions

(Note that these are not member functions.)

template<class T1 , class T2 >
double vil_abs_shuffle_distance (T1 v0, const vil_image_view< T2 > &image, unsigned plane, const vil_structuring_element &element, int i0, int j0)
 Return min difference of pixels under structuring element centred at (i0,j0).
template<class T1 , class T2 >
double vil_abs_shuffle_distance (const vil_image_view< T1 > &image1, const vil_image_view< T2 > &image2, const vil_structuring_element &element, bool include_borders=true)
 Computes shuffle distance between image1 and image2.
void vil_binary_closing (const vil_image_view< bool > &src_image, vil_image_view< bool > &dest_image, const vil_structuring_element &element)
 Applies morphological closing operation with given structuring element.
template<class imAccessorT >
bool vil_binary_dilate (const imAccessorT &image, unsigned plane, const vil_structuring_element &element, int i0, int j0)
 Return true if any image pixel under element centred at (i0,j0) is non-zero.
void vil_binary_dilate (const vil_image_view< bool > &src_image, vil_image_view< bool > &dest_image, const vil_structuring_element &element)
 Dilates src_image to produce dest_image (assumed single plane).
template<class imAccessorT >
bool vil_binary_erode (const imAccessorT &image, unsigned plane, const vil_structuring_element &element, int i0, int j0)
 Return false if any image pixel under element centred at (i0,j0) is zero.
void vil_binary_erode (const vil_image_view< bool > &src_image, vil_image_view< bool > &dest_image, const vil_structuring_element &element)
 Erodes src_image to produce dest_image (assumed single plane).
void vil_binary_opening (const vil_image_view< bool > &src_image, vil_image_view< bool > &dest_image, const vil_structuring_element &element)
 Applies morphological opening operation with given structuring element.
template<class T >
void vil_greyscale_closing (const vil_image_view< T > &src_image, vil_image_view< T > &dest_image, const vil_structuring_element &element)
 Applies morphological closing operation with given structuring element.
template<class T >
vil_greyscale_dilate (const vil_image_view< T > &image, unsigned plane, const vil_structuring_element &element, int i0, int j0)
 Return max of pixels under structuring element centred at (i0,j0).
template<class T >
void vil_greyscale_dilate (const vil_image_view< T > &src_image, vil_image_view< T > &dest_image, const vil_structuring_element &element)
 Dilates src_image to produce dest_image (assumed single plane).
template<class T >
vil_greyscale_erode (const vil_image_view< T > &image, unsigned plane, const vil_structuring_element &element, int i0, int j0)
 Return max of pixels under structuring element centred at (i0,j0).
template<class T >
void vil_greyscale_erode (const vil_image_view< T > &src_image, vil_image_view< T > &dest_image, const vil_structuring_element &element)
 Erodes src_image to produce dest_image (assumed single plane).
template<class T >
void vil_greyscale_opening (const vil_image_view< T > &src_image, vil_image_view< T > &dest_image, const vil_structuring_element &element)
 Applies morphological opening operation with given structuring element.
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

Structuring element for morphology represented as a list of non-zero pixels.

Elements in box bounded by [min_i(),max_i()][min_j(),max_j()] Non-zero pixels are given by (p_i[k],p_j[k])

Definition at line 15 of file vil_structuring_element.h.


Constructor & Destructor Documentation

vil_structuring_element::vil_structuring_element ( ) [inline]

Definition at line 31 of file vil_structuring_element.h.

vil_structuring_element::vil_structuring_element ( const vcl_vector< int > &  v_p_i,
const vcl_vector< int > &  v_p_j 
) [inline]

Define elements { (p_i[k],p_j[k]) }.

Definition at line 34 of file vil_structuring_element.h.


Member Function Documentation

int vil_structuring_element::max_i ( ) const [inline]

Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].

Definition at line 58 of file vil_structuring_element.h.

int vil_structuring_element::max_j ( ) const [inline]

Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].

Definition at line 62 of file vil_structuring_element.h.

int vil_structuring_element::min_i ( ) const [inline]

Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].

Definition at line 56 of file vil_structuring_element.h.

int vil_structuring_element::min_j ( ) const [inline]

Elements in box bounded by [min_i(),max_i()][min_j(),max_j()].

Definition at line 60 of file vil_structuring_element.h.

const vcl_vector<int>& vil_structuring_element::p_i ( ) const [inline]

i position of elements (i,j).

Definition at line 51 of file vil_structuring_element.h.

const vcl_vector<int>& vil_structuring_element::p_j ( ) const [inline]

j position of elements (i,j).

Definition at line 53 of file vil_structuring_element.h.

void vil_structuring_element::set ( const vcl_vector< int > &  v_p_i,
const vcl_vector< int > &  v_p_j 
)

Define elements { (p_i[k],p_j[k]) }.

Definition at line 12 of file vil_structuring_element.cxx.

void vil_structuring_element::set_to_disk ( double  r)

Set to disk of radius r.

Select pixels in disk s.t. x^x+y^y<r^r

Definition at line 33 of file vil_structuring_element.cxx.

void vil_structuring_element::set_to_line_i ( int  ilo,
int  ihi 
)

Set to line along i (ilo,0)..(ihi,0).

Definition at line 45 of file vil_structuring_element.cxx.

void vil_structuring_element::set_to_line_j ( int  jlo,
int  jhi 
)

Set to line along j (jlo,0)..(jhi,0).

Definition at line 59 of file vil_structuring_element.cxx.


Friends And Related Function Documentation

template<class T1 , class T2 >
double vil_abs_shuffle_distance ( T1  v0,
const vil_image_view< T2 > &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0 
) [related]

Return min difference of pixels under structuring element centred at (i0,j0).

I.e., returns minimum of |v0-image(i,j,plane)| over (i,j) in element. Checks boundary overlap.

Definition at line 32 of file vil_abs_shuffle_distance.h.

template<class T1 , class T2 >
double vil_abs_shuffle_distance ( const vil_image_view< T1 > &  image1,
const vil_image_view< T2 > &  image2,
const vil_structuring_element element,
bool  include_borders = true 
) [related]

Computes shuffle distance between image1 and image2.

For each pixel in image1 it finds the pixel in image2 with the closest value in an offset area defined by the element. Returns mean over all pixels of this minimum value. Images must be of same size. If include_borders is false then only include pixels for which the structuring element is entirely within the image.

For each pixel in image1 it finds the pixel in image2 with the closest value in an offset area defined by the element. Returns mean over all pixels of this minimum value.

Definition at line 18 of file vil_abs_shuffle_distance.txx.

void vil_binary_closing ( const vil_image_view< bool > &  src_image,
vil_image_view< bool > &  dest_image,
const vil_structuring_element element 
) [related]

Applies morphological closing operation with given structuring element.

Applies dilation followed by erosion

Definition at line 15 of file vil_binary_closing.h.

template<class imAccessorT >
bool vil_binary_dilate ( const imAccessorT &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0 
) [related]

Return true if any image pixel under element centred at (i0,j0) is non-zero.

Checks boundary overlap

Definition at line 23 of file vil_binary_dilate.h.

void vil_binary_dilate ( const vil_image_view< bool > &  src_image,
vil_image_view< bool > &  dest_image,
const vil_structuring_element element 
) [related]

Dilates src_image to produce dest_image (assumed single plane).

Definition at line 10 of file vil_binary_dilate.cxx.

template<class imAccessorT >
bool vil_binary_erode ( const imAccessorT &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0 
) [related]

Return false if any image pixel under element centred at (i0,j0) is zero.

Checks boundary overlap

Definition at line 23 of file vil_binary_erode.h.

void vil_binary_erode ( const vil_image_view< bool > &  src_image,
vil_image_view< bool > &  dest_image,
const vil_structuring_element element 
) [related]

Erodes src_image to produce dest_image (assumed single plane).

Definition at line 10 of file vil_binary_erode.cxx.

void vil_binary_opening ( const vil_image_view< bool > &  src_image,
vil_image_view< bool > &  dest_image,
const vil_structuring_element element 
) [related]

Applies morphological opening operation with given structuring element.

Applies erosion followed by dilation

Definition at line 15 of file vil_binary_opening.h.

template<class T >
void vil_greyscale_closing ( const vil_image_view< T > &  src_image,
vil_image_view< T > &  dest_image,
const vil_structuring_element element 
) [related]

Applies morphological closing operation with given structuring element.

Applies dilation followed by erosion

Definition at line 16 of file vil_greyscale_closing.h.

template<class T >
T vil_greyscale_dilate ( const vil_image_view< T > &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0 
) [related]

Return max of pixels under structuring element centred at (i0,j0).

Checks boundary overlap. Returns 0 if structuring element is empty.

Definition at line 26 of file vil_greyscale_dilate.h.

template<class T >
void vil_greyscale_dilate ( const vil_image_view< T > &  src_image,
vil_image_view< T > &  dest_image,
const vil_structuring_element element 
) [related]

Dilates src_image to produce dest_image (assumed single plane).

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

template<class T >
T vil_greyscale_erode ( const vil_image_view< T > &  image,
unsigned  plane,
const vil_structuring_element element,
int  i0,
int  j0 
) [related]

Return max of pixels under structuring element centred at (i0,j0).

Checks boundary overlap

Definition at line 26 of file vil_greyscale_erode.h.

template<class T >
void vil_greyscale_erode ( const vil_image_view< T > &  src_image,
vil_image_view< T > &  dest_image,
const vil_structuring_element element 
) [related]

Erodes src_image to produce dest_image (assumed single plane).

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

template<class T >
void vil_greyscale_opening ( const vil_image_view< T > &  src_image,
vil_image_view< T > &  dest_image,
const vil_structuring_element element 
) [related]

Applies morphological opening operation with given structuring element.

Applies erosion followed by dilation

Definition at line 16 of file vil_greyscale_opening.h.

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

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)

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 
) [related]

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.


Member Data Documentation

Elements in box bounded by [min_i_,max_i_][min_j_,max_j].

Definition at line 24 of file vil_structuring_element.h.

Elements in box bounded by [min_i_,max_i_][min_j_,max_j].

Definition at line 28 of file vil_structuring_element.h.

Elements in box bounded by [min_i_,max_i_][min_j_,max_j].

Definition at line 22 of file vil_structuring_element.h.

Elements in box bounded by [min_i_,max_i_][min_j_,max_j].

Definition at line 26 of file vil_structuring_element.h.

vcl_vector<int> vil_structuring_element::p_i_ [private]

i position of elements (i,j).

Definition at line 18 of file vil_structuring_element.h.

vcl_vector<int> vil_structuring_element::p_j_ [private]

j position of elements (i,j).

Definition at line 20 of file vil_structuring_element.h.


The documentation for this class was generated from the following files: