|
Bilinear interpolation function reversal |
Surt
Member #273
April 2000
|
Is is mathematically possible to reverse the bilinear interpolation function? That is, finding the square coordinate from a point between the four points of a distorted square. No need to do the math for me, I would rather do it my self, but I just want to know if it can be done, so I don't spend hours stressing my brain for nothing (I have allready spent quite a few on this problem). --- |
Bob
Free Market Evangelist
September 2000
|
Yes, if you have the original kernel matrix. Then, it's a simple matter of inverting the kernel matrix and reapplying it to the image. -- |
Zaphos
Member #1,468
August 2001
|
As a rule, if the result of some process could have been derived from more than one initial, the process is not reversible without extra information. It's a pretty simple rule, no?
|
Thomas Harte
Member #33
April 2000
|
Zaphos > Thats true in general, but you are being too simple. Look at what Thanatos knows in this case : [My site] [Tetrominoes] |
Zaphos
Member #1,468
August 2001
|
As in, "you can do it, sort of?" Yeah, I know that, kinda ... but that's not a true reversal, is it?
|
Thomas Harte
Member #33
April 2000
|
It can't be guaranteed to be a true reversal, but will be either entirely correct, visually correct (i.e. a few hues slightly off, but not to the human eye), or as correct as the output data allows (e.g. if a 3d projection doesn't end up including all the texels) . . . . [My site] [Tetrominoes] |
Thomas Harte
Member #33
April 2000
|
Also, there is the little matter of what exactly the original author means. I've shown that the answer to his question "[Is it possible to find] the square coordinate from a point between the four points of a distorted square." is exactly yes. I just don't see how a square distortion and the bilinear interpolation (which after all literall just means moving linearly simultaneously in two dimensions) are the same thing so I went of on all that about the bilinear interpolation of texture maps to remove hard texel edges . . . [My site] [Tetrominoes] |
Zaphos
Member #1,468
August 2001
|
Umm ... cool. My brain just exploded. Is that bad? Yeah, sorry, you're over my head ...
|
Surt
Member #273
April 2000
|
Thank for your replies, but I don't think I explained myself very well. --- |
Bob
Free Market Evangelist
September 2000
|
Actually, I think there are betters ways of doing what you're trying to achieve. Firstly, you can project your mouse in your 3D world - this will give you a line though, not a point. -- |
Gabhonga
Member #1,247
February 2001
|
well, you can easily go from 2d to 3d, but you'll have a line, and no point then... -------------------------------------------------------- |
Surt
Member #273
April 2000
|
Sorry, again I should have explained better. --- |
Bob
Free Market Evangelist
September 2000
|
How is your map displayed? Using a 3d engine (polygons) or a 2d engine (tiles)? If it's 2d, then it's trivial - You simply reverse the equaion used to draw tiles. I can give more details if I know how you draw the tiles though. -- |
Surt
Member #273
April 2000
|
Not bilinear filtering, bilinear interpolation. --- |
|