diff --git a/octreelib/ransac/cuda_ransac.py b/octreelib/ransac/cuda_ransac.py index 09dcbcb..ec1f9c5 100644 --- a/octreelib/ransac/cuda_ransac.py +++ b/octreelib/ransac/cuda_ransac.py @@ -5,7 +5,7 @@ from numba.cuda.random import create_xoroshiro128p_states from octreelib.internal import PointCloud -from octreelib.ransac.initial_points_config import N_INITIAL_POINTS +from octreelib.ransac.initial_points_config import INITIAL_POINTS_NUMBER from octreelib.ransac.util import ( generate_random_indices, get_plane_from_points, @@ -107,20 +107,20 @@ def __ransac_kernel( ): thread_id, block_id = cuda.threadIdx.x, cuda.blockIdx.x - if block_sizes[block_id] < N_INITIAL_POINTS: + if block_sizes[block_id] < INITIAL_POINTS_NUMBER: return # select random points as inliers initial_point_indices = cuda.local.array( - shape=N_INITIAL_POINTS, dtype=nb.size_t + shape=INITIAL_POINTS_NUMBER, dtype=nb.size_t ) initial_point_indices = generate_random_indices( initial_point_indices, rng_states, block_sizes[block_id], - N_INITIAL_POINTS, + INITIAL_POINTS_NUMBER, ) - for i in range(N_INITIAL_POINTS): + for i in range(INITIAL_POINTS_NUMBER): initial_point_indices[i] = ( block_start_indices[block_id] + initial_point_indices[i] ) diff --git a/octreelib/ransac/initial_points_config.py b/octreelib/ransac/initial_points_config.py index 572b5bb..8a8b9eb 100644 --- a/octreelib/ransac/initial_points_config.py +++ b/octreelib/ransac/initial_points_config.py @@ -6,4 +6,4 @@ and because of that it is placed in a separate file. """ -N_INITIAL_POINTS = 6 +INITIAL_POINTS_NUMBER = 6 diff --git a/octreelib/ransac/util.py b/octreelib/ransac/util.py index 3d0e45a..0d20e37 100644 --- a/octreelib/ransac/util.py +++ b/octreelib/ransac/util.py @@ -10,7 +10,7 @@ from numba import cuda from numba.cuda.random import xoroshiro128p_uniform_float32 -from octreelib.ransac.initial_points_config import N_INITIAL_POINTS +from octreelib.ransac.initial_points_config import INITIAL_POINTS_NUMBER @cuda.jit( @@ -100,9 +100,9 @@ def get_plane_from_points(points, initial_point_indices): centroid_y += points[idx][1] centroid_z += points[idx][2] - centroid_x /= N_INITIAL_POINTS - centroid_y /= N_INITIAL_POINTS - centroid_z /= N_INITIAL_POINTS + centroid_x /= INITIAL_POINTS_NUMBER + centroid_y /= INITIAL_POINTS_NUMBER + centroid_z /= INITIAL_POINTS_NUMBER xx, xy, xz, yy, yz, zz = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0