Quiz: splines on images
Before this unit: Interpolating, approximating and smoothing splines (previous unit); Day 1: Images, filters and frequencies.
See also: Day 5: Deconvolution; Day 14: Labelling.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. Nearest-neighbour and bilinear interpolation are B-splines of which degrees? What is the main fault of each?
Box and hat.
Degree 0 (box) and degree 1 (hat, in x and in y). Nearest: blocky jumps, aliasing. Bilinear: kinks along pixel rows and columns (the slope jumps) and blur between pixels.
Q2. Why can the pixel values not be used directly as the coefficients of a cubic B-spline interpolant?
Values of β³ at the integers.
The cubic B-spline is \tfrac16, \tfrac46, \tfrac16 at a pixel and its neighbours, so the resulting surface at a pixel is \tfrac16(f_{k-1} + 4f_k + f_{k+1}), a blurred value, not f_k. The coefficients must first be computed by the prefilter (solving \tfrac16(c_{k-1} + 4c_k + c_{k+1}) = f_k), which sharpens.
Q3. Cubic convolution and the cubic B-spline (with prefilter) both use 4 × 4 pixels per output value. What is the difference?
Which values are weighted: pixels or coefficients?
Cubic convolution weights the pixel values with a fixed interpolating kernel (C¹, no preprocessing, strictly local). The B-spline weights coefficients obtained by the prefilter over whole rows and columns; the result is C² and closer to an ideal low-pass, at the cost of the prefilter pass.
Q4. You rotate an image 10 times by 36°. Rank nearest, bilinear and cubic B-spline by how much the image changes, and explain the worst one.
Each rotation resamples the previous result.
Cubic B-spline (least: RMS 11.3 on the micrograph), bilinear (21.6), nearest (28.1). Nearest copies values from slightly wrong places each time; the position errors accumulate and edges become jagged. Bilinear blurs a little at every step and the blur accumulates.
Q5. Why must a label image (object numbers) be warped with nearest neighbour even if the grey image is warped with a cubic B-spline?
What is the average of label 1 and label 3?
Any interpolator that weights several pixels invents values between labels (label 2 between 1 and 3, fractions near every boundary), and cubics even overshoot to values beyond the range. Labels are names, not quantities; nearest neighbour copies an existing label.
Q6. In a free-form deformation with control spacing h = 32 pixels, one control point is dragged 12 pixels to the right. How far do the pixel at that control point and the pixel at the next control point move?
\beta^3(0)^2 = \tfrac49, \beta^3(1)\beta^3(0) = \tfrac19.
12 \cdot \tfrac49 = 5.33 pixels and 12 \cdot \tfrac19 = 1.33 pixels (diagonally 12 \cdot \tfrac1{36} = 0.33).
Q7. What does a negative Jacobian determinant of a deformation mean, and how do you avoid it?
Local change of area, with a sign.
The map folds: a small region is mirrored, so parts of the image land on top of other parts and the map is not one-to-one. Keep control displacements small relative to the spacing (below about 0.49 of the spacing in 2D guarantees no folding), or penalise bending during registration.
Q8. (math) Show that the frequency response of \tfrac16[1\;4\;1] is (2 + \cos\omega)/3 and explain why the prefilter (its inverse) exists.
Apply the filter to e^{i\omega k}.
\tfrac16(e^{-i\omega} + 4 + e^{i\omega}) = \tfrac16(4 + 2\cos\omega) = \tfrac{2 + \cos\omega}{3}. It is at least \tfrac13 (at \omega = \pi) and never zero, so the inverse filter 3/(2 + \cos\omega) exists and amplifies by at most 3.