2 #ifndef vil_suppress_non_max_h_ 3 #define vil_suppress_non_max_h_ 14 # include <vcl_msvc_warnings.h> 38 T threshold=0, T non_max_value=0)
40 unsigned ni=src_im.
ni(),nj=src_im.
nj();
45 std::ptrdiff_t istep = src_im.
istep(),jstep=src_im.
jstep();
46 std::ptrdiff_t distep = dest_im.
istep(),djstep=dest_im.
jstep();
49 for (
unsigned j=1;j<nj-1;++j,row+=jstep,drow+=djstep)
53 for (
unsigned i=1;i<ni-1;++i,pixel+=istep,dpixel+=distep)
56 *dpixel = non_max_value;
69 #endif // vil_suppress_non_max_h_ Various functions for manipulating image views.
Concrete view of image data of type T held in memory.
void set_size(unsigned ni, unsigned nj) override
resize current planes to ni x nj.
std::ptrdiff_t jstep() const
Add this to your pixel pointer to get next j pixel.
void vil_fill_col(vil_image_view< T > &view, unsigned i, T value)
Fill column i in view with given value.
unsigned ni() const
Width.
void vil_suppress_non_max_3x3(const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, T threshold=0, T non_max_value=0)
Suppress all non-maximal (non peaks) pixels in the image.
unsigned nj() const
Height.
A base class reference-counting view of some image data.
bool vil_is_peak_3x3(const T *im, std::ptrdiff_t i_step, std::ptrdiff_t j_step)
True if pixel at *im is strictly above 8 neighbours.
T * top_left_ptr()
Pointer to the first (top left in plane 0) pixel.
unsigned nplanes() const
Number of planes.
std::ptrdiff_t istep() const
Add this to your pixel pointer to get next i pixel.
void vil_fill_row(vil_image_view< T > &view, unsigned j, T value)
Fill row j in view with given value.