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

cv2 interpolation to resize the target #8

Open
victorjourne opened this issue Nov 4, 2021 · 1 comment
Open

cv2 interpolation to resize the target #8

victorjourne opened this issue Nov 4, 2021 · 1 comment

Comments

@victorjourne
Copy link
Contributor

It would be more accurate to use the INTER_AREA interpolation than the INTER_CUBIC one for the resize of the target.
Indeed, this downsampling is more natural here because it computes the weighted average of pixels.

Moreover, the rescale should be normalized with int(target.shape[0]) * int(target.shape[1])/ (int(target.shape[1]/ratio) * int(target.shape[0]/ratio)) rather than ratio**2.

It is not that minor, the current resize produces 1% of error.

I will make a PR for that!

Thanks

@rongliangzi
Copy link
Owner

Much appreciation for your contribution!

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

2 participants