- Tensor product linear interpolation, sometimes known as bilinear interpolation. (Arguably, this is not truly linear in some respects, but everyone calls it that. I would be splitting hairs to get into the subtleties.)
- Split each square in the lattice into two triangles, where the shared diagonal is oriented along a line parallel to y=x. Once that has been done, now purely linear interpolation is possible inside each triangle.
- Split each square in the lattice into two triangles, where the shared diagonal is oriented along a line parallel to y=-x. Once that has been done, now purely linear interpolation is possible inside each triangle.
Interpolate using a different method without the original image
1 ビュー (過去 30 日間)
The original image was resampled using linear interpolation. I now want to resample the original image using nearest neighbor interpolation. However, I don't have the original image anymore. Is there a way I could use the linearily interpolated image to produce a nearest neighbor image? The dimensions of the linearily interpolated image and nearest neighbor image would be the same; I just want the pixel values to change as if the original image were interpolated using nearest neighbor.
Thanks in advance for any help!
回答 (1 件)
John D'Errico 2022 年 5 月 20 日
編集済み: John D'Errico 2022 年 5 月 20 日
Um, no, or, yes. Anyway, you cannot do it directly. And it may be completely impossible to do. All of that depends on several things you have not told us.
First, when you say that "linear" interpolation was done, you have not provided sufficient information, as there are at least three different ways to perform linear interpolation on a regular lattice. (There are surely others that could be nominally called linear interpolation I could think of if you gave me some time, but these would be the common choices.) Until you say which was done, there is no hope to proceed at all, as that would be provably impossible. The 3 distinct ways I can think of off the top of my head are:
As you can see, the dissection derived from 2 and 3 are similar in theory, but clearly will result in different interpolants. You can see the two dissections below.
V = [0 0;1 0;0 1;1 1];
T2 = [1 2 4;1 3 4];
T3 = [1 2 3;2 3 4];
title('Method 2 dissection')
title('Method 3 dissection')
Once the actual interpolation method is known, now you have a chance of solving the problem. You simply form the inverse operation, using the interpolated values to infer the original image. This would be equivalent to solving a linear system of equations in the unknown image elements of the original image. Once you have recovered the original image, now going forward is trivial, since you can use any method of interpolation your heart desires to go forwards.
HOWEVER, if the interpolated image was interpolated on a more coarse grid than the original, then you cannot perform the inverse operation. It is now impossible to solve this problem, as the linear system you need to solve will be under-determined. So it is only possible if the original interpolation resulted in a finer grid, and then you could reverse that operation.
Your question seems to be, can you solve this problem directly, without going through the inverse operation? Well, yes. In theory you can, since nearest neighbor is a pretty simple operation, but it would still require the inverse transformation. And that means it is not worth the bother, since nearest neighbor is just so simple and efficient to write.