Nearest-neighbor interpolation: Difference between revisions

Content deleted Content added
Undid revision 272396661 by 75.79.43.39 (talk). Raster graphics is hardly the only application of this technique.
Citation bot (talk | contribs)
Added isbn. | Use this bot. Report bugs. | Suggested by Dominic3203 | Category:Interpolation | #UCB_Category 27/59
 
(45 intermediate revisions by 34 users not shown)
Line 1:
{{short description|Method of multivariate interpolation}}
[[Image:Piecewise_constant.svg|right|thumb|Nearest neighbor interpolation (blue lines) in one dimension on a (uniform) dataset (red points).]]
[[Image:Coloured_Voronoi_2DInterpolation-nearest.svg|right|thumb|Example of nearestNearest neighbor interpolation ofon a randomuniform set2D of pointsgrid (black dotspoints) in 2D. Each colouredcolored cell indicates the area in which all the points have the black point in the cell as their nearest black point.]]
 
[[Image:Nearest2DInterpolExample.png|right|thumb|Nearest neighbor interpolation on a uniform 2D grid (black points).]]
'''Nearest-neighbor interpolation''' (also known as '''proximal interpolation''' or, in some contexts, '''point sampling''' in some contexts) is a simple method of [[multivariate interpolation]] in 1one or more [[dimension]]s. [[Interpolation]] is the problem of approximating the value for a non-given point in some space, when given some values of points ''around'' that point. The nearest neighbor algorithm simply selects the value of the nearest point, and does not consider the values of other neighboring points at all, yielding a piecewise-constant interpolant. The algorithm is very simple to implement, and is commonly used (usually along with [[mipmap|mipmapping]]) in [[Real-time computing|real-time]] [[3D rendering]] to select color values for a [[texture filtering|textured]] surface.
 
[[Interpolation]] is the problem of approximating the value of a function for a non-given point in some space when given the value of that function in points around (neighboring) that point. The nearest neighbor algorithm selects the value of the nearest point and does not consider the values of neighboring points at all, yielding a piecewise-constant interpolant.<ref>{{cite book |last1=Thévenaz |first1=Philippe |last2=Blu |first2=Philippe |last3=Unser |first3=Philippe |year=2000 |chapter=Image Interpolation and Resampling |title=Handbook of Medical Imaging |page=405 |publisher=Academic Press |doi=10.1016/b978-012077790-7/50030-8|isbn=978-0-12-077790-7 }}</ref> The algorithm is very simple to implement and is commonly used (usually along with [[mipmap|mipmapping]]) in [[Real-time computing|real-time]] [[3D rendering]]<ref>{{cite book |last=Pfister |first=HANSPETER |year=2005 |chapter=Hardware-Accelerated Volume Rendering |editor=Charles D. Hansen and Chris R. Johnson |title=The Visualization Handbook |page=233 |publisher=Elsevier |doi=10.1016/b978-012387582-2/50013-7|isbn=978-0-12-387582-2 }}</ref> to select color values for a [[texture filtering|textured]] surface.
 
==Connection to Voronoi diagram==
For a given set of points in space, a [[Voronoi diagram]] is a decomposition of space into cells, one for each given point, so that anywhere in space, the closest given point is inside the cell. This is equivalent to nearest neighbourneighbor interpolation, by assigning the function value at the given point to all the points inside the cell.<ref>{{cite web |last1=Hartmann |first1=K. |last2=Krois |first2=J. |last3=Rudolph |first3=A. |year=2023 |title=Statistics and Geodata Analysis using R (SOGA-R) |publisher=Department of Earth Sciences, Freie Universität Berlin |url=https://www.geo.fu-berlin.de/en/ |accessdate=2024-11-14}}</ref> The figures on the right side show by colourcolor the shape of the cells.
 
{{comparison_of_1D_and_2D_interpolation.svg|left}}
For a given set of points in space, a [[Voronoi diagram]] is a decomposition of space into cells, one for each given point, so that anywhere in space, the closest given point is inside the cell. This is equivalent to nearest neighbour interpolation, by assigning the function value at the given point to all the points inside the cell. The figures on the right side show by colour the shape of the cells.
[[Image:Coloured_Voronoi_2D.svg|none|thumb|This [[Voronoi diagram]] is an example of nearest neighbor interpolation of a random set of points (black dots) in 2D.]]
{{-}}
 
==See also==
* [[Interpolation]]
* [[Natural neighbor interpolation]]
* [[Image scaling]]
* [[Nearest neighbor search]]
* [[Nearest neighbor smoothing]]
* [[Zero-order hold]]
* [[Rounding]]
 
==References==
{{Reflist}}
 
[[Category:Interpolation]]
[[Category:Multivariate interpolation]]
[[Category:Texture filtering]]
 
{{mathapplied-stub}}