Structuring element for morphology represented as a list of non-zero pixels. More...
#include <vil_structuring_element.h>
Public Member Functions | |
| vil_structuring_element () | |
| vil_structuring_element (const std::vector< int > &v_p_i, const std::vector< int > &v_p_j) | |
| Define elements { (p_i[k],p_j[k]) }. More... | |
| void | set (const std::vector< int > &v_p_i, const std::vector< int > &v_p_j) |
| Define elements { (p_i[k],p_j[k]) }. More... | |
| void | set_to_disk (double r) |
| Set to disk of radius r. More... | |
| void | set_to_line_i (int ilo, int ihi) |
| Set to line along i (ilo,0)..(ihi,0). More... | |
| void | set_to_line_j (int jlo, int jhi) |
| Set to line along j (jlo,0)..(jhi,0). More... | |
| const std::vector< int > & | p_i () const |
| i position of elements (i,j). More... | |
| const std::vector< int > & | p_j () const |
| j position of elements (i,j). More... | |
| int | min_i () const |
| Elements in box bounded by [min_i(),max_i()][min_j(),max_j()]. More... | |
| int | max_i () const |
| Elements in box bounded by [min_i(),max_i()][min_j(),max_j()]. More... | |
| int | min_j () const |
| Elements in box bounded by [min_i(),max_i()][min_j(),max_j()]. More... | |
| int | max_j () const |
| Elements in box bounded by [min_i(),max_i()][min_j(),max_j()]. More... | |
Private Attributes | |
| std::vector< int > | p_i_ |
| i position of elements (i,j). More... | |
| std::vector< int > | p_j_ |
| j position of elements (i,j). More... | |
| int | min_i_ |
| Elements in box bounded by [min_i_,max_i_][min_j_,max_j]. More... | |
| int | max_i_ |
| Elements in box bounded by [min_i_,max_i_][min_j_,max_j]. More... | |
| int | min_j_ |
| Elements in box bounded by [min_i_,max_i_][min_j_,max_j]. More... | |
| int | max_j_ |
| Elements in box bounded by [min_i_,max_i_][min_j_,max_j]. More... | |
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). More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| 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). More... | |
| 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). More... | |
| template<class T > | |
| 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). More... | |
| 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). More... | |
| 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. More... | |
| template<class T > | |
| T | vil_sorted_value (const vil_image_view< T > &image, unsigned plane, const vil_structuring_element &element, int i0, int j0, std::vector< T > &values, double r) |
| Return (n*r)-th sorted value of pixels under element centred at (i0,j0). More... | |
| 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. More... | |
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 18 of file vil_structuring_element.h.
|
inline |
Definition at line 34 of file vil_structuring_element.h.
|
inline |
Define elements { (p_i[k],p_j[k]) }.
Definition at line 37 of file vil_structuring_element.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
i position of elements (i,j).
Definition at line 54 of file vil_structuring_element.h.
|
inline |
j position of elements (i,j).
Definition at line 56 of file vil_structuring_element.h.
| void vil_structuring_element::set | ( | const std::vector< int > & | v_p_i, |
| const std::vector< int > & | v_p_j | ||
| ) |
Define elements { (p_i[k],p_j[k]) }.
Definition at line 15 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 36 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 48 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 62 of file vil_structuring_element.cxx.
|
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.
|
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 21 of file vil_abs_shuffle_distance.hxx.
|
related |
Applies morphological closing operation with given structuring element.
Applies dilation followed by erosion
Definition at line 15 of file vil_binary_closing.h.
|
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.
|
related |
Dilates src_image to produce dest_image (assumed single plane).
Definition at line 13 of file vil_binary_dilate.cxx.
|
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.
|
related |
Erodes src_image to produce dest_image (assumed single plane).
Definition at line 13 of file vil_binary_erode.cxx.
|
related |
Applies morphological opening operation with given structuring element.
Applies erosion followed by dilation
Definition at line 15 of file vil_binary_opening.h.
|
related |
Applies morphological closing operation with given structuring element.
Applies dilation followed by erosion
Definition at line 16 of file vil_greyscale_closing.h.
|
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.
|
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)
|
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.
|
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)
|
related |
Applies morphological opening operation with given structuring element.
Applies erosion followed by dilation
Definition at line 16 of file vil_greyscale_opening.h.
|
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)
|
related |
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 36 of file vil_median.h.
|
private |
Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
Definition at line 27 of file vil_structuring_element.h.
|
private |
Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
Definition at line 31 of file vil_structuring_element.h.
|
private |
Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
Definition at line 25 of file vil_structuring_element.h.
|
private |
Elements in box bounded by [min_i_,max_i_][min_j_,max_j].
Definition at line 29 of file vil_structuring_element.h.
|
private |
i position of elements (i,j).
Definition at line 21 of file vil_structuring_element.h.
|
private |
j position of elements (i,j).
Definition at line 23 of file vil_structuring_element.h.
1.8.15