Skip to content

Commit

Permalink
changed memory allocation in matcher (uzh-rpg#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfo committed Jul 7, 2014
1 parent b4696fd commit 2eabd6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
8 changes: 4 additions & 4 deletions svo/include/svo/matcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class Matcher
{}
} options_;

uint8_t* patch_;
uint8_t* patch_with_border_;
uint8_t patch_[patch_size_*patch_size_] __attribute__ ((aligned (16)));
uint8_t patch_with_border_[(patch_size_+2)*(patch_size_+2)] __attribute__ ((aligned (16)));
Matrix2d A_cur_ref_; //!< affine warp matrix
Vector2d epi_dir_;
double epi_length_; //!< length of epipolar line segment in pixels (only used for epipolar search)
Expand All @@ -102,8 +102,8 @@ class Matcher
Feature* ref_ftr_;
Vector2d px_cur_;

Matcher();
~Matcher();
Matcher() = default;
~Matcher() = default;

/// Find a match by directly applying subpix refinement.
/// IMPORTANT! This function assumes that px_cur is already set to an estimate that is within ~2-3 pixel of the final result!
Expand Down
14 changes: 0 additions & 14 deletions svo/src/matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <vikit/abstract_camera.h>
#include <vikit/vision.h>
#include <vikit/math_utils.h>
#include <vikit/aligned_mem.h>
#include <vikit/patch_score.h>
#include <svo/matcher.h>
#include <svo/frame.h>
Expand Down Expand Up @@ -107,19 +106,6 @@ void warpAffine(

} // namespace warp


Matcher::Matcher()
{
patch_ = vk::aligned_mem::aligned_alloc<uint8_t>(patch_size_*patch_size_, 16);
patch_with_border_ = vk::aligned_mem::aligned_alloc<uint8_t>((patch_size_+2)*(patch_size_+2), 16);
}

Matcher::~Matcher()
{
free(patch_);
free(patch_with_border_);
}

bool depthFromTriangulation(
const SE3& T_search_ref,
const Vector3d& f_ref,
Expand Down

0 comments on commit 2eabd6d

Please sign in to comment.