You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am dealing with octree box search. It seems it could not produce valid result. For test purpose, I deal with only eight points, and I set lower & upper corner values. It is expected it will produce all values from input cloud. Here is my code.
I am dealing with octree box search. It seems it could not produce valid result. For test purpose, I deal with only eight points, and I set lower & upper corner values. It is expected it will produce all values from input cloud. Here is my code.
int main(..)
{
pcl::PointCloudpcl::PointXYZ cloud;
cloud.width = 8;
cloud.height = 1;
cloud.is_dense = false;
cloud.points.resize (cloud.width * cloud.height);
float box_point[8][3] = {
{0, 0, 0},
{0, 2, 0},
{0, 1, 1},
{0, 3, 1},
{0, 0, 3},
{0, 2, 3},
{0, 1, 4},
{0, 3, 4}
};
for (size_t i = 0; i < cloud.points.size (); ++i)
{
}
float resolution = 0.1;
pcl::octree::OctreePointCloudSearchpcl::PointXYZ octree (resolution);
octree.setInputCloud (cloud.makeShared());
octree.addPointsFromInputCloud ();
std::vector pointIdxVec;
Eigen::Vector3f min_pt(0,0,0);
Eigen::Vector3f max_pt(0,3,4);
octree.boxSearch(min_pt,max_pt,pointIdxVec);
for (size_t i = 0; i < pointIdxVec.size (); ++i)
std::cout << " " << cloud.points[pointIdxVec[i]].x
<< " " << cloud.points[pointIdxVec[i]].y
<< " " << cloud.points[pointIdxVec[i]].z << std::endl;
cout<<"PointIdxVec size:"<<pointIdxVec.size ()<<endl;
}
My understanding is output would be 8 points, but i got 0 point. ur suggession most appreciable. Thanks in advance.
The text was updated successfully, but these errors were encountered: