UPEM Master 2 Informatique SIS. Digital Geometry. Topic 3: Discrete straight lines: definition and recognition. Yukiko Kenmochi.

Similar documents
UPEM Master 2 Informatique SIS. Digital Geometry. Topic 2: Digital topology: object boundaries and curves/surfaces. Yukiko Kenmochi.

Digital Planar Surface Segmentation Using Local Geometric Patterns

Algorithms for Fast Digital Straight Segments Union

Convexity-preserving rigid motions of 2D digital objects

Optimal covering of a straight line applied to discrete convexity

Measure of Straight Lines and its Applications in Digital Geometry

Digital shape analysis with maximal segments

Discrete Circularity Measure

SUPERCOVER PLANE RASTERIZATION A Rasterization Algorithm for Generating Supercover Plane Inside A Cube

Digital Level Layers for Digital Curve Decomposition and Vectorization

Measure of Straight Lines for Digital Contour Analysis

274 Curves on Surfaces, Lecture 5

Fast recognition of a Digital Straight Line subsegment: Two algorithms of logarithmic time complexity

An Arithmetical Characterization of the Convex Hull of Digital Straight Segments

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Optimal Time Computation of the Tangent of a Discrete Curve: Application to the Curvature

RANSAC and some HOUGH transform

Hinge angles for 3D discrete rotations

5200/7200 Fall 2007 Concurrence theorems for triangles

Computational Geometry. Geometry Cross Product Convex Hull Problem Sweep Line Algorithm

Decomposing Coverings and the Planar Sensor Cover Problem

CS 664 Image Matching and Robust Fitting. Daniel Huttenlocher

Numerical Optimization

Edge and local feature detection - 2. Importance of edge detection in computer vision

Local non-planarity of three dimensional surfaces for an invertible reconstruction: k-cuspal cells.

Optimal Covering of a Straight Line Applied to Discrete Convexity

Dubna 2018: lines on cubic surfaces

C3 Numerical methods

Ma/CS 6b Class 11: Kuratowski and Coloring

7. The Gauss-Bonnet theorem

Optimal Consensus Set for Digital Line and Plane Fitting

Digital Straight Line Segment Recognition on Non-Standard Point Lattices

The Cut Locus and the Jordan Curve Theorem

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) We will be interested in s.t. ( )~1. To gain some intuition note ( )

Euclidean Shortest Paths in Simple Cube Curves at a Glance

The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) 2 ( ) ( )

Line Arrangement. Chapter 6

Geometry Definitions and Theorems. Chapter 9. Definitions and Important Terms & Facts

Reversible polyhedral reconstruction of discrete surfaces

Chapter - 2: Geometry and Line Generations

Computer Graphics 7 - Rasterisation

PITSCO Math Individualized Prescriptive Lessons (IPLs)

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

SECONDARY DRAFT SYLLABUS. 2. Representation of functions. 3. Types of functions. 4. Composition of functions (two and three)

CS 372: Computational Geometry Lecture 10 Linear Programming in Fixed Dimension

Topology 550A Homework 3, Week 3 (Corrections: February 22, 2012)

TOPICS. Integers Properties of addition and. Rational Numbers Need for rational numbers. Exponents or Powers Introduction to Exponents or

Digital Geometry Based on the Topology of Abstract Cell Complexes

As a consequence of the operation, there are new incidences between edges and triangles that did not exist in K; see Figure II.9.

O(n 3 log n) time complexity for the Optimal Consensus Set computation for 4-connected Digital circles

A Generic and Parallel Algorithm for 2D Image Discrete Contour Reconstruction

Lecture 18 Representation and description I. 2. Boundary descriptors

Weighted Neighborhood Sequences in Non-Standard Three-Dimensional Grids Parameter Optimization

Fundamental Algorithms of Computer Graphics and the Needs for New Display Materials

EULER S FORMULA AND THE FIVE COLOR THEOREM

4-Border and 4-Boundary

Efficiently Updating Feasible Regions for Fitting Discrete Polynomial Curve

Digital straight lines in the Khalimsky plane

Counting Double Tangents of Closed Curves Without Inflection Points

Pick s Theorem and Lattice Point Geometry

Linear Programming in Small Dimensions

DRAFT: Mathematical Background for Three-Dimensional Computer Graphics. Jonathan R. Senning Gordon College

ADDITION LAW ON ELLIPTIC CURVES

Punctured Torus Groups

Surface Area Estimation of Digitized Planes Using Weighted Local Configurations

Euclidean farthest-point Voronoi diagram of a digital edge

Locally convex topological vector spaces

How many colors are needed to color a map?

EECS490: Digital Image Processing. Lecture #23

Computer Graphics. - Rasterization - Philipp Slusallek

Fuzzy Voronoi Diagram

THE DNA INEQUALITY POWER ROUND

CS 543: Computer Graphics. Rasterization

On a fast discrete straight line segment detection

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1

X Std. Topic Content Expected Learning Outcomes Mode of Transaction

2 Geometry Solutions

Click the mouse button or press the Space Bar to display the answers.

2.8. Connectedness A topological space X is said to be disconnected if X is the disjoint union of two non-empty open subsets. The space X is said to

A Model to Evaluate Ray Tracing Hierarchies

Discrete plane segmentation and estimation from a point cloud using local geometric patterns

1 Elementary number theory

AQA GCSE Maths - Higher Self-Assessment Checklist

Lecture 8 Object Descriptors

Einführung in Visual Computing

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

Computational Geometry. Algorithm Design (10) Computational Geometry. Convex Hull. Areas in Computational Geometry

Advanced Algorithms Computational Geometry Prof. Karen Daniels. Fall, 2012

Course Number: Course Title: Geometry

Performance Level Descriptors. Mathematics

3D convex hulls. Computational Geometry [csci 3250] Laura Toma Bowdoin College

arxiv: v1 [cs.cg] 8 Jan 2018

Jordan Curves. A curve is a subset of IR 2 of the form

Algorithms for GIS. Spatial data: Models and representation (part I) Laura Toma. Bowdoin College

Year Nine Scheme of Work. Overview

Grades 7 & 8 Pre-Algebra/Course 3,

Conic Duality. yyye

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

MATHEMATICS SYLLABUS SECONDARY 4th YEAR

Realizing Planar Graphs as Convex Polytopes. Günter Rote Freie Universität Berlin

Transcription:

UPEM Master 2 Informatique SIS Digital Geometry Topic 3: Discrete straight lines: definition and recognition Yukiko Kenmochi October 12, 2016 Digital Geometry : Topic 3 1/30

Straight lines and their discretizations Straight line Definition (Straight line) A line in the Euclidean space R 2 is defined by where α, β, γ R. L = {(x, y) R 2 : αx + βy + γ = 0} We use a normalization, for example, α 2 + β 2 = 1, α + β = 1, or max( α, β ) = 1. Digital Geometry : Topic 3 2/30

Straight lines and their discretizations Discretization of straight line Definition (Discrete line) The discrete line of L in Z 2 is defined by D(L) = {(p, q) Z 2 : 0 αp + βq + γ ω} where ω is called the thickness. The values of γ and ω depend on the model of discretization. Digital Geometry : Topic 3 3/30

Straight lines and their discretizations Discretization of straight line Definition (Discrete line) The discrete line of L in Z 2 is defined by D(L) = {(p, q) Z 2 : 0 αp + βq + γ ω} where ω is called the thickness. The values of γ and ω depend on the model of discretization. Grid-intersection: γ = γ + ω 2, ω = max( α, β ). Digital Geometry : Topic 3 3/30

Straight lines and their discretizations Discretization of straight line Definition (Discrete line) The discrete line of L in Z 2 is defined by D(L) = {(p, q) Z 2 : 0 αp + βq + γ ω} where ω is called the thickness. The values of γ and ω depend on the model of discretization. Grid-intersection: γ = γ + ω 2, ω = max( α, β ). Super-cover (outer Jordan): γ = γ + ω 2, ω = α + β, Digital Geometry : Topic 3 3/30

Straight lines and their discretizations Discretization of straight line Definition (Discrete line) The discrete line of L in Z 2 is defined by D(L) = {(p, q) Z 2 : 0 αp + βq + γ ω} where ω is called the thickness. The values of γ and ω depend on the model of discretization. Grid-intersection: γ = γ + ω 2, ω = max( α, β ). Super-cover (outer Jordan): γ = γ + ω 2, ω = α + β, Gauss (half-plane): Digital Geometry : Topic 3 3/30

Straight lines and their discretizations Discretization of straight line Definition (Discrete line) The discrete line of L in Z 2 is defined by D(L) = {(p, q) Z 2 : 0 αp + βq + γ ω} where ω is called the thickness. The values of γ and ω depend on the model of discretization. Grid-intersection: γ = γ + ω 2, ω = max( α, β ). Super-cover (outer Jordan): γ = γ + ω 2, ω = α + β, Gauss (half-plane): γ = γ, ω detemines the m-connectedness of the half-plane border: ω = max( α, β ) 1 for m = 8, ω = α + β 1 for m = 4. Digital Geometry : Topic 3 3/30

Properties of discrete lines Freeman code Freeman code Chain code: Digital Geometry : Topic 3 4/30

Properties of discrete lines Properties of discrete lines Criteria of Freeman (1974) For discrete lines (by grid-intersection discretization), the Freeman code verifies the following three properties: Freeman code Discrete line : Digital Geometry : Topic 3 5/30

Properties of discrete lines Properties of discrete lines Criteria of Freeman (1974) For discrete lines (by grid-intersection discretization), the Freeman code verifies the following three properties: Freeman code Discrete line : 10101001010... Digital Geometry : Topic 3 5/30

Properties of discrete lines Properties of discrete lines Criteria of Freeman (1974) For discrete lines (by grid-intersection discretization), the Freeman code verifies the following three properties: 1 the code contains at most two different values; Freeman code Discrete line : 10101001010... Digital Geometry : Topic 3 5/30

Properties of discrete lines Properties of discrete lines Criteria of Freeman (1974) For discrete lines (by grid-intersection discretization), the Freeman code verifies the following three properties: 1 the code contains at most two different values; 2 those two values differ at most by one unit (modulo 8) ; Freeman code Discrete line : 10101001010... Digital Geometry : Topic 3 5/30

Properties of discrete lines Properties of discrete lines Criteria of Freeman (1974) For discrete lines (by grid-intersection discretization), the Freeman code verifies the following three properties: 1 the code contains at most two different values; 2 those two values differ at most by one unit (modulo 8) ; 3 one of the two values appears isolatedly and its appearances are uniformly spaced in the code. Freeman code Discrete line : 10101001010... Digital Geometry : Topic 3 5/30

Properties of discrete lines Properties of discrete lines (cont.) Definition (Chord property (Rosenfeld, 1974)) A set of discrete points X satisfies the chord property if for every pair of points p and q of X and for every point r = (r x, r y ) of the real segment between p and q, there exists a point s = (s x, s y ) of X such that max( s x r x, s y r y ) < 1. Digital Geometry : Topic 3 6/30

Properties of discrete lines Properties of discrete lines (cont.) Definition (Chord property (Rosenfeld, 1974)) A set of discrete points X satisfies the chord property if for every pair of points p and q of X and for every point r = (r x, r y ) of the real segment between p and q, there exists a point s = (s x, s y ) of X such that max( s x r x, s y r y ) < 1. It proves that a discrete curve is a discrete line segment if and only if it owns the chord property. Digital Geometry : Topic 3 6/30

Properties of discrete lines Properties of discrete lines (cont.) Definition (Chord property (Rosenfeld, 1974)) A set of discrete points X satisfies the chord property if for every pair of points p and q of X and for every point r = (r x, r y ) of the real segment between p and q, there exists a point s = (s x, s y ) of X such that max( s x r x, s y r y ) < 1. It proves that a discrete curve is a discrete line segment if and only if it owns the chord property. It allows to show the two first criteria of Freeman and to deduce a number of properties that specify the third criterion. Digital Geometry : Topic 3 6/30

Properties of discrete lines Properties of discrete lines (cont.) Definition (Chord property (Rosenfeld, 1974)) A set of discrete points X satisfies the chord property if for every pair of points p and q of X and for every point r = (r x, r y ) of the real segment between p and q, there exists a point s = (s x, s y ) of X such that max( s x r x, s y r y ) < 1. It proves that a discrete curve is a discrete line segment if and only if it owns the chord property. It allows to show the two first criteria of Freeman and to deduce a number of properties that specify the third criterion. There are a number of algorithms for recognizing a discrete straight line based on this property. Digital Geometry : Topic 3 6/30

Discrete line drawing Bresenham line-drawing algorithm Algorithm: drawing a discrete line (Bresenham, 1962) Input: Two discrete points (x 1, y 1 ), (x 2, y 2 ) (s.t. x 2 x 1 y 2 y 1 > 0) Output: Line segment between the two points d x = x 2 x 1, d y = y 2 y 1 ; y = y 1 ; e = 0; for x from x 1 to x 2 do put the pixel (x, y); e = e + dy d x ; if e 1 then y = y + 1; e = e 1; initialization value of initial error Can we avoid fractional numbers (error accumulation)? Digital Geometry : Topic 3 7/30

Discrete line drawing Bresenham line-drawing algorithm Algorithm: drawing a discrete line (Bresenham, 1962) Input: Two discrete points (x 1, y 1 ), (x 2, y 2 ) (s.t. x 2 x 1 y 2 y 1 > 0) Output: Line segment between the two points d x = x 2 x 1, d y = y 2 y 1 ; y = y 1 ; e = 0; for x from x 1 to x 2 do put the pixel (x, y); e = e + d y ; if e d x then y = y + 1; e = e d x; initialization value of initial error Can we consider rounding instead of truncation? Digital Geometry : Topic 3 7/30

Discrete line drawing Bresenham line-drawing algorithm Algorithm: drawing a discrete line (Bresenham, 1962) Input: Two discrete points (x 1, y 1 ), (x 2, y 2 ) (s.t. x 2 x 1 y 2 y 1 > 0) Output: Line segment between the two points d x = x 2 x 1, d y = y 2 y 1 ; y = y 1 ; e = d x ; for x from x 1 to x 2 do put the pixel (x, y); e = e + 2d y ; if e 2d x then y = y + 1; e = e 2d x; initialization value of initial error All the calculations are realised by using integers. Digital Geometry : Topic 3 7/30

Arithmetic lines Arithmetic definition of discrete lines Definition (Arithmetic line) An arithmetic line of parameters (a, b, c) and of arithmetic thickness w is defined as D(a, b, c, w) = {(p, q) Z 2 : 0 ap + bq + c < w} where a, b, c, w Z and gcd(a, b) = 1. The thickness w allows to control the connectedness of the line. Digital Geometry : Topic 3 8/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: Digital Geometry : Topic 3 9/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: 1 if w < max( a, b ), it is not connected; 1 Digital Geometry : Topic 3 9/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: 1 if w < max( a, b ), it is not connected; 2 if w = max( a, b ), it is a 8-curve ; naive line 1 2 Digital Geometry : Topic 3 9/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: 1 if w < max( a, b ), it is not connected; 2 if w = max( a, b ), it is a 8-curve ; naive line 3 if max( a, b ) < w < a + b, it is a -curve (its two successive points are 4-adjacent or strictly 8-adjacent); 1 2 Digital Geometry : Topic 3 9/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: 1 if w < max( a, b ), it is not connected; 2 if w = max( a, b ), it is a 8-curve ; naive line 3 if max( a, b ) < w < a + b, it is a -curve (its two successive points are 4-adjacent or strictly 8-adjacent); 4 if w = a + b, it is a 4-curve; standard line 1 2 4 Digital Geometry : Topic 3 9/30

Arithmetic lines Thickness and connectedness of arithmetic lines Theorem Let D(a, b, c, w) be an arithmetic line, then: 1 if w < max( a, b ), it is not connected; 2 if w = max( a, b ), it is a 8-curve ; naive line 3 if max( a, b ) < w < a + b, it is a -curve (its two successive points are 4-adjacent or strictly 8-adjacent); 4 if w = a + b, it is a 4-curve; standard line 5 if w > a + b, it is said thick. 1 2 4 5 Digital Geometry : Topic 3 9/30

Arithmetic lines Remainder and leaning point of arithmetic lines Definition (Remainder) The remainder associated to a point p = (p x, p y ) of D(a, b, c, w) is an integer value defined by R(p) = ap x + bp y + c. Digital Geometry : Topic 3 10/30

Arithmetic lines Remainder and leaning point of arithmetic lines Definition (Remainder) The remainder associated to a point p = (p x, p y ) of D(a, b, c, w) is an integer value defined by R(p) = ap x + bp y + c. When the remainder is 0, p is called a lower leaning point. When the remainder is w 1, p is called a upper leaning point. Digital Geometry : Topic 3 10/30

Arithmetic lines Remainder and leaning point of arithmetic lines Definition (Remainder) The remainder associated to a point p = (p x, p y ) of D(a, b, c, w) is an integer value defined by R(p) = ap x + bp y + c. When the remainder is 0, p is called a lower leaning point. When the remainder is w 1, p is called a upper leaning point. We can generalize the Bresenham algorithm by using the remainder instead of the error e. Digital Geometry : Topic 3 10/30

Arithmetic lines Arithmetic line drawing algorithm Algorithm: drawing an arithmetic (naive) line Input: Two discrete points (x 1, y 1 ), (x 2, y 2 ) and c Output: Line segment between the two points b = x 2 x 1, a = y 2 y 1 ; y = y 1 ; r = ax 1 + by 1 + c; for x from x 1 to x 2 put the pixel (x, y); r = ; if then y = y + 1; r = ; We consider here that x 2 x 1 y 2 y 1 > 0. The value of c is initially chosen such that 0 ax 1 + by 1 + c < b. Digital Geometry : Topic 3 11/30

Arithmetic lines Arithmetic line drawing algorithm Algorithm: drawing an arithmetic (naive) line Input: Two discrete points (x 1, y 1 ), (x 2, y 2 ) and c Output: Line segment between the two points b = x 2 x 1, a = y 2 y 1 ; y = y 1 ; r = ax 1 + by 1 + c; for x from x 1 to x 2 put the pixel (x, y); r = r + a; if r b then y = y + 1; r = r b; We consider here that x 2 x 1 y 2 y 1 > 0. The value of c is initially chosen such that 0 ax 1 + by 1 + c < b. Digital Geometry : Topic 3 11/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? Digital Geometry : Topic 3 12/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? There are many recognition algorithms with linear complexity. Digital Geometry : Topic 3 12/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? There are many recognition algorithms with linear complexity. 1 approach of linear programming (Werman et al, 1987): verify the existence of feasible (real) solutions. Digital Geometry : Topic 3 12/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? There are many recognition algorithms with linear complexity. 1 approach of linear programming (Werman et al, 1987): verify the existence of feasible (real) solutions. 2 linguistic approach (Smeulders, Dorst, 1991): use the linguistic properties of discrete lines. Digital Geometry : Topic 3 12/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? There are many recognition algorithms with linear complexity. 1 approach of linear programming (Werman et al, 1987): verify the existence of feasible (real) solutions. 2 linguistic approach (Smeulders, Dorst, 1991): use the linguistic properties of discrete lines. 3 approach based on preimage (Lindenbaum, Bruckstein, 1993): use the properties of discrete lines in the dual space, called preimages. Digital Geometry : Topic 3 12/30

Discrete line recognition Discrete line recognition Problem (Discrete line recognition) Given a discrete curve X (more generally, a set of discrete points), is there a discrete line such that all the points of X belong to it? Yes or No If yes, what are the parameters of this discrete line? There are many recognition algorithms with linear complexity. 1 approach of linear programming (Werman et al, 1987): verify the existence of feasible (real) solutions. 2 linguistic approach (Smeulders, Dorst, 1991): use the linguistic properties of discrete lines. 3 approach based on preimage (Lindenbaum, Bruckstein, 1993): use the properties of discrete lines in the dual space, called preimages. 4 arithmetic approach (Debled-Rennesson, Reveillès, 1995): verify the existence of integer solutions by using arithmetic properties. Digital Geometry : Topic 3 12/30

Discrete line recognition Incremental arithmetic line recognition: initialization Let S be a segment of naive line D(a, b, c) with 0 a < b, q = (xq, yq) be the point of the greatest abscissa of S, l and l be the lower leaning points of minimum and maximum abscissas of S, u and u be the upper leaning points of minimum and maximum abscissas of S. By adding a point p = (xp, yp) connected to S such that xp = xq + 1, we verify if S = S {p} is still a naive line segment. Digital Geometry : Topic 3 13/30

Discrete line recognition Incremental arithmetic line recognition: algorithm Theorem (Debled-Rennesson and Reveillès, 1995) We have 1 if 0 r(p) < b, S is a naive line segment D(a, b, c); 1 Digital Geometry : Topic 3 14/30

Discrete line recognition Incremental arithmetic line recognition: algorithm Theorem (Debled-Rennesson and Reveillès, 1995) We have 1 if 0 r(p) < b, S is a naive line segment D(a, b, c); 2 if r(p) < 1 or r(p) > b, then S is not a naive line segment; 1 Digital Geometry : Topic 3 14/30

Discrete line recognition Incremental arithmetic line recognition: algorithm Theorem (Debled-Rennesson and Reveillès, 1995) We have 1 if 0 r(p) < b, S is a naive line segment D(a, b, c); 2 if r(p) < 1 or r(p) > b, then S is not a naive line segment; 3 if r(p) = 1, then S is a naive line segment D(yp yu, xp xu, axp + byp); 1 Digital Geometry : Topic 3 14/30

Discrete line recognition Incremental arithmetic line recognition: algorithm Theorem (Debled-Rennesson and Reveillès, 1995) We have 1 if 0 r(p) < b, S is a naive line segment D(a, b, c); 2 if r(p) < 1 or r(p) > b, then S is not a naive line segment; 3 if r(p) = 1, then S is a naive line segment D(yp yu, xp xu, axp + byp); 4 if r(p) = b, then S is a naive line segment D(yp y l, xp x l, axp + byp + b 1). 1 4 Digital Geometry : Topic 3 14/30

Discrete line recognition Farey sequence Definition (Farey sequence (Hardy and Write, 1979)) The Farey sequence F n of order n is the sequence of irreducible fractions between 0 and 1, whose denominators are less than or equal to n, in ascending order. Digital Geometry : Topic 3 15/30

Discrete line recognition Farey sequence Definition (Farey sequence (Hardy and Write, 1979)) The Farey sequence F n of order n is the sequence of irreducible fractions between 0 and 1, whose denominators are less than or equal to n, in ascending order. If 0 h k n and gcd(h, k) = 1, then h k is in F n. Digital Geometry : Topic 3 15/30

