Download presentation
Presentation is loading. Please wait.
Published byJohn Day Modified over 9 years ago
1
Tracing and compressing digital curves András Hajdu Department of Computer Graphics and Image Processing Faculty of Informatics, University of Debrecen, Hungary 17th Summer School on Image Processing, July 2-11 2009, Debrecen.
2
Overview of the problem Tracing a curve having general topology Partitioning the curve into line segments
3
Overview of the proposed approach Assign an underlying graph to the curve Find an Euler decomposition of the graph Trace the Euler components with respect to a linear optimality criterion at junctions Compress the curve components using an alphabet of line segments (polygon approximation)
4
Assigning an underlying graph to the curve - Basics A graph G = ( V, E ) V: set of vertices, E = V×V= {{v 1, v 2 } | v 1, v 2 V }: set of edges. G is undirected, loops and multiple edges allowed. The degree of a vertex is the number of edges containing it. A path is a list of edges: {v 1,v 2 }, {v 2,v 3 },..., {v n-1,v n }. A route is a closed path with v 1 = v n. A path containing all the edges exactly once is an Euler path (route)
5
Assigning an underlying graph to the curve - Basics An Euler decomposition of G is the union of its edge- disjoint Euler subgraphs G i (i=1,...,n). Results on Euler graphs and decompositions: –Every Euler graph is connected, –A connected graph has Euler route iff all of its vertices have even degree, –A connected graph has Euler path iff at most two vertices have odd degree, –Every connected graph has an Euler decomposition.
6
Assigning an underlying graph to the curve The curve tracing (CT) algorithm: 1.Assign a graph G C = ( V C, E C ) to the curve C, where V C contains all the end and junction points of C. The edges are the curve segments connecting these vertices. 2.Create an Euler decomposition C i of C based on G C. 3.Trace all the C i ’s separately through their Euler paths. i=1 n
7
Realization of CT algorithm - preprocessing The input can be any one-pixel wide self intersecting object (curve) for graph assignment. To guarantee one-pixel wideness, thinning can be applied first to remove undesired thickening pixels.
8
Realization of CT algorithm - locating vertices Vertices are assigned to curve junctions and end points Junctions: curve points with more than two 8-neighbors, End points: curve points with exactly one 8-neighbor.
9
Realization of CT algorithm - extracting edges Non-vertex 8-neighbors of vertices with exactly two 8- neighbors are marked as edge end points. Edges are 8-connected paths connecting edge end points. edge end point edge point junction point
10
Realization of CT algorithm - the underlying graph end points: 1,10 junction points: 2,3,4,5,6,7,8,9,11,12,13
11
Realization of CT algorithm - junctions of special type Junctions degenerate if tangents of curve segments almost coincide. Junction points closer than a threshold K are found, and the pixels between them are merged. edge end point edge point junction point degenarated intersection K = 2 K = 9
12
Realization of CT algorithm - tracing the components The first step to trace an Euler curve is to locate a starting vertex having odd degree. Then, we take an edge from the starting vertex to initialize the tracer. possible starting vertices: 1 (finishing at 10) 10 (finishing at 1) possible starting edges: {1,4} (finishing with {8,10}) {10,8} (finishing with {4,1})
13
Realization of CT algorithm - tracing through junctions More Euler paths may exist. Which edge to take next at junctions? For better polygon approximation, go on straight: –calculate the centre of the junction having E 1,..., E k edge end points (we arrive at E 0 ) –calculate the change of direction for all E i : –select the most linear direction towards E l with:
14
Realization of CT algorithm - tracing through junctions we arrive at E 0...... we go on with E 2
15
Realization of CT algorithm - restrictions for tracing The most straight direction cannot be always selected freely at junctions. We must obey the graph traversal (Fleury’s) algorithm to extract an Euler path: –Always leave one edge available to get back to the starting vertex or to the other odd vertex. –Do not use an edge to go to a vertex unless there is another edge available to leave it.
16
Realization of CT algorithm - complete tracing Euler path: {1,4,5,2,4,8,13,11,7,5,2,3,6,7,9,13,12,6,3,12,11,9,8,10} Start End
17
Realization of CT algorithm - complete tracing of the curve
18
Compressing the curve - steps of compression A finite alphabet of digital line segments is defined. The traced curve is compressed online to replace curve segments with letters from the alphabet. Complementary variable length (Huffmann) coding is applied.
19
Compressing the curve - alphabet of digital line segments Λ is a finite alphabet of Bresenham line segments of all orientations having length at most T. T=6, first octant
20
Compressing the curve - alphabet of digital line segments all orientations
21
Compressing the curve - alphabet of digital line segments Cardinality of Λ: Number of bits to code a letter: To keep cardinality small, we consider unique (Bresenham) segments to connect two points.
22
Compressing the curve - replacing curve segments Online curve compression is used: during tracing the curve, current curve segment is replaced from Λ if it violates linearity: Information loss is allowed as Bresenham segments differ, but linearity is common criterion. the segment should stay between two parallel lines [Rosenfeld and Klette].
23
Compressing the curve - comparing with JBEAM JBEAM [Huo and Chen] is a state-of-the-art algorithm for the compresson of one-pixel wide objects. It divides binary (curve) image using quadtree decomposition till having single linear curve segments in cells to be substituted by beamlets.
24
Compressing the curve - comparing with JBEAM Test curves Euler curves Non-Euler curve (decomposition)
25
Compressing the curve - comparing with JBEAM ~50% improvement With tracing, the proposed CT algorithm avoids subdivision.
26
Compressing the curve - comparing with MPEG-4 In MPEG-4 a vertex-based shape approximation was developed to code the outline of shapes. The boundary is approximated by a polygon, with a recursive splitting process that starts with the longest axis (diameter). If the distance of the curve and polygon segment is > d max the segment is splitted into two new parts.
27
Compressing the curve - comparing with MPEG-4 d max = 2 / 2 guarantees straight polygon segments. d max = 1 had similar performance than the proposed. d max = 1.4 is reported perceptually acceptable.
28
Compressing the curve - comparing with MPEG-4 Test curves (shapes have simple closed boundary)
29
Compressing the curve - comparing with MPEG-4 ~similar performance with MPEG-4 for d max =1 (d max =1 violates the linearity criterion for MPEG-4)
30
Compressing the curve - comparing with MPEG-4 Partitioned test curves
31
Compressing the curve - comparing with MPEG-4 MPEG-4 recommends the application of a complementary variable length coding, e.g. Huffmann coding ~50% improvement in compression performance.
32
Compressing the curve - more MPEG-4 improvements Some more minor recommendations from MPEG-4: –For lossy shape coding the selection of the vertices on the object boundary is not optimal. Therefore, the vertices can be shifted by 1 pixel within a neighborhood of size 3 × 3. –The maximal length of the alphabet elements can be fixed dynamically as the length of the longest polygon segment. In this case, this length information should be transmitted, as well.
33
Alternative approaches – weighted graphs The same finite alphabet of line segments and online curve compression is considered. Weighted graph approaches can be considered with a natural weight function for the edges: The number of letters needed:
34
Alternative approaches – weighted graphs number of letters needed to compress edges (weights)
35
Alternative approaches – compressing edges separately Compression can be executed at edge level without tracing. This simple approach also avoids curve subdivision, but has drawbacks: –the coordinates of the start pixel of each curve segment for appropriate geometric positioning. –lack of junction information leads to distortion at junctions during decompression (the curve segments must be connected ad-hoc).
36
Alternative approaches – compressing edges separately Optimal tracing performs well for curves having more straight sections (e.g. General, Lines)
37
Alternative approaches – avoiding Euler decomposition Our basic approach is to decompose every underlying graph into Euler subgraphs. Decomposition can be avoided with taking some edges more than once (Chinese Postman Problem, CPP). Advantage is that we can avoid graph decomposition. Disadvantage is the redundant compression of edges. Algorithmic solution is known for the CPP problem: we must try to select the redundant edges with keeping the extra weight sum minimal.
38
Alternative approaches – avoiding Euler decomposition Vertices 1,2,3,12,16,17 are of odd degree (non-Euler) Allowing edges {2,3} and {16,17} twice gives minimal weight sum for an Euler traversal.
39
Alternative approaches – avoiding Euler decomposition Path with minimal weight sum: {1,6,7,4,6,10,15,13,9,7,4,3,2,3,5,8,9,11,15,16,17,16,14,8,5,14,13,11,10,12} Start End
40
Discussion,applications To ”untie” curves can have impact in curve watermarking (with providing the data in terms of few large blocks) Tracing the curve according to its ”natural” direction looks feasible to reconstruct hand-written text or figures, or to classify vessel types (arterial/venous): (image is from Rothaus et al. 2007)
41
Related publications A. Hajdu and I. Pitas: Piecewise linear digital curve representation and compression using graph theory and a line segment alphabet, IEEE Trans. on Image Processing 17/2 (February 2008), 126-133. A. Hajdu and I. Pitas: Compression optimized tracing of digital curves using graph theory, IEEE International Conference on Image Processing (ICIP 2007), San Antonio, Texas, USA, Vol. VI, 453-456. ACKNOWLEDGEMENT This work was partially supported by the project SHARE: Mobile Support for Rescue Forces, Integrating Multiple Modes of Interaction, EU FP6 Information Society Technologies, Contract Number FP6-004218.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.