Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dnhkng/huang-thresholding
A nice thresholding algorithm for bacterial colony isolation
https://github.com/dnhkng/huang-thresholding
Last synced: 12 days ago
JSON representation
A nice thresholding algorithm for bacterial colony isolation
- Host: GitHub
- URL: https://github.com/dnhkng/huang-thresholding
- Owner: dnhkng
- Created: 2014-03-24T16:14:31.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2024-02-18T11:15:28.000Z (9 months ago)
- Last Synced: 2024-02-18T12:26:02.851Z (9 months ago)
- Language: Python
- Size: 5.65 MB
- Stars: 9
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Huang-Thresholding
A nice thresholding algorithm for bacterial colony isolation
Implements Huang's fuzzy thresholding method, recoded from the Java version from ImageJ.Uses Shannon's entropy function, from *Huang L.-K. and Wang M.-J.J. (1995) "Image Thresholding by Minimizing the Measures of Fuzziness" Pattern Recognition, 28(1): 41-51*
### Installation
Copy the python files to your working directory.
### Testing
```Python
python -m unittest test_huang_thresholding.py
```
### Usage
There are bacterial colonies images in 'colonies.npy'To calculate the Huang Thresholding, you would use the following code to first get the data into numpy and get the histogram values, and then calculate the threshold.
```Python
import numpy as np
from huang_thresholding import HuangThresholdingcolony_data = np.load("colonies.npy")
histogram_data, _ = np.histogram(colony_data, bins=range(257))
huang_thresholding = HuangThresholding(histogram_data)
threshold = huang_thresholding.find_threshold()
```