Discrete line recognition Farey sequence Definition (Farey sequence (Hardy and Write, 1979)) The Farey sequence F n of order n is the sequence of irreducible fractions between 0 and 1, whose denominators are less than or equal to n, in ascending order. If 0 h k n and gcd(h, k) = 1, then h k is in F n. Example (F 5 ) 0 1, 1 5, 1 4, 1 3, 2 5, 1 2, 3 5, 2 3, 3 4, 4 5, 1 1 Digital Geometry : Topic 3 15/30

Discrete line recognition Structure of the Farey sequence: Stern-Brocot tree Property (Neighborhood) If a b and c d are neighboring in a Farey sequence, with a b < c d, then their difference is equal to 1 bd. Digital Geometry : Topic 3 16/30

Discrete line recognition Structure of the Farey sequence: Stern-Brocot tree Property (Neighborhood) If a b and c d are neighboring in a Farey sequence, with a b < c d, then their difference is equal to 1 bd. Property (Median) If a b, p q and c d are neighboring in a Farey sequence such that a b < p q < c d, then p q is the median of a b and c d such as p q = a + c b + d. Digital Geometry : Topic 3 16/30

Discrete line recognition Structure of the Farey sequence: Stern-Brocot tree Property (Neighborhood) If a b and c d are neighboring in a Farey sequence, with a b < c d, then their difference is equal to 1 bd. Property (Median) If a b, p q and c d are neighboring in a Farey sequence such that a b < p q < c d, then p q is the median of a b and c d such as p q = a + c b + d. These properties allow to construct the Stern-Brocot tree. Digital Geometry : Topic 3 16/30

Discrete line recognition Stern-Brocot tree and discrete lines Each vertex h k of the tree corresponds to a pattern (motif) associated to the discrete line of slope h k. Digital Geometry : Topic 3 17/30

Discrete line recognition Stern-Brocot tree and discrete lines Each vertex h k of the tree corresponds to a pattern (motif) associated to the discrete line of slope h k. Updating parameters of the incremental discrete line recognition algorithm indicates moving from the tree root to a leaf. (Debled-Rennesson, 1995) Digital Geometry : Topic 3 17/30

Discrete line recognition Preimage of a discrete line segment Definition (Preimage of a discrete line segment (Anderson, Kim, 1985)) Given a discrete line segment S, the preimage P(S) is defined as the set of all lines y = sx + t having the same discretization S. Each point (p i, q i ) S, i = 1, 2,..., S, satisfies 0 sp i + q i + t < 1. Thus, P(S) in the parameter space (s, t) is the intersection of 2 S half-planes or S strips of height 1. y t s x Discrete line segment Preimage Digital Geometry : Topic 3 18/30

Discrete line recognition Properties of preimages and incremental discrete line recognition Property (Preimage (Dorst, Smeulders, 1984)) Any preimage P(S) forms a convex polygon with at most four vertices in the parameter space. If P(S) has four vertices, then two of them have a common s-coordinate, which is between the s-coordinates of the other two vertices. Property (Preimage (McIlroy, 1984)) The s-coordinates of the vertices of P(S) are successive terms of the Farey sequence of order max(p 0, S p 0 ) where p 0 is the minimal x-coordinate of S. Digital Geometry : Topic 3 19/30

Discrete line recognition Properties of preimages and incremental discrete line recognition Property (Preimage (Dorst, Smeulders, 1984)) Any preimage P(S) forms a convex polygon with at most four vertices in the parameter space. If P(S) has four vertices, then two of them have a common s-coordinate, which is between the s-coordinates of the other two vertices. Property (Preimage (McIlroy, 1984)) The s-coordinates of the vertices of P(S) are successive terms of the Farey sequence of order max(p 0, S p 0 ) where p 0 is the minimal x-coordinate of S. These properties allow to improve the incremental algorithm for discrete line recognition with optimal complexity in linear time and constant space. For checking if the set S = S {(p, q)} is a discrete line segment, we verify if P(S ) = P(S) {(s, t) 0 sp + q + t < 1} is not empty. (Lindenbaum, Bruckstein, 1993) Digital Geometry : Topic 3 19/30

Discrete line recognition Applications of discrete line recognition The discrete line recognition allow us to: Digital Geometry : Topic 3 20/30

Discrete line recognition Applications of discrete line recognition The discrete line recognition allow us to: study the parallelism, colinearity, orthogonality, convexity in the discrete space; Digital Geometry : Topic 3 20/30

Discrete line recognition Applications of discrete line recognition The discrete line recognition allow us to: study the parallelism, colinearity, orthogonality, convexity in the discrete space; estimate geometric properties of discrete object borders, such as the length of a curve, tangent and curvature at a point in a curve, etc.; Digital Geometry : Topic 3 20/30

Discrete line recognition Applications of discrete line recognition The discrete line recognition allow us to: study the parallelism, colinearity, orthogonality, convexity in the discrete space; estimate geometric properties of discrete object borders, such as the length of a curve, tangent and curvature at a point in a curve, etc.; make a segmentation of a discrete curve into line segments (polygonal approximation). Digital Geometry : Topic 3 20/30

Discrete line recognition Applications of discrete line recognition The discrete line recognition allow us to: study the parallelism, colinearity, orthogonality, convexity in the discrete space; estimate geometric properties of discrete object borders, such as the length of a curve, tangent and curvature at a point in a curve, etc.; make a segmentation of a discrete curve into line segments (polygonal approximation). If there is noise in discrete object border, we need to modify the problem. Digital Geometry : Topic 3 20/30

Discrete line fitting Discrete line fitting Problem (Discrete line fitting) Given a finite set of discrete points such that S = {p i Z 2 : i = 1, 2,..., N}, we seek the maximum subset of S whose elements are contained by some discrete line D(L). Digital Geometry : Topic 3 21/30

Discrete line fitting Discrete line fitting Problem (Discrete line fitting) Given a finite set of discrete points such that S = {p i Z 2 : i = 1, 2,..., N}, we seek the maximum subset of S whose elements are contained by some discrete line D(L). Points p i S are called inliers if p i S D(L); otherwise, they are called outliers. Then, the problem is also described as finding the maximum inlier set in S, called the optimal consensus of discrete line fitting. Digital Geometry : Topic 3 21/30

Discrete line fitting Deterministic method for discrete line fitting In the line parameter space, each point p i S corresponds to the strip of height 1. Thus the set of all the strips of S divides the parameter space into regions (as preimages). The problem is to find the region where the maximum number of strips pass. Solution (Kenmochi et al. 2010) By using the topological sweep algorithm (for arrangement of lines), we can visit all the regions with the time complexity O(N 2 ) and the space complexity O(N) where N is the number of points. Digital Geometry : Topic 3 22/30

Discrete line fitting Probabilistic method for discrete line fitting (RANSAC) If you know the probability information of data (you know how many outliers are contained approximately), then you can try RANSAC (RANdom Sample Consensus). A solution is obtained with a certain probability; if we increase this probability, we need more iterations, whose number can be fixed by the above probability information of data. RANSAC (Fischler, Bolles, 1981) Iteratively, 1 choose two points, and make a discrete line model from them; 2 count the number of inliers, and compare it to the current best one; 3 if it is better, then replace it as the current best. Alternative robust line fitting: Hough transform Digital Geometry : Topic 3 23/30

3D discrete lines 3D straight lines and their discretization Definition (3D straight line) A straight line in the Euclidean space R 3 is defined by L = {(α 1 t + β 1, α 2 t + β 2, α 3 t + β 3 ) R 3 : t R} where α i, β i R for i = 1, 2, 3. Digital Geometry : Topic 3 24/30

3D discrete lines 3D straight lines and their discretization Definition (3D straight line) A straight line in the Euclidean space R 3 is defined by L = {(α 1 t + β 1, α 2 t + β 2, α 3 t + β 3 ) R 3 : t R} where α i, β i R for i = 1, 2, 3. The discrete line D(L) defined in Z 3 by the grid intersection is the set of discrete points that are closest to the intersection in the plane of the grid. Digital Geometry : Topic 3 24/30

3D discrete lines Discretized line and discrete curve A discretized line is a 26-curve. Definition (m-curve) An m-path π is an m-curve if for every element p i of π, i = 1,..., n, p i has exactly two m-adjacent points in π, except for p 0 and p n that has only one. Digital Geometry : Topic 3 25/30

3D discrete lines Discretized line and discrete curve A discretized line is a 26-curve. Theorem (Kim, 1983) A 26-curve is a discrete line if and only if two of its projections on the xy-, yz- and zx-planes are 8-connected 2D discrete lines. Digital Geometry : Topic 3 25/30

3D discrete lines Discretized line and discrete curve A discretized line is a 26-curve. Theorem (Kim, 1983) A 26-curve is a discrete line if and only if two of its projections on the xy-, yz- and zx-planes are 8-connected 2D discrete lines. The 3D discrete line recognition is realized by the 2D discrete line recognition (three times). Digital Geometry : Topic 3 25/30

3D discrete lines Arithmetic definition of 3D discrete lines Definition (3D arithmetic line) A set G Z 3 is an arithmetic line defined by seven integer parameters a, b, c, d 1, d 2, w 1, and w 2 if and only if G = {(x, y, z) Z 3 : d 1 cx az < d 1 +w 1 d 2 bx ay < d 2 +w 2 }. For simplification, we consider 0 c b a and gcd(a, b, c) = 1. Digital Geometry : Topic 3 26/30

