We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As I see in code, both src and dst sizes reduced by 1. https://github.com/torch/image/blob/master/generic/image.c#L84 It could be due to Lua's 1-based sizes, but actually it means that image scaled by (dst-1)/(src-1) It results in loosing half a pixel on each side
im=torch.Tensor(3,3):zero() im[2][2]=1 print(im) 0 0 0 0 1 0 0 0 0 [torch.DoubleTensor of size 3x3]
im4=image.scale(im,6,6,'bilinear') print(im4) 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.1600 0.3200 0.3200 0.1600 0.0000 0.0000 0.3200 0.6400 0.6400 0.3200 0.0000 0.0000 0.3200 0.6400 0.6400 0.3200 0.0000 0.0000 0.1600 0.3200 0.3200 0.1600 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 [torch.DoubleTensor of size 6x6] print(im4:sum()) 5.7599997425079
s seen sum = 5.76, instead of expected 4 real scale ratio = 2.4 instead of 2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As I see in code, both src and dst sizes reduced by 1.
https://github.com/torch/image/blob/master/generic/image.c#L84
It could be due to Lua's 1-based sizes, but actually it means that image scaled by (dst-1)/(src-1)
It results in loosing half a pixel on each side
s seen sum = 5.76, instead of expected 4
real scale ratio = 2.4 instead of 2
The text was updated successfully, but these errors were encountered: