vil_binary_closing.h
Go to the documentation of this file.
1 #ifndef vil_binary_closing_h_
2 #define vil_binary_closing_h_
3 //:
4 // \file
5 // \brief Perform binary 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 inline void vil_binary_closing(const vil_image_view<bool>& src_image,
16  vil_image_view<bool>& dest_image,
17  const vil_structuring_element& element)
18 {
19  vil_image_view<bool> dilated_im;
20  vil_binary_dilate(src_image,dilated_im,element);
21  vil_binary_erode(dilated_im,dest_image,element);
22 }
23 
24 #endif // vil_binary_closing_h_
Structuring element for morphology represented as a list of non-zero pixels.
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.
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_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.
Perform binary erosion on images.
Perform binary dilation on images.