Skip to content

Commit

Permalink
Merge pull request #65 from othlu/feature/rs-calibration
Browse files Browse the repository at this point in the history
Rolling Shutter Camera calibration
  • Loading branch information
rehderj authored Aug 25, 2016
2 parents 5a68b63 + 1e857b4 commit a9d5b0e
Show file tree
Hide file tree
Showing 58 changed files with 2,247 additions and 1,459 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Kalibr is a toolbox that solves the following calibration problems:
intrinsic and extrinsic calibration of a camera-systems with non-globally shared overlapping fields of view
1. **Camera-IMU calibration**:
spatial and temporal calibration of an IMU w.r.t a camera-system
1. **Rolling Shutter Camera calibration**:
full intrinsic calibration (projection, distortion and shutter parameters) of rolling shutter cameras


**Please find more information on the [wiki pages](https://github.com/ethz-asl/kalibr/wiki) of this repository.**

Expand All @@ -17,13 +20,15 @@ Kalibr is a toolbox that solves the following calibration problems:
* Jérôme Maye ([email](jerome.maye@mavt.ethz.ch))
* Jörn Rehder ([email](joern.rehder@mavt.ethz.ch))
* Thomas Schneider ([email](schneith@ethz.ch))
* Luc Oth

## References
The calibration approaches used in Kalibr are based on the following papers. Please cite the appropriate papers when using this toolbox or parts of it in an academic publication.

1. <a name="paul1"></a>Paul Furgale, Joern Rehder, Roland Siegwart (2013). Unified Temporal and Spatial Calibration for Multi-Sensor Systems. In Proceedings of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), Tokyo, Japan.
1. <a name="paul2"></a>Paul Furgale, T D Barfoot, G Sibley (2012). Continuous-Time Batch Estimation Using Temporal Basis Functions. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), pp. 2088–2095, St. Paul, MN.
1. <a name="jmaye"></a> J. Maye, P. Furgale, R. Siegwart (2013). Self-supervised Calibration for Robotic Systems, In Proc. of the IEEE Intelligent Vehicles Symposium (IVS)
1. <a name="othlu"></a>L. Oth, P. Furgale, L. Kneip, R. Siegwart (2013). Rolling Shutter Camera Calibration, In Proc. of the IEEE Computer Vision and Pattern Recognition (CVPR)

## Acknowledgments
This work is supported in part by the European Community's Seventh Framework Programme (FP7/2007-2013) under grants #269916 (V-Charge), and #610603 (EUROPA2).
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef PORTABLE_BINARY_ARCHIVE_HPP
#define PORTABLE_BINARY_ARCHIVE_HPP

// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -13,7 +13,13 @@

#include <boost/config.hpp>
#include <boost/cstdint.hpp>

// breaking changes in boost >=1.59
#if BOOST_VERSION >= 105900
#else
#include <boost/serialization/pfto.hpp>
#endif

#include <boost/static_assert.hpp>

#include <climits>
Expand Down Expand Up @@ -47,7 +53,6 @@ reverse_bytes(char size, char *address){
}
}


} // namespace archive
} // namespace boost

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// portable_binary_iarchive.hpp

// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002-7 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -28,26 +28,28 @@
#include <boost/archive/basic_binary_iprimitive.hpp>
#include <boost/archive/detail/common_iarchive.hpp>
#include <boost/version.hpp>

#if BOOST_VERSION >= 105600 // see changes in https://github.com/boostorg/serialization/commit/75f09afc895ab09c4eb55d36fcf6f91ef4a0107a
#include <boost/serialization/shared_ptr.hpp>
#else
#include <boost/archive/shared_ptr_helper.hpp>
#endif

#include <boost/archive/detail/register_archive.hpp>
#include "portable_binary_archive.hpp"

