|
|
Geometric primitives for the fake object detector. More...
Classes | |
| struct | Box |
| An oriented bounding box in the global frame. More... | |
| struct | Frustum |
| A symmetric view frustum. More... | |
Enumerations | |
| enum class | DetectionMode { Always , FieldOfView , LineOfSight } |
| How strictly an object must be perceivable before it is reported. More... | |
Functions | |
| Eigen::Vector3f | faceCenter (const Box &box, int faceIndex) |
Centre of faceIndex in global coordinates. | |
| Eigen::Vector3f | faceNormal (const Box &box, int faceIndex) |
Outward unit normal of faceIndex in global coordinates. | |
| int | frontFaceIndex (const Frustum &frustum, const Box &box) |
The face of box that points most directly at the camera - the "front facing side" of the bounding box. | |
| std::optional< float > | intersectRayBox (const Eigen::Vector3f &origin, const Eigen::Vector3f &unitDirection, const Box &box) |
| Intersect a ray with an oriented box using the slab method. | |
| bool | isInFieldOfView (const Frustum &frustum, const Box &box, bool requireFullyInside) |
Whether box is inside the camera frustum. | |
| std::vector< Eigen::Vector3f > | sampleFace (const Box &box, int faceIndex, int gridN) |
A gridN x gridN grid of sample points spread over faceIndex, in global coordinates. | |
| float | visibleFraction (const Frustum &frustum, const Box &target, const std::vector< Box > &occluders, int gridN, float epsilon) |
The fraction of sample points on the front face of target that the camera can see. | |
Geometric primitives for the fake object detector.
This header is deliberately free of Ice, ArmarX component and Simox types so that the visibility logic can be unit tested in isolation.
All lengths are in millimetres and all poses are in the global frame, matching the ArmarX/Simox convention.
|
strong |
How strictly an object must be perceivable before it is reported.
| Eigen::Vector3f faceCenter | ( | const Box & | box, |
| int | faceIndex ) |
Centre of faceIndex in global coordinates.
| Eigen::Vector3f faceNormal | ( | const Box & | box, |
| int | faceIndex ) |
Outward unit normal of faceIndex in global coordinates.
The face of box that points most directly at the camera - the "front facing side" of the bounding box.
| std::optional< float > intersectRayBox | ( | const Eigen::Vector3f & | origin, |
| const Eigen::Vector3f & | unitDirection, | ||
| const Box & | box ) |
Intersect a ray with an oriented box using the slab method.
| unitDirection | Must be normalized. |
origin to the nearest intersection, or std::nullopt if the ray misses. Returns 0 when origin lies inside the box. Whether box is inside the camera frustum.
| requireFullyInside | If true, all eight corners must be inside. Otherwise it is enough that any corner or the box centre is inside. |
| std::vector< Eigen::Vector3f > sampleFace | ( | const Box & | box, |
| int | faceIndex, | ||
| int | gridN ) |
A gridN x gridN grid of sample points spread over faceIndex, in global coordinates.
Samples sit at cell centres, so they never lie exactly on an edge shared with an adjacent object. gridN == 1 yields the face centre alone.
| float visibleFraction | ( | const Frustum & | frustum, |
| const Box & | target, | ||
| const std::vector< Box > & | occluders, | ||
| int | gridN, | ||
| float | epsilon ) |
The fraction of sample points on the front face of target that the camera can see.
A sample is blocked when any occluder is hit closer than the sample itself. An occluder containing the camera (such as the head link the camera is mounted in) never blocks.
| occluders | Must NOT contain target; otherwise every ray is blocked by the target's own front face. |
| epsilon | Tolerance [mm] to absorb the hit exactly on the target's surface. |