44#include <pcl/point_cloud.h>
45#include <pcl/search/search.h>
46#include <pcl/common/eigen.h>
59 template<
typename Po
intT>
109 float min_f = 0.043744332f *
static_cast<float>(
input_->width);
160 unsigned int max_nn = 0)
const override;
215 if (
mask_ [index] && std::isfinite (point.x))
225 [](
float dist,
const Entry&
ent){ return dist<ent.distance; }),
243 clipRange (
int& begin,
int &end,
int min,
int max)
const
245 begin = std::max (std::min (begin, max), min);
246 end = std::min (std::max (end, min), max);
259 unsigned&
maxX,
unsigned&
maxY)
const;
266 Eigen::Matrix<float, 3, 3, Eigen::RowMajor>
KR_;
269 Eigen::Matrix<float, 3, 3, Eigen::RowMajor>
KR_KRT_;
285#ifdef PCL_NO_PRECOMPILE
286#include <pcl/search/impl/organized.hpp>
Iterator class for point clouds with or without given indices.
std::size_t size() const
Size of the range the iterator is going through.
PointCloud represents the base class in PCL for storing collections of 3D points.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
OrganizedNeighbor is a class for optimized nearest neigbhor search in organized point clouds.
void setInputCloud(const PointCloudConstPtr &cloud, const IndicesConstPtr &indices=IndicesConstPtr()) override
Provide a pointer to the input data set, if user has focal length he must set it before calling this.
typename PointCloud::ConstPtr PointCloudConstPtr
int radiusSearch(const PointT &p_q, double radius, Indices &k_indices, std::vector< float > &k_sqr_distances, unsigned int max_nn=0) const override
Search for all neighbors of query point that are within a given radius.
int nearestKSearch(const PointT &p_q, int k, Indices &k_indices, std::vector< float > &k_sqr_distances) const override
Search for the k-nearest neighbors for a given query point.
bool isValid() const
Test whether this search-object is valid (input is organized AND from projective device) User should ...
Eigen::Matrix< float, 3, 3, Eigen::RowMajor > KR_
inveser of the left 3x3 projection matrix which is K * R (with K being the camera matrix and R the ro...
void computeCameraMatrix(Eigen::Matrix3f &camera_matrix) const
Compute the camera matrix.
bool testPoint(const PointT &query, unsigned k, std::vector< Entry > &queue, index_t index) const
test if point given by index is among the k NN in results to the query point.
std::vector< unsigned char > mask_
mask, indicating whether the point was in the indices list or not.
void clipRange(int &begin, int &end, int min, int max) const
Eigen::Matrix< float, 3, 4, Eigen::RowMajor > projection_matrix_
the projection matrix.
void estimateProjectionMatrix()
estimated the projection matrix from the input cloud.
typename PointCloud::Ptr PointCloudPtr
const unsigned pyramid_level_
using only a subsample of points to calculate the projection matrix.
Eigen::Matrix< float, 3, 3, Eigen::RowMajor > KR_KRT_
inveser of the left 3x3 projection matrix which is K * R (with K being the camera matrix and R the ro...
OrganizedNeighbor(bool sorted_results=false, float eps=1e-4f, unsigned pyramid_level=5)
Constructor.
bool projectPoint(const PointT &p, pcl::PointXY &q) const
projects a point into the image
~OrganizedNeighbor()
Empty deconstructor.
void getProjectedRadiusSearchBox(const PointT &point, float squared_radius, unsigned &minX, unsigned &minY, unsigned &maxX, unsigned &maxY) const
Obtain a search box in 2D from a sphere with a radius in 3D.
const float eps_
epsilon value for the MSE of the projection matrix estimation
PointCloudConstPtr input_
pcl::IndicesConstPtr IndicesConstPtr
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Defines functions, macros and traits for allocating and using memory.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
Defines all the PCL and non-PCL macros used.
A 2D point structure representing Euclidean xy coordinates.
A point structure representing Euclidean xyz coordinates, and the RGB color.
bool operator<(const Entry &other) const
Entry(index_t idx, float dist)