open-simulation-interface icon indicating copy to clipboard operation
open-simulation-interface copied to clipboard

Bounding box definition for sensor data osi3::BaseMoving::base_polygon and osi3::BaseStationary::base_polygon - use the Vector2d more efficiently

Open j-p-e opened this issue 4 years ago • 0 comments

Describe the problem

Aiming to use the osi3::BaseMoving::base_polygon and osi3::BaseStationary::base_polygon to describe sensor data, in this case 2D bounding boxes for an obstacle detection algorithm running on camera data

The code comments saying 'project to the z plane' seem to suggest we should use the height field of osi3::BaseMoving::dimension to give height, base_polygon::y for 'left', but cannot use base_polygon::x (sensor forward) as it will always be 0. This doesn't seem to be a good use of the Vector2D for this common use case when working with sensors

Projecting to the z plane can remain as-is for ground truth (i.e. ground truth is genuinely along the ground) to avoid breaking changes, but when used as sensor data it would seem to make more sense to project to the x plane (so that one direction is 'sensor left' and one direction is 'sensor up') - that way both coordinates can be used when looking from a 'sensor view'

Proposed solution is to change the comment text both here https://opensimulationinterface.github.io/open-simulation-interface/structosi3_1_1BaseMoving.html#a584e39108fe12db4933390975a172c63 and here https://opensimulationinterface.github.io/open-simulation-interface/structosi3_1_1BaseStationary.html#aa1db348acaac2d5a2ba0883903d962cd

CHANGE FROM

Usage as ground truth: The two dimensional (flat) contour of the object. This is an extension of the concept of a bounding box as defined by Dimension3d. The contour is the projection of the object's outline onto the z-plane in the object frame (independent of its current position and orientation). The height is the same as the height of the bounding box.

Usage as sensor data: The polygon describes the visible part of the object's contour.

General definitions: The polygon is defined in the local object frame: x pointing forward and y to the left. The origin is the center of the bounding box. As ground truth, the polygon is closed by connecting the last with the first point. Therefore these two points must be different. The polygon must consist of at least three points. As sensor data, however, the polygon is open. The polygon is defined counter-clockwise.

TO

Usage as ground truth: The two dimensional (flat) contour of the object. This is an extension of the concept of a bounding box as defined by Dimension3d. The contour is the projection of the object's outline onto the z-plane in the object frame (independent of its current position and orientation). The height in the z direction is given by dimension::height of the bounding box. For ground truth data the polygon is defined in the local object frame projected onto the z plane: base_polygon::x pointing forward and base_polygon::y to the left.

Usage as sensor data: The polygon describes the visible part of the object's contour. The contour is the projection of the object's outline onto the x-plane (the sensor view, where x == sensor-forward) in the sensor frame. The depth in the sensor-forward direction is given by dimension::length of the bounding box. For sensor data the polygon is defined in the sensor frame as the projection of the object onto the x plane, with base_polygon::x pointing sensor-up and base_polygon::y pointing sensor-left. For sensor data 2D bounding boxes dimension::length is 0. For sensor data 3D bounding boxes the dimension::length gives the depth of the bounding box in the sensor-forward direction

General definitions: The origin is the center of the bounding box (i.e. when used together with a ReferencePoint, ReferencePoint shall be REFERENCE_POINT_CENTER). The polygon is defined counter-clockwise. The polygon must consist of at least three points. As ground truth, the polygon is always closed by connecting the last with the first point, Therefore these two points must be different. As sensor data, the polygon is permitted to be open to allow for occluded objects.

j-p-e avatar Jul 21 '21 09:07 j-p-e