Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Implement Box blur fast filter that could approximate gaussian filter #223
base: main
Are you sure you want to change the base?
Implement Box blur fast filter that could approximate gaussian filter #223
Changes from all commits
7660471
2c5c101
9108613
37fc576
5facd4f
849d57a
b7b86ce
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add also some test that it’s not only ones ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'll add a few more tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can allocate once outside the loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would some simple numbers test too similar to the other functions to verify that’s doing the right thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I added 2 tests here: test_box_blur_fast() and test_gaussian_blur(). Both has the same input (0..25) to show that the outputs are not that much different.
I did attempt to use the same input (all 0.0, 9.0 in the middle) as test_fast_horizontal_filter(), if that's how you mean by this comment. The result was a little disappointing as there's a big difference between the outputs of the 2 methods. I figured it's because the test input was odd. It might be fitting for test_fast_horizontal_filter() but not for these. Therefore I went with something more randomized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should be different? The test you describe should give you a box of ones, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Split header docs. Usually there’s a single line explaining in short the purpose of the function followed by end of line then you can add some clarification, formulation of anything needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering wether this offset could be precomputed beforehand as you are computing several times in the top level function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(src.cols()-1)*C)
could be computed outside before the loops