-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
Add TryGetLinearlySeparableComponents and tests #2224
Add TryGetLinearlySeparableComponents and tests #2224
Conversation
Ooh I forgot about this branch, really happy to see it back! |
Very useful!! I'll be incorporating it into the general convolution API I'll be exposing. |
|
||
for (int x = 1; x < width; x++) | ||
{ | ||
if (Math.Abs(ratio - (matrix[y, x] / matrix[0, x])) > 0.0001f) |
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.
Using a hardcoded epsilon might be problematic in many cases. Personally I prefer to make it a parameter with a default value or at least to work with library-wide constants proven to work well for the given library.
What are ImageSharp use-cases for this feature?
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.
Yeah we should normalise constants. There might be one in Numerics already.
I plan to use this as an underlying optimisation when exposing a general convolution API.
Prerequisites
Description
This is all @Sergio0694 brilliant work from sp/auto-matrix-linear-decomposition. All I've done is copy the code and tests from that branch as it's impossible to merge it following the Git LFS changes.