Estimation of the derivatives of a digital function with a convergent bounded error Laurent Provot, Yan Gerard * 1 DGCI, April, 6 th 2011 * speaker
Outline 2 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
Outline 3 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
Problem statement A digital function Input Its ``derivative´´ Output 4 Which definition of digital derivative ? Which criterion to assess a definition ?
Problem statement 5 Which criterion to assess a definition ?
and prove Lim f h ’(x) = f ’(x) Problem statement continuous function f(x) f ’(x) derivative digitization digital function f h (x) f h ’(x) digital derivative ~ 6 grid resolution h Aim: bound the error |f’(x) – f h ’(x)| according to h h 0 f(x) f h (x) Which criterion to assess a definition ?
and prove Lim f h ’(x) = f ’(x) Problem statement continuous function f(x) f ’(x) derivative digitization digital function f h (x) f h ’(x) digital derivative ~ 7 grid resolution h Aim: bound the error |f’(x) – f h ’(x)| according to h h 0 f(x) f h (x) Which criterion to assess a definition ? Lim f h ’(x) = f ’(x) h 0
and prove Lim f h ’(x) = f ’(x) Problem statement continuous function f(x) f ’(x) derivative digitization digital function f h (x) f h *’(x) digital derivative ~ grid resolution h Aim: bound the error |f’(x) – f h ’(x)| according to h h 0 f(x) f h (x) Which criterion to assess a definition ? Lim f h ’(x) = f ’(x) h 0 This criterion is called Multigrid Convergence 8
Outline 9 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
10 State of the Art Finite differences Which definition for a digital derivative ? f ’(x) = f(x+1)-f(x) Drawback: only integer values (with a lot of small variations) No Multigrid convergence Idea: smooth with a convolution… Digital function f(x)
11 State of the Art Finite differences Which definition for a digital derivative ? f ’(x) = f(x+1)-f(x) Idea: smooth with a convolution… Digital function f(x)
12 State of the Art Finite differences with a convolution Which definition for a digital derivative ? f ’(x) = f(x+1)-f(x) Digital function f(x) Convolution with a binomial kernel (R. Malgouyres, S. Fourey, H.-A Esbelin, F. Brunet…), since 2008… For the derivative of order k | f (k) (x) - f h (k) (x) | < O( h (2/3) ) Property : Multigrid convergence | f ’(x) - f h ’(x) | < O( h 2/3 ) k
13 State of the Art Digital Segments 0≤ y - (ax+b) < 1 as Tangents Digital function f(x) This approach is mostly introduced on digital curves (4 or 8-connected) (J.-O Lachaud, A. Vialard, F. De Vieilleville, F. Feschet, L. Tougne) since 2004… Property : Multigrid convergence | f ’(x) - f h ’(x) | < O( h 1/3 ) Which definition for a digital derivative ?
14 State of the Art Digital Segments 0≤ y - (ax+b) < 1 as Tangents Digital function f(x) Which definition for a digital derivative ? Idea: use digital primitives of higher degree 0≤ y – P(x) < namely Digital Level Layers (see poster session) Generalization
Outline 15 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
Principle 16 A discrete function f : X R R A maximal degree k Input there is a threshold R k such that there exists a polynomial P of degree k with for all x in X, |P(x)-f(x)|≤R k In most cases, if card X > k+1, there is no polynomial P of degree k such that for all x in X, P(x)=f(x) No interpolation we expand each value in intervals, so that we can fit
Principle 17 A discrete function f : X R R A maximal degree k Input there is a threshold R k such that there exists a polynomial P of degree k with for all x in X, |P(x)-f(x)|≤R k
Principle 18 there is a threshold R k such that there exists a polynomial P of degree k with for all x in X, |P(x)-f(x)|≤R k The expansion of y=P(x) in |y-P(x)|≤ leads to digital primitives called Digital Level Layers Remark : it is equivalent to expand the values of f in intervalls or to expand the polynomial P A discrete function f : X R R A maximal degree k Input
Principle 19 Definition : The roughness of f(x) of degree k roughness k (f)= inf ( ||P(x)- f(x)|| ) P in R [X] X k there is a threshold R k such that there exists a polynomial P of degree k with for all x in X, |P(x)-f(x)|≤R k A discrete function f : X R R A maximal degree k Input
Principle 20 Definition : The roughness of f(x) of degree k roughness k (f)= inf ( ||P(x)- f(x)|| ) P in R [X] X k
Principle 21 Property : The roughness of f(x) is the half of the vertical thickness of { ((x i ) 1≤i≤k ; f(x) ) / x in X } Definition : The roughness of f(x) of degree k roughness k (f)= inf ( ||P(x)- f(x)|| ) P in R [X] X k Many strips contain S vertical thickness (S) vertical thickness one has a minimal vertical thickness
Principle 22 Example Roughness of degree 2 of function f(0)=2 f(1)=3 f(2)=2 f(3)=1 f(4)=0 = Vertical thickness (0,0 2,2) (1,1 2,3) (2,2 2,2) (3,3 2,1) (4,4 2,0) Property : The roughness of f(x) is the half of the vertical thickness of { ((x i ) 1≤i≤k ; f(x) ) / x in X } Definition : The roughness of f(x) of degree k roughness k (f)= inf ( ||P(x)- f(x)|| ) P in R [X] X k
Principle 23 Example Roughness of degree 3 of function f(0)=2 f(1)=3 f(2)=2 f(3)=1 f(4)=0 = Vertical thickness (0,0 2,0 3,2) (1,1 2,1 3,3) (2,2 2,2 3,2) (3,3 2,3 3,1) (4,4 2,4 3,0) Property : The roughness of f(x) is the half of the vertical thickness of { ((x i ) 1≤i≤k ; f(x) ) / x in X } Definition : The roughness of f(x) of degree k roughness k (f)= inf ( ||P(x)- f(x)|| ) P in R [X] X k Linear Programming Min h,P h / V x in X: -h≤f(x)-P(x)≤h Computational Geometry Chord’s algorithm
Principle 24 A digital function Input Its « derivative » of order k at x Output Fix a parameter R max of maximal roughness of degree k } R max Extend the neighborhood around x until the roughness of the restriction of f becomes greater than the maximal authorized roughness R max degree k = 2 The best fitting polynomial provides the derivatives x
Outline 25 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
Error bound 26 - Let f: R R be a C k+1 function with f (k+1) (y) < M in the neighborhood of x f(hx) - f h (x): Z Z is the digitization of f(x) at resolution h : f h (x) = | | grid resolution h f h (x) f (x) digitization - Maximal roughness R max (x) ≥ k+1 M Three conditions h Theorem : | f (k) (x) - f h (k) (x) | = O( h ) 1 k+1
Error bound 27 Theorem : | f (k) (x) - f h (k) (x) | = O( h ) 1 k+1
Error bound 28 Proof : Taylor Lagrange inequality + A discrete norm on polynomials of degree n N m (P)= max { |P(x)| / for all integers x from –m to m } N m (P) ≤ 1 |a k |≤ We prove for the polynomial P(X)= ∑ a k X k n k=1 U k,n m k Theorem : | f (k) (x) - f h (k) (x) | = O( h ) 1 k+1
Error bound 29 α Derivative of order k k=1k=2k=3k=4k=5 Digital Straight Segments (J-O Lachaud et al.) 0.33 Convolutions (R. Malgouyres et al.)( ) k Digital Level Layers (L. Provot, Y. G.) The errors are bounded in h α : the greater the α value, the better the convergence k+1
Outline 30 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
Experimental Results 31 digitization of sin(x) at resolution h=0.05 First derivative
Experimental Results 32 digitization of sin(x) at resolution h=0.05 Second derivative
Experimental Results 33 digitization of sin(x) at resolution h=0.05 Third derivative
Experimental Results 34 Second derivative at several resolutions
Experimental Results 35 digitization of sin(x) at resolution h=0.05 Second derivative
Experimental Results 36 For the time of computation (with GMP), we did no specific experiments : - For the first order derivative of sin(x), it took less than 0.2s on a laptop. - For the derivatives of higher order, it goes to some seconds (<10s) Nevertheless, the code which is used is made in order to compute only one value without taking account of the neighbors Many improvements have to be done for the computation of the derivatives at consecutive points (as for the computation of the tangential cover)
Outline 37 State of the Art Principle Error bound Experimental results Problem Statement Conclusion
- Bound the error on multivariate functions and prove multigrid convergence - The method allows to compute partial derivatives of multivariate digital function : there is nothing to add in practice! Conclusion 38 perspectives - Experimental comparisons with other approaches - Improve the computation of the derivatives at consecutive points What remains to do …
39 Thank you for your attention