PrimitiveExtractionParameterTuning.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package VisionX::ArmarXObjects::PrimitiveExtractionParameterTuning
17 * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
18 * @date 2017
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <pcl/io/pcd_io.h>
26#include <pcl/point_types.h>
27
29
31#include <VisionX/interface/components/FakePointCloudProviderInterface.h>
32#include <VisionX/interface/components/PointCloudSegmenter.h>
33#include <VisionX/interface/components/PrimitiveMapper.h>
34
35namespace armarx
36{
37 /**
38 * @class PrimitiveExtractionParameterTuningPropertyDefinitions
39 * @brief
40 */
43 {
44 public:
47 {
48 defineRequiredProperty<std::string>("SourcePointCloud",
49 "A XYZRGBA source truth point cloud");
50 defineRequiredProperty<std::string>("GroundTruthPointCloud",
51 "A XYZRGBL ground truth point cloud");
52 defineOptionalProperty<std::string>("PointCloudProviderName",
53 "FakePointCloudProvider",
54 "The name of the point cloud provider");
55 defineOptionalProperty<std::string>("PointCloudSegmenterName",
56 "PointCloudSegmenter",
57 "The name of the point cloud segmenter");
58 defineOptionalProperty<std::string>("PrimitiveExtractorName",
59 "PrimitiveExtractor",
60 "The name of the point cloud provider");
61 defineOptionalProperty<std::string>("PrimitivesProviderName",
62 "PrimitiveExtractorResult",
63 "The name of the primitive provider");
65 "ExportDirectory",
66 "The name of the directory to export point clouds and setup files");
67 }
68 };
69
70 /**
71 * @defgroup Component-PrimitiveExtractionParameterTuning PrimitiveExtractionParameterTuning
72 * @ingroup VisionX-Components
73 * A description of the component PrimitiveExtractionParameterTuning.
74 *
75 * @class PrimitiveExtractionParameterTuning
76 * @ingroup Component-PrimitiveExtractionParameterTuning
77 * @brief Brief description of class PrimitiveExtractionParameterTuning.
78 *
79 * Detailed description of class PrimitiveExtractionParameterTuning.
80 */
82 {
83 public:
84 /**
85 * @see armarx::ManagedIceObject::getDefaultName()
86 */
87 std::string
88 getDefaultName() const override
89 {
90 return "PrimitiveExtractionParameterTuning";
91 }
92
93 protected:
94 /**
95 * @see visionx::PointCloudProcessor::onInitPointCloudProcessor()
96 */
97 void onInitPointCloudProcessor() override;
98
99 /**
100 * @see visionx::PointCloudProcessor::onConnectPointCloudProcessor()
101 */
102 void onConnectPointCloudProcessor() override;
103
104 /**
105 * @see visionx::PointCloudProcessor::onDisconnectPointCloudProcessor()
106 */
107 void onDisconnectPointCloudProcessor() override;
108
109 /**
110 * @see visionx::PointCloudProcessor::onExitPointCloudProcessor()
111 */
112 void onExitPointCloudProcessor() override;
113
114 /**
115 * @see visionx::PointCloudProcessor::process()
116 */
117 void process() override;
118
119 /**
120 * @see PropertyUser::createPropertyDefinitions()
121 */
123
124 float compareLabeledPointClouds(const pcl::PointCloud<pcl::PointXYZL>::Ptr& labeled,
125 const pcl::PointCloud<pcl::PointXYZRGBL>::Ptr& reference);
127
128 float sample(float current, const Eigen::Vector2f& bounds);
129 void exportBestSetup(const std::string& directory,
130 const pcl::PointCloud<pcl::PointXYZL>::Ptr& pointCloud,
131 const visionx::LccpParameters& lccp_prm,
132 const visionx::PrimitiveExtractorParameters& pe_prm);
133
134 protected:
138 std::string exportDirectory;
139
140 visionx::FakePointCloudProviderInterfacePrx pointCloudProvider;
141 visionx::PointCloudSegmenterInterfacePrx pointCloudSegmenter;
142 visionx::PrimitiveMapperInterfacePrx primitiveExtractor;
143
144 pcl::PointCloud<pcl::PointXYZRGBL>::Ptr referencePointCloud;
145
146 visionx::PrimitiveExtractorParameters extractionPrm;
147 visionx::LccpParameters segmentationPrm;
148
149 visionx::PrimitiveExtractorParameters bestExtractionPrm;
150 visionx::LccpParameters bestSegmentationPrm;
152
153 unsigned int iteration = 0;
154
177 };
178} // namespace armarx
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Brief description of class PrimitiveExtractionParameterTuning.
float compareLabeledPointClouds(const pcl::PointCloud< pcl::PointXYZL >::Ptr &labeled, const pcl::PointCloud< pcl::PointXYZRGBL >::Ptr &reference)
visionx::FakePointCloudProviderInterfacePrx pointCloudProvider
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
float sample(float current, const Eigen::Vector2f &bounds)
visionx::PointCloudSegmenterInterfacePrx pointCloudSegmenter
void exportBestSetup(const std::string &directory, const pcl::PointCloud< pcl::PointXYZL >::Ptr &pointCloud, const visionx::LccpParameters &lccp_prm, const visionx::PrimitiveExtractorParameters &pe_prm)
pcl::PointCloud< pcl::PointXYZRGBL >::Ptr referencePointCloud
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
The PointCloudProcessor class provides an interface for access to PointCloudProviders via Ice and sha...
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.