FLANN Kd-tree in PCL: Valgrind reports an uninitialised value warningConditional jump valgrind with char* and << operatorerror while working with boost::sregex_token_iteratorC++ polymorphism with variadic function parameterc++ string constructor under the hoodCompilation Error when using tr1::functionGetting very long “No match for 'operator+'” error in C++Xcode 5.1.1 and BoostValgrind complaining possible memory leak in std string's new operatorPCL (point cloud library) 1.7 on Ubuntu 16.04 LTS build errorundefined reference to boost::program_options in xubuntu

Should I hide continue button until tasks are completed?

Does the Paladin's Aura of Protection affect only either her or ONE ally in range?

"It will become the talk of Paris" - translation into French

Why do some games show lights shine through walls?

Putting out of focus command for LaTeX/fuzzying the resulting pdf

How risky is real estate?

How many codes are possible?

Syntax Error with 'if'

Simple object validator with a new API

Why is C++ initial allocation so much larger than C's?

Why does adding parentheses prevent an error?

Counting occurrence of words in table is slow

How can Charles Proxy change settings without admin rights after first time?

How can I convince my reader that I will not use a certain trope?

Can a US President have someone sent to prison?

Is this one of the engines from the 9/11 aircraft?

Mount a folder with a space on Linux

Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?

Is adding a new player (or players) a DM decision, or a group decision?

How to positively portray high and mighty characters?

Cascading Repair Costs following Blown Head Gasket on a 2004 Subaru Outback

How many satellites can stay in a Lagrange point?

Does ultrasonic bath cleaning damage laboratory volumetric glassware calibration?

STM Microcontroller burns every time



FLANN Kd-tree in PCL: Valgrind reports an uninitialised value warning


Conditional jump valgrind with char* and << operatorerror while working with boost::sregex_token_iteratorC++ polymorphism with variadic function parameterc++ string constructor under the hoodCompilation Error when using tr1::functionGetting very long “No match for 'operator+'” error in C++Xcode 5.1.1 and BoostValgrind complaining possible memory leak in std string's new operatorPCL (point cloud library) 1.7 on Ubuntu 16.04 LTS build errorundefined reference to boost::program_options in xubuntu






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I've written a code to extract 3D features from a pointcloud using PCL. I'm using Kd-tree with an input point cloud and indices in to use it as the search method for normal estimation. Everything works fine, but when checking for memory leaks with valgrind, I get the following warning:



==29706== Memcheck, a memory error detector
==29706== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==29706== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==29706== Command: /home/inhands/Workspaces/objrecog_ws/devel/lib/objrecog_object_recognition/TrainingNode
==29706==
==29706== Conditional jump or move depends on uninitialised value(s)
==29706== at 0x135300D7: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::divideTree(int, int, std::vector<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval, std::allocator<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval> >&) (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
==29706== by 0x13533A22: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::buildIndexImpl() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
==29706== by 0x1353793D: flann::NNIndex<flann::L2_Simple<float> >::buildIndex() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
==29706== by 0x17762A18: pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)
==29706== by 0x107275AA: pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.7.2)
==29706== by 0x9027D90: FeatureExtraction3D::estimateNormals(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, boost::shared_ptr<pcl::PointCloud<pcl::Normal> >&) (feature_extraction_3d.cpp:30)
==29706== by 0x9027C1F: FeatureExtraction3D::computeFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction_3d.cpp:19)
==29706== by 0x9245397: FeatureExtraction::extractFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction.cpp:28)
==29706== by 0x540813D: SVM::loadObjectSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (svm_class.cpp:210)
==29706== by 0x5406609: SVM::train() (svm_class.cpp:64)
==29706== by 0x408FA7: objrecog_recognition_training::RecognitionTraining::trainAll() (objrecog_recognition_training_node.cpp:22)
==29706== by 0x409140: main (objrecog_recognition_training_node.cpp:48)
==29706== Uninitialised value was created by a stack allocation
==29706== at 0x17749BF3: int flann::get_param<int>(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, flann::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, flann::any> > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)


which is repeated for every call to divideTree(). This seems to happen only at the beginning of the program, although a new tree is created for each new input. I wonder if it is an issue of my code or if it comes from the FLANN library.




The code that uses the Kd-tree is the following:



FeatureExtraction - superclass



