HAL Id: hal-00374372
https://hal.archives-ouvertes.fr/hal-00374372v5
Submitted on 6 May 2010
HAL
is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or
L’archive ouverte pluridisciplinaire
HAL, estdestinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires
Patterns in discretized parabolas and length estimation (extended version)
Alain Daurat, Mohamed Tajine, Mahdi Zouaoui
To cite this version:
Alain Daurat, Mohamed Tajine, Mahdi Zouaoui. Patterns in discretized parabolas and length estima-
tion (extended version). DGCI 2009, Sep 2009, Montréal, Canada. pp.737-384, �10.1007/978-3-642-
04397-0�. �hal-00374372v5�
Patterns in discretized parabolas and length estimation
(extended version)
Alain Daurat, Mohamed Tajine, and Mahdi Zouaoui LSIIT CNRS UMR 7005, Universit´e de Strasbourg,
Pˆole API, Boulevard S´ebastien Brant, 67400 Illkirch-Graffenstaden, France {daurat,tajine,mzouaoui}@unistra.fr
Abstract. We estimate the frequency of the patterns in the discretiza- tion of parabolas, when the resolution tends to zero. We deduce that local estimators of length almost never converge to the length for the parabolas.
Keywords:Digital Curve, Pattern, Multigrid Convergence.
1 Introduction
Length estimation is an important domain of Image Analysis (see [1] for a re- view). In this paper, we will consider the problem of estimating the length of a curve from its discretizations at different resolutions. In particular we are in- terested in the comportment of estimators when the resolution tends to zero.
We also restrict our study to special estimators called “local estimators” which consist in consideringpatterns which are pieces of fixed length of the discretized curve. Local estimators simply consist to fix a weight to each pattern and sum- ming these weights to obtain the estimation of length (See Fig. 4 for illustration).
So, if we want to study the estimated length by local estimators when the res- olution tends to zero, we have at first to study the number of occurrences of a pattern of the discretization of digital curves. In fact an asymptotic result about the occurrence number of patterns for discretized general curves looks to be a quite hard problem, because the discretization process is not a continuous process (the integer part function is not continuous), so the estimation of the occurrence number of patterns cannot be deduced from Mathematical Analysis arguments, but by Number Theory arguments. The two first authors of this pa- per have already made this study for segments in [2]. In this paper we continue this work by considering another class of curves, the parabolas.
The paper is organized as follows: Section 2 describes the notations used in this paper, Section 3 will be devoted to the study of the frequency of patterns in parabolas, and finally Section 4 will apply the results of this study to the local estimators of length of parabolas. Appendix A contains the detailed proofs which are not in the main part of this paper.
2 Notations
In this section we precise the notations that will be used in all the paper.
– Forx∈Rwe denote by⌊x⌋(resp.⌈x⌉) the integerksuch thatk≤x < k+ 1 (resp.k−1< x≤k).
– The fractional part ofxis denotedhxiand is defined byx=⌊x⌋+hxi. – ForA, B∈Z, the discrete interval{A, A+1, . . . , B−1, B}is denotedJA, BK.
– Letmbe a positive integer. A pattern of sizemis a functionωfrom J0, mK toZ such thatω(0) = 0 andω(k+ 1)∈ {ω(k), ω(k) + 1} (see Fig. 1). The set of patterns of sizemis denoted Pm.
– IfX andY are two real numbers such thatY >0 thenXmodY is the real number such that 0≤XmodY < Y and X−XYmodY ∈Z.
– Forr∈RandE⊂R2,rE={(rx, ry)|(x, y)∈E}.
00
11 010011 01 01 00 11
0000 1111
0 1 010011
0 10011
00 11
00 11
00 11
0 10011
00 11
0 10011
0000 1111
0
1 010011 01
00 11
00 11
00 11
0000 1111
0 1 0011
00 11
00 11 010011
00 11
00 11
00 11 01
00 11
00 11
00 11
00 11
0 1
0000 1111
00 11
00 11
00 11
0 10011
00 11
00 11
0 1
00 11
0 00 1
0011 11 00
11 0000 1111
0 1
0 1
00 11
00 11
00 11
00 11
0 1 00
11 00 11
00 11
00 11 01
00 11 010011
00 11
00 11 0 1 0000
1111 0000 1111
00 11 00 11
Fig. 1. The 16 patterns of size m = 4. Only the encircled one are not digital segments.
3 Frequency of patterns in Discrete Parabolas
Leta, b∈Rsuch thata < band a derivable functiong: [a, b]→Rwhich satisfies 0≤g′(x)≤1 for allx∈[a, b].
In all the following, for anyr >0 we use the notations:
• Ar=⌈ar⌉,Br=⌊rb⌋, Nr=Br−Ar+ 1,
• Crg=r{(X, Y)∈Z2|Ar≤X≤Br and Y =⌊g(rX)r ⌋}.
The setCrgis the “naive” discretization of the graph ofgat resolutionr, andNr
is its number of points.
Letm be a positive integer. The pattern at position X ∈ JAr, Br−mK of sizem ofCrg, denoted ωX,r,mg is defined by:
ωX,r,mg (k) =⌊g(r(X+k))
r ⌋ − ⌊g(rX) r ⌋. The frequency of a patternω of sizem inCrgis defined by:
Frg(ω) =card{X ∈JAr, Br−mK|ωX,r,mg =ω}
Nr−m .
The aim of this section is the study ofFrg(ω) for some functions g. For this we will approximate the curve by its tangents which will also be discretized, so we need some notions about digital straight lines:
Foru∈[0,1] andv∈[0,1), let us denotesu,vm the pattern of sizemdefined by:
su,vm (k) =⌊uk+v⌋.
A pattern of this form is called a digital segment of sizem.
For any patternω,
P I(ω) ={(u, v)∈[0,1]2| ⌊uk+v⌋=ω(k) for anyk∈J0, mK},
pinfu(ω) = inf{v|(u, v)∈P I(ω)}, (1) psupu(ω) = sup{v|(u, v)∈P I(ω)}, (2) F Lu(ω) = 0 if{v|(u, v)∈P I(ω)}=∅
= psupu(ω)−pinfu(ω) otherwise.
P I(ω) is called the preimage of ω, it is nonempty if and only if ω is a digital segment.F Lu(ω) is intuitively the frequency of the patternω in the discretized straight lines of slopeu. (See [2,3] for more details and [4] for the generalization to slopes of planes).
In all the paper, the considered curves are parabolas corresponding to the function g(x) = αx2. We distinguish two cases: the case α irrational and the caseαrational. In Subsection 3.1, we will see that forαirrational, the frequency Frg(ω) converges, whenris rational and tends to zero, to a quantity which can be expressed by using the functionx7→F Lg′(x)(ω). In Subsection 3.2, we study the caseαrational, but we do not succeed to prove a similar result as in the case αirrational. Nevertheless we obtain a weaker result (The Tangent Lemma).
3.1 Parabolas of equation y= αx2 with α irrational
In this subsection we consider curves Crg for g defined on [a, b] by g(x) = αx2 with αirrational, and 0≤a < b ≤ 2α1. This last hypothesis is needed to have 0≤g′(x)≤1 forx∈[a, b].
The main result of this subsection is the following:
Theorem 1. If g(x) =αx2 withα /∈Qthen for any patternω we have Frg(ω)−−−→r
→0 r∈Q
1 b−a
Z b a
F Lg′(x)(ω)dx (3)
The rest of this subsection is devoted to the proof of this Theorem.
The first needed lemma shows that the discretization of a curve and the discretization of its tangent are similar near the origin of the tangent and when the resolution tends to zero:
Lemma 1 (Tangent Lemma). If g is defined on [a, b] by g(x) =αx2 with α irrational, and0≤a < b≤ 2α1 then
card{X ∈JAr, Br−mK|ωX,r,mg 6=sg′(rX),h
g(rX) r i
m }
Nr−m −−−→r
→0 r∈Q
0.
Lemma 1 is illustrated by Fig. 2. In the last lemma we considerr∈Qbecause its proof needs the irrationality ofαr.
rX
Discretization of the curve Discretization of the tangent y=g(x)
tangent of the curve
r
Fig. 2. Comparison of the discretization of the curve and the discretization of its tangent : here we haveωgX,r,m=sg′(rX),h
g(rX) r i
m form= 9 but not form= 10.
Before starting the proof of Lemma 1 we need one more notation and two other lemmas. ForX ∈JAr, BrK, we define Pr,k(X) by:
Pr,k(X) =g(rX)
r +g′(rX)k=αrX2+ 2αkrX =αr((X+k)2−k2).
This definition is motivated by the following lemma:
Lemma 2. If r < αm12, then for anyX we have ωX,r,mg =sg′(rX),h
g(rX) r i
m if and
only if for allk∈J0, mK we havehPr,k(X)i<1−αrk2.
Proof.
ωX,r,mg (k) =⌊g(r(X+k))
r ⌋ − ⌊g(rX) r ⌋
=⌊g(rX)
r +g′(rX)k+αrk2⌋ − ⌊g(rX) r ⌋ We know that⌊u+v⌋=⌊u⌋+⌊v⌋iffhui+hvi<1.
SoωX,r,mg (k) =⌊g(rX)r +g′(rX)k⌋−⌊g(rX)r ⌋iffhg(rX)r +g′(rX)ki+hαrk2i<1.
With the hypothesisr < αm12 we havehαrk2i=αrk2. But:
⌊g(rX)
r +g′(rX)k⌋−⌊g(rX)
r ⌋=⌊hg(rX)
r i+g′(rX)k⌋−⌊hg(rX)
r i⌋=sg′(rX),h
g(rX) r i
m (k)
SoωgX,r,m=sg′(rX),h
g(rX) r i
m iff for allk∈J0, mKwe havehPr,k(X)i<1−αrk2.
⊓
⊔ Lemma 3. Let I be an interval of[0,1]. We haveTr,k(I)−−−→
r→0 r∈Q
µ(I)where
Tr,k(I) = 1 Nr
card{X ∈JAr, BrK| hPr,k(X)i ∈I} andµ(I)is the usual length ofI.
The proof of this lemma uses Weyl’s argument, as in the proof of Theorem 1 of [2] or Appendix A.1 of [4], but extended to the quadratic case following the same ideas as in [5, p6-7]. It is given in Appendix A.1.
Proof of Lemma 1. We recall that ωX,r,mg =sg′(rX),h
g(rX) r i
m iff for allk ∈J0, mK we havehPr,k(X)i<1−αrk2 so:
card{X ∈JAr, Br−mK|ωX,r,mg 6=sg′(rX),h
g(rX) r i
m }
Nr−m ≤ Nr
Nr−m maxm
k=0Tr,k(Ir,k) where Ir,k = [1−αrk2,1), so it is sufficient to show that Tr,k(Ir,k)−−−→r
→0 r∈Q
0 for anyk∈J0, mK. Letε >0, there existsR1>0 such that for anyr < R1 we have αrk2 < 2ε. We know by Lemma 3 that there exists R2 > 0 such that for any r < R2 we haveTr,k(IR0,k)≤µ(IR0,k) +ε2. Ifris such thatr <min(R1, R2), we have:
Sr,k(Ir,k)≤Sr,k(IR1,k)
≤µ(IR1,k) +ε 2
=αrk2+ε 2
≤ ε 2+ ε
2 =ε
This finishes the proof of Lemma 1. ⊓⊔
Sketch of Proof of Theorem 1. We present here the main ideas of the proof of Theorem 1. The detailed proof is in Appendix A.2.
By using Lemma 1 we know thatFrg(ω) has the same limit asrtends to zero as:
Ggr(ω) =card{X ∈JAr, Br−mK|sg′(rX),h
g(rX) r i
m =ω}
Nr−m .
Butsx,ym =ω is equivalent to (x,hyi)∈P I(ω) so:
Ggr(ω) =card{X ∈JAr, Br−mK|(g′(rX),hg(rX)r i)∈P I(ω)} Nr−m
which has the same limit asHr(P I(ω)) where
Hr(E) =card{X ∈JAr, BrK|(g′(rX),hg(rX)r i)∈E}
Br−Ar+ 1 .
By applying Lemma 3 withk= 0 to the piece of the curve y =g(x) restricted to the domaing′−1(α1)≤x≤g′−1(α2), we can prove:
Hr([α1, α2)×I)−−−→r
→0 r∈Q
g′−1(α2)−g′−1(α1) b−a µ(I) So by approximatingP I(ω) as the union of rectangles
n
[
i=1
[yi−1, yi)×[pinfyi(ω),psupyi(ω)) we approximateHr(P I(ω)) by:
n
X
i=1
g′−1(yi)−g′−1(yi−1)
b−a F Lyi(ω) which is a Riemann sum forRb
a F Lg′(x)(ω)dx. ⊓⊔
Corollary 1. Ifg(x) =αx2 with α /∈Q, then for any patternω which is not a digital segment we have
Frg(ω)−−−→r
→0 r∈Q
0.
Numerical Application: We illustrate Theorem 1 with an example. Consider the curveC defined y=g(x) = √12x2 forxbetweena= 0 andb= √12, and the patternω of size m= 3 defined by (ω(0), ω(1), ω(2), ω(3)) = (0,1,2,2). We will compute the limit of the frequency ofω when the resolution tends to zero.
First we can compute easilyF Lα(ω) becauseα7→ F Lα(ω) is a continuous function which is affine between twom-Farey numbers (see [3]). So we deduce:
F Lα(ω) = 0 ifα∈[0,1 2]
= 2α−1 ifα∈[1 2,2
3]
= 1−α ifα∈[2 3,1]
Theorem 1 proves that:
Frg(ω)−−−→r
→0 r∈Q
1 b−a
Z b a
F Lg′(x)(ω)dx
=√ 2
Z √1 2
0
F L√2x(ω)dx
=√ 2
Z 3√2 2
1 2√ 2
(2√
2x−1)dx+ Z √1
2
2 3√ 2
(1−√ 2x)dx
!
= 1 12
3.2 Parabolas of equation y= αx2 with α rational
Now we are interested in the case whereαis rational. Theorem 1 can be general- ized toαrational and to the irrational resolutionsrbecause only the irrationality ofαr is used in the proof of this theorem.
On the contrary, in the case α rational and rational resolutions, the only result we will prove in this subsection is about the Tangent Lemma. Moreover, we must impose some restrictions about the resolutionrand the interval [a, b] of definition of the parabola:rα= 1p wherepis a prime number ;a= 0 andb=2α1 . In all this subsection we suppose that these conditions are satisfied. Actually, we do not succeed to prove the Tangent Lemma in the general case for αrational.
LetPr,k(X) =rα((X+k)2−k2). We will prove that for any intervalI⊂[0,1]
rlim→0
1
rα is prime
card{X ∈JAr, Br−kK| hPr,k(x)i ∈I}
Nr−k =µ(I)
Definition 1. Let pbe a prime number anda be an integer number, we define the Legendre symbol (ap)of a relatively to p by
(a p) =
0 ifpdividesa
1 ifathere exists t∈Z such thatamodp=t2modp
−1otherwise.
Property 1. (P´olya-Vinogradov inequality [6], [7, Chap. 23]) Letp be a prime number and M andN two positive integers then
|
M+N
X
n=M
(n
p)|<√plog(p)
Corollary 2. LetJ =JM, M+NKbe an integer interval. Then
|card(J)
2 −card{y∈I|(y
p) = 1}|<√plog(p).
Lemma 4. Let α be a rational number and assume that a = 0 and b = 2α1. Then, for any interval I⊂[0,1]
r→lim0
card{X ∈JAr, Br−kK| hPr,k(X)i ∈I}
Nr−k =µ(I)
where the limit is taken on the rsuch thatr >0andrα= 1p wherepis a prime number.
Proof. The functionX 7→X2modpfromJ1,p−21Kto{Y |(Yp) = 1}is a bijection.
PutHr=card{X ∈JAr, Br−kK| hPr,k(x)i ∈I} Nr
. Then
Hr= card{X∈Jk,⌊p2⌋K| hX2p−k2i ∈I}
Nr−k = 2card{X∈Jk,p−21K|X2modpp −k2 ∈I}
p+ 1−2k (4)
Thus
card{X ∈J1,p−1
2 K|X2modp∈J}= card{Y ∈J|(Y
p) = 1}whereJ =pI+k2. So|card{X∈Jk,p−21K|X2modp∈J} −card{Y ∈J|(Yp) = 1}|< k.
By using P´olya-Vinogradov inequality we have:
|card(J)
2 −card{X ∈J1,p−1
2 K|X2modp∈J}|<√plog(p) So,|card(J)2 −card{X ∈Jk,p−21K|X2modp∈J}|<√plog(p) +k.
By (4) we have
| 2 p+ 1−2k
card(J)
2 − 2
p+ 1−2kcard{X∈Jk,p−1
2 K|X2modp∈J}|< 2√plog(p) + 2k p+ 1−2k Thus, limr→0
card{X∈JAr, Br−kK| hPr,k(X)i ∈I}
Nr−k =µ(I)
⊓
⊔
Theorem 2 (Tangent Lemma for rational slopes and special rational resolutions).For any rationalα >0and anya, bsuch that0≤a < b≤2α1 we have
card{X∈JAr, Br−mK|ωgX,r,m6=sg′(rX),h
g(rX) r i
m }
Nr−m −−−−−−−−→r
→0
1
rα is prime
0
Proof. The case wherea= 0,b= 2α1 can be proved exactly in the same way as for Lemma 1 by using Lemma 4 instead of Lemma 3. Consider the general case [a, b]⊂[0,2α1 ]. Then we know that:
card{X∈JAr, Br−mK|ωgX,r,m6=sg′(rX),h
g(rX) r i
m }
Nr−m
≤ ⌊2αr1 ⌋+ 1−m
Nr−m · card{X ∈J0,⌊br⌋ −mK|ωgX,r,m6=sg′(rX),h
g(rX) r i
m }
⌊2αr1 ⌋+ 1−m
−−−−−−−→r
→0
1
rαis prime 1 2α
b−a·0 = 0 because of the casea= 0, b= 1 2α.
⊓
⊔ Unfortunately we do not successfully generalize Theorem 1 to rational α and some rational resolutions even if experimentally Theorem 1 seems to be true in all the cases.
4 Application to local estimators of length
A local estimator is given by a weight functionpfrom the setPmof patterns of size mtoR. The estimated length of the curvey=g(x) where g: [a, b]→Rat resolutionris given by:
l(p, g, r) =r
⌊Br−mm−Ar⌋
X
k=0
p(ωAgr+km,r,m).
Theorem 3. Let a, bsuch that 0≤a < b. The length estimated by a local esti- mator of a parabola y=αx2, x∈[a, b], (α≤ 2b1) converges when the resolution r is rational and tends to zero, to the length of the parabola only for a finite number of irrational numbers α.
Sketch of proof. For this proof we use the notation [f(x)]ba=f(b)−f(a).
It is easy to see that:
l(p, g, r)−(b−a) m
X
ω∈Pm
p(ω)F′gr(ω)−−−→r→0 0
00 11
0000 1111
00 11 00 11
00 11
0000 1111
0000 1111
00 11
0000 1111
0000 1111
0000 1111
00 11
C1 2
C1 4
r= 12 r= 14
C y=g(x)
ω2 ω4 ω2 ω2 ω1 ω1 ω2ω4ω3ω4ω2ω2ω2ω2ω1ω3ω1ω1ω1
a) b) p(ω4) = 2.8 p(ω2) = 2.2
p(ω3 ) = 2.2 p(ω1 ) = 2 ω1
ω2
ω3
ω4
Fig. 3. Estimation of length of a curve from its discretization for two different resolutions: a)l(p, g,12) = 12(2p(ω1) + 3p(ω2) + 1p(ω4)) = 6.7, b)l(p, g,14) =
1
4(4p(ω1) + 5p(ω2) + 2p(ω3) + 2p(ω4)) = 7.1
where
F′gr(ω) = card{X ∈JAr, Br−mK∩(Ar+mZ)|ωgX,r,m=ω}
⌊Br−mm−Ar⌋ .
Consider again the curve defined by g(x) = αx2 for α /∈ Q. The proof of Theorem 1 can be extended to prove that:
F′gr(ω)−−−→r
→0 r∈Q
1 b−a
Z b a
F Lg′(x)(ω)dx.
So,
l(p, g, r)−−−→
r→0 r∈Q
1 m
X
ω∈Pm
p(ω) Z b
a
F Lg′(x)(ω)dx. (5)
We know thatx7→F Lx(ω) is piecesewisely affine ([3]). From this property we deduce that we can partition the interval [0,2b1] in a finite number of intervals (Ik)0≤k≤n such that Lest(α) = limr→0
r∈Ql(p, g, r) is of the form Aα +Bα+C on each intervalIk. (See Appendix A.3 for the details).
LetLreal(α) be the length of the parabola{(x, αx2)|x∈[a, b]}. We have:
Lreal(α) = Z b
a
p1 + (2αx)2dx=
"
xp
1 + (2αx)2
2 +arg sinh(2αx) 4α
#b
a
Suppose that Lreal(α) = Lest(α) for an infinite number of irrational numbers α, then there exists an interval Ik of the previous partition of [0,2b1] such that Lreal(α) =Lest(α) for an infinite number of irrational numbers α∈Ik. OnIk
we know thatLest(α) has the form Aα +Bα+C. The functions α7→αLreal(α) andα7→α(Aα +Bα+C) are holomorphic in a open set of Ccontaining [0,2b1] and are equal for an infinite number of α∈Ik ⊂[0,2b1]. So by Theorem on the zeros of holomorphic functions [8, Cha. 10] they are equal on [0,2b1]. So:
αLreal(α) =A+Bα2+Cα for allα∈[0, 1 2b] We have:
∂(αLreal(α)
∂α =bp
1 + (2αb)2−ap
1 + (2αa)2
=b−a+ 2(b3−a3)α2+o(α2) when α→0
But ∂(A+Bα∂α2+Cα) = 2Bα+C, so 2(b3−a3) = 0 which is impossible ifb > a. So the hypothesis that Lreal(α) =Lest(α) for an infinite number of irrationalαis
absurd. ⊓⊔
Corollary 3. Let a, b such that 0 ≤ a < b. The length estimated by a local estimator of a parabolay=αx2,x∈[a, b], does notconverge when the resolution is rational and tends to zero, to the length of the curve for almost allα∈[0,2b1].
Numerical application: Again, we take the curve y = g(x) = √1
2x2 for x betweena= 0 andb=√1
2. Suppose that we consider the local estimator Chamfer 5-7-11 ([9]) with m= 2, p(000) = 2, p(001) =p(011) = 2210, p(012) = 2810. With Equation (13), we can prove that the estimation of the length of the parabola given by this local estimator converges toLest= 2340√
2≈0.813172, this limit is different from the length of the parabola which is12+14√
2 log(1+√
2)≈0.811612.
Moreover Figure 4 shows how the length given by the estimator converges to its limit when the resolution tends to zero. It seems on this example thatl(p, g, r)− Lest=O(r).
-16 -14 -12 -10 -8 -6 -4 -2 0
2 4 6 8 10 12 14
log(|estimated length-limit|)
log(1/r)
Fig. 4. Figure showing Convergence Speed of the Chamfer 5-7-11 to its limits for the parabolay=√12x2, 0≤x≤√12.
5 Conclusion and Perspectives
In this paper, we have proved some local properties of discretizations of parabo- las: First we show that locally discretization of parabola and discretization of its tangent often coincide (Tangent Lemma: Lemmas 1 and Theorem 2). In par- ticular, asymptotically, the local patterns of a discretized parabola are digital segments. From this, we also give an explicit formula for the limit of frequency of a pattern of a parabola when the resolution tends to zero (Theorem 1). This has the important consequence that we can know to what tend local estimators of length for the parabolas, moreover it can be proved that this limit is often different from the length of the curve.
This work mainly brings two perspectives:
– The extension of Formula (3), which gives the limit of the frequency of pat- tern when the resolution tends to zero, to more general curves, in particular to the curvesy=P(x) whenP is a polynomial of degree greater than 2.
– The application of this work for recognition of curve by just looking at patterns. For example, if the frequencies of patterns of a curve does not satisfy Theorem 1 then it is not a parabola of equationy=αx2.
References
1. Coeurjolly, D., Klette, R.: A comparative evaluation of length estimators. IEEE Trans. Pattern Anal. Mach. Intell.26(2) (2004) 252–258
2. Tajine, M., Daurat, A.: On local definitions of length of digital curves. In: Proc.
of DGCI 2003. Volume 2886 of Lecture Notes in Comp. Sci. (2003) 114–123 3. Tajine, M.: Digital segments and Hausdorff discretization. In: Proc. of IWCIA
2008. Volume 4958 of Lecture Notes in Comp. Sci. (2008) 75–86
4. Daurat, A., Tajine, M., Zouaoui, M.: About the frequencies of some patterns in digital planes. Application to area estimators. Comput. Graph.33(1) (2008) 11–20
5. Granville, A., Rudnick, Z.: Uniform distribution. In Granville, A., Rudnick, Z., eds.: Equidistribution in Number Theory, An Introduction. Springer (2007) 1–13 6. Vinogradov, I.M.: Elements of Number Theory, 5th rev. ed. Dover (1954) 7. Davenport, H.: Multiplicative Number Theory, 2nd ed. Springer-Verlag, New York
(1980)
8. Rudin, W.: Real and complex analysis. McGraw-Hill, New York (1966)
9. Borgefors, G.: Distance transformations in digital images. Computer Vision, Graphics, and Image Processing34(3) (1986) 344–371
10. McIlroy, M.D.: A note on discrete representation of lines. ATT Tech. J. 64(2) (1985) 481–490
11. Wikipedia: (2008) http://en.wikipedia.org/wiki/Pigeonhole principle ac- cessed 14-November-2008.
12. Munroe, M.E.: Measure and integration, 2nd ed. Addison-Wesley (1971)
A Proofs
Additional notations
– The distance betweenxandZis denotedkxk. Sokxk= min(hxi,1− hxi).
– Ifz is complex numberz denotes its conjugate, and Re(z) denotes its real part.
– gcd(p, q) denotes the greatest common divisor ofpandq.
A.1 Proof of Lemma 3 For anyf ∈L1([0,1]) we define:
Sr,k(f) = 1 Nr
Br
X
X=Ar
f(hPr,k(X)i).
so we haveTr,k(I) =Sr,k(χI) whereχI is the indicator function ofI. We denote e(t) =e2πit andec(t) =e(ct).
Sublemma 5 For any c∈Z\ {0}we have Sr,k(ec)−−−→r
→0 r∈Q
0.
Proof.
|Sr,k(ec)|2=Sr,k(ec)Sr,k(ec)
= 1 Nr2
X
Ar≤X,Y≤Br
ec(Pr,k(X))ec(Pr,k(Y))
= 1 Nr
+ 2 Nr2Re
X
Ar≤X<Y≤Br
ec(Pr,k(Y)−Pr,k(X))
Let us poseY =X+h, we have
Pr,k(Y)−Pr,k(X) =rα(X+h)2+ 2αk(X+H)−αrX2−2αkrX
=Pr,k(h) + 2αrXh So:
|Sr,k(ec)|2= 1 Nr
+ 2 Nr2Re
Br−1
X
X=Ar
Br−X
X
h=1
ec(Pr,k(h))ec(2αrXh)
!
= 1 Nr
+ 2 Nr2Re
Nr−1
X
h=1 Br−h
X
X=Ar
ec(Pr,k(h))ec(2αrXh)
!
= 1 Nr
+ 2 Nr2Re
Nr−1
X
h=1
ec(Pr,k(h))
Br−h
X
X=Ar
ec(2αrXh)
!!
Subsublemma 6 For any β∈R\Z,u, v∈Z such thatu≤v we have:
v
X
k=u
e(βk)
≤min(v−u+ 1, 1 2kβk).
Proof.
v
X
k=u
e(βk) =e(βu)1−e(β(v−u+ 1)) 1−e(β)
so
v
X
k=u
e(βk)
≤ 2
|1−e(β)|
But|1−e(β)|=|e(β2)(e(−β2)−e(β2))|= 2|sin(πβ)|. Moreover sin(πβ)≥2kβk (because sin(πx)≥2xforx∈[0,12]). So:
v
X
k=u
e(βk)
≤ 1 2kβk With the clear inequality|Pv
k=ue(βk)| ≤v−u+ 1, it ends the proof of Subsub-
lemma 6. ⊓⊔
As Re(x)≤ |x|, Subsublemma 6 shows that:
|Sr,k(ec)|2≤ 1 Nr
+ 2 Nr2
Nr−1
X
h=1
min(Nr, 1
2k2αrchk) (6)
Subsublemma 7 Let C0 ≥0, u∈R\Q, N, p, q ∈Nwhich satisfy q ≤C0N,
|uq−p| ≤ C01N, gcd(p, q) = 1. We have
N−1
X
h=1
min(N, 1
2kuhk)≤4(1 +C0) N2
q +Nlogq
.
Proof.
N−1
X
h=1
min(N, 1 2kuhk)≤
⌊Nq−1⌋
X
H=0 qH+q
X
h=qH+1
min(N, 1 2kuhk)
But: qH+q
X
h=qH+1
min(N, 1 2kuhk) =
q
X
h=1
min(N, 1
2ku(qH+h)k) ku(qH+h)k=k(p+ε
q )(qH+h)k whereε=uq−p
=kpH+p
qh+εH+εh q k
=kp
qh+εH+εh q k Let γ = (εH) mod 1q
, and k0 such that εH = γ + kq0. We have: (pqh+ εH) mod 1 = γ+iqh where ih = (ph+k0q) modq. As gcd(p, q) = 1, {ih|h ∈ J1, qK}=J0, q−1K.
Ifih< q2 then ku(qH+h)k=kγ+ih
q +εh q k
≥ kγ+ih
qk −|ε|h
q becausex7→ kxkis Lipschitz continuous with constant 1
=γ+ih
q −|ε|h q
≥ ih
q − |ε| ash≤q
≥ ih
q − 1
C0N. (7)
Similarly ifih≥ q2 then
ku(qH+h)k ≥ kγ+ih
qk − |ε|h q
= 1−(γ+ih
q)−|ε|h q
≥q−1−ih
q − 1
C0N. (8)
If we use the variable changeh7→ihfor ih< q2,h7→q−1−ih forih≥ q2, the inequality min(N,2ku(qH+h)1 k)≤N forih= 0,1, q−2, q−1, and the inequalities (7),(8) for the otherih, we deduce:
q
X
h=1
min(N, 1
2ku(qH+h)k)≤4N+ 2
⌊q−21⌋
X
i=2
1 2
i q −C01N
.
But 1−x1 ≤1 + 2xforx∈(0,12]. So fori≥2 we have:
1
i
q −C01N =q i
1 1−iCq0N
≤q i
1 + 2 q iC0N
because q
iC0N ∈(0,1
2] asi≥2 andq≤C0N
≤2q i So
q
X
h=1
min(N, 1
2ku(qH+h)k)≤4N+ 2q
⌊q−12 ⌋
X
i=2
1 i. But:
⌊q−12 ⌋
X
i=2
1 i =
⌊q−12 ⌋
X
i=2
Z i i−1
1 idt
≤
⌊q−21⌋
X
i=2
Z i i−1
1 tdt
=
Z ⌊q−21⌋
1
1 tdt
= log(⌊q−1 2 ⌋) So:
N−1
X
h=1
min(N, 1 2kuhk)≤
⌊N−1
q ⌋+ 1 4N+ 2qlog(⌊q−1 2 ⌋)
≤ N
q + 1
(4N+ 2qlogq)
≤ N
q +C0N q
(4N+ 2qlogq) because q≤C0N
≤4(1 +C0)(N2+Nlogq)
This finishes the proof of Subsublemma 7. ⊓⊔
In the following we suppose thatris rational. Soαris irrational, so by Dirichlet’s principle ([11]) we know that there exist two coprime integersqr≤αc(b−a)2Nr and prsuch that|2αrcqr−pr| ≤ αc(b2N−ra). By Subsublemma 7 withC0= αc(b−a)2 and Equation (6) we deduce:
|Sr,k(ec)|2≤ 1 Nr
+8(1 +C0) Nr2
Nr2
q +Nrlogqr
≤ 1 Nr
+8(1 +C0) qr
+8(1 +C0) logqr
Nr
AsNr−−−→r
→0 +∞and logNqr
r ≤log(CN0rNr) −−−→r
→0 0, it remains to prove thatqr−−−→r
→0
+∞.
We have:
pr
qr ≥2αrc−αc(b−a) 2Nr
We have Nr ≥ (rb −1)−(ar + 1)−1 = b−ar−r. We suppose without loss of generality thatr≤b−2a so Nr≥ b−2ra, so
pr
qr ≥2αrc−αrc >0, sopr≥1. We deduce:
1 qr ≤ pr
qr ≤2αrc+ 1
Nrqr ≤2αrc+ 1 Nr
Soqr≥ 2αrc+1 1
Nr −−−→r
→0 +∞. This ends the proof of Sublemma 5. ⊓⊔ To finish the proof of Lemma 3 we must prove thatSr,k(χI)−−−→r
→0 r∈Q
µ(I) where χI is the indicator function of I. We have Sr,k(e0) = 1 and by Sublemma 5 Sr,k(ec) −−−→r
→0 r∈Q
0 for c 6= 0, so by Weyl’s strategy (see for example [2] or [4,
Appendix A.1]) we can prove Lemma 3. ⊓⊔
A.2 Proof of Theorem 1 Now let:
Ggr(ω) =card{X ∈JAr, Br−mK|sg′(rX),h
g(rX) r i
m =ω}
Nr−m .
By Lemma 1 we have
Frg(ω)−Ggr(ω)−−−→
r→0 r∈Q
0. (9)
We have by definition ofP I(ω) (and because⌊hg(rX)r i⌋= 0):
Ggr(ω) =card{X ∈JAr, Br−mK|(g′(rX),hg(rX)r i)∈P I(ω)} Nr−m
For any subsetE ofR2, we define:
Hr(E) = card{X ∈JAr, BrK|(g′(rX),hg(rX)r i)∈E} Nr
We have
NrHr(P I(ω))−m
Nr−m ≤Ggr(ω)≤ NrHr(P I(ω))
Nr−m . (10)
Suppose first thatE= [α1, α2)×I. The functiong′is linear, so in particular is a bijection, we denote by g′−1 its reciprocal function. We suppose that α >
0, so that g′ is an increasing function. (g′(rX),hg(rX)r i) ∈ E is equivalent to g′(rX)∈[α1, α2) andhg(rX)r i)∈I. So
Hr(E) =card{X ∈J⌈g′−1r(α1)⌉,⌊g′−1r(α2)⌋K| hg(rX)r i ∈I} Nr
.
If we apply Lemma 3 withk= 0 to the piece of the curvey=g(x) restricted to the domaing′−1(α1)≤x≤g′−1(α2). we find:
NrHr(E)
⌊g′−1r(α2)⌋ − ⌈g′−1r(α1)⌉+ 1 −−−→r
→0 r∈Q
µ(I)
We deduce that:
Hr([α1, α2)×I)−−−→r
→0 r∈Q
g′−1(α2)−g′−1(α1)
b−a µ(I) (11)
In [10] it is shown that
P I(ω) ={(α, β)|α∈[αb, αe] and pinfα(ω)≤β <psupα(ω)
whereα7→pinfα(ω) andα7→psupα(ω) are two piecewise affine functions which slope is between−m and 0.1 2
Letn∈N\ {0}andyi=αb+iαe−nαb fori∈J0, nK.
P I(ω) is approximated by an union ofnrectangles:
n
[
i=1
[yi−1, yi)×[pinfyi−1(ω),psupyi(ω))⊂P I(ω)⊂
n
[
i=1
[yi−1, yi]×[pinfyi(ω),psupyi−1(ω))
1 In fact it is proved thatP I(ω) is a triangle or a quadrangle.
2 Formulas (1),(2) do not define pinf and psup forα=αb, αe, we define these values just by continuity.
Asyi−yi−1≤ 1n andα7→pinfα(ω) andα7→psupα(ω) are two piecewise affine functions which slope is between−mand 0, we have pinfyi−1(ω)≤pinfyi(ω)+mn and psupyi−1(ω)≤psupyi(ω) +mn. So:
n
[
i=1
[yi−1, yi)×[pinfyi(ω) +m
n,psupyi(ω))⊂P I(ω)⊂
n
[
i=1
[yi−1, yi]×[pinfyi(ω),psupyi(ω) +m n) (12) Let
Fn,r=Hr n
[
i=1
[yi−1, yi)×[pinfyi(ω) +m
n,psupyi(ω))
! ,
Fn,r′ =Hr n
[
i=1
[yi−1, yi]×[pinfyi(ω),psupyi(ω) +m n)
! .
So by Equation (12):
Fn,r≤Hr(P I(ω))≤Fn,r′ . By summing equations of the form (11) we obtain:
Fn,r−−−→r
→0 r∈Q
n
X
i=1
g′−1(yi)−g′−1(yi−1) b−a
F Lyi(ω)−m n
Fn,r′ −−−→
r→0 r∈Q
n
X
i=1
g′−1(yi)−g′−1(yi−1) b−a
F Lyi(ω) +m n
Let
Fn′′=
n
X
i=1
g′−1(yi)−g′−1(yi−1)
b−a F Lyi(ω).
(limr→0 r∈Q
Fn,r)−Fn′′=−
n
X
i=1
g′−1(yi)−g′−1(yi−1) b−a
m n
=−
n
X
i=1 1
2α(yi−yi−1) b−a
m n
=−m(αe−αb) 2α(b−a)
1 n Similarly
(limr→0 r∈Q
Fn,r′ )−Fn′′=m(αe−αb) 2α(b−a)
1 n.
Letzi=g′−1(yi), we have Fn′′=
n
X
i=1
(zi−zi−1)F Lg′(zi)(ω) b−a
which is a Riemann sum ofx7→ F Lg′(x)b−a(ω), butt7→F Lt(ω) is continuous ([3]), so we have by [12, Chap. 5]:
Fn′′−−−−→n
→∞
1 b−a
Z b a
F Lg′(x)(ω)dx Letε >0, there existsN1 such that for alln > N1 we have
Fn′′− 1 b−a
Z b a
F Lg′(x)(ω)dx
≤ ε 3. There existsN2such that for anyn > N2we have
m(αe−αb) 2α(b−a)
1 n <ε
3
LetN = max(N1, N2) + 1. There exists R1 >0 such that for any rational r < R1 we have:
|FN,r−(FN′′ −m(αe−αb) 2α(b−a)
1 N)| ≤ ε
3. There existsR2>0 such that for any rationalr < R2 we have:
|FN,r′ −(FN′′ +m(αe−αb) 2α(b−a)
1 N)| ≤ ε
3. Suppose thatr <min(R1, R2).
We have:
Hr(P I(ω))≥Fn,r
≥FN′′ −m(αe−αb) 2α(b−a)
1 N −ε
3
≥FN′′ −ε 3−ε
3
≥ 1 b−a
Z b a
F Lg′(x)(ω)dx−ε 3 −ε
3 −ε 3
= 1
b−a Z b
a
F Lg′(x)(ω)dx−ε Similarly
Hr(P I(ω))≤Fn,r′
≤ 1 b−a
Z b a
F Lg′(x)(ω)dx+ε,