Anthony:
Actually, as far as RobidouxSharp is concerned, the dust has settled.
I wanted to triple check that the above RobidouxSharp C value is also the one that minimizes maximum deviation for an arbitrary (not extreme) value. The Axiom code that checks this is here:
Code: Select all
)cl a
inner x == _
eval( ( (12 - 9 * B - 6 * C) * x * x * x _
+ (-18 + 12 * B + 6 * C) * x * x _
+ (6 - 2 * B) ) / 6, B = 1-2*C )
outer x == _
eval( ( (-B - 6 * C) * x * x * x _
+ (6 * B + 30 * C) * x * x _
+ (-12 * B - 48 * C) * x _
+ (8 * B + 24 * C) ) / 6, B = 1-2*C )
z := inner 0
cr := inner 1
di := outer sqrt 2
denom := z + 4 * ( cr + di )
-- I factored out a factor of 4
l1 := ( sqrt(( cr + di )^2) + sqrt(cr*cr) + sqrt(di*di) ) / denom
draw(l1,C=0...55)
D(l1^2,C)
limit(%,C=(42*sqrt(2)-7)/142)
[ %.leftHandLimit :: EXPR Float, %.rightHandLimit :: EXPR Float ]
Here is a quick explanation of what Robidoux and RobidouxSharp are about in the EWA context:
Somewhat surprisingly, the Keys cubics are the BC-cubics which minimize the error when upsampling linear (a.k.a. affine) gradients aligned with the axes with Clamped EWA. In the orthogonal context, Keys cubics are precisely the ones which reconstruct such gradients exactly. The surprise lies in that they also minimize (without making it zero) the reconstruction error of linear gradients when used radially. (There is a back of the envelope argument that makes this plausible, having to do with the dominant part of the error along grid lines. The surprise is that this very rough argument actually captures the truth.)
Among the Keys cubics, which are defined by either the B value or the C value since Keys cubics satisfy B+2C=1, two pairs of B,C values are special when performing Elliptical Weighted Averaging (and no downsampling is taking place in any direction):
- The Robidoux pair B = (228 - 108 sqrt(2))/199 = 0.37821575509399866, C = (108 sqrt(2) - 29)/398 = 0.31089212245300067
- The RobidouxSharp pair B = (78 - 42 sqrt(2))/71 = 0.2620145123990142, C = (42 sqrt(2) - 7)/142 = 0.3689927438004929
Informally, the Robidoux Keys cubic is the one that best preserves vertical and horizontal features under no-op when resampling with EWA, and the RobidouxSharp Keys cubic is the one which is closest to being interpolatory in the same situation. Being interpolatory is roughly correlated with being "optimally sharp." Overall, EWA Robidoux turns out to be roughly equivalent to (orthogonal) Mitchell, and EWA RobidouxSharp roughly equivalent to (orthogonal) Catmull-Rom. (If you know how EWA works, it should not surprise you to find out that using a BC-cubic as radial function actually gives a scheme which is somewhat sharper than when used orthogonally.)
Specifically, the Robidoux pair gives the unique Keys cubic such that, under no-op, a vertical (resp. horizontal) line with constant colour value will not affect nearby pixel values when resampling with EWA. Consequently, putting a black frame (say) around an image will not change the content of the image except at its four corner pixels when no-op "resampling" (filtering, really) with EWA. There is another characterization of the Robidoux pair: If an image is constant along vertical (resp. horizontal) lines, no-op EWA will not modify it. Mathematically, the Robidoux pair is defined by the property that under no-op the coefficients of the pixels immediately left, right, up and down are twice as large as the coefficients of the nearest pixels in the four diagonal directions. (They have opposite signs.)
The RobidouxSharp pair gives the unique Keys cubic which minimizes the maximum possible deviation under no-op, under the assumption that pixel values are bound to a fixed range (like 0-255). (In the terminology of applied linear algebra, the RobidouxSharp no-op EWA filter is the one that is closest to the identity in the l1-norm, which ensures that as a linear operator it is as close as possible to the identity in l-infinity a.k.a. max operator norm.) It turns out that the RobidouxSharp pair is also the one that minimizes the maximum possible change in a pixel value which is at one of the extremes (e.g., 0 or 255) under no-op. Mathematically, the RobidouxSharp pair is defined by the property that under no-op the coefficients of the pixels immediately left, right, up and down are exactly as large as the coefficients of the nearest pixels in the four diagonal directions. (Again, they have opposite signs.)
The above properties are not only relevant to no-op: When using Clamped EWA, they describe what happens to the values at the original pixel locations whenever there is no downsampling in any direction (that is, when the EWA ellipse is a circle with the minimal radius, minimal radius equal to 2 when using a BC-cubic as radial filter).
That the Mitchell-Netravali pair B=1/3, C=1/3 is pretty close to being halfway between the Robidoux and RobidouxSharp pairs is an example of the strange coincidences surrounding the use of Keys cubics for Elliptical Weighted Averaging, an application for which they would appear to be ill-suited.
(This coincidence could be taken as justification for reverting to Mitchell-Netravali as the default. Then, users know where to go to get something sharper (RobidouxSharp) or smoother (Robidoux). Alternatively, RobidouxSharp could be made the default, and users could then be instructed to "back down" the sharpness by trying Mitchell, Robidoux and Cubic in order, keeping the first one which they considered sufficiently un-aliased. Or else, switch to Jinc Lanczos.)