-
Notifications
You must be signed in to change notification settings - Fork 52
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
Gaussian Blur implementation is very slow #4
Comments
I looked through the code that does Gaussian blur, and the efficiency is at least O(n)^4 or larger. There is two for loops to iterate through the image, and there are two for loops to iterate through the kernel. It is possible to completely unroll the for loops, as in make them disappear, for iterating through the image kernel. That would make the efficiency at O(n)^2. Example in Python:
For variable kernel sizes, it would obviously make the code larger to maintain since you would need multiple functions. |
You're not magically reducing the time complexity by unrolling the inner loops. It wasn't really |
On a simple 1080x800px image, with kernel of size 10, it takes well over 15s. Not sure if there's more efficient ways to implement it, is it the same method used as the Java version?
I wonder if it's possible to use the browser's CSS filter for guassian blur, then transfer that back to a canvas.
The text was updated successfully, but these errors were encountered: