Re: 'Magic' kernel for image zoom resampling?



Thanks all -- it is making much more sense to me now. I started off
with filters and sinc functions, didn't do a good job of it, and went
back to something simple, that worked better that I expected it to. The
explanation that it is a truncated sinc makes it make a helluva lot
more sense -- many thanks.

I've also followed up on the excellent suggestion to determine the
continuous version of the discrete case, to figure out what I'm
actually using. It's becoming a lot clearer now, although I'm still
trying to figure out the best way to express it mathematically.

The key seems to be that, in one dimension, for upsampling by a factor
of m = 2^k, each pixel of the original image contributes to three
pixels in the upsampled image, or in other words that the kernel, from
the upsampled image's point of view, is 3m pixels wide. The kernel is
made up of three parabolas, each of width m pixels, which smoothly join
together. The parabolas on either end reduce to zero at the extremes.
The curvature of the center parabola is twice the magnitude, and of
opposite sign, of the other two.

The key net effect of these qualities seems to be the property

k(x-m) + k(x) + k(x+m) = const.

for -m <= x <= m. This is what ensures that the convolution of each
pixel with the kernel "joins together" with all the other pixels, like
jigsaw pieces, without any systematic artifacts.

Put another way, if you place a copy of the kernel every m pixels
apart, and add them together, you get a constant function across all
pixels.

It is not clear to me whether it is possible to do this for an
arbitrary type of function. In fact, it's not even clear to me that it
is easy to do for functions of finite support. In any case, I believe
that this is why the kernel does such a good job of avoiding visually
obvious artifacts.

And, of course, the best thing about the kernel is that it is so
lightning fast to implement, not to mention positive definite. :)

John

.



Relevant Pages

  • Re: Filtering kernel width
    ... , how wide should the window be, ... function leaves a realizable filter of finite size: ... However it doesn't seem to really explain how many pixels you ... Assume a 1D binomial kernel ...
    (comp.graphics.algorithms)
  • Re: need some help with custom filter in Photoshop
    ... the coefficients the weighting of the corresponding pixels in the input image, ... summing follwoed by a scaling operation implicit in the kernel. ... input image, and creating an output image from the input pixels. ... For instance, corner pixels may get weight 1, orthogonal pixels weight ...
    (sci.astro.amateur)
  • Re: what is the Nyuist rate of an image?
    ... Do you mean to shift by 0.5 of the diagonal distance between pixels in a ... Use the 1D kernel only in the diagonal direction to directly shift. ...
    (sci.image.processing)
  • Java2D Image Manipulation!
    ... First of all, I'm creating an image manipulation software, for image ... Is BufferedImage enough? ... On the other hand, if I use the Kernel methods, can I choose the ... number of pixels that are too bright) if the image is not in memory (is ...
    (comp.lang.java.gui)