void
FeatureExtraction::extractFeatures(const pointCloud::Ptr & cloud,
const pointIndices::Ptr & indices,
cv::Mat & features)

// Compute Features
this->computeFeatures(cloud, indices, features);



FeatureExtraction3D - subclass (computeFeatures is a virtual overriden method)



void
FeatureExtraction3D::computeFeatures(const pointCloud::Ptr & cloud,
const pointIndices::Ptr & indices,
cv::Mat & output_features)

normalCloud::Ptr cloud_normals (new normalCloud);
this->estimateNormals(cloud, indices, cloud_normals);
this->computeNormalHistogram(cloud_normals, output_features);



void
FeatureExtraction3D::estimateNormals(const pointCloud::Ptr & cloud,
const pointIndices::Ptr & indices,
normalCloud::Ptr & output_normals)

pcl::search::KdTree<point>::Ptr tree (new pcl::search::KdTree<point> ());
tree->setInputCloud(cloud, boost::make_shared<std::vector<int>>(indices->indices));
this->normal_estimation_.setInputCloud(cloud);
this->normal_estimation_.setIndices(indices);
this->normal_estimation_.setSearchMethod(tree);
this->normal_estimation_.setRadiusSearch (0.01);
this->normal_estimation_.useSensorOriginAsViewPoint();
this->normal_estimation_.compute(*output_normals);










