|
|
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.
Definition at line 45 of file VisibilityCheck.h.
| Eigen::Vector3f faceCenter | ( | const Box & | box, |
| int | faceIndex ) |
Centre of faceIndex in global coordinates.
Definition at line 151 of file VisibilityCheck.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| Eigen::Vector3f faceNormal | ( | const Box & | box, |
| int | faceIndex ) |
Outward unit normal of faceIndex in global coordinates.
Definition at line 145 of file VisibilityCheck.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:The face of box that points most directly at the camera - the "front facing side" of the bounding box.
Definition at line 158 of file VisibilityCheck.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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. Definition at line 218 of file VisibilityCheck.cpp.
Here is the call graph for this function: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. |
Definition at line 121 of file VisibilityCheck.cpp.
Here is the call graph for this function:| 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.
Definition at line 187 of file VisibilityCheck.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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. |
Definition at line 270 of file VisibilityCheck.cpp.
Here is the call graph for this function: