Segtree is a plugin designed for the segmentation of individual trees from imagery. It isolates tree in ovelapping tree context.
Input: RGB images or preprocessed point clouds.
Output: Binary masks of segmentated tree.
The user provides as input a color image and, optionally, a trunk detector mask. With a single click, the plugin automatically places prompt points on the detected trunk labels. These prompts are then used by SAM2 HQ (Segment Anything Model v2, High Quality mode) to segment the tree foliage associated with each trunk.
METUAREA, Herearii, LAURENS, François, GUERRA, Walter, et al. Individual Segmentation of Intertwined Apple Trees in a Row via Prompt Engineering. Sensors, 2025, vol. 25, no 15, p. 4721.
If you find segtree useful in your research, please star ⭐ this repository and consider citing 📝:
@article{metuarea2025individual,
title={Individual Segmentation of Intertwined Apple Trees in a Row via Prompt Engineering},
author={Metuarea, Herearii and Laurens, Fran{\c{c}}ois and Guerra, Walter and Lozano, Lidia and Patocchi, Andrea and Van Hoye, Shauny and Dutagaci, Helin and Labrosse, Jeremy and Rasti, Pejman and Rousseau, David},
journal={Sensors},
volume={25},
number={15},
pages={4721},
year={2025},
publisher={MDPI}
}
You can install orchardseg via pip:
pip install orchardseg
To install latest development version :
pip install git+https://github.com/hereariim/segtree.git
Imhorphen team, bioimaging research group
42 rue George Morel, Angers, France
- Pr David Rousseau, david.rousseau@univ-angers.fr
- Herearii Metuarea, herearii.metuarea@univ-angers.fr
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the BSD-3 license, "segtree" is free and open source software
If you encounter any problems, please file an issue along with a detailed description.

