Skip to content

GabrielSpdf/Plant-Segmentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

6 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒฑ Plant-Segmentation

This repository contains a technique for segmenting a set of plants and measuring their areas. Originally, this code was developed as my final project for the Digital Image Processing course, and the image included in this repository is one of many from the original dataset. However, due to limited access, I only had access to a single image. As a result, my code is designed to address the challenges of a single image. It's important to note that the solution may not perform optimally when applied to other plant images. Nevertheless, there is room for improvement, so feel free to use and implement a more general solution.


๐Ÿ—ƒ๏ธ Library

โ€ข OpenCV
โ€ข NumPy

๐Ÿ“„ Implemented method

  1. Process the image
  2. Use Canny Edge Detection
  3. Dilate the image
  4. Find contours in the resulting image
  5. Create a vector to store each area
  6. Use Contour Approximation
  7. Find the area for a closed contour
  8. Create a vector to store each area
  9. For each area, convert the measurement from pixel^2 to mm^2
  10. In the source image, add text to each plant indicating its index

๐Ÿ”๏ธ Area approximation method

In the image, there was a ruler that could be used to assist in measurement transformation

๐Ÿ“ Results

The results were good and significant; most plants have a concrete and feasible area. However...

๐Ÿšจ Problems

However, three plants have an incorrect area. Even though the code can handle most plants, it's important to note that there are errors

๐Ÿ”ง Possible solution

For those who are reading and want to explore the code, I believe that a possible solution is to use the Otsu method to segment the plants, as the application of the threshold is automatic and efficient

โ„น๏ธ Documentation

For more information about the OpenCV library, please visit: OpenCV

For additional details on the NumPy library, visit: NumPy

To learn more about the Canny Edge Detection method, refer to: Canny Edge Detection

For in-depth information on Contour methods, explore: Contours

About

Measure the area of short-length plants

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages