arXiv:2609.11766cs.ROSep 2026

Manuscript Offprint

arXiv:2609.11766

Visual-SLAM for the detection of hidden tomatoes in greenhouses by Hierarchical Localization and GLOMAPfor robotized harvesting

Fernando Cañadas-Aránega, José C. Moreno, José L. Blanco-Claraco, Francisco Rodríguez

Abstract

Advanced crop monitoring inside greenhouses is becoming one of the primary objectives of research centers. High-performance sensors, such as LiDAR or stereo cameras, have traditionally been employed for this purpose, though these often have a high cost. This work proposes a Visual-SLAM system using a monocular camera, which is significantly more cost-effective and specifically tailored for agricultural applications, such as mapping tomato crops in a greenhouse. Tests were carried out on a real tomato bunch, located in the Agroconnect experimental greenhouse. A ROS 2 Humble node was developed to run on the robot in order to capture images of these crops, which were then stored for offline processing. To generate a 3D mapped model for the crop in the greenhouse, the GLOMAP mapper, based on Structure-From-Motion, was integrated with the Hierarchical Localization toolbox. This initial mapping is a foundation for future, more advanced algorithms to analyze growth patterns, and optimize agricultural management. The system leverages a hierarchical localization paradigm based on a coarse-to-fine strategy: it first performs global retrieval to generate location hypotheses, then combines local features within the identified candidate regions. The results show a cor-

*Corresponding author

Email addresses: fernando.ca@ual.es (Fernando Cañadas-Aránega), jcmoreno@ual.es (José C. Moreno), jlblanco@ual.es (José L. Blanco-Claraco), frrodrig@ual.es (F. Rodríguez) rect identification of the tomato cluster, correctly characterising the tomato that is occluded and inaccessible by classical vision technologies. The reconstructed 3D model was further validated against manual ground-truth measurements of fruit size, centroid position, and orientation, confirming the geometric accuracy of the proposed low-cost monocular pipeline.

Keywords: Agricultural robotics, Simultaneous Localization And Mapping, Vision for Robotics, ROS 2

1. Introduction

Greenhouses exhibit a certain degree of structural organization but differ significantly from highly controlled industrial environments, such as automotive assembly lines. This distinction presents specific challenges that require the integration of highly automated machinery to ensure the efficient development of greenhouse agriculture. A key aspect in the deployment of robotic systems in such environments is the selection of appropriate sensors capable of detecting obstacles and localizing the robot in dynamic settings with limited communication (Feng et al., 2015; Cañadas-Aránega et al., 2026c). These systems must not only navigate autonomously but also perform complex tasks such as automated crop harvesting.

Maximizing the efficient use of available space within the greenhouse becomes a critical strategy for achieving optimal productivity, which in turn demands the adaptation of task-specific algorithms to the environmental conditions. Research on robotic tasks in greenhouses has been ongoing since 1987 (Bachche, 2015). It is estimated that up to 80% of operational time during the crop season is devoted to monitoring and fruit harvesting, the latter being one of the most studied tasks by the authors (Taqi et al., 2017). The most successful developments have incorporated robotic arms for automated harvesting, typically equipped with Red, Green and Blue – Depth (RGB-D) cameras for shape and depth detection, and/or LiDAR sensors for 3D scanning and environmental mapping (Cañadas-Aránega et al., 2024b), or by using RGB-D cameras to carry out ground segmentation, detection or classification (Cañadas-Aránega et al., 2026b).

Accurate environmental mapping is essential to determine the 3D position of fruits, which are then processed by object detection and classification algorithms. Using traditional techniques with 2D cameras has been a failure because the information obtained from this type of sensor is insufficient to identify the fruit (Ge et al., 2021). However, there are strategies that aim to improve these algorithms using RGB-D cameras to obtain three-dimensional models that can locate the position of the object in space. In Rong et al. (2022), the YOLOv5 algorithm Ge et al. (2021) is used to detect tomato clusters from 2D images and estimate their position. In Zheng et al. (2024) the YOLOv5_se variant is employed to identify tomatoes using RGB and depth images. Similarly, Cañadas-Aranega et al. (2025) applies SLAM techniques to estimate a 3D model of tomatoes using 3D LiDAR technology. However, accurately determining the total number of fruits remains a challenge, as many are occluded and can not be detected by these technologies. This limitation has driven the development of algorithms capable of estimating occlusions and improving the efficiency of automated harvesting (Aguilar et al., 2024).

In this context, the three-dimensional image restructuring algorithms from motion, also known as Visual-SLAM, are a possible tool to be investigated for robotized crop monitoring in agriculture. In particular, the Hierarchical Localization (HLoc) (Sarlin et al., 2019), an algorithm that provides feature matching between consecutive images with a SuperPoint + SuperGlue structure. On the other hand, the Global Structure-from-Motion Revisited (GLOMAP) algorithm (Pan et al., 2024) produces larger-scale reconstructions—approximately one to two times bigger—while incorporating features specifically designed to enhance depth perception in the resulting 3D models.

This paper presents an application of work of Pablo Vela (Vela, 2025), which introduces a repository for utilizing the GLOMAP Structure-From-Motion mapper in conjunction with the Hierarchical Localization toolbox to achieve a faster mapper with depth-learned features and matches. Initially, a rosbag is recorded using ROS2 Humble on a real tomato cluster located in a real greenhouse. For the recording, an Intel RealSense D435i camera is used, from which only the information recorded by the RGB lens will be utilized. This information is converted to a frame rate of 10 Hz, which will be used as input to the algorithm. Subsequently, HLoc-GLOMAP is used for the active reconstruction of the cluster. The technique yields promising results, demonstrating how a set of 2D images can be used to reconstruct a real 3D model, a key aspect for locating a percentage of the objects and planning a more efficient future harvesting strategy. The main contribution of this work is the identification of the tomatoes that are hidden in the plant for the subsequent planning of harvesting, in order to speed up the harvesting.

problems typical of this type of vegetables, from a sequence of 2D images, which in general can be acquired by a low cost camera.

This paper is organized as follows: Section 2 describes the materials and methods that have been used. Section 3 presents the results of applying this technique to a real data set. Finally, Section 4 outlines the main conclusions of this research.

References (21)