contrib/mul/vil3d/algo/vil3d_binary_erode.h
Go to the documentation of this file.
00001 #ifndef vil3d_binary_erode_h_
00002 #define vil3d_binary_erode_h_
00003 //:
00004 // \file
00005 // \brief Perform binary erosion on 3D images
00006 // \author Tim Cootes
00007 
00008 #include <vil3d/algo/vil3d_structuring_element.h>
00009 #include <vil3d/vil3d_image_view.h>
00010 
00011 
00012 //: Return false if any im[offset[k]] is zero
00013 inline bool vil3d_binary_erode(const bool* im, const vcl_ptrdiff_t* offset, unsigned n)
00014 {
00015   for (unsigned i=0;i<n;++i) if (!im[offset[i]]) return false;
00016   return true;
00017 }
00018 
00019 //: Erodes src_image to produce dest_image (assumed single plane)
00020 // \relatesalso vil3d_image_view
00021 // \relatesalso vil3d_structuring_element
00022 void vil3d_binary_erode(const vil3d_image_view<bool>& src_image,
00023                        vil3d_image_view<bool>& dest_image,
00024                        const vil3d_structuring_element& element);
00025 
00026 #endif // vil3d_binary_erode_h_