Giter Site home page Giter Site logo

zhengpeng7 / leafveinextraction Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 7.0 7.61 MB

To extract leaf veins from scanned leaf groups.

License: BSD 2-Clause "Simplified" License

Python 100.00%
extract-leaf-veins computer-vision edge-detection curvature leaf veins region-growth

leafveinextraction's Introduction

LeafVeinExtraction

To extract leaf veins from scanned leaf groups and save some valuable data, like curvatures.

Done:

  1. Use K-means to get the order of each leaf in current group, then use Radon Transformation to straighten the leaf images.
  2. Use an improved dynamic Canny + Region Growth with two direction to extract leaf vein from the scanned leaf groups.
  3. Use DFT(Discrete Fourier Transformation) to evaluate the curvatures of the discrete vein points.
  4. Use curve-fitting to calculate the angles between the main-vein and sub-veins.

Author: Peng Zheng.

Project duration: 6/2017~12/2017, while some data formatting jobs still need to be done.

Required_packages:

  • numpy
  • scipy
  • opencv-python
  • scikit-image
  • scikit-learn
  • matplotlib
  • xlsxwriter

Essential methods:

  1. Preprocessing:
    1. Radon transformation.
    2. FloodFill.
    3. K-means
  2. Extraction:
    1. Improved Canny.
    2. Region growth.
  3. Data formatting:
    1. Discrete Fourier Transformation.
    2. Skeletonization.
    3. Curve fitting.

Usage:

  1. Put the scanned leaf group image in the "split_before" folder.
  2. python main.py.

Result:

cannied_edges

veins

main_veins

color_veins_with_angles

find_tops_bottoms

TODO:

  • Use superpixel to adapt canny theshold locally.

  • Upgrade Region Growth with Kalman Filter.

If you've ever met any confusion or bug in related algorithms or code, please be not mean about your issue:)

leafveinextraction's People

Contributors

ai4sciencelab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

leafveinextraction's Issues

problem in the file extract_vein_by_region_grow.py

Traceback (most recent call last):
File "E:\research\LeafVeinExtraction-master\main.py", line 93, in
extract_vein_by_region_grow.extract_vein_by_region_grow(edges_canny[i], images[i], 150, (15, 15))
File "E:\research\LeafVeinExtraction-master\extract_vein_by_region_grow.py", line 164, in extract_vein_by_region_grow
cv2.findContours(vein[:, round(w/2)-20:round(w/2)+20], cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
ValueError: not enough values to unpack (expected 3, got 2)

How to fix this? opencv-python 4.0.0.21

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.