30#include <Eigen/Geometry>
59 Eigen::Matrix4f
centerPose = Eigen::Matrix4f::Identity();
63 Eigen::Vector3f
center()
const;
64 Eigen::Matrix3f
axes()
const;
67 std::array<Eigen::Vector3f, 8>
corners()
const;
80 Eigen::Matrix4f
cameraPose = Eigen::Matrix4f::Identity();
93 Eigen::Vector3f
upLocal = -Eigen::Vector3f::UnitY();
101 Eigen::Vector3f
toViewFrame(
const Eigen::Vector3f& globalPoint)
const;
104 bool contains(
const Eigen::Vector3f& globalPoint)
const;
135 std::vector<Eigen::Vector3f>
sampleFace(
const Box& box,
int faceIndex,
int gridN);
145 const Eigen::Vector3f& unitDirection,
161 const std::vector<Box>& occluders,
Geometric primitives for the fake object detector.
DetectionMode
How strictly an object must be perceivable before it is reported.
@ LineOfSight
Additionally require a clear line of sight to the front face of the bounding box.
@ Always
Report every object, regardless of where the camera looks.
@ FieldOfView
Report an object once its bounding box enters 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.
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.
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.
Eigen::Vector3f faceNormal(const Box &box, int faceIndex)
Outward unit normal of faceIndex in global coordinates.
Eigen::Vector3f faceCenter(const Box &box, int faceIndex)
Centre of faceIndex in global coordinates.
An oriented bounding box in the global frame.
std::array< Eigen::Vector3f, 8 > corners() const
The eight corners in global coordinates.
Eigen::Matrix4f centerPose
Rotation = box axes, translation = box centre.
Eigen::Vector3f halfExtents
Half the extent along each local box axis.
Eigen::Matrix3f axes() const
Eigen::Vector3f center() const
A symmetric view frustum.
bool contains(const Eigen::Vector3f &globalPoint) const
Whether a global point lies inside the frustum.
Eigen::Vector3f upLocal
Up axis in the camera's local frame.
float minDistance
Detection range along the viewing axis [mm].
Eigen::Matrix4f cameraPose
Camera -> global.
Eigen::Vector3f toViewFrame(const Eigen::Vector3f &globalPoint) const
Express a global point in the camera's viewing frame.
float horizontalFov
Full opening angles [rad].
Eigen::Vector3f forwardLocal
Viewing axis in the camera's local frame.
Eigen::Vector3f position() const