A MATLAB algorithm has been developed that identifies and outlines the canopies of the primary trees in the two-dimensional, side-view images that we obtained from an orchard. The basic algorithm outline is shown below.
Canopy-identifying algorithm sequence:
Images of seven different trees were tested, each having the same side-view perspective. Below are each of the images overlaid with the outlining results of the algorithm.
Test tree 1
Test tree 2
Test tree 3
Test tree 4
Test tree 5
Test tree 6
Test tree 7
As is easily seen from the results of Test tree 6, the algorithm is not very robust (a tree behind the primary tree was also outlined). An obvious problem also occurred with Test tree 7: the primary tree was properly outlined, but part of the background was outlined as a second, false tree. Because there is no depth information contained in 2-D images, it is difficult to create an algorithm that can reliably distinguish the primary canopies from the background canopies in our images. This algorithm takes advantage of the fact that the primary trees appear taller in the images than the background trees - vertical erosion is used to find the approximate vertical boundaries of the primary tree canopies, which is why the outlines along the sides of the canopies appear to be cropped. It appears that the slight size difference between the canopy leaves of the primary tree and the background trees could possibly be used to improve the algorithm.
When you look at the images, you may be able to identify the primary canopies and then wonder why it is so difficult for a computer to outline them. Part of the reason that we humans can quickly identify complex objects is that we learn from experience; in this case, we know what trees usually look like, so that helps us to find the primary trees in the images. Of course there is such a thing as machine learning, but in this case we were attempting to use relatively simple image-processing techniques to identify the tree canopies.
Once we begin taking aerial images of orchards, we will adapt this algorithm to segment tree canopies from a top-view perspective. 2-D segmentation should then be easier to perform because the background will be the ground beneath the trees.