core/vil/algo/vil_greyscale_closing.h
Go to the documentation of this file.
00001 #ifndef vil_greyscale_closing_h_
00002 #define vil_greyscale_closing_h_
00003 //:
00004 // \file
00005 // \brief Perform greyscale closing on images
00006 // \author Tim Cootes
00007 
00008 #include <vil/algo/vil_greyscale_dilate.h>
00009 #include <vil/algo/vil_greyscale_erode.h>
00010 
00011 //: Applies morphological closing operation with given structuring element
00012 //  Applies dilation followed by erosion
00013 // \relatesalso vil_image_view
00014 // \relatesalso vil_structuring_element
00015 template <class T>
00016 inline void vil_greyscale_closing(const vil_image_view<T>& src_image,
00017                                   vil_image_view<T>& dest_image,
00018                                   const vil_structuring_element& element)
00019 {
00020   vil_image_view<T> dilated_im;
00021   vil_greyscale_dilate(src_image,dilated_im,element);
00022   vil_greyscale_erode(dilated_im,dest_image,element);
00023 }
00024 
00025 #endif // vil_greyscale_closing_h_