Forecasting crop yields provides crucial intelligence for growers of high-value commodities, helping them organize and streamline harvest logistics. The bulk of current yield forecasting approaches rely on manual sampling and statistical procedures, which are intricate, labor-intensive, and time-consuming. Lately, advances in image processing and the broader integration of autonomous systems, such as unmanned aerial vehicles, have enabled swifter, more precise yield forecasting across diverse crops. This work puts forward a novel, rapid, efficient, and accurate image processing algorithm. The segmentation technique proved capable of distinguishing mature citrus trees from their natural surroundings within the CIE (Commission Internationale de l'Éclairage) Lab color space. The influence of the spacing between the camera and the target on resolution and detection accuracy was examined and discussed. Outcomes revealed that distances from 1.524 meters (5 feet) up to 2.134 meters (7 feet) yielded high detection accuracy. The count of correctly recognized fruit attained 91.69%, with an average processing duration of 1.1 s for each image across a set of 132 images. A correlation coefficient (R2) equal to 0.98 was secured between the citrus counting algorithm and counts generated through human visual assessment of 66 sample trees. A comparative review of the introduced technique indicated greater accuracy and robustness than other related research.