Skip to content

Commit

Permalink
Removed unified camera model. Compiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
VladyslavUsenko committed Jul 24, 2018
1 parent d4b7868 commit 0b8b9e8
Show file tree
Hide file tree
Showing 18 changed files with 115 additions and 227 deletions.
1 change: 0 additions & 1 deletion aslam_cv/aslam_cameras/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ if(CATKIN_ENABLE_TESTING)
test/test_main.cpp
test/PinholeCameraGeometry.cpp
test/OmniCameraGeometry.cpp
test/UnifiedCameraGeometry.cpp
test/ExtendedUnifiedCameraGeometry.cpp
test/DoubleSphereCameraGeometry.cpp
test/RadialTangentialDistortion.cpp
Expand Down
2 changes: 0 additions & 2 deletions aslam_cv/aslam_cameras/include/aslam/cameras.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// Projection models
#include <aslam/cameras/PinholeProjection.hpp>
#include <aslam/cameras/OmniProjection.hpp>
#include <aslam/cameras/UnifiedProjection.hpp>
#include <aslam/cameras/ExtendedUnifiedProjection.hpp>
#include <aslam/cameras/DoubleSphereProjection.hpp>
#include <aslam/cameras/DepthProjection.hpp>
Expand Down Expand Up @@ -45,7 +44,6 @@ typedef CameraGeometry<OmniProjection<EquidistantDistortion>, GlobalShutter,
typedef CameraGeometry<OmniProjection<FovDistortion>, GlobalShutter,
NoMask> FovDistortedOmniCameraGeometry;

typedef CameraGeometry<UnifiedProjection<NoDistortion>, GlobalShutter, NoMask> UnifiedCameraGeometry;
typedef CameraGeometry<ExtendedUnifiedProjection<NoDistortion>, GlobalShutter, NoMask> ExtendedUnifiedCameraGeometry;
typedef CameraGeometry<DoubleSphereProjection<NoDistortion>, GlobalShutter, NoMask> DoubleSphereCameraGeometry;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef ASLAM_CAMERAS_DOUBLE_SPHERE_PROJECTION_HPP
#define ASLAM_CAMERAS_DOUBLE_SPHERE_PROJECTION_HPP
#ifndef ASLAM_CAMERAS_EXTENDED_UNIFIED_PROJECTION_HPP
#define ASLAM_CAMERAS_EXTENDED_UNIFIED_PROJECTION_HPP

#include "StaticAssert.hpp"
#include "FiniteDifferences.hpp"
Expand All @@ -16,7 +16,7 @@ namespace aslam {
namespace cameras {

template<typename DISTORTION_T>
class DoubleSphereProjection {
class ExtendedUnifiedProjection {
public:

enum {
Expand All @@ -34,20 +34,20 @@ class DoubleSphereProjection {
typedef Eigen::Matrix<double, KeypointDimension, IntrinsicsDimension> jacobian_intrinsics_t;

/// \brief Default constructor
DoubleSphereProjection();
ExtendedUnifiedProjection();

DoubleSphereProjection(double xi1, double xi2, double focalLengthU, double focalLengthV,
ExtendedUnifiedProjection(double xi1, double xi2, double focalLengthU, double focalLengthV,
double imageCenterU, double imageCenterV, int resolutionU,
int resolutionV, distortion_t distortion);

DoubleSphereProjection(double xi1, double xi2, double focalLengthU, double focalLengthV,
ExtendedUnifiedProjection(double xi1, double xi2, double focalLengthU, double focalLengthV,
double imageCenterU, double imageCenterV, int resolutionU,
int resolutionV);

DoubleSphereProjection(const sm::PropertyTree & config);
ExtendedUnifiedProjection(const sm::PropertyTree & config);

/// \brief destructor.
virtual ~DoubleSphereProjection();
virtual ~ExtendedUnifiedProjection();

/// \brief resize the intrinsics based on a scaling of the image.
void resizeIntrinsics(double scale);
Expand Down Expand Up @@ -191,11 +191,11 @@ class DoubleSphereProjection {
;

/// \brief the xi1 parameter that controls the spherical projection.
double xi1() const {
return _xi1;
double alpha() const {
return _alpha;
} /// \brief the xi2 parameter that controls the spherical projection.
double xi2() const {
return _xi2;
double beta() const {
return _beta;
}
/// \brief The horizontal focal length in pixels.
double fu() const {
Expand Down Expand Up @@ -247,17 +247,17 @@ class DoubleSphereProjection {
return KeypointDimension;
}

bool isBinaryEqual(const DoubleSphereProjection<distortion_t> & rhs) const;
bool isBinaryEqual(const ExtendedUnifiedProjection<distortion_t> & rhs) const;

static DoubleSphereProjection<distortion_t> getTestProjection();
static ExtendedUnifiedProjection<distortion_t> getTestProjection();
private:

// FIXME @demmeln: rename xi1 and xi2 to xi and alpha

/// \brief the xi1 parameter that controls the spherical projection.
double _xi1;
double _alpha;
/// \brief the xi2 parameter that controls the spherical projection.
double _xi2;
double _beta;
/// \brief The horizontal focal length in pixels.
double _fu;
/// \brief The vertical focal length in pixels.
Expand Down Expand Up @@ -287,8 +287,8 @@ class DoubleSphereProjection {
} // namespace cameras
} // namespace aslam

#include "implementation/DoubleSphereProjection.hpp"
#include "implementation/ExtendedUnifiedProjection.hpp"

SM_BOOST_CLASS_VERSION_T1 (aslam::cameras::DoubleSphereProjection);
SM_BOOST_CLASS_VERSION_T1 (aslam::cameras::ExtendedUnifiedProjection);

#endif /* ASLAM_CAMERAS_DOUBLE_SPHERE_PROJECTION_HPP */
#endif /* ASLAM_CAMERAS_EXTENDED_UNIFIED_PROJECTION_HPP */
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

#include <aslam/cameras/OmniProjection.hpp>
#include <aslam/cameras/DoubleSphereProjection.hpp>
#include <aslam/cameras/NoDistortion.hpp>

namespace aslam {

Expand All @@ -20,7 +21,7 @@ DoubleSphereProjection<DISTORTION_T>::DoubleSphereProjection()

// NOTE @demmeln 2018-05-07: In order to use this with distortion, you need to add the proper calls for projection
// and unprojection, including for Jacobian computation.
EIGEN_STATIC_ASSERT_SAME_TYPE(T, NoDistortion, "Currently only implemented for 'NoDistortion'");
EIGEN_STATIC_ASSERT_SAME_TYPE(DISTORTION_T, NoDistortion, "Currently only implemented for 'NoDistortion'");

updateTemporaries();

Expand Down
Loading

0 comments on commit 0b8b9e8

Please sign in to comment.