Skip to content

Pre labelled tree extraction - #55

Merged
thomas-lowe merged 7 commits into
csiro-robotics:mainfrom
tim-devereux:pre-labelled-tree-extraction
Sep 11, 2026
Merged

thomas-lowe merged 7 commits into
csiro-robotics:mainfrom
tim-devereux:pre-labelled-tree-extraction

Conversation

@tim-devereux

Copy link
Copy Markdown
Contributor

Adding functionality to perform the tree modelling with a pre-labelled (or manually fixed) input.

This is useful for cases where the semantic segmentation is poor and propagates errors in the tree models.

  • The shortest path pass still runs, as the branch tracing needs the path connectivity, but
    paths cannot cross between two labels, and unlabelled points adopt the label of the path
    that reaches them so that they cannot bridge two trees.
  • The grid based tree separation is replaced by grouping the ground mesh root points per
    label. Each root point goes to the label that most of its points belong to, and is kept
    near that label's most voted root, so that a single path down to a distant patch of ground
    cannot move the tree base. A label with no root of its own falls back to its entry points.
  • Trunks are not split into several trees in this mode, as the labels are taken to be correct.
  • height_min still removes labels that are too short to count as a tree.

tim-devereux and others added 5 commits April 29, 2026 16:10
When the input cloud is already segmented into individual trees, this takes
the segmentation from the cloud and only estimates the tree models, one per
label. Labels are read from the point colours, so it accepts the _segmented.ply
files that rayextract trees generates (allowing a hand-corrected segmentation
to be re-modelled) as well as clouds coloured one arbitrary colour per tree
from any other segmentation method. Black points are unlabelled.

The shortest path pass still runs, as the branch structure needs the path
connectivity, but paths cannot cross between two labels, and unlabelled points
adopt the label of the path reaching them so that they cannot bridge two trees.
The grid based tree separation is replaced by grouping the ground mesh root
points per label, each root point going to the label that most of its points
belong to, and kept near the label's most voted root so that a single path down
to a distant patch of ground cannot move the tree base. Labels with no root of
their own use their entry points instead. Trunks are not split into several
trees in this mode, as the labels are taken to be correct.

@thomas-lowe thomas-lowe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great piece of work.
I have tested it on the raycreate forest as a quick sanity test.
I note that if you enter forest_segmented.ply the output forest_segmented_segmented.ply is a different set of colours. Not sure if that is intended... people may want to for instance use a fixed set of tree IDs from a first scan and then apply that _segmented.ply on subsequent scans of the same forest, and expect it to output with the same IDs.

@thomas-lowe thomas-lowe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a sizeable pull request but it seems to be worth the extra complexity. It allows external party tree segmentation, and allows you to keep the same tree IDs on subsequent scans, by painting the first cloud's _segmented.ply colours onto subsequent input clouds.
How you do that painting is another question... raycolour allows you to paint a top-down image and rayextract forest outputs such a coloured image. For rayextract trees you'd have to do a rayrender on the _segmented.ply of the first scan.

@thomas-lowe
thomas-lowe merged commit cf75c9b into csiro-robotics:main Sep 11, 2026
2 of 3 checks passed
@tim-devereux
tim-devereux deleted the pre-labelled-tree-extraction branch September 11, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants