Finding plant canopy area using computer vision.
Goal: Recognise plant leaves from live images and determine plant size and additionally, growth rate.
This repo contains 2 main technologies for image segmentation:
- Color thresholding
- Deep learning
pip install -r requirements.txt
You can run python color_segmentation_image.py if you are using photos, or python color_segmentation_webcam.py if you want to use your webcam for live feed instead.
-
Prepare dataset
Obtain dataset from plant-phenotyping.org.
Prepare your training dataset and inference dataset in folders named
train,train_masks_pngandmydata_png.Run
python preprocessing.py -
Train model
Run
python train.py -
Model inference
Run
python infer.py
More explanations here
Notice that the model is able to pick out the leaves under light condition similar to the sample dataset (top photo). However, performance drops as lighting is changed, usually to purple as this is the common 'grow light' color.
Retraining with colour augmentation improved the performance.
- OpenCV
- PyTorch
- Desaturating training dataset to make color less significant
- Adding purple to training dataset
- Removing purple color before inference
- Changing training background color



