Skip to content

Commit e82b7e7

Browse files
committed
new tag for pcl-1.5.0
git-svn-id: svn+ssh://svn.pointclouds.org/pcl/tags/pcl-1.5.0@4702 a9d63959-f2ad-4865-b262-bf0e56cfafb6
2 parents 6791791 + 023c291 commit e82b7e7

File tree

5 files changed

+63
-99
lines changed

5 files changed

+63
-99
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if(USE_PROJECT_FOLDERS)
9898
endif(USE_PROJECT_FOLDERS)
9999

100100
include(${PCL_SOURCE_DIR}/cmake/pcl_utils.cmake)
101-
set(PCL_VERSION 1.5.0 CACHE STRING "PCL version")
101+
set(PCL_VERSION 1.5.1 CACHE STRING "PCL version")
102102
DISSECT_VERSION()
103103
GET_OS_INFO()
104104
SET_INSTALL_DIRS()

kdtree/include/pcl/kdtree/impl/kdtree_flann.hpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -249,20 +249,25 @@ pcl::KdTreeFLANN<PointT, Dist>::convertCloudToArray (const PointCloud &cloud, co
249249
cloud_ = (float*)malloc (original_no_of_points * dim_ * sizeof (float));
250250
float* cloud_ptr = cloud_;
251251
index_mapping_.reserve (original_no_of_points);
252-
identity_mapping_ = true;
253252

254-
for (int indices_index = 0; indices_index < original_no_of_points; ++indices_index)
253+
// true only identity:
254+
// - indices size equals cloud size
255+
// - indices only contain values between 0 and cloud.size - 1
256+
// - no index is multiple times in the list
257+
// => index is complete
258+
// But we can not guarantee that => identity_mapping_ = false
259+
identity_mapping_ = false;
260+
261+
for (std::vector<int>::const_iterator iIt = indices.begin (); iIt != indices.end (); ++iIt)
255262
{
256263
// Check if the point is invalid
257-
if (!point_representation_->isValid (cloud.points[indices[indices_index]]))
258-
{
259-
identity_mapping_ = false;
264+
if (!point_representation_->isValid (cloud.points[*iIt]))
260265
continue;
261-
}
262266

263-
index_mapping_.push_back (indices_index); // If the returned index should be for the indices vector
264267

265-
point_representation_->vectorize (cloud.points[indices[indices_index]], cloud_ptr);
268+
index_mapping_.push_back (*iIt); // If the returned index should be for the indices vector
269+
270+
point_representation_->vectorize (cloud.points[*iIt], cloud_ptr);
266271
cloud_ptr += dim_;
267272
}
268273
}

