Skip to content

Commit 1987a3a

Browse files
author
Cuong Ngo
committed
Add more general way to discretize pointcloud featuremap
1 parent a712f52 commit 1987a3a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/data_process/kitti_bev_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ def removePoints(PointCloud, BoundaryCond):
3434
return PointCloud
3535

3636

37-
def makeBVFeature(PointCloud_, Discretization, bc):
37+
def makeBVFeature(PointCloud_, Discretization_X, Discretization_Y, bc):
3838
Height = cnf.BEV_HEIGHT + 1
3939
Width = cnf.BEV_WIDTH + 1
4040

4141
# Discretize Feature Map
4242
PointCloud = np.copy(PointCloud_)
43-
PointCloud[:, 0] = np.int_(np.floor(PointCloud[:, 0] / Discretization))
44-
PointCloud[:, 1] = np.int_(np.floor(PointCloud[:, 1] / Discretization) + Width / 2)
43+
44+
offset_x = np.int_(np.floor(bc['minX'] / Discretization_X))
45+
offset_y = np.int_(np.floor(bc['minY'] / Discretization_Y))
46+
47+
PointCloud[:, 0] = np.int_(np.floor(PointCloud[:, 0] / Discretization_X)) - offset_x
48+
PointCloud[:, 1] = np.int_(np.floor(PointCloud[:, 1] / Discretization_Y)) - offset_y
4549

4650
# sort-3times
4751
indices = np.lexsort((-PointCloud[:, 2], PointCloud[:, 1], PointCloud[:, 0]))

0 commit comments

Comments
 (0)