00001 // This is contrib/mul/vil3d/algo/vil3d_suppress_non_max_edges.h 00002 #ifndef vil3d_suppress_non_max_edges_h_ 00003 #define vil3d_suppress_non_max_edges_h_ 00004 //: 00005 // \file 00006 // \brief Given gradient image, compute magnitude and zero any non-maximal values 00007 // \author Tim Cootes 00008 00009 #include <vil3d/vil3d_image_view.h> 00010 00011 //: Given gradient images, computes magnitude image containing maximal edges 00012 // Points with gradient magnitude above a threshold are tested against gradient 00013 // along normal to the edge and retained only if they are higher than 00014 // their neighbours. 00015 // 00016 // Gradient images are assumed to be in units of (intensity change) per world unit. 00017 // (ie the output of vil3d_world_gradients) 00018 // 00019 // Note: Currently assumes single plane only. 00020 // 2 pixel border around output set to zero. 00021 // If two neighbouring edges have exactly the same strength, it retains 00022 // both (ie an edge is eliminated if it is strictly lower than a neighbour, 00023 // but not if it is the same as two neighbours). 00024 // 00025 // \relatesalso vil3d_image_view 00026 template<class srcT> 00027 void vil3d_suppress_non_max_edges(const vil3d_image_view<srcT>& world_grad, 00028 const vil3d_image_view<srcT>& grad_mag, 00029 double voxel_width_i, 00030 double voxel_width_j, 00031 double voxel_width_k, 00032 srcT grad_mag_threshold, 00033 vil3d_image_view<srcT>& max_grad_mag); 00034 00035 #endif // vil3d_suppress_non_max_edges_h_