How do I use the Morphology class?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How do I use the Morphology class?

nanocar
Hi all,

I am trying to implement the openingbinary method within the morphology
class and I have not figured out a way to do so yet. I have found two
methods online, but neither currently works. These are the two methods:

Method 1:
  Morphology<pcl::PointXYZI> *morph = new Morphology<pcl::PointXYZI>();
  morph->setInputCloud(input_cloud);
  morph->structuringElementRectangle(*structuring_element_cloud, 3, 3);
  morph->setStructuringElement(structuring_element_cloud);
  morph->openingGray(*output_cloud);

  threshold(input_cloud, 100);
  morph->setInputCloud(input_cloud);
  morph->openingBinary(*output_cloud);

Method 2:
  Morphology<pcl::PointXYZRGB> morphology;

  /*dummy clouds*/
  pcl::PointCloud<pcl::PointXYZRGB>::Ptr input_cloud (new
pcl::PointCloud<pcl::PointXYZRGB>);
  pcl::PointCloud<pcl::PointXYZRGB>::Ptr structuring_element_cloud (new
pcl::PointCloud<pcl::PointXYZRGB>);
  pcl::PointCloud<pcl::PointXYZRGB>::Ptr output_cloud (new
pcl::PointCloud<pcl::PointXYZRGB>);

  /*example 1 : Gaussian Smoothing*/
  morphology.structuringElementCircular (*structuring_element_cloud, 3);
  morphology.structuring_element_ = *structuring_element_cloud;
  morphology.operator_type_ = Morphology<pcl::PointXYZRGB>::EROSION_GRAY;
  morphology.applyMorphologicalOperation (*output_cloud, *input_cloud);


I tried implementing both manners for the openingBinary method and the
program crashes with this error:

Assertion failed: (px != 0), function operator->, file
/usr/local/include/boost/smart_ptr/shared_ptr.hpp, line 734.

Any tips will be appreciated!





--
Sent from: http://www.pcl-users.org/
_______________________________________________
[hidden email] / http://pointclouds.org
http://pointclouds.org/mailman/listinfo/pcl-users