-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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-2551: prevented NaN in convoluted matrix #2553
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2553 +/- ##
==========================================
+ Coverage 90.53% 90.53% +<.01%
==========================================
Files 304 304
Lines 21706 21707 +1
Branches 1872 1872
==========================================
+ Hits 19652 19653 +1
Misses 1714 1714
Partials 340 340
Continue to review full report at Codecov.
|
@meriki you need to justify this change by adding a test which will fail on old code and work fine on yours. Also, ensure that your code is PEP-8 compliant (as it mentioned in the PR template). |
@@ -387,6 +387,7 @@ def richardson_lucy(image, psf, iterations=50, clip=True): | |||
|
|||
for _ in range(iterations): | |||
relative_blur = image / convolve_method(im_deconv, psf, 'same') | |||
relative_blur[np.isnan(relative_blur)] = 0 # to prevent NaN from propogating throughout convulated matrix |
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.
what about np.nan_to_num()
- https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.nan_to_num.html
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.
+1
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.
Propagating.
And, "result of convolution" instead of "convulated matrix"?
Description
[Tell us about your new feature, improvement, or fix! If relevant, please supplement the PR with images.]
Checklist
[It's fine to submit PRs which are a work in progress! But before they are merged, all PRs should provide:]
./doc/examples
(new features only)[For detailed information on these and other aspects see scikit-image contribution guidelines]
References
[If this is a bug-fix or enhancement, it closes issue # ]
[If this is a new feature, it implements the following paper: ]