MCPcopy
hub / github.com/open-mmlab/OpenPCDet / get_points_in_box

Function get_points_in_box

pcdet/datasets/augmentor/augmentor_utils.py:453–470  ·  view source on GitHub ↗
(points, gt_box)

Source from the content-addressed store, hash-verified

451 return gt_boxes, points
452
453def get_points_in_box(points, gt_box):
454 x, y, z = points[:,0], points[:,1], points[:,2]
455 cx, cy, cz = gt_box[0], gt_box[1], gt_box[2]
456 dx, dy, dz, rz = gt_box[3], gt_box[4], gt_box[5], gt_box[6]
457 shift_x, shift_y, shift_z = x - cx, y - cy, z - cz
458
459 MARGIN = 1e-1
460 cosa, sina = math.cos(-rz), math.sin(-rz)
461 local_x = shift_x * cosa + shift_y * (-sina)
462 local_y = shift_x * sina + shift_y * cosa
463
464 mask = np.logical_and(abs(shift_z) <= dz / 2.0, \
465 np.logical_and(abs(local_x) <= dx / 2.0 + MARGIN, \
466 abs(local_y) <= dy / 2.0 + MARGIN ))
467
468 points = points[mask]
469
470 return points, mask

Callers 9

local_scalingFunction · 0.85
local_rotationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected