All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Functions
pathresize.h File Reference

Definitions for PixPath specializations to resize paths. More...

#include <l/l_debug.h>
#include <m_cpp/m_vector.h>
#include <qd_cpp/pixpath.h>
#include <vector>

Go to the source code of this file.


class  kjb::qd::PixPath_expander
 Expand, if possible, a PixPath to fill a specified minimum size. More...


 Classes and functions for dealing with trajectory files.
 support for the path algorithm I call the quasi-Dijkstra method.


PixPath kjb::qd::polyline_approx (const PixPath &base_path, size_t goal_size, float *error=00)
 compute polyline approximation to base_path with dynamic programming More...
PixPath kjb::qd::rightsize (const PixPath &base_path, size_t goal_size, float distance_too_close)
 compute polyline approximation of base_path of the "right size." More...
float kjb::qd::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 More...
PixPath kjb::qd::reduce_pixels_pv (const PixPath &pixelpath)
 Remove "unnecessary" pixels, using the Perez-Vidal algorithm. More...
PixPath kjb::qd::reduce_pixels_bfs (const PixPath &pixelpath)
 another heuristic to reduce pixels, using previous two methods + BFS More...

Detailed Description

Definitions for PixPath specializations to resize paths.

Andrew Predoehl

Suppose you have a PixPath (q.v.) and it represents the ordered vertices of a polygonal path. This header provides functionality to expand or shrink the number of vertices in your path, without "much" affecting the set of points in the corresponding polygonal path.

In other words, you can add vertices if you need to, or remove them, and the connect-the-dots result will resemble the connect-the-dots appearance of the original, we hope.

This also supports the concept of "too close." You might know a threshold value distance X, such that any vertices closer than X is unacceptable; one or both must go. The expander class lets you set a too-close value (so that some vertices are removed) and will add new vertices if necessary, but not too close, so that the final result has your goal size without any vertices as close as or closer than X apart. If this isn't possible, it throws. The class PixPath_expander supports all these features.

If you just need to remove vertices (maybe lots of them) to reach a given goal size, use function polyline_approx().