diff --git a/octreelib/grid/grid_base.py b/octreelib/grid/grid_base.py index 606c60b..2f03349 100644 --- a/octreelib/grid/grid_base.py +++ b/octreelib/grid/grid_base.py @@ -157,15 +157,15 @@ def map_leaf_points(self, function: Callable[[PointCloud], PointCloud]): @abstractmethod def map_leaf_points_cuda_ransac( self, - n_poses_per_batch: int = 10, - threshold: int = 0.01, - n_iterations: int = 1024, + poses_per_batch: int = 1, + threshold: float = 0.01, + hypotheses_number: int = 1024, ): """ transform point cloud in the node using the function - :param n_poses_per_batch: Number of poses per batch. + :param poses_per_batch: Number of poses per batch. :param threshold: Distance threshold. - :param n_iterations: Number of RANSAC iterations (<= 1024). + :param hypotheses_number: Number of RANSAC iterations (<= 1024). """ pass diff --git a/octreelib/octree/octree.py b/octreelib/octree/octree.py index 3fb570c..d0266c6 100644 --- a/octreelib/octree/octree.py +++ b/octreelib/octree/octree.py @@ -269,9 +269,9 @@ def apply_mask(self, mask: np.ndarray): """ start_index = 0 for leaf in filter(lambda v: v.n_points != 0, self._cached_leaves): - n_points = leaf.n_points - leaf.apply_mask(mask[start_index : start_index + n_points]) - start_index += n_points + points_number = leaf.n_points + leaf.apply_mask(mask[start_index : start_index + points_number]) + start_index += points_number @property def n_points(self): diff --git a/octreelib/ransac/util.py b/octreelib/ransac/util.py index b2d9818..3d0e45a 100644 --- a/octreelib/ransac/util.py +++ b/octreelib/ransac/util.py @@ -45,32 +45,34 @@ def generate_random_int(rng_states, lower_bound, upper_bound): @cuda.jit(device=True, inline=True) -def generate_random_indices(initial_point_indices, rng_states, block_size, n_points): +def generate_random_indices( + initial_point_indices, rng_states, block_size, points_number +): """ Generate random points from the given block. :param initial_point_indices: Array to store the initial point indices. :param rng_states: Random number generator states. :param block_size: Size of the block. - :param n_points: Number of points to generate. + :param points_number: Number of points to generate. """ - for i in range(n_points): + for i in range(points_number): initial_point_indices[i] = generate_random_int(rng_states, 0, block_size) return initial_point_indices @cuda.jit(device=True, inline=True) def generate_unique_random_indices( - initial_point_indices, rng_states, block_size, n_points + initial_point_indices, rng_states, block_size, points_number ): """ Generate unique random points from the given block. :param initial_point_indices: Array to store the initial point indices. :param rng_states: Random number generator states. :param block_size: Size of the block. - :param n_points: Number of points to generate. + :param points_number: Number of points to generate. """ - for ii in range(n_points): + for ii in range(points_number): initial_point_indices[ii] = generate_random_int(rng_states, 0, block_size) unique = False while not unique: diff --git a/test/grid/test_cuda_ransac.py b/test/grid/test_cuda_ransac.py index 51c1ba2..038e9fd 100644 --- a/test/grid/test_cuda_ransac.py +++ b/test/grid/test_cuda_ransac.py @@ -7,14 +7,14 @@ @pytest.fixture() def generated_grid_with_planar_clouds(): def generate_planar_cloud( - n_points, plane_coefficients, voxel_corner, edge_length, sigma + points_number, plane_coefficients, voxel_corner, edge_length, sigma ): voxel_points = ( - np.random.rand(n_points, 3) * np.array([edge_length - 6 * sigma] * 3) + np.random.rand(points_number, 3) * np.array([edge_length - 6 * sigma] * 3) + voxel_corner + 3 * sigma ) - noise = np.random.normal(0, sigma, (n_points,)) + noise = np.random.normal(0, sigma, (points_number,)) plane_points_z = ( -plane_coefficients[0] * voxel_points[:, 0] - plane_coefficients[1] * voxel_points[:, 1] @@ -23,7 +23,7 @@ def generate_planar_cloud( noisy_plane_points_z = plane_points_z + noise return np.column_stack((voxel_points[:, :2], noisy_plane_points_z)) - n_points = 10 + points_number = 10 corner = np.array([0, 0, 0]) edge_length = 5 sigma = 0.1 @@ -33,7 +33,7 @@ def generate_planar_cloud( grid.insert_points( 0, generate_planar_cloud( - n_points=n_points, + points_number=points_number, plane_coefficients=(1, 2, 3, 0.5), voxel_corner=corner, edge_length=edge_length, @@ -43,7 +43,7 @@ def generate_planar_cloud( grid.insert_points( 1, generate_planar_cloud( - n_points=n_points, + points_number=points_number, plane_coefficients=(-1, 2, 3, 0.5), voxel_corner=corner, edge_length=edge_length,