search/include/pcl/search/impl/organized.hpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pcl::search::OrganizedNeighbor<PointT>::radiusSearch (const PointT
5454
unsigned int max_nn) const
5555
{
5656
// NAN test
57-
assert (isFiniteFast (query) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!");
57+
assert (isFinite (query) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!");
5858

5959
// search window
6060
unsigned left, right, top, bottom;
@@ -114,7 +114,7 @@ pcl::search::OrganizedNeighbor<PointT>::nearestKSearch (const PointT &query,
114114
std::vector<int> &k_indices,
115115
std::vector<float> &k_sqr_distances) const
116116
{
117-
assert (isFiniteFast (query) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!");
117+
assert (isFinite (query) && "Invalid (NaN, Inf) point coordinates given to nearestKSearch!");
118118
if (k < 1)
119119
{
120120
k_indices.clear ();
@@ -326,7 +326,7 @@ pcl::search::OrganizedNeighbor<PointT>::getProjectedRadiusSearchBox (const Point
326326
template<typename PointT> template <typename MatrixType> void
327327
pcl::search::OrganizedNeighbor<PointT>::makeSymmetric (MatrixType& matrix, bool use_upper_triangular) const
328328
{
329-
if (use_upper_triangular)
329+
if (use_upper_triangular && (MatrixType::Flags & Eigen::RowMajorBit) )
330330
{
331331
matrix.coeffRef (4) = matrix.coeff (1);
332332
matrix.coeffRef (8) = matrix.coeff (2);
@@ -387,11 +387,11 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
387387
}
388388

389389
// we just want to use every 16th column and row -> skip = 2^4
390-
const unsigned int skip = input_->width >> 4;
391-
Eigen::Matrix<Scalar, 4, 4> A = Eigen::Matrix<Scalar, 4, 4>::Zero ();
392-
Eigen::Matrix<Scalar, 4, 4> B = Eigen::Matrix<Scalar, 4, 4>::Zero ();
393-
Eigen::Matrix<Scalar, 4, 4> C = Eigen::Matrix<Scalar, 4, 4>::Zero ();
394-
Eigen::Matrix<Scalar, 4, 4> D = Eigen::Matrix<Scalar, 4, 4>::Zero ();
390+
const unsigned int skip = input_->width >> 3;
391+
Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor> A = Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor>::Zero ();
392+
Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor> B = Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor>::Zero ();
393+
Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor> C = Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor>::Zero ();
394+
Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor> D = Eigen::Matrix<Scalar, 4, 4, Eigen::RowMajor>::Zero ();
395395

396396
for (unsigned yIdx = 0, idx = 0; yIdx < input_->height; yIdx += skip, idx += input_->width * (skip-1))
397397
{
@@ -474,7 +474,7 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
474474
makeSymmetric(C);
475475
makeSymmetric(D);
476476

477-
Eigen::Matrix<Scalar, 12, 12> X = Eigen::Matrix<Scalar, 12, 12>::Zero ();
477+
Eigen::Matrix<Scalar, 12, 12, Eigen::RowMajor> X = Eigen::Matrix<Scalar, 12, 12, Eigen::RowMajor>::Zero ();
478478
X.topLeftCorner<4,4> () = A;
479479
X.block<4,4> (0, 8) = B;
480480
X.block<4,4> (8, 0) = B;
@@ -483,8 +483,8 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
483483
X.block<4,4> (8, 4) = C;
484484
X.block<4,4> (8, 8) = D;
485485

486-
Eigen::SelfAdjointEigenSolver<Eigen::Matrix<Scalar, 12, 12> > ei_symm(X);
487-
Eigen::Matrix<Scalar, 12, 12> eigen_vectors = ei_symm.eigenvectors();
486+
Eigen::SelfAdjointEigenSolver<Eigen::Matrix<Scalar, 12, 12, Eigen::RowMajor> > ei_symm(X);
487+
Eigen::Matrix<Scalar, 12, 12, Eigen::RowMajor> eigen_vectors = ei_symm.eigenvectors();
488488

489489
// check whether the residual MSE is low. If its high, the cloud was not captured from a projective device.
490490
Eigen::Matrix<Scalar, 1, 1> residual_sqr = eigen_vectors.col (0).transpose () * X * eigen_vectors.col (0);
@@ -493,6 +493,7 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
493493
PCL_ERROR ("[pcl::%s::radiusSearch] Input dataset is not from a projective device!\nResidual (MSE) %f, using %d valid points\n", this->getName ().c_str (), residual_sqr.coeff (0) / A.coeff (15), (int)A.coeff (15));
494494
return;
495495
}
496+
496497
projection_matrix_.coeffRef (0) = eigen_vectors.coeff (0);
497498
projection_matrix_.coeffRef (1) = eigen_vectors.coeff (12);
498499
projection_matrix_.coeffRef (2) = eigen_vectors.coeff (24);
@@ -514,7 +515,7 @@ pcl::search::OrganizedNeighbor<PointT>::estimateProjectionMatrix ()
514515
KR_ = projection_matrix_.topLeftCorner <3, 3> ();
515516

516517
// precalculate KR * KR^T needed by calculations during nn-search
517-
KR_KRT_ = KR_ * KR_.transpose ();
518+
KR_KRT_ = KR_ * KR_.transpose ();
518519
}
519520

520521
#define PCL_INSTANTIATE_OrganizedNeighbor(T) template class PCL_EXPORTS pcl::search::OrganizedNeighbor<T>;

search/include/pcl/search/organized.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace pcl
8080
OrganizedNeighbor (bool sorted_results = false)
8181
: Search<PointT> ("OrganizedNeighbor", sorted_results)
8282
, projection_matrix_ (Eigen::Matrix<float, 3, 4, Eigen::RowMajor>::Zero ())
83-
, eps_ (1e-6)
83+
, eps_ (1e-4)
8484
{
8585
}
8686

0 commit comments

Comments
 (0)