Go to the documentation of this file.00001 #ifndef bdgl_curve_algs_h_
00002 #define bdgl_curve_algs_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "dll.h"
00016 #include <vgl/vgl_line_2d.h>
00017 #include <vgl/vgl_point_2d.h>
00018 #include <vdgl/vdgl_edgel_chain_sptr.h>
00019 #include <vdgl/vdgl_digital_curve_sptr.h>
00020
00021 class bdgl_curve_algs
00022 {
00023 public:
00024 static BDGL_DLL_DATA const double tol;
00025 static BDGL_DLL_DATA const double max_edgel_sep;
00026 static BDGL_DLL_DATA const double synthetic;
00027 ~bdgl_curve_algs();
00028
00029
00030 static int closest_point(vdgl_edgel_chain_sptr const& ec,
00031 const double x, const double y);
00032
00033
00034 static double closest_point(vdgl_digital_curve_sptr const& dc,
00035 const double x, const double y);
00036
00037
00038 static bool closest_point(vdgl_digital_curve_sptr const& dc,
00039 const double x, const double y,
00040 double& xc, double& yc);
00041
00042
00043 static bool closest_point_near(vdgl_edgel_chain_sptr const& ec,
00044 const int index,
00045 const double x, const double y,
00046 double & xc, double & yc);
00047
00048
00049 static int closest_end(vdgl_edgel_chain_sptr const & ec,
00050 const double x, const double y);
00051
00052
00053 static vdgl_digital_curve_sptr reverse(vdgl_digital_curve_sptr const& dc);
00054
00055
00056 static bool intersect_bounding_box(vdgl_digital_curve_sptr const& dc,
00057 vgl_line_2d<double> & line);
00058
00059
00060
00061 static bool intersect_line_fast(vdgl_digital_curve_sptr const& dc,
00062 vgl_line_2d<double> & line,
00063 vcl_vector<double>& indices);
00064
00065
00066
00067 static bool intersect_line_fast(vdgl_digital_curve_sptr const& dc,
00068 vgl_line_2d<double> & line,
00069 vcl_vector<vgl_point_2d<double> >& pts);
00070
00071
00072 static bool intersect_line(vdgl_digital_curve_sptr const& dc,
00073 vgl_line_2d<double> & line,
00074 vcl_vector<double>& indices);
00075
00076
00077 static bool intersect_line(vdgl_digital_curve_sptr const& dc,
00078 vgl_line_2d<double> & line,
00079 vcl_vector<vgl_point_2d<double> >& pts);
00080
00081
00082 static bool match_intersection(vdgl_digital_curve_sptr const& dc,
00083 vgl_line_2d<double>& line,
00084 vgl_point_2d<double> const& ref_point,
00085 double ref_gradient_angle,
00086 vgl_point_2d<double>& point);
00087
00088
00089 static bool line_gen(float xs, float ys, float xe, float ye,
00090 bool& init, bool& done,
00091 float& x, float& y);
00092
00093
00094 static int add_straight_edgels(vdgl_edgel_chain_sptr const& ec,
00095 const double x, const double y,
00096 bool debug = false);
00097
00098 static void
00099 smooth_curve(vcl_vector<vgl_point_2d<double> >& curve,double sigma=1.0);
00100
00101 static vdgl_digital_curve_sptr
00102 create_digital_curves(vcl_vector<vgl_point_2d<double> > & curve);
00103
00104 private:
00105 bdgl_curve_algs();
00106 };
00107
00108 #endif