Skip to content

A leaf segmentation algorithm written in Python3 using OpenCV.

License

Notifications You must be signed in to change notification settings

oguztoraman/leaf-segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaf Segmentation

A leaf segmentation algorithm written in Python3 using OpenCV. In order to segment leaves from background, Otsu's threshold algorithm was used. To improve Otsu's performance both pre-processing and post porcessing operations were also used.

Requirements

  • Git
  • Python3
  • Numpy
  • OpenCV
  • Scipy

Usage

  1. Install requirements

For Debian/Ubuntu

sudo apt install python3-opencv python3-scipy python3-numpy git

For Fedora

sudo dnf install python3-opencv python3-scipy python3-numpy git
  1. Clone this repo
git clone https://github.com/oguztoraman/leaf-segmentation
  1. Run test.py
cd leaf-segmentation && python3 test.py

License

  • GPLv3. See the COPYING file for details.

References

stackoverflow segmentation problem

Sample Output from Google Colab

===================================
RGB image

Resulted image

Segmented image

Success rate: % 91.900634765625
Elapsed time: 0.2488720417022705 s
===================================
Average success rate: % 91.900634765625
Average elapsed time: 0.2488720417022705 s

About

A leaf segmentation algorithm written in Python3 using OpenCV.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages