Woolz Image Processing
Version 1.8.3
|
Functions to decimate polyline and boundary domains The functions remove vertices that are parts of straight lines as defined by a maximum distance. The algorithm starts at vertex 1, walks along the line until at least one vertex between the start and current position is more than max-dist from the straight line between vertex 1 and current. All vertices between position 1 and current-1 are removed and position 1 is incremented (to what was current-1). The process is then repeated. More...
Functions | |
double | WlzIVtx2TriangleHeight (WlzIVertex2 *vtxs, int i, int j, int k) |
Calculate the height of a triangle from the last vertex to the line defined by the first two. Uses formula that can be derived from Faux and Pratt p57-65 or see my lab notebook #1, p17. For three vertices \(\mathbf{v_1}, \mathbf{v_2}, \mathbf{v_3},\) we define the vectors \(\mathbf{r} = \mathbf{v_2} - \mathbf{v_1}\), \(\mathbf{s} = \mathbf{v_3} - \mathbf{v_1}\) then the the required height \(h\) is given by: \[ h = \frac{|\mathbf{r}|^2|\mathbf{s}|^2 - (\mathbf{r}\cdot\mathbf{s})^2} {|\mathbf{r}|^2} \] . More... | |
WlzPolygonDomain * | WlzPolyDecimate (WlzPolygonDomain *poly, int wrap, double maxDist, WlzErrorNum *dstErr) |
Decimate a polyline by removing vertices that are within straight line segments as defined by a maximum distance. The algorithm starts at vertex 1, walks along the line until at least one vertex between the start and current position is more than maxDist from the straight line between vertex 1 and current. All vertices between position 1 and current-1 are removed and position 1 is incremented (to what was current-1). The process is then repeated. More... | |
WlzBoundList * | WlzBoundDecimate (WlzBoundList *bound, double maxDist, WlzErrorNum *dstErr) |
Decimate a boundary list using WlzPolyDecimate() on the boundary polylines. More... | |
Functions to decimate polyline and boundary domains The functions remove vertices that are parts of straight lines as defined by a maximum distance. The algorithm starts at vertex 1, walks along the line until at least one vertex between the start and current position is more than max-dist from the straight line between vertex 1 and current. All vertices between position 1 and current-1 are removed and position 1 is incremented (to what was current-1). The process is then repeated.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.