This is a pure Python 3 implementation of COCCIMORPH, a system for the automatic diagnosis of Coccidia using morphological characteristics. A test dataset for Eimeria species for domestic fowl can be found here; for rabbits, there is this dataset.
$ conda create --name coccimorph python=3.6
$ source activate coccimorph
$ pip install cython flask numpy opencv-python pandas scipy tqdm
Before running the scripts:
$ cd <BASEPATH>
$ git clone https://github.com/ricardoy/coccimorph
$ cd coccimorph
$ export PYTHONPATH=.
First, a good threshold value should be found (and optionally, the image scale); the segment.py
script should be used for that:
$ python coccimorph/segment.py -i <IMAGE> -t <integer between 0 and 255> [-s <image scale in pixels/micrometer>] [-output-binary <FILENAME>] [-output-segmented <FILENAME>]
(This document provides information about how to choose the threshold and the image scale)
After choosing the threshold value, run the classifier.py
script:
$ python coccimorph/classifier.py -input-file <IMAGE> -t <THRESHOLD> [--fowl | --rabit] [-s <SCALE>]
If no problems occurred, an output similar to the following one should be shown:
Mean of curvature: 1.122e-02
Standard deviation from curvature: 4.200e-03
Entropy of curvature: 3.431e+02
Largest diameter: 2.062e+02
Smallest diameter: 1.501e+02
Symmetry based on first principal component: 1.302e-02
Symmetry based on second principal component: 5.623e-02
Total number of pixels: 2.396e+04
Entropy of image content: 1.194e+01
Angular second moment from co-occurrence matrix: 2.663e-04
Contrast from co-occurrence matrix: 3.905e+02
Inverse difference moment from co-occurrence matrix: 1.124e-01
Entropy of co-occurence matrix: 3.766e+01
Probability classification:
E. acervulina: 99.5308
E. mitis: 0.4692
Similarity classification:
E. acervulina: 71.5685
E. necatrix: 28.1404
Run the following command:
$ python server.py
Then, open the URL http://localhost:8080.