Add parameters to mean adaptive thresh
Describe your changes Adding parameters of block size and offset to both, mean and Gaussian adaptive threshold functions.
This will add flexibility to tune the behavior of the adaptive threshold depending on the image (resolution, size of the objects, and degree of change in brightness).
We have been using these functions as automatic methods, with block size and offset fixed, but that is not an optimal usage of the adaptive thresholds. The important characteristic of these adaptive methods is that they use a different threshold value for each pixel, depending on the value of the pixels in a surrounding block.
Type of update Is this a:
- New feature or feature enhancement
Associated issues
Additional context
For the reviewer See this page for instructions on how to review the pull request.
- [x] PR functionality reviewed in a Jupyter Notebook
- [x] All tests pass
- [x] Test coverage remains 100%
- [x] Documentation tested
- [x] New documentation pages added to
plantcv/mkdocs.yml - [x] Changes to function input/output signatures added to
updating.md - [x] Code reviewed
- [x] PR approved
Codecov Report
Merging #937 (8ce5f85) into release-4.0 (4390066) will not change coverage. The diff coverage is
100.00%.
:exclamation: Current head 8ce5f85 differs from pull request most recent head 00c5d74. Consider uploading reports for the commit 00c5d74 to get more accurate results
@@ Coverage Diff @@
## release-4.0 #937 +/- ##
==============================================
Coverage 100.00% 100.00%
==============================================
Files 161 147 -14
Lines 6840 6640 -200
==============================================
- Hits 6840 6640 -200
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 100.00% <100.00%> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| plantcv/parallel/multiprocess.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/find_objects.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/hyperspectral/analyze_spectral.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/roi/roi2mask.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/roi/roi_methods.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/threshold/threshold_methods.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/transform/color_correction.py | 100.00% <100.00%> (ø) |
|
| ...lantcv/plantcv/visualize/auto_threshold_methods.py | 100.00% <100.00%> (ø) |
|
| plantcv/plantcv/transform/__init__.py | ||
| plantcv/learn/__init__.py | ||
| ... and 12 more |