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

fix: resize nearest #454

Merged
merged 2 commits into from
May 3, 2024
Merged

Conversation

tpoisseau
Copy link
Contributor

@tpoisseau tpoisseau commented May 2, 2024

Refs: #452


chirurgical fix, rework of #453

previous PR had lot of issues due to fix for bilinear interpolation breaking lot of tests for general worse results (only clear better results was for the opencv bilinear test).

better / worse are personal appreciation.

This PR fix resize with nearest interpolation by using transform matrix without change interpolateNearest function and adding small translation to compensate.
Changing interpolation function would break some tests but not for the best. I continue to think more work need to be done on this topic.

  • interpolateNearest should use floor I guess
  • compensate with translation may not be the best things to do
  • other resize interpolation should also use transform
  • maybe the algorithm for transform is not exactly right or be specific for each interpolation method

It's a lot of work to plan for really small, nearly impossible to see with the naked eye and lot of decision and estimation to do to actualize breaking tests or not.

@tpoisseau tpoisseau marked this pull request as ready for review May 2, 2024 12:27
@tpoisseau tpoisseau requested a review from targos May 2, 2024 12:27
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can ref #452, but it doesn't close it (only nearest-neighbor is fixed).

chirurgical fix, rework of #453

Refs: #452
@tpoisseau tpoisseau force-pushed the 452-resize-method-doesnt-work-properly-try-2 branch from 6e8748a to 1944341 Compare May 2, 2024 12:52
@tpoisseau
Copy link
Contributor Author

Ok for refs instead closes.

@tpoisseau tpoisseau requested a review from targos May 2, 2024 13:26
@targos targos merged commit d80f4a7 into main May 3, 2024
8 checks passed
@targos targos deleted the 452-resize-method-doesnt-work-properly-try-2 branch May 3, 2024 06:58
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

Successfully merging this pull request may close these issues.

2 participants