3 ms·
No, this isn't a misconception. Yes, a pixel is (theoretically) a point sample, but it matters where we site them. > I prefer to treat pixel coordinates as bei
by Jasper_ 6y ago
No, this isn't a misconception. Yes, a pixel is (theoretically) a point sample, but it matters where we site them.
> I prefer to treat pixel coordinates as being on the integer coordinates
If we have a continuous grid, defined by point samples, where everywhere outside of the point samples is undefined (classic sampling theorem), we need to choose the location of those points. Pixels themselves might not be boxes, but during the process of rasterization (sampling an abstract mathematical shape to define coverage), we treat pixels as little squares we compute the area over.
For a lot of good mathematical reasons, we often will choose to site these points at +0.5,+0.5 inside the box [0], and this is what all GPUs do. This is well-defined.
On top of this, we can define the rest of the grid -- usually through some form of interpolation, as the article suggests. When resampling, we need to be extra careful about the location of our pixel samples here.
Please don't think place pixel point sample centers on the "integer grid lines", that leads to a lot of trouble when doing all sorts of things.
[0] For a visual demonstration of why we do this, see https://magcius.github.io/xplain/article/rast1.html#sampling https://magcius.github.io/xplain/article/rast1.html#sampling