Skip to content

Commit

Permalink
fix letter variables
Browse files Browse the repository at this point in the history
  • Loading branch information
true-real-michael committed Mar 23, 2024
1 parent b3976ee commit 950d086
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions octreelib/ransac/cuda_ransac.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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]
)
Expand Down
2 changes: 1 addition & 1 deletion octreelib/ransac/initial_points_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
and because of that it is placed in a separate file.
"""

N_INITIAL_POINTS = 6
INITIAL_POINTS_NUMBER = 6
8 changes: 4 additions & 4 deletions octreelib/ransac/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 950d086

Please sign in to comment.