Transforms a baseline (in world coords) into a 2d box (in sensor coords) Args: baseline ([type]): [description] cam ([type]): [description] height (int, optional): Box height. Defaults to 1. Returns: [type]: Box in sensor coords
(self, baseline, cam, height=1)
| 600 | return baseline |
| 601 | |
| 602 | def _baseline_to_box(self, baseline, cam, height=1): |
| 603 | """Transforms a baseline (in world coords) into a 2d box (in sensor coords) |
| 604 | |
| 605 | Args: |
| 606 | baseline ([type]): [description] |
| 607 | cam ([type]): [description] |
| 608 | height (int, optional): Box height. Defaults to 1. |
| 609 | |
| 610 | Returns: |
| 611 | [type]: Box in sensor coords |
| 612 | """ |
| 613 | cords_x_y_z = np.array(self._world_to_sensor(baseline, self._get_sensor_position(cam))[:3, :]) |
| 614 | |
| 615 | cords = np.hstack((cords_x_y_z, np.fliplr(cords_x_y_z + np.array([[0],[0],[height]])))) |
| 616 | |
| 617 | return self._coords_to_2d_bb(cords) |
| 618 | |
| 619 | |
| 620 | def _coords_to_2d_bb(self, cords): |
no test coverage detected