KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pathresize.h
Go to the documentation of this file.
1 
26 /*
27  * $Id: pathresize.h 17756 2014-10-15 18:58:24Z predoehl $
28  */
29 
30 #ifndef PATHRESIZE_H_INCLUDED_PREDOEHL_UOFARIZONA_VISION
31 #define PATHRESIZE_H_INCLUDED_PREDOEHL_UOFARIZONA_VISION 1
32 
33 #include <l/l_debug.h>
34 #include <m_cpp/m_vector.h>
35 #include <qd_cpp/pixpath.h>
36 
37 #include <vector>
38 
39 
40 namespace kjb
41 {
42 namespace qd
43 {
44 
45 
55 : public PixPath
56 {
58  static PixPath expanded_pp( const PixPath&, size_t, float );
59 
60  static PixPath all_from_list_a_with_some_from_list_b(
61  const PixPath&,
62  const PixPath&,
63  size_t
64  );
65 
66  static PixPath choose_random_redundancies(
67  const PixPath&,
68  const PixPath&,
69  std::vector< size_t >&, // this parameter gets clobbered
70  size_t
71  );
72 
73  static PixPath choose_hermitic_redundancies(
74  const PixPath&,
75  const PixPath&,
76  size_t
77  );
78 
79  static size_t insertion_yield( const std::vector< float >&, float );
80 
81  static PixPath cull_squashed_points( const PixPath&, float );
82 
83 public:
94  PixPath_expander( const PixPath& p, size_t sz, float distance_too_close )
95  : PixPath( expanded_pp( p, sz, distance_too_close ) )
96  {}
97 
99  static PixPath cull_cozy_points( const PixPath&, float );
100 };
101 
102 
103 
119 PixPath polyline_approx(
120  const PixPath& base_path,
121  size_t goal_size,
122  float* error = 00
123 );
124 
125 
126 
144 PixPath rightsize(
145  const PixPath& base_path,
146  size_t goal_size,
147  float distance_too_close
148 );
149 
150 
151 
152 float sosq_error( const PixPath&, size_t, size_t );
153 
154 PixPath reduce_pixels_pv(const PixPath&);
155 
156 PixPath reduce_pixels_bfs(const PixPath&);
157 
158 } // ns qd
159 } // ns kjb
160 
161 #endif /* PATHRESIZE_H_INCLUDED_PREDOEHL_UOFARIZONA_VISION */
PixPath polyline_approx(const PixPath &base_path, size_t goal_size, float *error)
compute polyline approximation to base_path with dynamic programming
Definition: pathresize.cpp:1262
float sosq_error(const PixPath &path, size_t iii, size_t jjj)
this is an error metric for a path bridging from index iii to jjj
Definition: pathresize.cpp:1244
Representation of a sequence of pixel coordinates.
Definition: pixpath.h:117
PixPath reduce_pixels_bfs(const PixPath &pixelpath)
another heuristic to reduce pixels, using previous two methods + BFS
Definition: pathresize.cpp:1462
Expand, if possible, a PixPath to fill a specified minimum size.
Definition: pathresize.h:54
PixPath_expander(const PixPath &p, size_t sz, float distance_too_close)
ctor builds a new path with at least as many points as requested.
Definition: pathresize.h:94
PixPath rightsize(const PixPath &base_path, size_t goal_size, float distance_too_close)
compute polyline approximation of base_path of the "right size."
Definition: pathresize.cpp:669
PixPath reduce_pixels_pv(const PixPath &pixelpath)
Remove "unnecessary" pixels, using the Perez-Vidal algorithm.
Definition: pathresize.cpp:1414
static PixPath cull_cozy_points(const PixPath &, float)
return a new path after eliminating points that are too close
Definition: pathresize.cpp:691
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...
Contains definition for class PixPath.