The identification of individual trees is an important research topic in forestry, remote sensing, and computer vision. It is a requirement in forest management and monitoring because it provides key forest inventory information, vegetation distribution mapping, vegetation density estimation, change monitoring, and species classification.However, counting trees can be challenging due to the crowded environment, time-consumption, and expensive operation. Remote Sensing methods such as UAV imagery and the development of efficient algorithms can be adapted to estimate and detect individual tree counts in orchards. This paper aims to use the template matching technique to automatically detect olive trees from high resolution drone imagery in the eastern part of Morocco. The algorithm successfully detected and counted 2719 olive trees with a difference of less than 233 trees with manual detection. The results of detecting and counting the individual olive trees were evaluated using several parameters: an Fscore of 94%, with a recall of 92% and a precision of 98%, which are satisfactory.