Point Cloud Library (PCL)
1.10.0
|
42 #include <pcl/keypoints/agast_2d.h>
70 template <
typename Po
intInT,
typename Po
intOutT = pcl::Po
intWithScale,
typename IntensityT = pcl::common::IntensityFieldAccessor<Po
intInT> >
89 : threshold_ (threshold)
91 , remove_invalid_3D_keypoints_ (false)
94 name_ =
"BriskKeypoint2D";
108 threshold_ = threshold;
142 remove_invalid_3D_keypoints_ = remove;
151 return (remove_invalid_3D_keypoints_);
163 pt.x = pt.y = pt.z = 0;
165 const PointInT &p1 = (*cloud)(u, v);
166 const PointInT &p2 = (*cloud)(u+1, v);
167 const PointInT &p3 = (*cloud)(u, v+1);
168 const PointInT &p4 = (*cloud)(u+1, v+1);
170 float fx = x - float (u), fy = y - float (v);
171 float fx1 = 1.0f - fx, fy1 = 1.0f - fy;
173 float w1 = fx1 * fy1, w2 = fx * fy1, w3 = fx1 * fy, w4 = fx * fy;
206 pt.x = pt.y = pt.z = std::numeric_limits<float>::quiet_NaN ();
209 weight = 1.0f / weight;
210 pt.x *= weight; pt.y *= weight; pt.z *= weight;
225 IntensityT intensity_;
235 bool remove_invalid_3D_keypoints_;
263 Layer (
const std::vector<unsigned char>& img,
264 int width,
int height,
265 float scale = 1.0f,
float offset = 0.0f);
278 getAgastPoints (
std::uint8_t threshold, std::vector<
pcl::PointUV, Eigen::aligned_allocator<pcl::PointUV> > &keypoints);
294 getAgastScore_5_8 (
int x,
int y,
std::uint8_t threshold);
302 getAgastScore (
float xf,
float yf,
std::uint8_t threshold,
float scale = 1.0f);
313 getValue (
const std::vector<unsigned char>& mat,
314 int width,
int height,
float xf,
float yf,
float scale);
317 const std::vector<unsigned char>&
334 return (img_height_);
352 inline const std::vector<unsigned char>&
361 halfsample (
const std::vector<unsigned char>& srcimg,
362 int srcwidth,
int srcheight,
363 std::vector<unsigned char>& dstimg,
364 int dstwidth,
int dstheight);
368 twothirdsample (
const std::vector<unsigned char>& srcimg,
369 int srcwidth,
int srcheight,
370 std::vector<unsigned char>& dstimg,
371 int dstwidth,
int dstheight);
374 std::vector<unsigned char> img_;
379 std::vector<unsigned char> scores_;
406 constructPyramid (
const std::vector<unsigned char>& image,
407 int width,
int height);
414 getKeypoints (
const int threshold,
415 std::vector<
pcl::PointWithScale, Eigen::aligned_allocator<pcl::PointWithScale> > &keypoints);
420 isMax2D (
const std::uint8_t layer,
const int x_layer,
const int y_layer);
424 refine1D (
const float s_05,
const float s0,
const float s05,
float& max);
428 refine1D_1 (
const float s_05,
const float s0,
const float s05,
float& max);
432 refine1D_2 (
const float s_05,
const float s0,
const float s05,
float& max);
436 subpixel2D (
const int s_0_0,
const int s_0_1,
const int s_0_2,
437 const int s_1_0,
const int s_1_1,
const int s_1_2,
438 const int s_2_0,
const int s_2_1,
const int s_2_2,
439 float& delta_x,
float& delta_y);
444 const int x_layer,
const int y_layer,
445 float& x,
float& y,
float& scale,
bool& ismax);
449 getScoreAbove (
const std::uint8_t layer,
const int x_layer,
const int y_layer);
452 getScoreBelow (
const std::uint8_t layer,
const int x_layer,
const int y_layer);
457 const int x_layer,
const int y_layer,
458 const int threshold,
bool& ismax,
459 float& dx,
float& dy);
463 const int x_layer,
const int y_layer,
464 const int threshold,
bool& ismax,
465 float& dx,
float& dy);
469 std::vector<pcl::keypoints::brisk::Layer>
pyramid_;
484 #include <pcl/keypoints/impl/brisk_2d.hpp>
A 2D point structure representing pixel image coordinates.
typename Keypoint< PointInT, PointOutT >::PointCloudIn PointCloudIn
This file defines compatibility wrappers for low level I/O functions.
typename Keypoint< PointInT, PointOutT >::KdTree KdTree
static const int TWOTHIRDSAMPLE
bool isFinite(const PointT &pt)
Tests if the 3D components of a point are all finite param[in] pt point to be tested return true if f...
Detects BRISK interest points based on the original code and paper reference by.
shared_ptr< AgastDetector5_8 > Ptr
shared_ptr< const BriskKeypoint2D< PointInT, PointOutT, IntensityT > > ConstPtr
std::size_t getThreshold()
Get the threshold for corner detection, as set by the user.
int getImageHeight() const
Get the height of the image used.
float getOffset() const
Get the offset used.
std::vector< pcl::keypoints::brisk::Layer > pyramid_
typename PointCloudIn::ConstPtr PointCloudInConstPtr
shared_ptr< OastDetector9_16 > Ptr
~BriskKeypoint2D()
Destructor.
void detectKeypoints(PointCloudOut &output) override
Detects the keypoints.
bool getRemoveInvalid3DKeypoints()
Specify whether the keypoints that do not have a valid 3D position are kept (false) or removed (true)...
A layer in the BRISK detector pyramid.
BriskKeypoint2D(int octaves=4, int threshold=60)
Constructor.
typename Keypoint< PointInT, PointOutT >::PointCloudOut PointCloudOut
void setThreshold(const int threshold)
Sets the threshold for corner detection.
std::string name_
The key point detection method's name.
const std::vector< unsigned char > & getImage() const
Get the image used.
BRISK Scale Space helper.
void bilinearInterpolation(const PointCloudInConstPtr &cloud, float x, float y, PointOutT &pt)
int getOctaves()
Returns the number of octaves used.
void setOctaves(const int octaves)
Set the number of octaves to use.
void setRemoveInvalid3DKeypoints(bool remove)
Specify whether we should do a 2nd pass through the list of keypoints found, and remove the ones that...
A point structure representing a 3-D position and scale.
int getImageWidth() const
Get the width of the image used.
bool initCompute() override
Initializes everything and checks whether input data is fine.
static const int HALFSAMPLE
shared_ptr< BriskKeypoint2D< PointInT, PointOutT, IntensityT > > Ptr
std::uint8_t safe_threshold_
Keypoint represents the base class for key points.
float getScale() const
Get the scale used.
int k_
The number of K nearest neighbors to use for each point.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
const std::vector< unsigned char > & getScores() const
Get the scores obtained.