The influence of exterior unknown values on interior image values

Loïc Simon, Mauricio Delbracio, Jean-Michel Morel
Abstract.

The goal of these notes is to provide a theoretical framework to evaluate the precision of image values inside the image domain, taking into account that by Shannon theory, these values for a band limited image depend on the exterior, unknown values. Since the exterior values are actually unknown the evaluation of this precision requires a model. Following other studies [] and in particular Shannon’s proposal, we take as worst case the case where the image inside and outside is a white noise. This permits easy theoretical computations and actually corresponds to a worst case but also to a realistic case. This is realistic because real digital images have noise and contain microtexture whose characteristics is close to white noise. This is a worst case because digital images have a decay spectrum that is significantly faster than the white noise spectrum (which is flat). Therefore among band-limited digital images white noise has the least predictable samples from neighborhoods. The calculations deliver quantitative security rules. They give us a guaranteed image accuracy depending on the distance from the image boundary, and show that for large images the inside values actually depend marginally on the outside values, up to a narrow security band on the boundary.

1 The error caused by the ignorance of outside samples

1.1 The case of 1D signals

We shall start the calculations in 1D. We denote the sinus cardinal function sincx:=sinπxπx. Its Fourier transform is supported in -π,π. In such a case we shall say that the function is “band limited”. The system Skx:=sincπ-k, kZ is an orthonormal system of the set of band limited functions in L2R. By Shannon-Whittaker theorem, a function uxL2R is band limited if and only if the sequence uk belongs to l2Z and

ux=kZuksincx-k. (1)

Our general model for an unknown function will be a stationary white noise. This noise will represent the unknown samples, being outside the signal domain. Consider a noise nkkZ whose samples are N0,σ2 independent real variables. The sum knk2 is almost surely unbounded. Nevertheless we can still use the Shannon-Whittaker formula (1). Indeed set nx=kZnksincx-k. Then

Enx2=σ2kZsinπx-kπx-k2.

This series is uniformly bounded with respect to x. By Lebesgue theorem it follows that the function nx belongs to Lloc2R almost surely and that the above series converges in Lloc2. Thus we can make a sense of the Shannon-Whittaker Lloc2 interpolate of a white uniform noise, defined as the limit in Lloc2 as M of the Shannon-Whittaker interpolate of a the truncated noise nk1-M,M. Thus, even if in practice we end up playing with finitely many samples, it is convenient to consider this white noise interpolate.

We assume that the uk are the samples of a band limited function in -π,π. The samples uk are known for k-K,K and the rest is unknown and can have arbitrary values that we model in a worst case strategy by a white noise nk. Here we shall consider several “extrapolation” possibilities that will turn out equivalent for the error analysis (I am not yet sure that this statement is really true). There are actually two classical extrapolation for the missing samples (we could think of the DCT as well - it assumes a mirror symmetry before periodizing). The first is to decide that the samples uk outside the observed domain -K,K are null. Then the Shannon-Wittaker interpolation will be faulty, and the error ex between the original and the interpolated one will be ex=k>Kuksincx-k. The alternative consists in a periodization of the observed image. It corresponds to the use of the discrete Fourier transform to interpolate the known samples uk amounts to assuming that the outside samples are mere repetitions of uk. This discrete case will differ a little and we shall consider it later on. Now we focus on the error analysis caused by the ignorance of the samples uk, k>K. We have just seen that the error caused inside the domain, namely for x-K,K, satisfies

ex=k>Knksinπx-kπx-k. (2)

Thus the error variance is

Eex2=σ2k>Ksin2πx-kπ2x-k2. (3)

For x in the signal domain -K,K, define the distances to the (respectively left and right) boundary dlx:=x+K,drx:=K-x. We shall estimate how ex varies as a function of these distances. Starting with sinπx-k=-1ksinπx, we obtain

Eex2=σ2sin2πxπ2k>K1x-k2
=σ2sin2πxπ2k=K+11k+x2+k=K+11x-k2
σ2sin2πxπ2K1y+x2dy+K1x-y2dy
σ2sin2πxπ21K+x+1K-x
σ2sin2πxπ21dlx+1drx

Note, the third line (i.e. the first inequality) is obtained by using an argument of decreasing function. Wa can use the same argument but to get a lower bound of the error and then obtain the following feasible range

