tlseparation.scripts package¶
Submodules¶
tlseparation.scripts.automated_separation module¶
-
tlseparation.scripts.automated_separation.
generic_tree
(arr, knn_list=[40, 50, 80, 100, 120], voxel_size=0.05, retrace_steps=40)[source]¶ Run an automated separation of a single tree point cloud.
Parameters: - arr : array
Three-dimensional point cloud of a single tree to perform the wood-leaf separation. This should be a n-dimensional array (m x n) containing a set of coordinates (n) over a set of points (m).
- knn_lst: list
Set of knn values to use in the neighborhood search in classification steps. This variable will be directly used in a step containing the function reference_classification and its minimum and maximum values will be used in a different step with threshold_classification (both from classification.classify_wood). These values are directl dependent of point density and were defined based on a medium point density scenario (mean distance between points aroun 0.05m). Therefore, for higher density point clouds it’s recommended the use of larger knn values for optimal results.
- verbose : bool
Option to set (or not) verbose output.
Returns: - wood_final : array
Wood point cloud.
- leaf_final : array
Leaf point cloud.
-
tlseparation.scripts.automated_separation.
large_tree_3
(arr, class_file=[], knn_lst=[20, 40, 60, 80], gmm_nclasses=4, class_prob_threshold=0.95, cont_filt=True, cf_rad=None, verbose=False)[source]¶ Run an automated separation of a single tree point cloud.
Parameters: - arr : array
Three-dimensional point cloud of a single tree to perform the wood-leaf separation. This should be a n-dimensional array (m x n) containing a set of coordinates (n) over a set of points (m).
- class_file : str
Path to classes reference values file. This file will be loaded and its reference values are used to select wood and leaf classes.
- knn_lst: list
Set of knn values to use in the neighborhood search in classification steps. This variable will be directly used in a step containing the function wlseparate_ref_voting and its minimum value will be used in another step containing wlseparate_abs (both from classification.wlseparate). These values are directly dependent of point density and were defined based on a medium point density scenario (mean distance between points aroun 0.05m). Therefore, for higher density point clouds it’s recommended the use of larger knn values for optimal results.
- gmm_nclasses: int
Number of classes to use in Gaussian Mixture Classification. Default is 4.
- cont_filt : boolean
Option to select if continuity_filter should be applied to wood and leaf point clouds. Default is True.
- class_prob_threshold : float
Classification probability threshold to filter classes. This aims to avoid selecting points that are not confidently enough assigned to any given class. Default is 0.95.
- cf_rad : float
Continuity filter search radius.
- verbose : bool
Option to set (or not) verbose output.
Returns: - wood_final : array
Wood point cloud.
- leaf_final : array
Leaf point cloud.
-
tlseparation.scripts.automated_separation.
large_tree_4
(arr, class_file=[], knn_lst=[20, 40, 60, 80], gmm_nclasses=4, class_prob_threshold=0.95, cont_filt=True, cf_rad=None, verbose=False)[source]¶ Run an automated separation of a single tree point cloud.
Parameters: - arr : array
Three-dimensional point cloud of a single tree to perform the wood-leaf separation. This should be a n-dimensional array (m x n) containing a set of coordinates (n) over a set of points (m).
- class_file : str
Path to classes reference values file. This file will be loaded and its reference values are used to select wood and leaf classes.
- knn_lst: list
Set of knn values to use in the neighborhood search in classification steps. This variable will be directly used in a step containing the function wlseparate_ref_voting and its minimum value will be used in another step containing wlseparate_abs (both from classification.wlseparate). These values are directly dependent of point density and were defined based on a medium point density scenario (mean distance between points aroun 0.05m). Therefore, for higher density point clouds it’s recommended the use of larger knn values for optimal results.
- gmm_nclasses: int
Number of classes to use in Gaussian Mixture Classification. Default is 4.
- cont_filt : boolean
Option to select if continuity_filter should be applied to wood and leaf point clouds. Default is True.
- class_prob_threshold : float
Classification probability threshold to filter classes. This aims to avoid selecting points that are not confidently enough assigned to any given class. Default is 0.95.
- cf_rad : float
Continuity filter search radius.
- verbose : bool
Option to set (or not) verbose output.
Returns: - wood_final : array
Wood point cloud.
- leaf_final : array
Leaf point cloud.
-
tlseparation.scripts.automated_separation.
nopath_generic_tree
(arr, knn_list=[40, 50, 80, 100, 120])[source]¶ Run an automated separation of a single tree point cloud.
Parameters: - arr : array
Three-dimensional point cloud of a single tree to perform the wood-leaf separation. This should be a n-dimensional array (m x n) containing a set of coordinates (n) over a set of points (m).
- knn_lst: list
Set of knn values to use in the neighborhood search in classification steps. This variable will be directly used in a step containing the function reference_classification and its minimum and maximum values will be used in a different step with threshold_classification (both from classification.classify_wood). These values are directl dependent of point density and were defined based on a medium point density scenario (mean distance between points aroun 0.05m). Therefore, for higher density point clouds it’s recommended the use of larger knn values for optimal results.
Returns: - wood_final : array
Wood point cloud.
- leaf_final : array
Leaf point cloud.
tlseparation.scripts.post_processing module¶
-
tlseparation.scripts.post_processing.
isolated_clusters
(arr, voxel_size=0.05, size_threshold=0.3, feature_threshold=0.6, min_pts=10)[source]¶ Performs a connected component analysis to cluster points from a point cloud and filters them these clusters based on size and shape (geometric feature).
Parameters: - arr : array
Three-dimensional (m x n) array of a point cloud, where the coordinates are represented in the columns (n) and the points are represented in the rows (m).
- voxel_size: float
Distance used to generate voxels from point cloud in order to perform the connected component analysis in 3D space.
- size_threshold : int/float
Minimum size, on any dimension, for a cluster to be set as valid (True)
- feature_threshold : float
Minimum feature value for the cluster to be set as elongated (True).
- min_pts : int
Minimum number of points for the cluster to be set as valid (True).
Returns: - filter_mask : array
1D mask array setting True for valid poins in ‘arr’ and False otherwise.