Tracing and compressing digital curves András Hajdu Department of Computer Graphics and Image Processing Faculty of Informatics, University of Debrecen,

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

The Primal-Dual Method: Steiner Forest TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A AA A A A AA A A.
Chapter 4 Partition I. Covering and Dominating.
Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
Introduction to Computer Science 2 Lecture 7: Extended binary trees
2012: J Paul GibsonT&MSP: Mathematical FoundationsMAT7003/L2-GraphsAndTrees.1 MAT 7003 : Mathematical Foundations (for Software Engineering) J Paul Gibson,
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
Approximation Algorithms Chapter 14: Rounding Applied to Set Cover.
Approximations of points and polygonal chains
Label Placement and graph drawing Imo Lieberwerth.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
A Recursive Algorithm for Calculating the Relative Convex Hull Gisela Klette AUT University Computing & Mathematical Sciences Auckland, New Zealand.
Train DEPOT PROBLEM USING PERMUTATION GRAPHS
1 Computer Graphics Chapter 7 3D Object Modeling.
CS447/ Realistic Rendering -- Solids Modeling -- Introduction to 2D and 3D Computer Graphics.
1 Processing & Analysis of Geometric Shapes Shortest path problems Shortest path problems The discrete way © Alexander & Michael Bronstein, ©
Surface Reconstruction from 3D Volume Data. Problem Definition Construct polyhedral surfaces from regularly-sampled 3D digital volumes.
Cutting a surface into a Disk Jie Gao Nov. 27, 2002.
Spatial Information Systems (SIS) COMP Raster-based structures (2) Data conversion.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Fat Curves and Representation of Planar Figures L.M. Mestetskii Department of Information Technologies, Tver’ State University, Tver, Russia Computers.
1 University of Denver Department of Mathematics Department of Computer Science.
Complex Model Construction Mortenson Chapter 11 Geometric Modeling
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
Introduction --Classification Shape ContourRegion Structural Syntactic Graph Tree Model-driven Data-driven Perimeter Compactness Eccentricity.
GRAPH Learning Outcomes Students should be able to:
Graph Theory Chapter 6 from Johnsonbaugh Article(6.1, 6.2)
Data Structures Using C++ 2E
Slide 14-1 Copyright © 2005 Pearson Education, Inc. SEVENTH EDITION and EXPANDED SEVENTH EDITION.
University of Texas at Arlington Srikanth Vadada Kishan Kumar B P Fall CSE 5311 Solving Travelling Salesman Problem for Metric Graphs using MST.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
S EGMENTATION FOR H ANDWRITTEN D OCUMENTS Omar Alaql Fab. 20, 2014.
Trees and Distance. 2.1 Basic properties Acyclic : a graph with no cycle Forest : acyclic graph Tree : connected acyclic graph Leaf : a vertex of degree.
1 CS612 Algorithms for Electronic Design Automation CS 612 – Lecture 8 Lecture 8 Network Flow Based Modeling Mustafa Ozdal Computer Engineering Department,
Dijkstra’s Algorithm. Announcements Assignment #2 Due Tonight Exams Graded Assignment #3 Posted.
FAST DYNAMIC QUANTIZATION ALGORITHM FOR VECTOR MAP COMPRESSION Minjie Chen, Mantao Xu and Pasi Fränti University of Eastern Finland.
TEL-AVIV UNIVERSITY RAYMOND AND BEVERLY SACKLER FACULTY OF EXACT SCIENCES SCHOOL OF MATHEMATICAL SCIENCES An Algorithm for the Computation of the Metric.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Graphs, Puzzles, & Map Coloring
Introduction --Classification Shape ContourRegion Structural Syntactic Graph Tree Model-driven Data-driven Perimeter Compactness Eccentricity.
Data Structures & Algorithms Graphs
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Presenter : Kuang-Jui Hsu Date : 2011/3/24(Thur.).
Discrete Mathematical Structures: Theory and Applications
Graph Theory and Applications
1 CS612 Algorithms for Electronic Design Automation CS 612 – Lecture 8 Lecture 8 Network Flow Based Modeling Mustafa Ozdal Computer Engineering Department,
1/57 CS148: Introduction to Computer Graphics and Imaging Geometric Modeling CS148 Lecture 6.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Raster Data Models: Data Compression Why? –Save disk space by reducing information content –Methods Run-length codes Raster chain codes Block codes Quadtrees.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
Grade 11 AP Mathematics Graph Theory Definition: A graph, G, is a set of vertices v(G) = {v 1, v 2, v 3, …, v n } and edges e(G) = {v i v j where 1 ≤ i,
Relationship between pixels Neighbors of a pixel – 4-neighbors (N,S,W,E pixels) == N 4 (p). A pixel p at coordinates (x,y) has four horizontal and vertical.
Sheng-Fang Huang Chapter 11 part I.  After the image is segmented into regions, how to represent and describe these regions? ◦ In terms of its external.
Beth Tsai Jennifer E. Walter Nancy M. Amato Department of Computer Science Texas A&M University, College Station Distributed Reconfiguration of Metamorphic.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Algorithms and Networks
Bitmap Image Vectorization using Potrace Algorithm
Greedy Technique.
Mean Shift Segmentation
Fitting Curve Models to Edges
Bart M. P. Jansen June 3rd 2016, Algorithms for Optimization Problems
Algorithms and data structures
5.4 T-joins and Postman Problems
Graph Theory: Euler Graphs and Digraphs
Presentation transcript:

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 , Debrecen.

Overview of the problem Tracing a curve having general topology Partitioning the curve into line segments

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)

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)

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.

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

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.

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.

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

Realization of CT algorithm - the underlying graph end points: 1,10 junction points: 2,3,4,5,6,7,8,9,11,12,13

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

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})

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:

Realization of CT algorithm - tracing through junctions we arrive at E we go on with E 2

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.

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

Realization of CT algorithm - complete tracing of the curve

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.

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

Compressing the curve - alphabet of digital line segments all orientations

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.

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].

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.

Compressing the curve - comparing with JBEAM Test curves Euler curves Non-Euler curve (decomposition)

Compressing the curve - comparing with JBEAM ~50% improvement With tracing, the proposed CT algorithm avoids subdivision.

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.

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. 

Compressing the curve - comparing with MPEG-4 Test curves (shapes have simple closed boundary)

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)

Compressing the curve - comparing with MPEG-4 Partitioned test curves

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.

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.

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:

Alternative approaches – weighted graphs number of letters needed to compress edges (weights)

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).

Alternative approaches – compressing edges separately Optimal tracing performs well for curves having more straight sections (e.g. General, Lines)

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.

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.

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

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)

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), 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, 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 FP