σ2sin2πxπ21dlx+1+1drx+1Eex2σ2sin2πxπ21dlx+1drx.

We have proved

Lemma 1.

The error ex on the value at x of a band limited function whose samples are known on an interval -K,K and whose unknown samples are i.i.d. with variance σ2 outside the domain satisfies

Eex2σ2sin2πxπ21dlx+1drx

where dlx and drx are the integer parts of the distances of x to the left/right boundaries.

Besides, the tightness of this upper bound can be estimated as

σ2sin2πxπ21dlxdlx+1+1drxdrx+1.

1.2 Extension to 2D images

We now proceed to the 2D extension of the above estimate. The 2D model is

ux,y=k,lZ2uk,lsincx-ksincy-l. (4)

The error formula becomes

Eex,y2=σ2k,lZ2-K,K2sin2πx-kπ2x-k2sin2πy-lπ2y-l2. (5)

Using the respective horizontal and vertical distances dx and dy of x,y to the boundary of the square -K,K2, assuming without loss of generality that x,y0, and using11The mentioned formula is a straightforward consequence of the Shannnon-Whittaker interpolation formula with fxy=sincx-y at y=x. the identity kZsinc2x-k=1, we obtain

Eex,y2lZsinc2y-lk=K+1σ2sin2πxπ2k+x2+k=1σ2sin2πxπ2dx+k2
+kZsinc2x-kl=K+1σ2sin2πyπ2l+y2+l=1σ2sin2πyπ2dy+l2
σ2π2sin2πxdlx+sin2πxdrx+sin2πydly+sin2πyduy.
Theorem 1.

The expected square error Eex,y2 on the value at x of a band limited image whose samples are known on a domain -K,K2 and whose unknown samples are i.i.d. with variance σ2 outside this domain satisfies

Eex,y2σ2π2sin2πxdlx+sin2πxdrx+sin2πydly+sin2πyduy,

where dlx and drx (resp. dly and duy) are the integer parts of the distances of x (resp. y) to the left/right (resp. lower/upper) boundaries.

In short denoting by δx,y=infdlx,drx,dly,duy the taxi driver distance of x,y to the image boundary, and having K while δx,y remains bounded, the error bound behaves like 2σπδx,y.

1.3 Discussion

We can first give some orders of magnitude. A typical digital image has standard deviation of about 20. Thus avoiding an error Eex,y2 larger than 1, requires by the preceding result δ80. Since digital images nowadays are very large, this estimate is somewhat reassuring. Indeed, an order 1 error on colors escapes our attention and the security zone to remove is small if not negligible for images that attain respectable widths of 4000 pixels and more. On the other hand, this estimate clearly hinders using cameras as high precision numerical tools. Furthermore, the error caused by our ignorance of the image outside its domain remains serious even far inside the image domain, since it decreases like the square root of the distance to the boundary.

Besides, the problem of the truncation error bound has been studied in previous literature, in the case of deterministic signals. It is interesting to note that form of the error estimate presented in Lemma 1 bears a strong resemblance with the ones in [5, 3]. Note that [2] has also studied similar bounds but for a slightly different interpolation, and we will not study the comparison in this case. However, a more careful comparison with these two works reveals subtle distinctions. First of all, both bounds are obtained under deterministic model.

The closest formula is this proposed in [3], which under our notations becomes:

exsinπxπSK1dlx+1drx,

where SK2:=k>Knk2. Note that for a white noise SK is almost-surely unbounded.

In [5], the formula is a bit different:

exMsinπx2πcosπfmaxSK1dlx+1drx,

where, M=maxx-,nx and fmax12 is the upper bound of the frequencies present in n.

I should also read [1, 4], when I have access to them.

Note also that many articles (at least [5, 2]) impose a frequency guard band regarding the strict Nyquist limit.

\ointctrclockwiseopfzdz

2 The error caused by missing outside samples for DFT interpolation

Again we start studying the phenomenon in 1D. Now we consider the classic DFT interpolation. This interpolation starts with the samples nk,k-K,K. Computing the discrete Fourier transform of this vector yields 2K+1 Fourier coefficients,

n~l=k=-KKnke-2iπklN, (6)

obtained from the samples nk, k=0,1,N-1, which can themselves be recovered by the discrete inverse Fourier transform

