Skip to content
New issue

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

resampleBilinear relX and relY #447

Open
savage13 opened this issue Nov 30, 2024 · 0 comments
Open

resampleBilinear relX and relY #447

savage13 opened this issue Nov 30, 2024 · 0 comments

Comments

@savage13
Copy link

Should relX and relY in resampleBilinear()
be

    var relX = (inWidth - 1) / (outWidth - 1);
    var relY = (inHeight - 1) / (outHeight - 1);

If the lengths are the same, all is ok
Currently the last interpolated x point is at (outWidth - 1) * (inWidth)/(outWidth)
If inWidth < outWidth then the last point is short of the last input point
If inWidth > outWidth then the last point is beyond the last input point
With this change the last interpolated x point is at (outWidth - 1) * (inWidth-1)/(outWidth-1) is at (inWidth -1)

It is possible that resample*() also requires this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant