53 const std::vector<std::shared_ptr<const okvis::kinematics::Transformation>> & T_SC,
54 const std::vector<std::shared_ptr<const cameras::CameraBase>> & cameraGeometries,
55 const std::vector<DistortionType>& distortionTypes,
58 cameraGeometries_(cameraGeometries),
59 distortionTypes_(distortionTypes)
63 Exception,
T_SC.size() == cameraGeometries.size(),
64 "Number of extrinsics must match number of camera models!");
66 Exception,
T_SC.size() == distortionTypes.size(),
67 "Number of distortiontypes must match number of extrinsics!");
69 if (computeOverlaps) {
79 const std::vector<std::shared_ptr<const okvis::kinematics::Transformation>> & T_SC,
80 const std::vector<std::shared_ptr<const cameras::CameraBase>> & cameraGeometries,
81 const std::vector<DistortionType>& distortionTypes,
85 Exception,
T_SC.size() == cameraGeometries.size(),
86 "Number of extrinsics must match number of camera models!");
88 Exception,
T_SC.size() == distortionTypes.size(),
89 "Number of distortiontypes must match number of extrinsics!");
96 if (computeOverlaps) {
103 std::shared_ptr<const okvis::kinematics::Transformation> T_SC,
104 std::shared_ptr<const cameras::CameraBase> cameraGeometry,
106 bool computeOverlaps)
108 T_SC_.push_back(T_SC);
113 if (computeOverlaps) {
120 size_t cameraIndex)
const
123 "Camera index " << cameraIndex <<
"out of range.");
124 return T_SC_[cameraIndex];
129 size_t cameraIndex)
const
132 "Camera index " << cameraIndex <<
"out of range.");
140 "Camera index " << cameraIndex <<
"out of range.");
146 size_t cameraIndex)
const
149 Exception, cameraIndexSeenBy <
T_SC_.size(),
150 "Camera index " << cameraIndexSeenBy <<
"out of range.");
152 "Camera index " << cameraIndex <<
"out of range.");
155 "Overlap computation not performed or incorrectly computed!");
162 size_t cameraIndex)
const
165 Exception, cameraIndexSeenBy <
T_SC_.size(),
166 "Camera index " << cameraIndexSeenBy <<
"out of range.");
168 "Camera index " << cameraIndex <<
"out of range.");
170 "Camera index " << cameraIndex <<
"out of range.");
173 "Overlap computation not performed or incorrectly computed!");
175 return overlaps_[cameraIndexSeenBy][cameraIndex];
181 "Number of extrinsics must match number of camera models!");
191 for(
size_t i= 0; i<
overlaps_.size(); ++i){
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
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
void computeOverlaps()
compute all the overlaps of fields of view. Attention: can be expensive.
Definition: NCameraSystem.cpp:50
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
std::vector< DistortionType > distortionTypes_
Definition: NCameraSystem.hpp:152
virtual ~NCameraSystem()
Destructor that doesn't do anything really.
Definition: NCameraSystem.hpp:73
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
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
std::vector< std::shared_ptr< const okvis::kinematics::Transformation > > T_SC_
Mounting transformations from IMU.
Definition: NCameraSystem.hpp:150
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
#define OKVIS_ASSERT_TRUE_DBG(exceptionType, condition, message)
Definition: assert_macros.hpp:211
std::shared_ptr< const cameras::CameraBase > cameraGeometry(size_t cameraIndex) const
get the camera geometry of camera cameraIndex
Definition: NCameraSystem.hpp:128