How to resize using Lanczos

I can easily calculate the values ​​of the sinc (x) curves used in Lanczos, and I read the previous explanations regarding resizing Lanczos, but as a newbie in this area, I don’t understand how to apply them.

To try again with lanczos, imagine that you overlap the output and input of each other, indicating the points where the pixel locations are located. For each output pixel position at which you box + - 3 output pixels from this point. For each input pixel that lies in this field, calculate the value of the function lanczos in this place with the distance from the output location in the pixel coordinates of the output as a parameter. Then you need to normalize the calculated values ​​by scaling them so that they are up to 1. After that, multiply each input pixel value with the corresponding scaling value and add the results together to get the value of the output pixel.

  • For example, what does "overlay input and output" really mean in terms of programming?
  • In the above equation, lanczos (x) = {0, if abs (x)> 3, 1, if x == 0, else sin (x * pi) / x} what is x?

As a simple example, suppose I have an input image with 14 values ​​(i.e. at In0-In13 addresses): 20 25 30 35 40 45 50 45 40 35 30 25 20 15

and I want to increase it by 2, i.e. to an image with 28 values ​​(i.e., in Out0-Out27 addresses).

Obviously, the value in the address of Out13 will be similar to the value in the address of In7, but what values ​​do I really multiply to calculate the correct value for Out13? What is x in the algorithm?

+3
source share
1 answer

t- [0 1 2 3...], ( 2) t- [0.5 1 1,5 2 2,5 3...]. , , 0 . , , 1/2 . Etc...

0

Source: https://habr.com/ru/post/1726481/


All Articles