pointtree.visualization

Tools for visualizing processing results.

pointtree.visualization.color_instance_segmentation(
point_cloud: DataFrame,
instance_id_column: str,
target_instance_id_column: str | None = None,
fp_ids: List[int] | None = None,
fn_ids: List[int] | None = None,
) DataFrame[source]

Sets the color of each point based on its instance ID.

Parameters:
  • point_cloud – Point cloud to be colored.

  • instance_id_column – Name of the column containing the instance IDs.

  • target_instance_id_column – Name of the column containing the ground truth instance IDs.

  • fp_ids – List of the predicted tree IDs that represent false positives. Defaults to None, which means that false positives are not colored by a dedicated color.

  • fn_ids – List of the ground truth tree IDs that represents false negatives. Defaults to None, which means that false negatives are not colored by a dedicated color.

Returns:

Point cloud with added or modified “r”, “g”, “b”, “a” attributes.

Return type:

pandas.DataFrame

pointtree.visualization.color_semantic_segmentation(
point_cloud: DataFrame,
classes_to_colors: Dict[int, str],
semantic_segmentation_column: str = 'classification',
) DataFrame[source]

Sets the color of each point based on its semantic class.

Parameters:
  • point_cloud – Point cloud to be colored.

  • classes_to_colors – Mapping of class IDs to hex color codes.

  • semantic_segmentation_column – Name of the column containing semantic class IDs. Defaults to "classification".

Returns:

Point cloud with added or modified “r”, “g”, “b”, “a” attributes.

pointtree.visualization.save_tree_map(
image: ndarray,
output_path: str,
*,
is_label_image: bool = False,
crown_borders: ndarray | None = None,
border_mask: ndarray | None = None,
seed_mask: ndarray | None = None,
core_mask: ndarray | None = None,
tree_positions: ndarray | None = None,
crown_positions: ndarray | None = None,
trunk_positions: ndarray | None = None,
) None[source]

Saves a 2D map showing canopy height models, tree positions etc. as image file.