Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 2.98 KB

README.md

File metadata and controls

43 lines (30 loc) · 2.98 KB

Count the number of leaves present in an image

In this project I have counted the number of leaves present in an Image. The whole project was done in Python programming language on Google Colab.

Throughout the project, I have used OpenCV's functions to do various tasks (ie, from reading the image, pre-processing it, drawing the contours to showing the final image).

Accuracy of detection depends on the image. You will have to change some values (ie, magnify the distance transform value, change the filter size etc. depending on the size of leaves present in the image).

Here are the outputs of some test images on which I had ran the algorithm:

Test case 1:

Test case 2:

Test case 3:

Test case 4:

Observations:

By observing the contours drawn on the leaves,

  • We will have to make some modifications to the values depending on the size of leaves present on the image.
  • Colour gradient changes in leaves can be an issue to detect the contours.
  • For slight overlapping of leaves, this algorithm works fine, but for large overlapping, this technique might not work as cv2.findContours() draw joint contours on overlapping objects.
  • In all other cases, the method works well when the image is placed on a less noisy background.

References:

Code References:

Image References: