34 #include <Color/ColorParameterSet.h>
35 #include <ObjectFinder/ObjectFinderStereo.h>
36 #include <Visualizer/OpenGLVisualizer.h>
44 static const std::size_t SegmentableBitmapWidth = 64;
45 static const std::size_t SegmentableBitmapSize =
46 SegmentableBitmapWidth * SegmentableBitmapWidth;
48 static const std::size_t SegmentableBitmapUInt32Size = SegmentableBitmapSize / 32;
55 std::uint32_t
bitmap[SegmentableBitmapUInt32Size];
68 std::unique_ptr<SegmentableTemplateHeader>
data;
69 std::unique_ptr<CFloatMatrix>
model;
77 static inline Eigen::Vector3f
78 stringToVector3f(std::string propertyValue)
81 sscanf(propertyValue.c_str(),
93 defineOptionalProperty<std::string>(
95 "VisionX/examples/cebit-colors.txt",
96 "The color parameter file configures the colors used for segmentable recognition "
97 "(usually colors.txt)");
98 defineOptionalProperty<int>(
101 "Minimum number of pixels per region for detecting a uniformly colored object");
102 defineOptionalProperty<float>(
103 "MaxEpipolarDistance",
105 "Maximum epipolar line distance allowed for a valid 3D recognition result");
107 defineOptionalProperty<std::string>(
"TemplatePath",
"VisionX/templates");
113 defineOptionalProperty<Eigen::Vector3f>(
"MinPoint",
114 Eigen::Vector3f(-3000.0f, -3000.0f, 100.0f),
115 "min point for valid result bounding box")
117 defineOptionalProperty<Eigen::Vector3f>(
"MaxPoint",
118 Eigen::Vector3f(3000.0f, 3000.0f, 3500.0f),
119 "max point for valid result bounding box")
122 defineOptionalProperty<float>(
"TemplateMatchThreshold", 0.7f,
"");
123 defineOptionalProperty<float>(
"SizeRatioThreshold", 0.7f,
"");
124 defineOptionalProperty<float>(
"CorrelationThreshold", 0.7f,
"");
126 defineOptionalProperty<bool>(
"SingleInstance",
true,
"");
152 const std::string& referenceName,
153 const Ice::Current&
c = Ice::emptyCurrent)
override
156 stereoCalibration,
x, referenceName,
c);
167 return "SegmentableTemplateRecognition";
188 debugObserver = getTopic<armarx::DebugObserverInterfacePrx>(
189 getProperty<std::string>(
"DebugObserverName").getValue());
224 memoryx::ObjectLocalizationResultList
231 void visualizeResults(
const Object3DList& objectList, CByteImage**
resultImages);
233 float calculateRecognitionCertainty(
const std::string& objectClassName,
234 const Object3DEntry& entry);
237 std::shared_ptr<CGLContext> contextGL;
238 std::shared_ptr<COpenGLVisualizer> m_pOpenGLVisualizer;
239 std::shared_ptr<CObjectFinderStereo> m_pObjectFinderStereo;
242 int paramMinPixelsPerRegion = 200;
243 float paramTemplateMatchThreshold = 0.7f;
244 float paramSizeRatioThreshold = 0.7f;
245 float paramCorrelationThreshold = 0.7f;
246 bool paramSingleInstance =
true;
249 std::string templatePath;
250 float minPixelsPerRegion;
251 float maxEpipolarDistance;
252 CColorParameterSet colorParameters;
254 std::map<std::string, SegmentableTemplateEntry> database;
256 Vec3d validResultBoundingBoxMin, validResultBoundingBoxMax;
259 std::map<std::string, int> seq;