Functions
vil_find_peaks.h File Reference

Find peaks in image. More...

#include <vector>
#include <vil/vil_image_view.h>

Go to the source code of this file.

Functions

template<class T >
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. More...
 
template<class T >
void vil_find_peaks_3x3 (std::vector< unsigned > &pi, std::vector< unsigned > &pj, const vil_image_view< T > &image, const T &min_thresh, bool clear_list=true)
 Return (pi,pj) for all points in image strictly above their 8 neighbours. More...
 
template<class T >
bool vil_interpolate_peak (const T *pixel, std::ptrdiff_t istep, std::ptrdiff_t jstep, double &dx, double &dy, double &val)
 Fit a paraboloid to a pixel and its 8 neighbors to interpolate the peak. More...
 
template<class T >
void vil_find_peaks_3x3_subpixel (std::vector< double > &px, std::vector< double > &py, std::vector< double > &val, const vil_image_view< T > &image, const T &min_thresh, bool clear_list=true)
 Return sub-pixel (px,py,val) for all points in image strictly above their 8 neighbours. More...
 

Detailed Description

Find peaks in image.

Author
Tim Cootes

Definition in file vil_find_peaks.h.

Function Documentation

◆ vil_find_peaks_3x3()

template<class T >
void vil_find_peaks_3x3 ( std::vector< unsigned > &  pi,
std::vector< unsigned > &  pj,
const vil_image_view< T > &  image,
const T &  min_thresh,
bool  clear_list = true 
)
inline

Return (pi,pj) for all points in image strictly above their 8 neighbours.

Compute position of all local peaks (pi[k],pj[k]) above given threshold value.

Parameters
clear_listIf true (the default) then empty lists before adding new examples
See also
vil_find_plateaus_3x3()

Definition at line 37 of file vil_find_peaks.h.

◆ vil_find_peaks_3x3_subpixel()

template<class T >
void vil_find_peaks_3x3_subpixel ( std::vector< double > &  px,
std::vector< double > &  py,
std::vector< double > &  val,
const vil_image_view< T > &  image,
const T &  min_thresh,
bool  clear_list = true 
)
inline

Return sub-pixel (px,py,val) for all points in image strictly above their 8 neighbours.

Interpolation sub-pixel position of all local peaks (px[k],py[k]) above given threshold value by fitting a paraboloid. Interpolated peak values are returned in val.

Parameters
clear_listIf true (the default) then empty lists before adding new examples.

Definition at line 146 of file vil_find_peaks.h.

◆ vil_interpolate_peak()

template<class T >
bool vil_interpolate_peak ( const T *  pixel,
std::ptrdiff_t  istep,
std::ptrdiff_t  jstep,
double &  dx,
double &  dy,
double &  val 
)

Fit a paraboloid to a pixel and its 8 neighbors to interpolate the peak.

Returns
true if the neighborhood produces a proper peak (not a saddle) return by reference the sub-pixel offsets from the pixel center dx and dy as well as the interpolated peak value val.

Definition at line 65 of file vil_find_peaks.h.

◆ vil_is_peak_3x3()

template<class T >
bool vil_is_peak_3x3 ( const T *  im,
std::ptrdiff_t  i_step,
std::ptrdiff_t  j_step 
)
inline

True if pixel at *im is strictly above 8 neighbours.

See also
vil_is_plateau_3x3()

Definition at line 18 of file vil_find_peaks.h.