23 #ifndef _ARMARX_VisionX_FeatureLearning_WidgetController_H
24 #define _ARMARX_VisionX_FeatureLearning_WidgetController_H
26 #include <VisionX/gui-plugins/FeatureLearning/ui_FeatureLearningWidget.h>
37 #include <Features/HarrisSIFTFeatures/HarrisSIFTFeatureCalculator.h>
38 #include <Features/SIFTFeatures/SIFTFeatureEntry.h>
39 #include <TexturedRecognition/TexturedFeatureSet.h>
40 #include <Math/LinearAlgebra.h>
41 #include <Math/FloatMatrix.h>
44 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
54 #include <QFileDialog>
55 #include <QMessageBox>
110 virtual void loadSettings(QSettings* settings)
override;
115 virtual void saveSettings(QSettings* settings)
override;
123 return "VisionX.FeatureLearning";
131 virtual void onInitImageProcessor()
override;
136 virtual void onConnectImageProcessor()
override;
141 virtual void onDisconnectImageProcessor()
override;
146 virtual void onExitImageProcessor()
override;
151 virtual void process()
override;
156 void addPolygonPoint(
int,
float x,
float y);
157 void connectButtonClicked(
bool toggled);
158 void disconnectButtonClicked(
bool toggled);
159 void loadFeaturesButtonClicked(
bool toggled);
160 void saveFeaturesButtonClicked(
bool toggled);
161 void pausePlayButtonClicked(
bool toggled);
162 void addFeaturesButtonClicked(
bool toggled);
163 void clearFeaturesButtonClicked(
bool toggled);
165 void objectChooserButtonClicked(
bool toggled);
166 void saveToMemoryButtonClicked(
bool toggled);
168 void objectChooserAccepted();
169 void saveToMemoryAccepted();
173 void imageProviderConnected(
bool connected);
179 Ui::FeatureLearningWidget widget;
180 QWidget* widgetPointer;
182 void loadFeatureSet(QString filePath);
183 void saveFeatureSet(QString filePath,
float w,
float h,
float d);
184 void updateFeatures();
186 void clearFeatures();
188 void updateSelection();
190 void connectToProvider();
191 void disconnectFromProvider();
193 void updatePausePlayButtonText();
194 void updateImageMonitorUI();
195 void updateFeaturesUI();
197 bool connectToPriorMemory(memoryx::PersistentObjectClassSegmentBasePrx& classesSegmentPrx,
memoryx::GridFileManagerPtr& fileManager);
201 static CFloatMatrix* createCuboid(
float w,
float h,
float d);
202 static void addRectangle(CFloatMatrix*
object,
int& offset,
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float x4,
float y4,
float z4,
float n1,
float n2,
float n3);
203 static void addTriangle(CFloatMatrix*
object,
int& offset,
float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float x3,
float y3,
float z3,
float n1,
float n2,
float n3);
207 visionx::ImageProviderInterfacePrx imageProviderPrx;
213 int numSelectedPoints;
215 CByteImage** cameraImages;
216 CByteImage* visualizationImage;
217 CByteImage* grayImage;
223 std::string imageProviderName;
225 CHarrisSIFTFeatureCalculator* featureCalculator;
226 CTexturedFeatureSet* objectFeatureSet;
227 CTexturedFeatureSet* viewFeatureSet;
229 bool undistortImages;
230 std::recursive_mutex imageMutex;
233 Eigen::ArrayX2f points;
241 QSettings mySettings;