#include <osl_canny_rothwell.h>
Public Member Functions | |
osl_canny_rothwell (osl_canny_rothwell_params const &) | |
~osl_canny_rothwell () | |
void | detect_edges (vil1_image const &image, vcl_list< osl_edge * > *, bool adaptive=false) |
Protected Member Functions | |
void | Non_maximal_suppression () |
Non-maximally suppresses the output image by searching along the edge normal and checking that the test edge has a greater that the interpolated neighbours in the direction. | |
void | Initial_hysteresis () |
Hysteresis follows edgel chains that lie above the low_ threshold and have at least one edgel above the high_ threshold. | |
void | Final_hysteresis (vcl_list< osl_edge * > *) |
Hysteresis follows edgel chains that lie above the low_ threshold and have at least one edgel above the high_ threshold. | |
void | Jump_gap (int, int, int, int, int *, int *) |
void | Thin_edges () |
Method to thin the image using the variation of Tsai-Fu thinning used by Van-Duc Nguyen in Geo-Calc. | |
void | Jump_single_breaks () |
Searches for single pixel breaks near dangling ends and patches them up. | |
void | Adaptive_Canny (vil1_image const &) |
Searches for high contrast changes in the vicinity of dangling ends. | |
void | Compute_adaptive_images (int, int, int, float **, float **, float **) |
void | Subtract_thick (int, int, int, float **) |
Wherever the thick_ image has an edge marked set the new gradient value to zero. | |
void | Best_eight_way (int, int, float **, int *, int *) |
Returns the eight-way neighbour with the strongest contrast change. | |
void | Find_dangling_ends () |
Searches for the junctions in the image. | |
int | Dangling_end (int, int) |
Tests whether a point is a dangling end and return 1 in that case. | |
void | Find_junctions () |
Searches for the junctions in the image. | |
void | Find_junction_clusters () |
Locate junction clusters using the following method of hysteresis. | |
void | Final_follow (int, int, vcl_list< int > *, vcl_list< int > *, vcl_list< float > *, int) |
Following routine looking for connectiveness of edgel chains and accounts for single pixel gaps in the chains. | |
Static Protected Member Functions | |
static void | Initial_follow (float *const *thin, int xsize, int ysize, float low, int x, int y, vcl_list< int > *xc, vcl_list< int > *yc, vcl_list< float > *grad) |
Following routine looking for connectiveness of edgel chains and accounts for single pixel gaps in the chains. | |
static void | Follow_junctions (int *const *junction, int x, int y, vcl_list< int > *xc, vcl_list< int > *yc) |
Following routine looking for searching out junction clusters. | |
static void | Cluster_centre_of_gravity (int *const *jx, int *const *jy, vcl_list< int > &xc, vcl_list< int > &yc, int &x0, int &y0) |
Finds which member of the lists lies closest to the centre of gravity of the lists. | |
static int | Junction_neighbour (int const *const *junction, int x, int y) |
Determines whether the point (x,y) is a neighbour to a junction. | |
Protected Attributes | |
int ** | dangling_ |
vcl_list< int > * | xdang_ |
vcl_list< int > * | ydang_ |
float | range_ |
float | old_sigma_ |
int | old_width_ |
int | old_k_size_ |
float | dummy_ |
unsigned int | xstart_ |
unsigned int | ystart_ |
unsigned int | xsize_ |
unsigned int | ysize_ |
float ** | smooth_ |
float ** | dx_ |
float ** | dy_ |
float ** | grad_ |
float ** | thick_ |
float ** | thin_ |
float ** | theta_ |
int ** | junction_ |
int ** | jx_ |
int ** | jy_ |
vcl_list< int > * | xjunc_ |
vcl_list< int > * | yjunc_ |
vcl_list< osl_Vertex * > * | vlist_ |
float | gauss_tail_ |
float | sigma_ |
int | width_ |
int | w0_ |
int | k_size_ |
float * | kernel_ |
float | low_ |
float | high_ |
float | jval_ |
int | chain_no_ |
bool | verbose |
Definition at line 41 of file osl_canny_rothwell.h.
osl_canny_rothwell::osl_canny_rothwell | ( | osl_canny_rothwell_params const & | params | ) |
Definition at line 23 of file osl_canny_rothwell.cxx.
osl_canny_rothwell::~osl_canny_rothwell | ( | ) |
Definition at line 46 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Adaptive_Canny | ( | vil1_image const & | image | ) | [protected] |
Searches for high contrast changes in the vicinity of dangling ends.
This is done by halving the previously used Canny sigma to reduce the effects of smoothing near corners. Ultimately the kernel size will be scaled down until its radius of influence is only two pixels; at that stage pixel-jumping should fix any problems.
Definition at line 654 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Best_eight_way | ( | int | x, |
int | y, | ||
float ** | grad, | ||
int * | xnew, | ||
int * | ynew | ||
) | [protected] |
Returns the eight-way neighbour with the strongest contrast change.
fsm: No, this routine returns the last of the eight neighbours with contrast change greater than 'low_'. Probably a bug. FIXME
Definition at line 755 of file osl_canny_rothwell.cxx.
void osl_canny_base::Cluster_centre_of_gravity | ( | int *const * | jx, |
int *const * | jy, | ||
vcl_list< int > & | xc, | ||
vcl_list< int > & | yc, | ||
int & | x0, | ||
int & | y0 | ||
) | [static, protected, inherited] |
Finds which member of the lists lies closest to the centre of gravity of the lists.
Definition at line 206 of file osl_canny_base.cxx.
void osl_canny_rothwell::Compute_adaptive_images | ( | int | , |
int | , | ||
int | , | ||
float ** | , | ||
float ** | , | ||
float ** | |||
) | [protected] |
int osl_canny_rothwell::Dangling_end | ( | int | x, |
int | y | ||
) | [protected] |
Tests whether a point is a dangling end and return 1 in that case.
Otherwise the return value could be 0 or between 2 and 8.
Definition at line 802 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::detect_edges | ( | vil1_image const & | image, |
vcl_list< osl_edge * > * | edges, | ||
bool | adaptive = false |
||
) |
Definition at line 74 of file osl_canny_rothwell.cxx.
void osl_canny_base::Final_follow | ( | int | x, |
int | y, | ||
vcl_list< int > * | xc, | ||
vcl_list< int > * | yc, | ||
vcl_list< float > * | grad, | ||
int | reverse | ||
) | [protected, inherited] |
Following routine looking for connectiveness of edgel chains and accounts for single pixel gaps in the chains.
Definition at line 92 of file osl_canny_base.cxx.
void osl_canny_rothwell::Final_hysteresis | ( | vcl_list< osl_edge * > * | edges | ) | [protected] |
Hysteresis follows edgel chains that lie above the low_ threshold and have at least one edgel above the high_ threshold.
Due to the Initial_hysteresis phase, all edges greater than low_ will be by default good and so have a member greater than high_.
Definition at line 360 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Find_dangling_ends | ( | ) | [protected] |
Searches for the junctions in the image.
Definition at line 778 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Find_junction_clusters | ( | ) | [protected] |
Locate junction clusters using the following method of hysteresis.
Definition at line 847 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Find_junctions | ( | ) | [protected] |
Searches for the junctions in the image.
Definition at line 824 of file osl_canny_rothwell.cxx.
void osl_canny_base::Follow_junctions | ( | int *const * | junction, |
int | x, | ||
int | y, | ||
vcl_list< int > * | xc, | ||
vcl_list< int > * | yc | ||
) | [static, protected, inherited] |
Following routine looking for searching out junction clusters.
Definition at line 172 of file osl_canny_base.cxx.
void osl_canny_base::Initial_follow | ( | float *const * | thin, |
int | xsize, | ||
int | ysize, | ||
float | low, | ||
int | x, | ||
int | y, | ||
vcl_list< int > * | xc, | ||
vcl_list< int > * | yc, | ||
vcl_list< float > * | grad | ||
) | [static, protected, inherited] |
Following routine looking for connectiveness of edgel chains and accounts for single pixel gaps in the chains.
Definition at line 50 of file osl_canny_base.cxx.
void osl_canny_rothwell::Initial_hysteresis | ( | ) | [protected] |
Hysteresis follows edgel chains that lie above the low_ threshold and have at least one edgel above the high_ threshold.
Once we have followed, the good edgelchains are re-written to the thin_ image for further processing.
Definition at line 299 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Jump_gap | ( | int | , |
int | , | ||
int | , | ||
int | , | ||
int * | , | ||
int * | |||
) | [protected] |
void osl_canny_rothwell::Jump_single_breaks | ( | ) | [protected] |
Searches for single pixel breaks near dangling ends and patches them up.
This is destructive on the dangling lists.
Definition at line 571 of file osl_canny_rothwell.cxx.
int osl_canny_base::Junction_neighbour | ( | int const *const * | junction, |
int | x, | ||
int | y | ||
) | [static, protected, inherited] |
Determines whether the point (x,y) is a neighbour to a junction.
Definition at line 252 of file osl_canny_base.cxx.
void osl_canny_rothwell::Non_maximal_suppression | ( | ) | [protected] |
Non-maximally suppresses the output image by searching along the edge normal and checking that the test edge has a greater that the interpolated neighbours in the direction.
We have also included sub-pixel interpolation of the peak position by parabolic fitting. Writes edges into the thick_ image.
Definition at line 197 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Subtract_thick | ( | int | x0, |
int | y0, | ||
int | image_size, | ||
float ** | grad | ||
) | [protected] |
Wherever the thick_ image has an edge marked set the new gradient value to zero.
Definition at line 740 of file osl_canny_rothwell.cxx.
void osl_canny_rothwell::Thin_edges | ( | ) | [protected] |
Method to thin the image using the variation of Tsai-Fu thinning used by Van-Duc Nguyen in Geo-Calc.
This relies on computing the genus of an edge location, and removing it if it is not a dangling chain as has genus zero.
Definition at line 519 of file osl_canny_rothwell.cxx.
int osl_canny_base::chain_no_ [protected, inherited] |
Definition at line 89 of file osl_canny_base.h.
int** osl_canny_rothwell::dangling_ [protected] |
Definition at line 65 of file osl_canny_rothwell.h.
float osl_canny_rothwell::dummy_ [protected] |
Definition at line 74 of file osl_canny_rothwell.h.
float** osl_canny_base::dx_ [protected, inherited] |
Definition at line 64 of file osl_canny_base.h.
float** osl_canny_base::dy_ [protected, inherited] |
Definition at line 65 of file osl_canny_base.h.
float osl_canny_base::gauss_tail_ [protected, inherited] |
Definition at line 79 of file osl_canny_base.h.
float** osl_canny_base::grad_ [protected, inherited] |
Definition at line 66 of file osl_canny_base.h.
float osl_canny_base::high_ [protected, inherited] |
Definition at line 86 of file osl_canny_base.h.
int** osl_canny_base::junction_ [protected, inherited] |
Definition at line 73 of file osl_canny_base.h.
float osl_canny_base::jval_ [protected, inherited] |
Definition at line 88 of file osl_canny_base.h.
int** osl_canny_base::jx_ [protected, inherited] |
Definition at line 74 of file osl_canny_base.h.
int ** osl_canny_base::jy_ [protected, inherited] |
Definition at line 74 of file osl_canny_base.h.
int osl_canny_base::k_size_ [protected, inherited] |
Definition at line 83 of file osl_canny_base.h.
float* osl_canny_base::kernel_ [protected, inherited] |
Definition at line 84 of file osl_canny_base.h.
float osl_canny_base::low_ [protected, inherited] |
Definition at line 85 of file osl_canny_base.h.
int osl_canny_rothwell::old_k_size_ [protected] |
Definition at line 72 of file osl_canny_rothwell.h.
float osl_canny_rothwell::old_sigma_ [protected] |
Definition at line 70 of file osl_canny_rothwell.h.
int osl_canny_rothwell::old_width_ [protected] |
Definition at line 71 of file osl_canny_rothwell.h.
float osl_canny_rothwell::range_ [protected] |
Definition at line 67 of file osl_canny_rothwell.h.
float osl_canny_base::sigma_ [protected, inherited] |
Definition at line 80 of file osl_canny_base.h.
float** osl_canny_base::smooth_ [protected, inherited] |
Definition at line 63 of file osl_canny_base.h.
float** osl_canny_base::theta_ [protected, inherited] |
Definition at line 70 of file osl_canny_base.h.
float** osl_canny_base::thick_ [protected, inherited] |
Definition at line 68 of file osl_canny_base.h.
float** osl_canny_base::thin_ [protected, inherited] |
Definition at line 69 of file osl_canny_base.h.
bool osl_canny_base::verbose [protected, inherited] |
Definition at line 90 of file osl_canny_base.h.
vcl_list<osl_Vertex*>* osl_canny_base::vlist_ [protected, inherited] |
Definition at line 77 of file osl_canny_base.h.
int osl_canny_base::w0_ [protected, inherited] |
Definition at line 82 of file osl_canny_base.h.
int osl_canny_base::width_ [protected, inherited] |
Definition at line 81 of file osl_canny_base.h.
vcl_list<int>* osl_canny_rothwell::xdang_ [protected] |
Definition at line 66 of file osl_canny_rothwell.h.
vcl_list<int>* osl_canny_base::xjunc_ [protected, inherited] |
Definition at line 75 of file osl_canny_base.h.
unsigned int osl_canny_base::xsize_ [protected, inherited] |
Definition at line 61 of file osl_canny_base.h.
unsigned int osl_canny_base::xstart_ [protected, inherited] |
Definition at line 60 of file osl_canny_base.h.
vcl_list<int> * osl_canny_rothwell::ydang_ [protected] |
Definition at line 66 of file osl_canny_rothwell.h.
vcl_list<int>* osl_canny_base::yjunc_ [protected, inherited] |
Definition at line 76 of file osl_canny_base.h.
unsigned int osl_canny_base::ysize_ [protected, inherited] |
Definition at line 61 of file osl_canny_base.h.
unsigned int osl_canny_base::ystart_ [protected, inherited] |
Definition at line 60 of file osl_canny_base.h.