Loading...
Searching...
No Matches
SimpleCamera.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/geometry/BearingRange.h>
#include <gtsam/geometry/Cal3Bundler.h>
#include <gtsam/geometry/Cal3DS2.h>
#include <gtsam/geometry/Cal3Fisheye.h>
#include <gtsam/geometry/Cal3Unified.h>
#include <gtsam/geometry/Cal3Fisheye.h>
#include <gtsam/geometry/Cal3_S2.h>
#include <gtsam/geometry/PinholeCamera.h>
namespace gtsam {
using PinholeCameraCal3_S2 = gtsam::PinholeCamera<gtsam::Cal3_S2>;
using PinholeCameraCal3Bundler = gtsam::PinholeCamera<gtsam::Cal3Bundler>;
using PinholeCameraCal3DS2 = gtsam::PinholeCamera<gtsam::Cal3DS2>;
using PinholeCameraCal3Unified = gtsam::PinholeCamera<gtsam::Cal3Unified>;
using PinholeCameraCal3Fisheye = gtsam::PinholeCamera<gtsam::Cal3Fisheye>;
#ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V42
class GTSAM_EXPORT SimpleCamera : public PinholeCameraCal3_S2 {
typedef PinholeCamera<Cal3_S2> Base;
typedef boost::shared_ptr<SimpleCamera> shared_ptr;
public:
SimpleCamera() :
Base() {
}
explicit SimpleCamera(const Pose3& pose) :
Base(pose) {
}
SimpleCamera(const Pose3& pose, const Cal3_S2& K) :
Base(pose, K) {
}
static SimpleCamera Level(const Cal3_S2 &K, const Pose2& pose2,
double height) {
return SimpleCamera(Base::LevelPose(pose2, height), K);
}
static SimpleCamera Level(const Pose2& pose2, double height) {
return SimpleCamera::Level(Cal3_S2(), pose2, height);
}
static SimpleCamera Lookat(const Point3& eye, const Point3& target,
const Point3& upVector, const Cal3_S2& K = Cal3_S2()) {
return SimpleCamera(Base::LookatPose(eye, target, upVector), K);
}
explicit SimpleCamera(const Vector &v) :
Base(v) {
}
SimpleCamera(const Vector &v, const Vector &K) :
Base(v, K) {
}
SimpleCamera::shared_ptr clone() const { return boost::make_shared<SimpleCamera>(*this); }
SimpleCamera retract(const Vector& d) const {
if ((size_t) d.size() == 6)
return SimpleCamera(this->pose().retract(d), calibration());
else
return SimpleCamera(this->pose().retract(d.head(6)),
calibration().retract(d.tail(calibration().dim())));
}
};
GTSAM_EXPORT SimpleCamera simpleCamera(const Matrix34& P);
// manifold traits
template <>
struct traits<SimpleCamera> : public internal::Manifold<SimpleCamera> {};
template <>
struct traits<const SimpleCamera> : public internal::Manifold<SimpleCamera> {};
// range traits, used in RangeFactor
template <typename T>
struct Range<SimpleCamera, T> : HasRange<SimpleCamera, T, double> {};
#endif
} // namespace gtsam
Cal3DS2.h
Calibration of a camera with radial distortion, calculations in base class Cal3DS2_Base.
Cal3_S2.h
The most common 5DOF 3D->2D calibration.
Cal3Fisheye.h
Calibration of a fisheye camera.
PinholeCamera.h
Base class for all pinhole cameras.
Cal3Bundler.h
Calibration used by Bundler.
Cal3Unified.h
Unified Calibration Model, see Mei07icra for details.
BearingRange.h
Bearing-Range product.
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::Point3
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:36
gtsam::PinholeCameraCal3_S2
gtsam::PinholeCamera< gtsam::Cal3_S2 > PinholeCameraCal3_S2
Convenient aliases for Pinhole camera classes with different calibrations.
Definition SimpleCamera.h:34
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
gtsam::internal::Manifold
Both ManifoldTraits and Testable.
Definition Manifold.h:120
gtsam::Range
Definition BearingRange.h:40
gtsam::HasRange
Definition BearingRange.h:194
gtsam::Cal3_S2
The most common 5DOF 3D->2D calibration.
Definition Cal3_S2.h:34
gtsam::PinholeCamera
A pinhole camera class that has a Pose3 and a Calibration.
Definition PinholeCamera.h:33
gtsam::Pose2
A 2D pose (Point2,Rot2).
Definition Pose2.h:36
gtsam::Pose3
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:37