Go to the documentation of this file.00001 #include <pcl/apps/cloud_composer/tools/organized_segmentation.h>
00002 #include <pcl/apps/cloud_composer/items/cloud_item.h>
00003
00004 #include <pcl/point_types.h>
00005 #include <pcl/filters/extract_indices.h>
00006 #include <pcl/kdtree/kdtree.h>
00007 #include <pcl/segmentation/extract_clusters.h>
00008
00009
00010 #include <pcl/apps/cloud_composer/tools/impl/organized_segmentation.hpp>
00011
00012 Q_EXPORT_PLUGIN2(cloud_composer_organized_segmentation_tool, pcl::cloud_composer::OrganizedSegmentationToolFactory)
00013
00014 pcl::cloud_composer::OrganizedSegmentationTool::OrganizedSegmentationTool (PropertiesModel* parameter_model, QObject* parent)
00015 : SplitItemTool (parameter_model, parent)
00016 {
00017
00018 }
00019
00020 pcl::cloud_composer::OrganizedSegmentationTool::~OrganizedSegmentationTool ()
00021 {
00022
00023 }
00024
00025 QList <pcl::cloud_composer::CloudComposerItem*>
00026 pcl::cloud_composer::OrganizedSegmentationTool::performAction (ConstItemList input_data, PointTypeFlags::PointType type)
00027 {
00028 if (type != PointTypeFlags::NONE)
00029 {
00030 switch (type)
00031 {
00032 case (PointTypeFlags::XYZ):
00033 return this->performTemplatedAction<pcl::PointXYZ> (input_data);
00034 case (PointTypeFlags::XYZ | PointTypeFlags::RGB):
00035 return this->performTemplatedAction<pcl::PointXYZRGB> (input_data);
00036 case (PointTypeFlags::XYZ | PointTypeFlags::RGBA):
00037 return this->performTemplatedAction<pcl::PointXYZRGBA> (input_data);
00038 }
00039 }
00040
00041 QList <CloudComposerItem*> output;
00042
00043 qCritical () << "organized_segmentation requires templated types!";
00044
00045 return output;
00046 }
00047
00049 pcl::cloud_composer::PropertiesModel*
00050 pcl::cloud_composer::OrganizedSegmentationToolFactory::createToolParameterModel (QObject* parent)
00051 {
00052 PropertiesModel* parameter_model = new PropertiesModel(parent);
00053
00054 parameter_model->addProperty ("Min Inliers", 1000, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00055 parameter_model->addProperty ("Min Plane Size", 10000, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00056 parameter_model->addProperty ("Angular Threshold", 2.0, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00057 parameter_model->addProperty ("Distance Threshold", 0.02, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00058 parameter_model->addProperty ("Cluster Dist. Thresh.", 0.01, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00059 parameter_model->addProperty ("Min Cluster Size", 1000, Qt::ItemIsEditable | Qt::ItemIsEnabled);
00060
00061
00062 return parameter_model;
00063 }