share|improve this question




























    0















    I've written a code to extract 3D features from a pointcloud using PCL. I'm using Kd-tree with an input point cloud and indices in to use it as the search method for normal estimation. Everything works fine, but when checking for memory leaks with valgrind, I get the following warning:



    ==29706== Memcheck, a memory error detector
    ==29706== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
    ==29706== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
    ==29706== Command: /home/inhands/Workspaces/objrecog_ws/devel/lib/objrecog_object_recognition/TrainingNode
    ==29706==
    ==29706== Conditional jump or move depends on uninitialised value(s)
    ==29706== at 0x135300D7: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::divideTree(int, int, std::vector<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval, std::allocator<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval> >&) (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
    ==29706== by 0x13533A22: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::buildIndexImpl() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
    ==29706== by 0x1353793D: flann::NNIndex<flann::L2_Simple<float> >::buildIndex() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
    ==29706== by 0x17762A18: pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)
    ==29706== by 0x107275AA: pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.7.2)
    ==29706== by 0x9027D90: FeatureExtraction3D::estimateNormals(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, boost::shared_ptr<pcl::PointCloud<pcl::Normal> >&) (feature_extraction_3d.cpp:30)
    ==29706== by 0x9027C1F: FeatureExtraction3D::computeFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction_3d.cpp:19)
    ==29706== by 0x9245397: FeatureExtraction::extractFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction.cpp:28)
    ==29706== by 0x540813D: SVM::loadObjectSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (svm_class.cpp:210)
    ==29706== by 0x5406609: SVM::train() (svm_class.cpp:64)
    ==29706== by 0x408FA7: objrecog_recognition_training::RecognitionTraining::trainAll() (objrecog_recognition_training_node.cpp:22)
    ==29706== by 0x409140: main (objrecog_recognition_training_node.cpp:48)
    ==29706== Uninitialised value was created by a stack allocation
    ==29706== at 0x17749BF3: int flann::get_param<int>(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, flann::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, flann::any> > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)


    which is repeated for every call to divideTree(). This seems to happen only at the beginning of the program, although a new tree is created for each new input. I wonder if it is an issue of my code or if it comes from the FLANN library.




    The code that uses the Kd-tree is the following:



    FeatureExtraction - superclass



    void
    FeatureExtraction::extractFeatures(const pointCloud::Ptr & cloud,
    const pointIndices::Ptr & indices,
    cv::Mat & features)

    // Compute Features
    this->computeFeatures(cloud, indices, features);



    FeatureExtraction3D - subclass (computeFeatures is a virtual overriden method)



    void
    FeatureExtraction3D::computeFeatures(const pointCloud::Ptr & cloud,
    const pointIndices::Ptr & indices,
    cv::Mat & output_features)

    normalCloud::Ptr cloud_normals (new normalCloud);
    this->estimateNormals(cloud, indices, cloud_normals);
    this->computeNormalHistogram(cloud_normals, output_features);



    void
    FeatureExtraction3D::estimateNormals(const pointCloud::Ptr & cloud,
    const pointIndices::Ptr & indices,
    normalCloud::Ptr & output_normals)

    pcl::search::KdTree<point>::Ptr tree (new pcl::search::KdTree<point> ());
    tree->setInputCloud(cloud, boost::make_shared<std::vector<int>>(indices->indices));
    this->normal_estimation_.setInputCloud(cloud);
    this->normal_estimation_.setIndices(indices);
    this->normal_estimation_.setSearchMethod(tree);
    this->normal_estimation_.setRadiusSearch (0.01);
    this->normal_estimation_.useSensorOriginAsViewPoint();
    this->normal_estimation_.compute(*output_normals);










    share|improve this question
























      0












      0








      0








      I've written a code to extract 3D features from a pointcloud using PCL. I'm using Kd-tree with an input point cloud and indices in to use it as the search method for normal estimation. Everything works fine, but when checking for memory leaks with valgrind, I get the following warning:



      ==29706== Memcheck, a memory error detector
      ==29706== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
      ==29706== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
      ==29706== Command: /home/inhands/Workspaces/objrecog_ws/devel/lib/objrecog_object_recognition/TrainingNode
      ==29706==
      ==29706== Conditional jump or move depends on uninitialised value(s)
      ==29706== at 0x135300D7: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::divideTree(int, int, std::vector<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval, std::allocator<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval> >&) (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x13533A22: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::buildIndexImpl() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x1353793D: flann::NNIndex<flann::L2_Simple<float> >::buildIndex() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x17762A18: pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)
      ==29706== by 0x107275AA: pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.7.2)
      ==29706== by 0x9027D90: FeatureExtraction3D::estimateNormals(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, boost::shared_ptr<pcl::PointCloud<pcl::Normal> >&) (feature_extraction_3d.cpp:30)
      ==29706== by 0x9027C1F: FeatureExtraction3D::computeFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction_3d.cpp:19)
      ==29706== by 0x9245397: FeatureExtraction::extractFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction.cpp:28)
      ==29706== by 0x540813D: SVM::loadObjectSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (svm_class.cpp:210)
      ==29706== by 0x5406609: SVM::train() (svm_class.cpp:64)
      ==29706== by 0x408FA7: objrecog_recognition_training::RecognitionTraining::trainAll() (objrecog_recognition_training_node.cpp:22)
      ==29706== by 0x409140: main (objrecog_recognition_training_node.cpp:48)
      ==29706== Uninitialised value was created by a stack allocation
      ==29706== at 0x17749BF3: int flann::get_param<int>(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, flann::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, flann::any> > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)


      which is repeated for every call to divideTree(). This seems to happen only at the beginning of the program, although a new tree is created for each new input. I wonder if it is an issue of my code or if it comes from the FLANN library.




      The code that uses the Kd-tree is the following:



      FeatureExtraction - superclass



      void
      FeatureExtraction::extractFeatures(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      cv::Mat & features)

      // Compute Features
      this->computeFeatures(cloud, indices, features);



      FeatureExtraction3D - subclass (computeFeatures is a virtual overriden method)



      void
      FeatureExtraction3D::computeFeatures(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      cv::Mat & output_features)

      normalCloud::Ptr cloud_normals (new normalCloud);
      this->estimateNormals(cloud, indices, cloud_normals);
      this->computeNormalHistogram(cloud_normals, output_features);



      void
      FeatureExtraction3D::estimateNormals(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      normalCloud::Ptr & output_normals)

      pcl::search::KdTree<point>::Ptr tree (new pcl::search::KdTree<point> ());
      tree->setInputCloud(cloud, boost::make_shared<std::vector<int>>(indices->indices));
      this->normal_estimation_.setInputCloud(cloud);
      this->normal_estimation_.setIndices(indices);
      this->normal_estimation_.setSearchMethod(tree);
      this->normal_estimation_.setRadiusSearch (0.01);
      this->normal_estimation_.useSensorOriginAsViewPoint();
      this->normal_estimation_.compute(*output_normals);










      share|improve this question














      I've written a code to extract 3D features from a pointcloud using PCL. I'm using Kd-tree with an input point cloud and indices in to use it as the search method for normal estimation. Everything works fine, but when checking for memory leaks with valgrind, I get the following warning:



      ==29706== Memcheck, a memory error detector
      ==29706== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
      ==29706== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
      ==29706== Command: /home/inhands/Workspaces/objrecog_ws/devel/lib/objrecog_object_recognition/TrainingNode
      ==29706==
      ==29706== Conditional jump or move depends on uninitialised value(s)
      ==29706== at 0x135300D7: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::divideTree(int, int, std::vector<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval, std::allocator<flann::KDTreeSingleIndex<flann::L2_Simple<float> >::Interval> >&) (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x13533A22: flann::KDTreeSingleIndex<flann::L2_Simple<float> >::buildIndexImpl() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x1353793D: flann::NNIndex<flann::L2_Simple<float> >::buildIndex() (in /usr/lib/x86_64-linux-gnu/libpcl_recognition.so.1.7.2)
      ==29706== by 0x17762A18: pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)
      ==29706== by 0x107275AA: pcl::search::KdTree<pcl::PointXYZRGB, pcl::KdTreeFLANN<pcl::PointXYZRGB, flann::L2_Simple<float> > >::setInputCloud(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> const> const&, boost::shared_ptr<std::vector<int, std::allocator<int> > const> const&) (in /usr/lib/x86_64-linux-gnu/libpcl_search.so.1.7.2)
      ==29706== by 0x9027D90: FeatureExtraction3D::estimateNormals(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, boost::shared_ptr<pcl::PointCloud<pcl::Normal> >&) (feature_extraction_3d.cpp:30)
      ==29706== by 0x9027C1F: FeatureExtraction3D::computeFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction_3d.cpp:19)
      ==29706== by 0x9245397: FeatureExtraction::extractFeatures(boost::shared_ptr<pcl::PointCloud<pcl::PointXYZRGB> > const&, boost::shared_ptr<pcl::PointIndices> const&, cv::Mat&) (feature_extraction.cpp:28)
      ==29706== by 0x540813D: SVM::loadObjectSet(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) (svm_class.cpp:210)
      ==29706== by 0x5406609: SVM::train() (svm_class.cpp:64)
      ==29706== by 0x408FA7: objrecog_recognition_training::RecognitionTraining::trainAll() (objrecog_recognition_training_node.cpp:22)
      ==29706== by 0x409140: main (objrecog_recognition_training_node.cpp:48)
      ==29706== Uninitialised value was created by a stack allocation
      ==29706== at 0x17749BF3: int flann::get_param<int>(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, flann::any, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, flann::any> > > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int const&) (in /usr/lib/x86_64-linux-gnu/libpcl_kdtree.so.1.7.2)


      which is repeated for every call to divideTree(). This seems to happen only at the beginning of the program, although a new tree is created for each new input. I wonder if it is an issue of my code or if it comes from the FLANN library.




      The code that uses the Kd-tree is the following:



      FeatureExtraction - superclass



      void
      FeatureExtraction::extractFeatures(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      cv::Mat & features)

      // Compute Features
      this->computeFeatures(cloud, indices, features);



      FeatureExtraction3D - subclass (computeFeatures is a virtual overriden method)



      void
      FeatureExtraction3D::computeFeatures(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      cv::Mat & output_features)

      normalCloud::Ptr cloud_normals (new normalCloud);
      this->estimateNormals(cloud, indices, cloud_normals);
      this->computeNormalHistogram(cloud_normals, output_features);



      void
      FeatureExtraction3D::estimateNormals(const pointCloud::Ptr & cloud,
      const pointIndices::Ptr & indices,
      normalCloud::Ptr & output_normals)

      pcl::search::KdTree<point>::Ptr tree (new pcl::search::KdTree<point> ());
      tree->setInputCloud(cloud, boost::make_shared<std::vector<int>>(indices->indices));
      this->normal_estimation_.setInputCloud(cloud);
      this->normal_estimation_.setIndices(indices);
      this->normal_estimation_.setSearchMethod(tree);
      this->normal_estimation_.setRadiusSearch (0.01);
      this->normal_estimation_.useSensorOriginAsViewPoint();
      this->normal_estimation_.compute(*output_normals);







      c++ valgrind point-cloud-library kdtree flann






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 25 at 11:12









      JGalloJGallo

      1518 bronze badges




      1518 bronze badges






















          0






          active

          oldest

          votes














          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336513%2fflann-kd-tree-in-pcl-valgrind-reports-an-uninitialised-value-warning%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336513%2fflann-kd-tree-in-pcl-valgrind-reports-an-uninitialised-value-warning%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript