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).
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.