Repository navigation
Pre labelled tree extraction - #55
Conversation
Merge from upstream
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
height_minstill removes labels that are too short to count as a tree.