supervoxels.cpp
Go to the documentation of this file.
00001 #include <pcl/apps/cloud_composer/tools/supervoxels.h>
00002 #include <pcl/apps/cloud_composer/items/cloud_item.h>
00003 #include <pcl/filters/extract_indices.h>
00004 #include <pcl/kdtree/kdtree.h>
00005 #include <pcl/point_types.h>
00006 #include <pcl/segmentation/extract_clusters.h>
00007 
00008 #include <pcl/apps/cloud_composer/tools/impl/supervoxels.hpp>
00009 
00010 Q_EXPORT_PLUGIN2(cloud_composer_voxel_superpixels_tool, pcl::cloud_composer::SupervoxelsToolFactory)
00011 
00012 pcl::cloud_composer::SupervoxelsTool::SupervoxelsTool (PropertiesModel* parameter_model, QObject* parent)
00013 : SplitItemTool (parameter_model, parent)
00014 {
00015   
00016 }
00017 
00018 pcl::cloud_composer::SupervoxelsTool::~SupervoxelsTool ()
00019 {
00020   
00021 }
00022 
00023 QList <pcl::cloud_composer::CloudComposerItem*>
00024 pcl::cloud_composer::SupervoxelsTool::performAction (ConstItemList input_data, PointTypeFlags::PointType type)
00025 {
00026   if (type != PointTypeFlags::NONE)
00027   {
00028     switch (type)
00029     {
00030       case (PointTypeFlags::XYZ | PointTypeFlags::RGB):
00031         return this->performTemplatedAction<pcl::PointXYZRGB> (input_data);
00032       case (PointTypeFlags::XYZ | PointTypeFlags::RGBA):
00033         return this->performTemplatedAction<pcl::PointXYZRGBA> (input_data);
00034     }
00035   }
00036   
00037   QList <CloudComposerItem*> output;
00038   
00039   qCritical () << "supervoxels requires templated types!";
00040   
00041   return output;
00042 } 
00043 
00044 template QList <pcl::cloud_composer::CloudComposerItem*> pcl::cloud_composer::SupervoxelsTool::performTemplatedAction <pcl::PointXYZRGB> (QList <const CloudComposerItem*>);
00045 //template QList <pcl::cloud_composer::CloudComposerItem*> pcl::cloud_composer::SupervoxelsTool::performTemplatedAction <pcl::PointXYZRGBA> (QList <const CloudComposerItem*>);
00046 
00047 
00049 pcl::cloud_composer::PropertiesModel*
00050 pcl::cloud_composer::SupervoxelsToolFactory::createToolParameterModel (QObject* parent)
00051 {
00052   PropertiesModel* parameter_model = new PropertiesModel(parent);
00053   
00054   parameter_model->addProperty ("Resolution", 0.008,  Qt::ItemIsEditable | Qt::ItemIsEnabled);
00055   parameter_model->addProperty ("Seed Resolution", 0.08,  Qt::ItemIsEditable | Qt::ItemIsEnabled);
00056   parameter_model->addProperty ("RGB Weight", 0.2,  Qt::ItemIsEditable | Qt::ItemIsEnabled);
00057   parameter_model->addProperty ("Normals Weight", 0.8,  Qt::ItemIsEditable | Qt::ItemIsEnabled);
00058   parameter_model->addProperty ("Spatial Weight", 0.4,  Qt::ItemIsEditable | Qt::ItemIsEnabled);
00059   
00060   return parameter_model;
00061 }


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:34:02