contrib/oxl/osl/osl_break_edge.h
Go to the documentation of this file.
00001 // This is oxl/osl/osl_break_edge.h
00002 #ifndef osl_break_edge_h_
00003 #define osl_break_edge_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 
00011 class osl_edge;
00012 #include <vcl_list.h>
00013 #include <vcl_vector.h>
00014 
00015 //: Break the given edge at the positions indicated.
00016 //
00017 // The first element of 'where' must be 0 and the last
00018 // must be in->size()-1.
00019 //
00020 // The output edges will be in the order of the edgelchain
00021 // and the first (resp. last) output edge will share its
00022 // start (resp. end) vertex with the start (resp. end)
00023 // vertex of the given edge.
00024 //
00025 // The input edge is not modified in any way, though its
00026 // endpoints will obviously have the reference counts
00027 // increased.
00028 void osl_break_edge(osl_edge const *in,
00029                     vcl_vector<unsigned> const &where,
00030                     vcl_list<osl_edge*> *broken);
00031 
00032 //: Break the given edge at points of "high curvature".
00033 //
00034 // This means edgels where the rms line fitting error over
00035 // a neighbourhood of the given size exceeds the given threshold.
00036 //
00037 // For a neighbourhood size of k,the number of edgels used in
00038 // each line fit is 2*k+1 (so the default is 5 edgels). The new
00039 // edges are pushed onto the end of the given vcl_list in the
00040 // obvious order.
00041 void osl_break_edge(osl_edge const *in,
00042                     vcl_list<osl_edge*> *broken,
00043                     double threshold = 0.2,
00044                     unsigned nbhd_size = 2);
00045 
00046 #endif // osl_break_edge_h_