41 #ifndef INCLUDE_OKVIS_NCAMERASYSTEM_HPP_
42 #define INCLUDE_OKVIS_NCAMERASYSTEM_HPP_
45 #pragma GCC diagnostic push
46 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
47 #include <opencv2/core/core.hpp>
48 #pragma GCC diagnostic pop
64 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
82 inline NCameraSystem(
const std::vector<std::shared_ptr<const okvis::kinematics::Transformation>> &
T_SC,
83 const std::vector<std::shared_ptr<const cameras::CameraBase>> & cameraGeometries,
84 const std::vector<DistortionType>& distortionTypes,
95 inline void reset(
const std::vector<std::shared_ptr<const okvis::kinematics::Transformation>> &
T_SC,
96 const std::vector<std::shared_ptr<const cameras::CameraBase>> & cameraGeometries,
97 const std::vector<DistortionType>& distortionTypes,
105 inline void addCamera(std::shared_ptr<const okvis::kinematics::Transformation>
T_SC,
120 inline std::shared_ptr<const okvis::kinematics::Transformation>
T_SC(
size_t cameraIndex)
const;
125 inline std::shared_ptr<const cameras::CameraBase>
cameraGeometry(
size_t cameraIndex)
const;
137 inline const cv::Mat
overlap(
size_t cameraIndexSeenBy,
138 size_t cameraIndex)
const;
144 inline bool hasOverlap(
size_t cameraIndexSeenBy,
size_t cameraIndex)
const;
150 std::vector<std::shared_ptr<const okvis::kinematics::Transformation>>
T_SC_;
void reset(const std::vector< std::shared_ptr< const okvis::kinematics::Transformation >> &T_SC, const std::vector< std::shared_ptr< const cameras::CameraBase >> &cameraGeometries, const std::vector< DistortionType > &distortionTypes, bool computeOverlaps)
Reset with vector of extrinsics and geometries.
Definition: NCameraSystem.hpp:78
Use with okvis::cameras::RadialTangentialDistortion.
Definition: NCameraSystem.hpp:70
void addCamera(std::shared_ptr< const okvis::kinematics::Transformation > T_SC, std::shared_ptr< const cameras::CameraBase > cameraGeometry, DistortionType distortionType, bool computeOverlaps=true)
Append with a single camera.
Definition: NCameraSystem.hpp:102
NCameraSystem()
Default constructor.
Definition: NCameraSystem.hpp:48
Use with okvis::cameras::EquidistantDistortion.
Definition: NCameraSystem.hpp:69
void computeOverlaps()
compute all the overlaps of fields of view. Attention: can be expensive.
Definition: NCameraSystem.cpp:50
This trivially doesn't do anything in terms of distortion. This is useful for testing, or working with pre-undistorted images.
Definition: NoDistortion.hpp:54
std::vector< std::vector< bool > > overlaps_
Overlaps between cameras: binary.
Definition: NCameraSystem.hpp:154
std::shared_ptr< const okvis::kinematics::Transformation > T_SC(size_t cameraIndex) const
get the pose of the IMU frame S with respect to the camera cameraIndex
Definition: NCameraSystem.hpp:119
A class that assembles multiple cameras into a system of (potentially different) cameras.
Definition: NCameraSystem.hpp:61
std::vector< DistortionType > distortionTypes_
Definition: NCameraSystem.hpp:152
virtual ~NCameraSystem()
Destructor that doesn't do anything really.
Definition: NCameraSystem.hpp:73
#define OKVIS_DEFINE_EXCEPTION(exceptionName, exceptionParent)
Macro for defining an exception with a given parent.
Definition: assert_macros.hpp:52
std::vector< std::shared_ptr< const cameras::CameraBase > > cameraGeometries_
Camera geometries.
Definition: NCameraSystem.hpp:151
std::vector< std::vector< cv::Mat > > overlapMats_
Overlaps between cameras: mats.
Definition: NCameraSystem.hpp:153
This file contains some useful assert macros.
Use with okvis::cameras::RadialTangentialDistortion.
Definition: NCameraSystem.hpp:72
DistortionType
The enumeration of the currently supported distortion types.
Definition: NCameraSystem.hpp:68
const cv::Mat overlap(size_t cameraIndexSeenBy, size_t cameraIndex) const
Get the overlap mask. Sorry for the weird syntax, but remember that cv::Mat is essentially a shared p...
Definition: NCameraSystem.hpp:145
DistortionType distortionType(size_t cameraIndex) const
get the distortion type of the camera
Definition: NCameraSystem.hpp:137
Header file for the CameraBase class.
std::vector< std::shared_ptr< const okvis::kinematics::Transformation > > T_SC_
Mounting transformations from IMU.
Definition: NCameraSystem.hpp:150
Header implementation file for the NCameraSystem class.
bool hasOverlap(size_t cameraIndexSeenBy, size_t cameraIndex) const
Can the first camera see parts of the FOV of the second camera?
Definition: NCameraSystem.hpp:161
bool overlapComputationValid() const
Use this to check overlapMats_ and overlaps_ have correct sizes.
Definition: NCameraSystem.hpp:178
size_t numCameras() const
Obtatin the number of cameras currently added.
Definition: NCameraSystem.hpp:202
std::shared_ptr< const cameras::CameraBase > cameraGeometry(size_t cameraIndex) const
get the camera geometry of camera cameraIndex
Definition: NCameraSystem.hpp:128