nk=1Nl=-Kl=Kn~le2iπkN, (7)

where for a sake of concision we set N=2K+1. In this framework the function nx is implicitly assumed to be N periodic, which is of course simply not true. Indeed, its DFT interpolate is the Fourier truncated series

mx=1Nl=-Kl=Kn~le2iπxN, (8)

where mx is clearly distinct from nx. Thus our goal is to evaluate the difference between mx and the lawful Shannon-Whittaker interpolate (assuming all samples known),

nx=lnksinπx-kπx-k. (9)

To evaluate mx-nx, our first goal will be to put (8) in a form similar to (9). To do so we can substitute (6) in (7),

mx=1Nl=-KKk=-KKnke-2iπlkNe2iπlxN=1Nk=-KKnkl=-KKe2iπlx-kN,

which after some reorganization yields the classic DFT interpolation formula

mx=k=-KKnksinπx-kNsinπNx-k. (10)

By subtracting (10) from (9) we obtain a closed formula for the error n(x)-m(x)=:=e1+e2 with

e1x:=k=-KKnksinπx-k1πx-k-1NsinπNx-k

and

e2x:=k>Knksincπx-k.

We have already evaluated e2x in the preceding section. Thus we have to evaluate e1x. In the following we normalize the space variable x=x~N so that when N, the signal domain becomes x~-12,12. By the Riemann sum theorem we have

Ee1x2=Ek=-KKnksinπx-k1πx-k-1NsinπNx-k2 (11)
=Ek=-KKnksinπx-kπx-k1-πx-kNsinπNx-k2 (12)
Enksinπx-kπx-k21-πx-kNsinπNx-k2 (13)
=σ2k=-KKsinc2x-k1k=-KK1-πx-kNsinπNx-k2 (14)
(15)
Ee1x2σ2k=-KK1πx-k-1NsinπNx-k2 (16)
=σ2N1Nk=-KK1πx~-kN-1sinπx~-kN2 (17)
σ2N-12121πx~-t-1sinπx~-t2dt (18)
=σ2N-12-x~12-x~1πu-1sinπu2du. (19)

This means that no matter where x~ is in the signal domain, the error between Shannon and DFT is O1N. We now pass to estimate how the error grows near the domain boundary. Thus we assume that x~12. Then the above integral is O1π12-x~. Indeed, the singluarities present in the integral at its upper bound (which tends to 0) cancel out. And the singular term introduced when the lower bound tends to -1 is 1sin2πu=1sin2πu+11π2u+12. In other term using that x~=x2K+1, the term bounding Ee1x2 is equivalent to σ2πx-K, which means that the term bounding Ee1x2 depends on the distance of x-K,K to the domain boundary and is of order σπx-K.

Although this equivalent is correct, the above estimates need some refinement. First we need to replace the inequality in (11) by a real equivalent. Second, we have made above two successive equivalence arguments which need some more rigor. The solution to avoid the inequality is to replace the upper bound on sin(x-k)2 by an equality, which can be probably done by using Cauchy Schwartz before taking the expectation of the square of e1x. The chain of equivalences can be straightened by replacing them by asymptotic expansions.

2.1 test

References

  • P.L. Butzer and W. Splettstosser (1977)
    A sampling theorem for duration-limited functions with error estimates,
    Information and Control 34 (1), pp. 55–65.
    External Links: Link.
    Cited by: 1.3.
  • L. Campbell (1968)
    Sampling theorem for the fourier transform of a distribution with bounded support,
    SIAM Journal on Applied Mathematics 16 (3), pp. 626–636.
    Cited by: 1.3, 1.3.
  • D. Jagerman (1966)
    Bounds for truncation error of the sampling expansion,
    SIAM Journal on Applied Mathematics 14 (4), pp. 714–723.
    Cited by: 1.3, 1.3.
  • S. Ries and V. Splettstößer (1984)
    On the approximation by truncated sampling series expansions,
    Signal processing 7 (2), pp. 191–197.
    Cited by: 1.3.
  • K. Yao and J. B. Thomas (1966)
    On truncation error bounds for sampling representations of band-limited signals,
    Aerospace and Electronic Systems, IEEE Transactions on (6), pp. 640–647.
    Cited by: 1.3, 1.3, 1.3.