00001 #ifndef vil_binary_opening_h_ 00002 #define vil_binary_opening_h_ 00003 //: 00004 // \file 00005 // \brief Perform binary opening on images 00006 // \author Tim Cootes 00007 00008 #include <vil/algo/vil_binary_dilate.h> 00009 #include <vil/algo/vil_binary_erode.h> 00010 00011 //: Applies morphological opening operation with given structuring element 00012 // Applies erosion followed by dilation 00013 // \relatesalso vil_image_view 00014 // \relatesalso vil_structuring_element 00015 inline void vil_binary_opening(const vil_image_view<bool>& src_image, 00016 vil_image_view<bool>& dest_image, 00017 const vil_structuring_element& element) 00018 { 00019 vil_image_view<bool> eroded_im; 00020 vil_binary_erode(src_image,eroded_im,element); 00021 vil_binary_dilate(eroded_im,dest_image,element); 00022 } 00023 00024 #endif // vil_binary_opening_h_