https://github.com/geezacoleman/gilgaidetection
Simple colour thresholdhing for Gilgai detection
https://github.com/geezacoleman/gilgaidetection
Last synced: 5 months ago
JSON representation
Simple colour thresholdhing for Gilgai detection
- Host: GitHub
- URL: https://github.com/geezacoleman/gilgaidetection
- Owner: geezacoleman
- License: gpl-3.0
- Created: 2023-03-20T08:39:37.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-28T08:16:11.000Z (about 2 years ago)
- Last Synced: 2024-08-02T01:25:39.748Z (9 months ago)
- Language: Python
- Size: 1.43 MB
- Stars: 9
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-ChatGPT-repositories - GilgaiDetection - Simple colour thresholdhing for Gilgai detection (Others)
README
# The Coverage Calculator
Now available as a web-app on StreamLit](https://geezacoleman-gilgaidetection-streamlit-app-wn203j.streamlit.app/)
The CoverageCalculator allows you to upload images and perform two-class, colour-based segmentation. Using [this thread on Twitter](https://twitter.com/cropmad/status/1637700842727022593) for inspiration, the app was made to allow a user to threshold images and
determine the area of an image that comes from each of the two classes. It was built in a few hours with a lot of help from ChatGPT.
## A Tkinter-based user interface
To use the tkinter GUI, clone this repository, install the requirements (numpy and OpenCV) and then run `python gui.py`
on your command line. It should bring up a window like the one below. There are default colour settings included
in the `parameters.json` file, but if you want to change those, you'll need to run `gilgai_detection.py` separately.
Once it is open, select the directory of images you would like to process, click process. It will save the percent cover
of each to a csv file and display a segmented image. You can toggle between the images using the Back/Forward
buttons.## Non-GUI based
This example of Gilgai 'detection' uses simple HSV thresholding for wheat and Gilgai/non-wheat areas with OpenCV and numpy.
The percentage cover of each class in the image is calculated using total pixels in the image and displayed
on the image.
When the windows are closed with 'Q' the slider values are saved and will be loaded on reopening. Use the `gilgai_detection.py`
file to set and store the values first and then the `process_directory.py` file to use the stored values to process and
save the results from an entire directory to CSV.