-
-
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
Feature request: implement generalized histogram thresholding #5189
Comments
Hello @jni , I'm new to open source and would like to make my first contribution to the community. Can you explain this issue in detail. |
@Monishver The main idea is:
|
@Monishver have you seen our contributing guide? https://scikit-image.org/docs/dev/contribute.html Please let us know if you have more questions after reading this! |
I guess I can close this. :) |
@divyank0 that would be much appreciated! 🎉 |
I am preparing the ticket , few questions I have
|
I am wondering what could be ideal signature for the function
where x is the array of bin intensities , n is histogram and others are algorithm specific parameters. The first one is definitely going to there, however we can name it to GHT. However for 2nd one, we have to supply default parameters, which might not suffice the problem. The user will need more control to optimally solve his thresholding problem. If my understanding is correct, This algorithm is for advanced User, since this requires tuning of 4 parameters. |
I vote for the first proposition, parameters must be adjustable. We have also other algorithms requiring some knowledge in scikit-image. We must do our best in the docstring to provide an intuition of the behavior of each parameter (with a formula or with typical effects). |
I have a created a pull request for this. do have a look. one suggestion made by mkcor is to use default Parameter values. It might be a good idea, what does everyone think about it? As to what those values could be? We could set values of nu, tau, omega, and kappa corresponding to Otsu's method. |
The signature should take an image or a histogram, where the histogram can be either just the set of frequencies or the bin centres and the frequencies. See the code for Otsu's thresholding for details. The idea is that you can provide the image (as all thresholding methods do), or, if you have a precomputed histogram, you can provide the histogram, which is more efficient. The parameters should all be accessible and yes, defaulting to Otsu's is probably the most sensible default. |
* Added cropping for image (ndarray) issue: #5189 * pep8 fixes * added output in fn docstring * auto pep8 fixes * fixes testcases * suggested fixes * added copy flag and change function name to bounding_box_crop * suggest change; axes name; slices use and valueerror test * DOC: update bounding_box_crop docstring * TST: use new-style random generator in test_cropy.py * Rename crop.py to avoid name clash with the skimage.utils.crop function add bounding_box_crop to skimage/utils/__init__.py * fix circular import * fix doctest * Apply suggestions from code review Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org> * Refactor bounding_box_crop to slice_along_axes * Fix tests * Fix linting * Fix docstring * Allow implicit axes; allow negative slicing * Fix doctest --------- Co-authored-by: Gregory Lee <grlee77@gmail.com> Co-authored-by: Marianne Corvellec <marianne.corvellec@ens-lyon.org> Co-authored-by: Stefan van der Walt <stefanv@berkeley.edu>
Description
There was a badass paper last year that unified and generalized Otsu and other thresholding methods (arXiv).
As usual, since it's a new algorithm the argument can be made that we should wait to see it in practice, but my gut feeling is that (a) it's really good, and (b) it's a generalization of an existing algorithm that we have in the library, so it does not add much code, and minimum error thresholding (Kittler & Illingworth, 1986) is also generalized by this method, so we would automatically gain an implementation of a thresholding algorithm that has 2600+ citations.
So, I would vote to include it in the library, e.g. as
threshold_generalized_histogram
. Furthermore, since there is Apache-licensed code available already (notebook), this might be a good first issue for someone who wants to get started contributing to the library.The text was updated successfully, but these errors were encountered: