Image Filtering

From David's Wiki
Revision as of 03:51, 29 March 2023 by David (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
\( \newcommand{\P}[]{\unicode{xB6}} \newcommand{\AA}[]{\unicode{x212B}} \newcommand{\empty}[]{\emptyset} \newcommand{\O}[]{\emptyset} \newcommand{\Alpha}[]{Α} \newcommand{\Beta}[]{Β} \newcommand{\Epsilon}[]{Ε} \newcommand{\Iota}[]{Ι} \newcommand{\Kappa}[]{Κ} \newcommand{\Rho}[]{Ρ} \newcommand{\Tau}[]{Τ} \newcommand{\Zeta}[]{Ζ} \newcommand{\Mu}[]{\unicode{x039C}} \newcommand{\Chi}[]{Χ} \newcommand{\Eta}[]{\unicode{x0397}} \newcommand{\Nu}[]{\unicode{x039D}} \newcommand{\Omicron}[]{\unicode{x039F}} \DeclareMathOperator{\sgn}{sgn} \def\oiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x222F}\,}{\unicode{x222F}}{\unicode{x222F}}{\unicode{x222F}}}\,}\nolimits} \def\oiiint{\mathop{\vcenter{\mathchoice{\huge\unicode{x2230}\,}{\unicode{x2230}}{\unicode{x2230}}{\unicode{x2230}}}\,}\nolimits} \)

Filtering an image refers to sampling an image in a way that resolve aliasing. Since images are a 2D signal, image filtering is a type of signal filtering.

Denoising

Mean filter

Simply take the mean of all pixels in the neighborhood. Also known as a box filter.

Median filter

Median of pixels in a neighborhood. This preserves edges.

Gaussian filter

Convolve the image with a gaussian kernel.
This is similar to a mean filter but pixels are weighted by their spatially distance.

Bilateral filtering

A bilateral filter is a gaussian filter but pixels are additionally weighted by the gaussian of the intensity difference. Hence, edges are preserved since adjacent pixels which have significantly different intensity are weighted much less.

Upfiltering

For upsampling an image, common filters include:

  • Linear
  • Nearest
  • Cubic

Downfiltering

Also known as minifying.

Mipmap

Anisotropic filtering

Anisotropic filtering refers to filtering different axis of an image differently, most useful when an texture is viewed at a steep angle.