svo
Semi-Direct Visual Odometry
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
svo::DepthFilter Class Reference

Depth filter implements the Bayesian Update proposed in: "Video-based, Real-Time Multi View Stereo" by G. More...

#include <depth_filter.h>

List of all members.

Classes

struct  Options
 Depth-filter config parameters. More...

Public Types

typedef boost::function< void(Point
*, double) 
callback_t )

Public Member Functions

 DepthFilter (feature_detection::DetectorPtr feature_detector, callback_t seed_converged_cb)
virtual ~DepthFilter ()
void startThread ()
 Start this thread when seed updating should be in a parallel thread.
void stopThread ()
 Stop the parallel thread that is running.
void addFrame (FramePtr frame)
 Add frame to the queue to be processed.
void addKeyframe (FramePtr frame, double depth_mean, double depth_min)
 Add new keyframe to the queue.
void removeKeyframe (FramePtr frame)
 Remove all seeds which are initialized from the specified keyframe.
void reset ()
 If the map is reset, call this function such that we don't have pointers to old frames.
void getSeedsCopy (const FramePtr &frame, std::list< Seed > &seeds)
 Returns a copy of the seeds belonging to frame.
std::list< Seed,
aligned_allocator< Seed > > & 
getSeeds ()
 Return a reference to the seeds. This is NOT THREAD SAFE!

Static Public Member Functions

static void updateSeed (const float x, const float tau2, Seed *seed)
 Bayes update of the seed, x is the measurement, tau2 the measurement uncertainty.
static double computeTau (const SE3 &T_ref_cur, const Vector3d &f, const double z, const double px_error_angle)
 Compute the uncertainty of the measurement.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW
typedef boost::unique_lock
< boost::mutex > 
lock_t
struct svo::DepthFilter::Options options_

Protected Member Functions

void initializeSeeds (FramePtr frame)
 Initialize new seeds from a frame.
virtual void updateSeeds (FramePtr frame)
 Update all seeds with a new measurement frame.
void clearFrameQueue ()
 When a new keyframe arrives, the frame queue should be cleared.
void updateSeedsLoop ()
 A thread that is continuously updating the seeds.

Protected Attributes

feature_detection::DetectorPtr feature_detector_
callback_t seed_converged_cb_
std::list< Seed,
aligned_allocator< Seed > > 
seeds_
boost::mutex seeds_mut_
bool seeds_updating_halt_
 Set this value to true when seeds updating should be interrupted.
boost::thread * thread_
std::queue< FramePtrframe_queue_
boost::mutex frame_queue_mut_
boost::condition_variable frame_queue_cond_
FramePtr new_keyframe_
 Next keyframe to extract new seeds.
bool new_keyframe_set_
 Do we have a new keyframe to process?.
double new_keyframe_min_depth_
 Minimum depth in the new keyframe. Used for range in new seeds.
double new_keyframe_mean_depth_
 Maximum depth in the new keyframe. Used for range in new seeds.
vk::PerformanceMonitor permon_
 Separate performance monitor since the DepthFilter runs in a parallel thread.
Matcher matcher_

Detailed Description

Depth filter implements the Bayesian Update proposed in: "Video-based, Real-Time Multi View Stereo" by G.

Vogiatzis and C. Hernández. In Image and Vision Computing, 29(7):434-441, 2011.

The class uses a callback mechanism such that it can be used also by other algorithms than nslam and for simplified testing.


Member Typedef Documentation

typedef boost::function<void ( Point*, double ) svo::DepthFilter::callback_t)

Constructor & Destructor Documentation

svo::DepthFilter::DepthFilter ( feature_detection::DetectorPtr  feature_detector,
callback_t  seed_converged_cb 
)
virtual svo::DepthFilter::~DepthFilter ( ) [virtual]

Member Function Documentation

Add frame to the queue to be processed.

void svo::DepthFilter::addKeyframe ( FramePtr  frame,
double  depth_mean,
double  depth_min 
)

Add new keyframe to the queue.

void svo::DepthFilter::clearFrameQueue ( ) [protected]

When a new keyframe arrives, the frame queue should be cleared.

static double svo::DepthFilter::computeTau ( const SE3 &  T_ref_cur,
const Vector3d &  f,
const double  z,
const double  px_error_angle 
) [static]

Compute the uncertainty of the measurement.

std::list<Seed, aligned_allocator<Seed> >& svo::DepthFilter::getSeeds ( ) [inline]

Return a reference to the seeds. This is NOT THREAD SAFE!

void svo::DepthFilter::getSeedsCopy ( const FramePtr frame,
std::list< Seed > &  seeds 
)

Returns a copy of the seeds belonging to frame.

Thread-safe. Can be used to compute the Next-Best-View in parallel. IMPORTANT! Make sure you hold a valid reference counting pointer to frame so it is not being deleted while you use it.

void svo::DepthFilter::initializeSeeds ( FramePtr  frame) [protected]

Initialize new seeds from a frame.

Remove all seeds which are initialized from the specified keyframe.

This function is used to make sure that no seeds points to a non-existent frame when a frame is removed from the map.

If the map is reset, call this function such that we don't have pointers to old frames.

Start this thread when seed updating should be in a parallel thread.

Stop the parallel thread that is running.

static void svo::DepthFilter::updateSeed ( const float  x,
const float  tau2,
Seed seed 
) [static]

Bayes update of the seed, x is the measurement, tau2 the measurement uncertainty.

virtual void svo::DepthFilter::updateSeeds ( FramePtr  frame) [protected, virtual]

Update all seeds with a new measurement frame.

void svo::DepthFilter::updateSeedsLoop ( ) [protected]

A thread that is continuously updating the seeds.


Member Data Documentation

std::queue<FramePtr> svo::DepthFilter::frame_queue_ [protected]
boost::condition_variable svo::DepthFilter::frame_queue_cond_ [protected]
boost::mutex svo::DepthFilter::frame_queue_mut_ [protected]
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef boost::unique_lock<boost::mutex> svo::DepthFilter::lock_t

Next keyframe to extract new seeds.

Maximum depth in the new keyframe. Used for range in new seeds.

Minimum depth in the new keyframe. Used for range in new seeds.

Do we have a new keyframe to process?.

vk::PerformanceMonitor svo::DepthFilter::permon_ [protected]

Separate performance monitor since the DepthFilter runs in a parallel thread.

std::list<Seed, aligned_allocator<Seed> > svo::DepthFilter::seeds_ [protected]
boost::mutex svo::DepthFilter::seeds_mut_ [protected]

Set this value to true when seeds updating should be interrupted.

boost::thread* svo::DepthFilter::thread_ [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines