Nearest-neighbor interpolation: Difference between revisions

Content deleted Content added
PrimeBOT (talk | contribs)
m top: Task 44: clean up shortdesc whitespace issues
Citation bot (talk | contribs)
Added isbn. | Use this bot. Report bugs. | Suggested by Dominic3203 | Category:Interpolation | #UCB_Category 27/59
 
(7 intermediate revisions by 3 users not shown)
Line 1:
{{short description|Method of multivariate interpolation}}
{{no sources|date=September 2021}}
[[Image:Piecewise_constant.svg|right|thumb|Nearest neighbor interpolation (blue lines) in one dimension on a (uniform) dataset (red points)]]
[[Image:Interpolation-nearest.svg|right|thumb|Nearest neighbor interpolation on a uniform 2D grid (black points). Each colouredcolored cell indicates the area in which all the points have the black point in the cell as their nearest black point.]]
 
'''Nearest-neighbor interpolation''' (also known as '''proximal interpolation''' or, in some contexts, '''point sampling''') is a simple method of [[multivariate interpolation]] in one or more [[dimension]]s.
 
[[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}}
Line 20 ⟶ 19:
* [[Image scaling]]
* [[Nearest neighbor search]]
* [[Nearest neighbor smoothing]]
* [[Zero-order hold]]
* [[Rounding]]
 
==References==
{{Reflist}}
 
[[Category:Interpolation]]