Tuesday, 22 May 2012

Lanczos resampling


Lanczos resampling (Hungarian pronunciation: ˈlaːntsoʃ) is an departure adjustment acclimated to compute new ethics for sampled data. It is generally acclimated in multivariate interpolation, for archetype for angel ascent (to resize agenda images), but can be acclimated for any added agenda signal. The Lanczos atom indicates which samples in the aboriginal data, and in what proportion, accomplish up anniversary sample of the final data.

The clarify is called afterwards Cornelius Lanczos,1 because he showed how to use Fourier alternation and Chebyshev polynomials for assorted problems area they had not been acclimated before.

Application


The Lanczos clarify is a windowed anatomy of the sinc clarify (a apparently optimal "brick-wall" low-pass filter). The sinc action is absolute in extent, and appropriately not anon accessible in practice. Instead, one uses approximations, alleged windowed forms of the filter, as discussed in window functions: clarify design, and the Lanczos clarify is one such windowing. The windows vanish alfresco of a range, and application beyond ranges allows one to advance accurateness in barter for added computation.

Some accept compared the Lanczos clarify agreeably with simpler filters or added windowings of sinc, award it the "best compromise" a part of filters considered.

Definition


The Lanczos clarify actuation acknowledgment is the normalized sinc function, sinc(x), windowed by the Lanczos window. The Lanczos window is the axial affiliate of a horizontally-stretched sinc, sinc(x/a) for −a ≤ x ≤ a. Due to its form, the Lanczos window is aswell alleged the sinc window.

Thus the Lanczos filter, on its interval, is a artefact of two sinc functions. The consistent action is again acclimated as a coil atom to resample the ascribe field. In one dimension, its blueprint is accustomed by:

with a a absolute integer, about 2 or 3, authoritative the admeasurement of the kernel. The constant a corresponds to the amount of lobes of sinc, as the normalized sinc has zeros at integers; appropriately a = 1 corresponds to just the (positive) axial lobe, while a = 2 has the axial affiliate and the additional affiliate on anniversary side, which are negative.

For any absolute amount of a, the Lanczos window and Lanczos clarify are connected and differentiable even at the ends area they to go zero. In the case of absolute accumulation ethics of a, both sinc functions go to aught at the edge, so the bend of the Lanczos clarify is aught to additional order, which agency its acquired is aswell continuous, and it is differentiable to additional order. Appropriately accumulation ethics crop a smoother cutoff, with no corner, which is why integers are about used.

In the above, we can aggrandize the sinc agreement (for nonzero x in the defined range):

Lanczos filter's atom in two ambit is artlessly the artefact of two apparent kernel

Interpolation formulas


Given a apparent action I(x) authentic at accumulation points, an amid amount at an approximate point x0 is accustomed by a coil with the Lanczos kernel:3

where a is the admeasurement of the filter. The bound of this sum are such that the atom is aught alfresco of them.

Given a two-dimension action I(x, y) authentic at accumulation credibility (e.g. intensities of pixels in a agenda image), the agnate departure blueprint is:

Evaluation


The Lanczos clarify has been compared with added filters, decidedly added windowing of the sinc filter. Some accept begin the Lanczos (with a = 2) the "best accommodation in agreement of abridgement of aliasing, sharpness, and basal ringing", compared with truncated sinc and the Barlett, cosine, and Hann windowed sinc, for annihilation and departure of 2-dimensional angel data.2

It has aswell been recommended by Jim Blinn for cartoon purposes, with a = 3, adage that it "keeps low frequencies and rejects top frequencies bigger than any (achievable) clarify we've apparent so far;" Blinn characterizes himself and others who adopt such filters as "negative lobists" for their alternative for such filters added optimized for abundance acknowledgment than for ringing.4

It is a accepted clarify for "upscaling" videos in assorted media utilities, such as AviSynth5 and FFmpeg6.

Limitations


Because the atom assumes abrogating ethics for a > 1, achievement ethics can be abrogating even with non-negative input. Abrogating ethics are out of bound for angel signals and could cause abridgement artifacts.clarification needed Abrogating lobes aswell abet campanology artifacts. In some applications, the abridgement artifacts can be affected by transforming the abstracts to a logarithmic area above-mentioned to filtering. In this case the low canyon clarify will compute a geometric mean, rather than an addition mean.

However, both undershoot and campanology are bargain compared to the (non-windowed) sinc filter, due to the windowing; the campanology is decidedly small, as the absolute ancillary affiliate admeasurement demonstrates, abnormally for a = 2.

Limitations


Because the atom assumes abrogating ethics for a > 1, achievement ethics can be abrogating even with non-negative input. Abrogating ethics are out of bound for angel signals and could cause abridgement artifacts.clarification needed Abrogating lobes aswell abet campanology artifacts. In some applications, the abridgement artifacts can be affected by transforming the abstracts to a logarithmic area above-mentioned to filtering. In this case the low canyon clarify will compute a geometric mean, rather than an addition mean.

However, both undershoot and campanology are bargain compared to the (non-windowed) sinc filter, due to the windowing; the campanology is decidedly small, as the absolute ancillary affiliate admeasurement demonstrates, abnormally for a = 2.

In visual processing


A accepted delusion is that the sinc clarify should be the best accessible angel filter, because of its ideal abundance response. This is alone accurate for bandlimited signals which were sampled afterwards an antialiasing filter, which is not about the case for images.7 The animal eye does not ascertain abundance anon (unlike the ear).clarification needed However, eyes utilizes specialized receptor patterns that ascertain things like localization, bend adverse and contour. The appropriate role of bend adverse in eyes is why the abrogating affiliate of the Lanczos clarify helps access perceived accurateness even admitting the aura it creates is an artifact; this is anatomy of bend enhancement.

As spatial localization and abundance localization are inversely related, beheld filters crave a trade-off. Acceptable abundance clarification banned aliasing; acceptable localization provides able edges.