forked from SolarFramework/SolARModuleOpenCV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolARModuleOpencv.cpp
More file actions
322 lines (315 loc) · 15.6 KB
/
SolARModuleOpencv.cpp
File metadata and controls
322 lines (315 loc) · 15.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
/**
* @copyright Copyright (c) 2015 All Right Reserved, B-com http://www.b-com.com/
*
* This file is subject to the B<>Com License.
* All other rights reserved.
*
* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
* KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
* PARTICULAR PURPOSE.
*
*/
#include <iostream>
#include "xpcf/module/ModuleFactory.h"
#include "SolARModuleOpencv_traits.h"
#include "SolAR2DOverlayOpencv.h"
#include "SolAR3DOverlayBoxOpencv.h"
#include "SolARCameraCalibrationOpencv.h"
#include "SolARCameraOpencv.h"
#include "SolARContoursExtractorOpencv.h"
#include "SolARContoursFilterBinaryMarkerOpencv.h"
#include "SolARDescriptorMatcherHammingBruteForceOpencv.h"
#include "SolARDescriptorMatcherKNNOpencv.h"
#include "SolARDescriptorMatcherRadiusOpencv.h"
#include "SolARDescriptorsExtractorSIFTOpencv.h"
#include "SolARDescriptorsExtractorAKAZEOpencv.h"
#include "SolARDescriptorsExtractorAKAZE2Opencv.h"
#include "SolARDescriptorsExtractorORBOpencv.h"
#include "SolARDescriptorsExtractorSBPatternOpencv.h"
#include "SolARFiducialMarkerLoaderOpencv.h"
#include "SolARFundamentalMatrixEstimationOpencv.h"
#include "SolARGeometricMatchesFilterOpencv.h"
#include "SolARHomographyEstimationOpencv.h"
#include "SolARHomographyMatrixDecomposerOpencv.h"
#include "SolARImageConvertorOpencv.h"
#include "SolARImageConvertorUnity.h"
#include "SolARImageFilterBinaryOpencv.h"
#include "SolARImageFilterAdaptiveBinaryOpencv.h"
#include "SolARImageFilterBlurOpencv.h"
#include "SolARImageFilterDilateOpencv.h"
#include "SolARImageFilterErodeOpencv.h"
#include "SolARImageLoaderOpencv.h"
#include "SolARImageMarkerLoaderOpencv.h"
#include "SolARImageViewerOpencv.h"
#include "SolARKeypointDetectorOpencv.h"
#include "SolARKeypointDetectorRegionOpencv.h"
#include "SolAROpticalFlowPyrLKOpencv.h"
#include "SolARPerspectiveControllerOpencv.h"
#include "SolARProjectOpencv.h"
#include "SolARUnprojectPlanarPointsOpencv.h"
#include "SolARPoseEstimationPlanarPointsOpencv.h"
#include "SolARPoseEstimationPnpOpencv.h"
#include "SolARPoseEstimationSACPnpOpencv.h"
#include "SolARPoseFinderFrom2D2DOpencv.h"
#include "SolARMatchesOverlayOpencv.h"
#include "SolARSVDFundamentalMatrixDecomposerOpencv.h"
#include "SolARSVDTriangulationOpencv.h"
#include "SolAR2D3DcorrespondencesFinderOpencv.h"
#include "SolARUndistortPointsOpencv.h"
#include "SolARVideoAsCameraOpencv.h"
#include "SolARImagesAsCameraOpencv.h"
#include "SolARDeviceDataLoader.h"
#include "SolARMapFusionOpencv.h"
#include "SolARCornerRefinementOpencv.h"
namespace xpcf=org::bcom::xpcf;
XPCF_DECLARE_MODULE("15e1990b-86b2-445c-8194-0cbe80ede970", "SolARModuleOpenCV", "SolARModuleOpenCV module description");
extern "C" XPCF_MODULEHOOKS_API xpcf::XPCFErrorCode XPCF_getComponent(const boost::uuids::uuid& componentUUID,SRef<xpcf::IComponentIntrospect>& interfaceRef)
{
xpcf::XPCFErrorCode errCode = xpcf::XPCFErrorCode::_FAIL;
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolAR2DOverlayOpencv>(componentUUID,interfaceRef);
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolAR3DOverlayBoxOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARCameraCalibrationOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARCameraOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARContoursExtractorOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARContoursFilterBinaryMarkerOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorMatcherHammingBruteForceOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorMatcherKNNOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorMatcherRadiusOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorsExtractorSIFTOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorsExtractorAKAZE2Opencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorsExtractorAKAZEOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorsExtractorORBOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDescriptorsExtractorSBPatternOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARFiducialMarkerLoaderOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARFundamentalMatrixEstimationOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARGeometricMatchesFilterOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARHomographyEstimationOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARHomographyMatrixDecomposerOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageConvertorOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageConvertorUnity>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageFilterBinaryOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageFilterAdaptiveBinaryOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageFilterBlurOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageFilterDilateOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageFilterErodeOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageLoaderOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageMarkerLoaderOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImageViewerOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARKeypointDetectorOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARKeypointDetectorRegionOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolAROpticalFlowPyrLKOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARPerspectiveControllerOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARProjectOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARUnprojectPlanarPointsOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARPoseEstimationPlanarPointsOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARPoseEstimationPnpOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARPoseEstimationSACPnpOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARPoseFinderFrom2D2DOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARMatchesOverlayOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARSVDFundamentalMatrixDecomposerOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARSVDTriangulationOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolAR2D3DCorrespondencesFinderOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARVideoAsCameraOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARImagesAsCameraOpencv>(componentUUID,interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARDeviceDataLoader>(componentUUID, interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARMapFusionOpencv>(componentUUID, interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARUndistortPointsOpencv>(componentUUID, interfaceRef);
}
if (errCode != xpcf::XPCFErrorCode::_SUCCESS)
{
errCode = xpcf::tryCreateComponent<SolAR::MODULES::OPENCV::SolARCornerRefinementOpencv>(componentUUID, interfaceRef);
}
return errCode;
}
XPCF_BEGIN_COMPONENTS_DECLARATION
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolAR2DOverlayOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolAR3DOverlayBoxOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARCameraCalibrationOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARCameraOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARContoursExtractorOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARContoursFilterBinaryMarkerOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorMatcherHammingBruteForceOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorMatcherKNNOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorMatcherRadiusOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorsExtractorSIFTOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorsExtractorAKAZE2Opencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorsExtractorAKAZEOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorsExtractorORBOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDescriptorsExtractorSBPatternOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARFiducialMarkerLoaderOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARFundamentalMatrixEstimationOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARGeometricMatchesFilterOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARHomographyEstimationOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARHomographyMatrixDecomposerOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageConvertorOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageConvertorUnity)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageFilterBinaryOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageFilterAdaptiveBinaryOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageFilterBlurOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageFilterDilateOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageFilterErodeOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageLoaderOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageMarkerLoaderOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImageViewerOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARKeypointDetectorOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARKeypointDetectorRegionOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolAROpticalFlowPyrLKOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARPerspectiveControllerOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARProjectOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARUnprojectPlanarPointsOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARPoseEstimationPlanarPointsOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARPoseEstimationPnpOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARPoseEstimationSACPnpOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARPoseFinderFrom2D2DOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARMatchesOverlayOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARSVDFundamentalMatrixDecomposerOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARSVDTriangulationOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolAR2D3DCorrespondencesFinderOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARVideoAsCameraOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARImagesAsCameraOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARDeviceDataLoader)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARMapFusionOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARUndistortPointsOpencv)
XPCF_ADD_COMPONENT(SolAR::MODULES::OPENCV::SolARCornerRefinementOpencv)
XPCF_END_COMPONENTS_DECLARATION