Go to the documentation of this file.00001 #ifndef gevd_clean_edgels_h_
00002 #define gevd_clean_edgels_h_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #include <vcl_vector.h>
00042 #include <vtol/vtol_vertex_2d.h>
00043 #include <vtol/vtol_vertex_2d_sptr.h>
00044 #include <vtol/vtol_edge_2d_sptr.h>
00045 #include <vsol/vsol_point_2d_sptr.h>
00046
00047 class gevd_clean_edgels
00048 {
00049 public:
00050 gevd_clean_edgels();
00051 ~gevd_clean_edgels();
00052 void DoCleanEdgelChains(vcl_vector<vtol_edge_2d_sptr>& in_edgels, vcl_vector<vtol_edge_2d_sptr>& out_edgels, int steps = 10);
00053 void JumpGaps();
00054 void RemoveBridges();
00055 void DeleteShortEdges();
00056 void FixDefficientEdgels();
00057 void RemoveJaggies();
00058 void RemoveLoops();
00059 protected:
00060 void print_protection();
00061 void detect_similar_edges(vcl_vector<vtol_edge_2d_sptr>& common_edges, float tolerance,
00062 vcl_vector<vtol_edge_2d_sptr>& deleted_edges);
00063 void remove_similar_edges(vtol_vertex_2d*& v1, vcl_vector<vtol_edge_2d_sptr>& deleted_edges);
00064 bool edge_exists(vtol_vertex_2d_sptr v1, vtol_vertex_2d_sptr v2, vcl_vector<vtol_edge_2d_sptr>& intersection);
00065 void remove_connected_edges(vtol_vertex_2d* v, vcl_vector<vtol_edge_2d_sptr>& edges);
00066 bool closest_vertex(vtol_edge_2d_sptr e, vsol_point_2d_sptr p, float radius, vtol_vertex_2d_sptr& v);
00067 bool split_edge(vtol_edge_2d_sptr e, vtol_vertex_2d_sptr v, vtol_edge_2d_sptr& e1, vtol_edge_2d_sptr& e2);
00068 vcl_vector<vtol_edge_2d_sptr>* out_edgels_;
00069 };
00070
00071 #endif // gevd_clean_edgels_h_