3D discrete lines Arithmetic definition of 3D discrete lines Definition (3D arithmetic line) A set G Z 3 is an arithmetic line defined by seven integer parameters a, b, c, d 1, d 2, w 1, and w 2 if and only if G = {(x, y, z) Z 3 : d 1 cx az < d 1 +w 1 d 2 bx ay < d 2 +w 2 }. For simplification, we consider 0 c b a and gcd(a, b, c) = 1. The parameters d 1 and d 2 are called the lower bounds and the parameters w 1 and w 2 define the arithmetic thickness Digital Geometry : Topic 3 26/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: Digital Geometry : Topic 3 27/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: 1 if a + c w 1 and a + b w 2, G is 6-connected; Digital Geometry : Topic 3 27/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: 1 if a + c w 1 and a + b w 2, G is 6-connected; 2 if a + c w 1 and a w 2 < a + b, or if a + b w 2 and a w 1 < a + c, G is 18-connected; Digital Geometry : Topic 3 27/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: 1 if a + c w 1 and a + b w 2, G is 6-connected; 2 if a + c w 1 and a w 2 < a + b, or if a + b w 2 and a w 1 < a + c, G is 18-connected; 3 if a w 1 < a + c and a w 2 < a + b, G is 26-connected; Digital Geometry : Topic 3 27/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: 1 if a + c w 1 and a + b w 2, G is 6-connected; 2 if a + c w 1 and a w 2 < a + b, or if a + b w 2 and a w 1 < a + c, G is 18-connected; 3 if a w 1 < a + c and a w 2 < a + b, G is 26-connected; 4 if w 1 < a or w 2 < a, G is not connected. Digital Geometry : Topic 3 27/30

3D discrete lines Thickness and connectedness of 3D discrete line The thickness w 1 and w 2 allow to control the connectedness of the line. Theorem (Coeurjolly et al., 2001) Let G be a discrete line defined by a, b, c, d 1, d 2, w 1, w 2 Z where 0 c < b < a, then: 1 if a + c w 1 and a + b w 2, G is 6-connected; 2 if a + c w 1 and a w 2 < a + b, or if a + b w 2 and a w 1 < a + c, G is 18-connected; 3 if a w 1 < a + c and a w 2 < a + b, G is 26-connected; 4 if w 1 < a or w 2 < a, G is not connected. G is called a 3D naive line if and only if w 1 = w 2 = max( a, b, c ). Digital Geometry : Topic 3 27/30

3D discrete lines 3D naive line Theorem (Coeurjolly et al., 2001) A rational line discretized by the grid intersection is a 3D naive line and vice-versa. Digital Geometry : Topic 3 28/30

3D discrete lines 3D naive line Theorem (Coeurjolly et al., 2001) A rational line discretized by the grid intersection is a 3D naive line and vice-versa. According to Theorem (Kim, 1983), we obtain the following corollary: Corollary (Coeurjolly et al., 2001) A 26-curve is a 3D naive line if and only if two of its projections on the xy-, yz- and zx-planes are 2D naives lines. Digital Geometry : Topic 3 28/30

3D discrete lines 3D discrete line recognition Problem (3D discrete line recognition) Given a set of 3D discrete points X, do the points of X belong to a 3D discrete line? Yes or No If yes, what are the parameters of this discrete line? Digital Geometry : Topic 3 29/30

3D discrete lines 3D discrete line recognition Problem (3D discrete line recognition) Given a set of 3D discrete points X, do the points of X belong to a 3D discrete line? Yes or No If yes, what are the parameters of this discrete line? We apply the incremental algorithm for arithmetic line recognition (for a 2D naive line) (Debled-Rennesson and Reveillès, 1995) to each projection of X on the xy-, yz- and zx-planes. Digital Geometry : Topic 3 29/30

3D discrete lines 3D discrete line recognition Problem (3D discrete line recognition) Given a set of 3D discrete points X, do the points of X belong to a 3D discrete line? Yes or No If yes, what are the parameters of this discrete line? We apply the incremental algorithm for arithmetic line recognition (for a 2D naive line) (Debled-Rennesson and Reveillès, 1995) to each projection of X on the xy-, yz- and zx-planes. If Yes for two of its projections, then Yes. Digital Geometry : Topic 3 29/30

References References I. Sivignon et I. Debled-Rennesson. Droites et plans discrets, Chapitre 6 dans Géométrie discrète et images numériques, Hermès, 2007. R. Klette and A. Rosenfeld. 2D Straightness, Chapter 9 in Digital geometry: geometric methods for digital picture analysis, Morgan Kaufmann, 2004. Digital Geometry : Topic 3 30/30