namespace boost {
namespace archive {

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// exception to be thrown if integer read from archive doesn't fit
// variable being loaded
class portable_binary_iarchive_exception :
class portable_binary_iarchive_exception :
public virtual boost::archive::archive_exception
{
public:
typedef enum {
incompatible_integer_size
incompatible_integer_size
} exception_code;
portable_binary_iarchive_exception(exception_code /* c */ ) :
boost::archive::archive_exception(boost::archive::archive_exception::other_exception)
Expand All @@ -73,13 +75,13 @@ class portable_binary_iarchive_exception :
};

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// "Portable" input binary archive. It addresses integer size and endienness so
// "Portable" input binary archive. It addresses integer size and endienness so
// that binary archives can be passed across systems. Note:floating point types
// not addressed here
class portable_binary_iarchive :
public boost::archive::basic_binary_iprimitive<
portable_binary_iarchive,
std::istream::char_type,
std::istream::char_type,
std::istream::traits_type
>,
public boost::archive::detail::common_iarchive<
Expand All @@ -93,7 +95,7 @@ class portable_binary_iarchive :
{
typedef boost::archive::basic_binary_iprimitive<
portable_binary_iarchive,
std::istream::char_type,
std::istream::char_type,
std::istream::traits_type
> primitive_base_t;
typedef boost::archive::detail::common_iarchive<
Expand Down Expand Up @@ -165,26 +167,34 @@ class portable_binary_iarchive :
this->primitive_base_t::load(t);
}
// intermediate level to support override of operators
// fot templates in the absence of partial function
// fot templates in the absence of partial function
// template ordering
typedef boost::archive::detail::common_iarchive<portable_binary_iarchive>
typedef boost::archive::detail::common_iarchive<portable_binary_iarchive>
detail_common_iarchive;
template<class T>

// breaking changes in boost >=1.59
#if BOOST_VERSION >= 105900
void load_override(T & t){
this->detail_common_iarchive::load_override(t);
}
void load_override(boost::archive::class_name_type & t);
void load_override(boost::archive::class_id_optional_type & /* t */){}
#else
void load_override(T & t, BOOST_PFTO int){
this->detail_common_iarchive::load_override(t, 0);
}
void load_override(boost::archive::class_name_type & t, int);
// binary files don't include the optional information
void load_override(
boost::archive::class_id_optional_type & /* t */,
int
){}
// binary files don't include the optional information
void load_override(boost::archive::class_id_optional_type & /* t */, int){}
#endif


void init(unsigned int flags);
public:
portable_binary_iarchive(std::istream & is, unsigned flags = 0) :
primitive_base_t(
* is.rdbuf(),
* is.rdbuf(),
0 != (flags & boost::archive::no_codecvt)
),
archive_base_t(flags),
Expand All @@ -195,13 +205,13 @@ class portable_binary_iarchive :

portable_binary_iarchive(
std::basic_streambuf<
std::istream::char_type,
std::istream::char_type,
std::istream::traits_type
> & bsb,
> & bsb,
unsigned int flags
) :
primitive_base_t(
bsb,
bsb,
0 != (flags & boost::archive::no_codecvt)
),
archive_base_t(flags),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// portable_binary_oarchive.hpp

// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -32,16 +32,16 @@

namespace boost {
namespace archive {

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// exception to be thrown if integer read from archive doesn't fit
// variable being loaded
class portable_binary_oarchive_exception :
class portable_binary_oarchive_exception :
public virtual boost::archive::archive_exception
{
public:
typedef enum {
invalid_flags
invalid_flags
} exception_code;
portable_binary_oarchive_exception(exception_code /* c */ )
{}
Expand All @@ -61,14 +61,14 @@ class portable_binary_oarchive_exception :
};

/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// "Portable" output binary archive. This is a variation of the native binary
// "Portable" output binary archive. This is a variation of the native binary
// archive. it addresses integer size and endienness so that binary archives can
// be passed across systems. Note:floating point types not addressed here

class portable_binary_oarchive :
public boost::archive::basic_binary_oprimitive<
portable_binary_oarchive,
std::ostream::char_type,
std::ostream::char_type,
std::ostream::traits_type
>,
public boost::archive::detail::common_oarchive<
Expand All @@ -77,7 +77,7 @@ class portable_binary_oarchive :
{
typedef boost::archive::basic_binary_oprimitive<
portable_binary_oarchive,
std::ostream::char_type,
std::ostream::char_type,
std::ostream::traits_type
> primitive_base_t;
typedef boost::archive::detail::common_oarchive<
Expand Down Expand Up @@ -133,9 +133,22 @@ class portable_binary_oarchive :

// default processing - kick back to base class. Note the
// extra stuff to get it passed borland compilers
typedef boost::archive::detail::common_oarchive<portable_binary_oarchive>
typedef boost::archive::detail::common_oarchive<portable_binary_oarchive>
detail_common_oarchive;
template<class T>
// breaking changes in boost >=1.59
#if BOOST_VERSION >= 105900
void save_override(T & t){
this->detail_common_oarchive::save_override(t);
}
// explicitly convert to char * to avoid compile ambiguities
void save_override(const boost::archive::class_name_type & t){
const std::string s(t);
* this << s;
}
// binary files don't include the optional information
void save_override(const boost::archive::class_id_optional_type & /* t */){}
#else
void save_override(T & t, BOOST_PFTO int){
this->detail_common_oarchive::save_override(t, 0);
}
Expand All @@ -144,11 +157,9 @@ class portable_binary_oarchive :
const std::string s(t);
* this << s;
}
// binary files don't include the optional information
void save_override(
const boost::archive::class_id_optional_type & /* t */,
int
){}
// binary files don't include the optional information
void save_override(const boost::archive::class_id_optional_type & /* t */, int){}
#endif

void init(unsigned int flags);
public:
Expand All @@ -165,13 +176,13 @@ class portable_binary_oarchive :

portable_binary_oarchive(
std::basic_streambuf<
std::ostream::char_type,
std::ostream::char_type,
std::ostream::traits_type
> & bsb,
> & bsb,
unsigned int flags
) :
primitive_base_t(
bsb,
bsb,
0 != (flags & boost::archive::no_codecvt)
),
archive_base_t(flags),
Expand Down
24 changes: 17 additions & 7 deletions Schweizer-Messer/sm_boost/src/portable_binary_iarchive.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
// portable_binary_iarchive.cpp

// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
// Use, modification and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -19,7 +19,7 @@
namespace boost {
namespace archive {

void
void
portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
char size;
l = 0;
Expand Down Expand Up @@ -50,18 +50,28 @@ portable_binary_iarchive::load_impl(boost::intmax_t & l, char maxsize){
if(m_flags & endian_big)
#endif
reverse_bytes(size, cptr);

if(negative)
l = -l;
}

void
portable_binary_iarchive::load_override(
boost::archive::class_name_type & t, int
boost::archive::class_name_type & t
// breaking changes in boost >=1.59
#if BOOST_VERSION >= 105900
#else
, int
#endif
){
std::string cn;
cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE);
// breaking changes in boost >=1.59
#if BOOST_VERSION >= 105900
load_override(cn);
#else
load_override(cn, 0);
#endif
if(cn.size() > (BOOST_SERIALIZATION_MAX_KEY_SIZE - 1))
boost::serialization::throw_exception(
boost::archive::archive_exception(
Expand All @@ -72,7 +82,7 @@ portable_binary_iarchive::load_override(
t.t[cn.size()] = '\0';
}

void
void
portable_binary_iarchive::init(unsigned int flags){
if(0 == (flags & boost::archive::no_header)){
// read signature in an archive version independent manner
Expand All @@ -96,7 +106,7 @@ portable_binary_iarchive::init(unsigned int flags){
boost::archive::archive_exception::unsupported_version
)
);

#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3205))
this->set_library_version(input_library_version);
//#else
Expand Down Expand Up @@ -127,7 +137,7 @@ namespace detail {

template class basic_binary_iprimitive<
portable_binary_iarchive,
std::istream::char_type,
std::istream::char_type,
std::istream::traits_type
> ;

Expand Down
Loading

0 comments on commit a9d5b0e

Please sign in to comment.