(points, gt_box)
| 451 | return gt_boxes, points |
| 452 | |
| 453 | def 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 |
no outgoing calls
no test coverage detected