// get scores - attention, this is in layer coordinates, not scale=1 coordinates!
inline uint8_t
- getAgastScore(int x, int y, uint8_t threshold);
+ getAgastScore(int x, int y, uint8_t threshold) const;
inline uint8_t
- getAgastScore_5_8(int x, int y, uint8_t threshold);
+ getAgastScore_5_8(int x, int y, uint8_t threshold) const;
inline uint8_t
- getAgastScore(float xf, float yf, uint8_t threshold, float scale = 1.0f);
+ getAgastScore(float xf, float yf, uint8_t threshold, float scale = 1.0f) const;
// accessors
inline const cv::Mat&
private:
// access gray values (smoothed/interpolated)
- __inline__ uint8_t
- value(const cv::Mat& mat, float xf, float yf, float scale);
+ inline uint8_t
+ value(const cv::Mat& mat, float xf, float yf, float scale) const;
// the image
cv::Mat img_;
// its Fast scores
// get Keypoints
void
- getKeypoints(const uint8_t _threshold, std::vector<cv::KeyPoint>& keypoints);
+ getKeypoints(const uint8_t _threshold, std::vector<cv::KeyPoint>& keypoints);
protected:
// nonmax suppression:
- __inline__ bool
+ inline bool
isMax2D(const uint8_t layer, const int x_layer, const int y_layer);
// 1D (scale axis) refinement:
- __inline__ float
- refine1D(const float s_05, const float s0, const float s05, float& max); // around octave
- __inline__ float
- refine1D_1(const float s_05, const float s0, const float s05, float& max); // around intra
- __inline__ float
- refine1D_2(const float s_05, const float s0, const float s05, float& max); // around octave 0 only
+ inline float
+ refine1D(const float s_05, const float s0, const float s05, float& max) const; // around octave
+ inline float
+ refine1D_1(const float s_05, const float s0, const float s05, float& max) const; // around intra
+ inline float
+ refine1D_2(const float s_05, const float s0, const float s05, float& max) const; // around octave 0 only
// 2D maximum refinement:
- __inline__ float
+ inline float
subpixel2D(const int s_0_0, const int s_0_1, const int s_0_2, const int s_1_0, const int s_1_1, const int s_1_2,
- const int s_2_0, const int s_2_1, const int s_2_2, float& delta_x, float& delta_y);
+ const int s_2_0, const int s_2_1, const int s_2_2, float& delta_x, float& delta_y) const;
// 3D maximum refinement centered around (x_layer,y_layer)
- __inline__ float
- refine3D(const uint8_t layer, const int x_layer, const int y_layer, float& x, float& y, float& scale, bool& ismax);
+ inline float
+ refine3D(const uint8_t layer, const int x_layer, const int y_layer, float& x, float& y, float& scale, bool& ismax) const;
// interpolated score access with recalculation when needed:
- __inline__ int
- getScoreAbove(const uint8_t layer, const int x_layer, const int y_layer);
- __inline__ int
- getScoreBelow(const uint8_t layer, const int x_layer, const int y_layer);
+ inline int
+ getScoreAbove(const uint8_t layer, const int x_layer, const int y_layer) const;
+ inline int
+ getScoreBelow(const uint8_t layer, const int x_layer, const int y_layer) const;
// return the maximum of score patches above or below
- __inline__ float
+ inline float
getScoreMaxAbove(const uint8_t layer, const int x_layer, const int y_layer, const int threshold, bool& ismax,
- float& dx, float& dy);
- __inline__ float
+ float& dx, float& dy) const;
+ inline float
getScoreMaxBelow(const uint8_t layer, const int x_layer, const int y_layer, const int threshold, bool& ismax,
- float& dx, float& dy);
+ float& dx, float& dy) const;
// the image pyramids:
uint8_t layers_;
}
// simple alternative:
-__inline__ int
+inline int
BRISK::smoothedIntensity(const cv::Mat& image, const cv::Mat& integral, const float key_x,
const float key_y, const unsigned int scale, const unsigned int rot,
const unsigned int point) const
}
// clean-up
- _integral.release();
delete[] _values;
}
}
// interpolated score access with recalculation when needed:
-__inline__ int
-BriskScaleSpace::getScoreAbove(const uint8_t layer, const int x_layer, const int y_layer)
+inline int
+BriskScaleSpace::getScoreAbove(const uint8_t layer, const int x_layer, const int y_layer) const
{
assert(layer<layers_-1);
- BriskLayer& l = pyramid_[layer + 1];
+ const BriskLayer& l = pyramid_[layer + 1];
if (layer % 2 == 0)
{ // octave
const int sixths_x = 4 * x_layer - 1;
return score;
}
}
-__inline__ int
-BriskScaleSpace::getScoreBelow(const uint8_t layer, const int x_layer, const int y_layer)
+inline int
+BriskScaleSpace::getScoreBelow(const uint8_t layer, const int x_layer, const int y_layer) const
{
assert(layer);
- BriskLayer& l = pyramid_[layer - 1];
+ const BriskLayer& l = pyramid_[layer - 1];
int sixth_x;
int quarter_x;
float xf;
return ((ret_val + scaling2 / 2) / scaling2);
}
-__inline__ bool
+inline bool
BriskScaleSpace::isMax2D(const uint8_t layer, const int x_layer, const int y_layer)
{
const cv::Mat& scores = pyramid_[layer].scores();
}
// 3D maximum refinement centered around (x_layer,y_layer)
-__inline__ float
+inline float
BriskScaleSpace::refine3D(const uint8_t layer, const int x_layer, const int y_layer, float& x, float& y, float& scale,
- bool& ismax)
+ bool& ismax) const
{
ismax = true;
- BriskLayer& thisLayer = pyramid_[layer];
+ const BriskLayer& thisLayer = pyramid_[layer];
const int center = thisLayer.getAgastScore(x_layer, y_layer, 1);
// check and get above maximum:
if (layer == 0)
{
// guess the lower intra octave...
- BriskLayer& l = pyramid_[0];
+ const BriskLayer& l = pyramid_[0];
register int s_0_0 = l.getAgastScore_5_8(x_layer - 1, y_layer - 1, 1);
max_below_uchar = s_0_0;
register int s_1_0 = l.getAgastScore_5_8(x_layer, y_layer - 1, 1);
}
// return the maximum of score patches above or below
-__inline__ float
+inline float
BriskScaleSpace::getScoreMaxAbove(const uint8_t layer, const int x_layer, const int y_layer, const int threshold,
- bool& ismax, float& dx, float& dy)
+ bool& ismax, float& dx, float& dy) const
{
ismax = false;
// the layer above
assert(layer+1<layers_);
- BriskLayer& layerAbove = pyramid_[layer + 1];
+ const BriskLayer& layerAbove = pyramid_[layer + 1];
if (layer % 2 == 0)
{
return max;
}
-__inline__ float
+inline float
BriskScaleSpace::getScoreMaxBelow(const uint8_t layer, const int x_layer, const int y_layer, const int threshold,
- bool& ismax, float& dx, float& dy)
+ bool& ismax, float& dx, float& dy) const
{
ismax = false;
// the layer below
assert(layer>0);
- BriskLayer& layerBelow = pyramid_[layer - 1];
+ const BriskLayer& layerBelow = pyramid_[layer - 1];
// check the first row
int max_x = x_1 + 1;
return max;
}
-__inline__ float
-BriskScaleSpace::refine1D(const float s_05, const float s0, const float s05, float& max)
+inline float
+BriskScaleSpace::refine1D(const float s_05, const float s0, const float s05, float& max) const
{
int i_05 = int(1024.0 * s_05 + 0.5);
int i0 = int(1024.0 * s0 + 0.5);
return ret_val;
}
-__inline__ float
-BriskScaleSpace::refine1D_1(const float s_05, const float s0, const float s05, float& max)
+inline float
+BriskScaleSpace::refine1D_1(const float s_05, const float s0, const float s05, float& max) const
{
int i_05 = int(1024.0 * s_05 + 0.5);
int i0 = int(1024.0 * s0 + 0.5);
return ret_val;
}
-__inline__ float
-BriskScaleSpace::refine1D_2(const float s_05, const float s0, const float s05, float& max)
+inline float
+BriskScaleSpace::refine1D_2(const float s_05, const float s0, const float s05, float& max) const
{
int i_05 = int(1024.0 * s_05 + 0.5);
int i0 = int(1024.0 * s0 + 0.5);
return ret_val;
}
-__inline__ float
+inline float
BriskScaleSpace::subpixel2D(const int s_0_0, const int s_0_1, const int s_0_2, const int s_1_0, const int s_1_1,
const int s_1_2, const int s_2_0, const int s_2_1, const int s_2_2, float& delta_x,
- float& delta_y)
+ float& delta_y) const
{
// the coefficients of the 2d quadratic function least-squares fit:
scores_(keypoints[i].pt.y, keypoints[i].pt.x) = keypoints[i].response;
}
inline uint8_t
-BriskLayer::getAgastScore(int x, int y, uint8_t threshold)
+BriskLayer::getAgastScore(int x, int y, uint8_t threshold) const
{
if (x < 3 || y < 3)
return 0;
}
inline uint8_t
-BriskLayer::getAgastScore_5_8(int x, int y, uint8_t threshold)
+BriskLayer::getAgastScore_5_8(int x, int y, uint8_t threshold) const
{
if (x < 2 || y < 2)
return 0;
}
inline uint8_t
-BriskLayer::getAgastScore(float xf, float yf, uint8_t threshold_in, float scale_in)
+BriskLayer::getAgastScore(float xf, float yf, uint8_t threshold_in, float scale_in) const
{
if (scale_in <= 1.0f)
{
}
// access gray values (smoothed/interpolated)
-__inline__ uint8_t
-BriskLayer::value(const cv::Mat& mat, float xf, float yf, float scale_in)
+inline uint8_t
+BriskLayer::value(const cv::Mat& mat, float xf, float yf, float scale_in) const
{
assert(!mat.empty());
// get the position