An "order statistic" is a rank in a sorted list. For example, the "median" is the middle rank.
Salt and pepper noise consists of isolated pixels that have extreme (very high or very low) values.
This noise can be reduced by replacing each pixel with the median pixel in its neighbourhood, called "median filtering", as follows:
for each pixel, p: p = median intensity in 3x3 neighbourhood of p
[ Gonzales & Woods ]
A "weighted median filter" gives different weights to the pixels in neighbourhood (e.g. farther pixels could have lower weights in a 5x5 neighbourhood).
With an image is transformed (using backprojection), the new image pixels don't correspond exactly to the original pixels; the new pixels may map back to somewhere in a cluster of four of the original pixels. See below:
[ gsfc.nasa.gov ]
There are several methods, discussed below, to determine the value at $P'$ of the output product (above) from the pixels on the input product (above).
[ chrismadden.co.uk ]
We pick the nearest pixel in the original image to use in the new image. This leads to a blocky new image.
We average the four pixels around the location in the original image, to get a pixel in the new image.
Suppose $p'$ backprojects to location $(x,y)$ in the original image.
Let $X = \lfloor x \rfloor$, $Y = \lfloor y \rfloor$, $\alpha = x-X$, and $\beta = y-Y$.
Then the coordinates of the four relevant pixels in the original image are (recall that $y$ increases downward):
$\begin{array}{cc} [X , Y ] & [X+1, Y ] \\ [X , Y+1] & [X+1, Y+1] \\ \end{array}$
Those are the coordinates of the four pixels in the "input product" image below.
The weight of each of the four pixels increases as (x,y) is closer to that pixel.
The weights are (for the corresponding pixels shown above):
$\begin{array}{cc} [ (1-\alpha) \; (1-\beta) ] & [ \alpha \; (1-\beta) ] \\ [ (1-\alpha) \; \beta ] & [ \alpha \; \beta ] \\ \end{array}$
In the image below, $d$ corresponds to our $\alpha$ above, and $d'$ corresponds to our $\beta$ above:
[ gsfc.nasa.gov ]
And the code looks like this:
bilinear_interp(x,y,image) X = floor(x); Y = floor(y); alpha = x-X; beta = y-Y; return (1-alpha)*(1-beta)*image[X ,Y ] + alpha *(1-beta)*image[X+1,Y ] + (1-alpha)* beta *image[X ,Y+1] + alpha * beta *image[X+1,Y+1]; // Must also check bounds!
Bilinear interpolation between four pixel centres really defines a continuous "intensity surface" above those pixel centres:
[ gsfc.nasa.gov ]
Use a 4x4 set of pixels to interpolate, instead of the 2x2 for bilinear.
Each row of 4 pixels has a cubic polynomial interpolating its 4 values: $F_0(x)$, $F_1(x)$, $F_2(x)$, and $F_3(x)$.
Given $(\alpha, \beta)$ as defined with biilnear interpolation, first evaluate the 4 polynomials to get four scalar values:
$F_0(\alpha)$, $F_1(\alpha)$, $F_2(\alpha)$, $F_3(\alpha)$
These are the four red polynomials shown in this image:
[ olympusmicro.com/primer/java/digitalimaging/processing/geometricaltransformation ]
Next, interpolate those 4 scalar values with another cubic polynomial, $G(x)$, and evaluate $G(\beta)$ to get the interpolated value. This is the blue polynomial shown above.
For 4 points with values (e.g. intensities) $P_0$, $P_1$, $P_2$, $P_3$, the interpolating polynomial is
$p(x) = a \; x^3 + b \; x^2 + c \; x + d$
where
$\left[ \begin{array}{c} a \\ b \\ c \\ d \\ \end{array} \right] = \left[ \begin{array}{rrrr} -0.5 & 1.5 & -1.5 & 0.5 \\ 1.0 & -2.5 & 2.0 & -0.5 \\ -0.5 & 0.0 & 0.5 & 0.0 \\ 0.0 & 1.0 & 0.0 & 0.0 \\ \end{array} \right] \;\; \left[ \begin{array}{c} P_0 \\ P_1 \\ P_2 \\ P_3 \\ \end{array} \right]$
Different matrices can be developed to have cubic polynomials with different properties.
You don't need to derive or memorize this matrix; that's a subject for another course.
Below is a comparison of bilinear interpolation and cubic interpolation. It's often not worth the extra computation to get the slightly better quality of cubic interpolation, which tends to show sharper small details (see the upper branch and the skin pattern).
Bilinear interpolation | Bicubic interpolation |
---|---|
The images above might not be good examples if your browser has already resized them using its own interpolation method.