vil_greyscale_closing.h
Go to the documentation of this file.
1 #ifndef vil_greyscale_closing_h_
2 #define vil_greyscale_closing_h_
3 //:
4 // \file
5 // \brief Perform greyscale closing on images
6 // \author Tim Cootes
7 
10 
11 //: Applies morphological closing operation with given structuring element
12 // Applies dilation followed by erosion
13 // \relatesalso vil_image_view
14 // \relatesalso vil_structuring_element
15 template <class T>
16 inline void vil_greyscale_closing(const vil_image_view<T>& src_image,
17  vil_image_view<T>& dest_image,
18  const vil_structuring_element& element)
19 {
20  vil_image_view<T> dilated_im;
21  vil_greyscale_dilate(src_image,dilated_im,element);
22  vil_greyscale_erode(dilated_im,dest_image,element);
23 }
24 
25 #endif // vil_greyscale_closing_h_
Structuring element for morphology represented as a list of non-zero pixels.
Concrete view of image data of type T held in memory.
Definition: vil_fwd.h:13
Perform greyscale dilation on images.
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).
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).
Perform greyscale erosion on images.
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.