Re: 'Magic' kernel for image zoom resampling?
- From: "John Costella" <jpcostella@xxxxxxxxxxx>
- Date: 8 Jun 2006 04:08:03 -0700
aruzinsky wrote:
Again, you lost me here. Please, stop belaboring everything else and
explain only the above. Since your kernel is separable, you should be able
to give a 1D example to explain your enlargement process.
Good idea. Sorry.
Take the original 1-d 'image' to be
a b c d e ...
and the enlarged image to be
A B C D E F G ...
Ignore edge effects, and put b half-way between A and B, c half-way
between C and D, d half-way between D and E, etc. Then
A = ( a + 3b ) / 4
B = ( 3b + c ) / 4
C = ( b + 3c ) / 4
D = ( 3c + d ) / 4
E = ( c + 3d ) / 4
F = ( 3d + e ) / 4
G = ( d + 3e ) / 4
etc. You can see, for example, that 'c' contributes {1,3,3,1} / 4 to
{B,C,D,E}; 'd' contributes {1,3,3,1} / 4 to {D,E,F,G}; and so on.
To downsample from the A B C ... back to the a b c ... you just apply
this in reverse:
c = ( B + 3C + 3D + E ) / 8
d = ( D + 3E + 3F + G ) / 8
etc.
In the general case of m=2^k, where the block filter would just choose
the nearest tile of m pixels, the algorithm actually chooses the center
tile of m pixels, plus the tile of m pixels to the left, plus the tile
of m pixels to the right. The left and right tiles grow parabolically
from 0 at the edges (that's why the kernel is of width 3m-2 rather than
3m, because the ends always vanish), and the center tile is an inverted
parabola of twice the curvature. Every pixel in the enlarged image
receives contributions from three original pixels; the two end
parabolas plus the middle parabola add up to unity, for every position.
For example, for m=4, the kernel is
0 1 3 6|10 12 12 10|6 3 1 0
and if you add up the three parabolas, you get
{0,1,3,6}
+{10,12,12,10}
+{6,3,1,0}
={16,16,16,16}.
In this case (again ignoring edge problems) you get
A = ( 6a + 10b + 0c ) / 16
B = ( 3a + 12b + 1c ) / 16
C = ( 1a + 12b + 3c ) / 16
D = ( 0a + 10b + 6c ) / 16
E = ( 6b + 10c + 0d ) / 16
F = ( 3b + 12c + 1d ) / 16
G = ( 1b + 12c + 3d ) / 16
H = ( 0b + 10c + 6d ) / 16
etc.
To downsample, you reverse the process, so that
c = ( 0A + 1B + 3C + 6D + 10E + 12F + 12G + 10H + 6I + 3J + 1K +0L ) /
64
etc.
Does this make more sense now?
Apologies again for being unclear,
John
.
- Follow-Ups:
- Re: 'Magic' kernel for image zoom resampling?
- From: |||newspam|||
- Re: Re: 'Magic' kernel for image zoom resampling?
- From: aruzinsky
- Re: 'Magic' kernel for image zoom resampling?
- References:
- Re: 'Magic' kernel for image zoom resampling?
- From: John Costella
- Re: Re: 'Magic' kernel for image zoom resampling?
- From: aruzinsky
- Re: 'Magic' kernel for image zoom resampling?
- Prev by Date: GIS, Remote sensing & Geoogy - NEW SOFTWARE - SIGEOL®
- Next by Date: Re: 'Magic' kernel for image zoom resampling?
- Previous by thread: Re: Re: 'Magic' kernel for image zoom resampling?
- Next by thread: Re: Re: 'Magic' kernel for image zoom resampling?
- Index(es):
Relevant Pages
|