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
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
//
// Copyright (C) 2018 Intel Corporation
#include "precomp.hpp"
#include <opencv2/gapi/gcall.hpp>
#include <opencv2/gapi/gscalar.hpp>
#include <opencv2/gapi/gkernel.hpp>
#include <opencv2/gapi/core.hpp>
#include <tuple>
#include <numeric>
namespace cv { namespace gapi {
GMat add(const GMat& src1, const GMat& src2, int dtype)
{
return core::GAdd::on(src1, src2, dtype);
}
GMat addC(const GMat& src1, const GScalar& c, int dtype)
{
return core::GAddC::on(src1, c, dtype);
}
GMat addC(const GScalar& c, const GMat& src1, int dtype)
{
return core::GAddC::on(src1, c, dtype);
}
GMat sub(const GMat& src1, const GMat& src2, int dtype)
{
return core::GSub::on(src1, src2, dtype);
}
GMat subC(const GMat& src1, const GScalar& c, int dtype)
{
return core::GSubC::on(src1, c, dtype);
}
GMat subRC(const GScalar& c, const GMat& src, int dtype)
{
return core::GSubRC::on(c, src, dtype);
}
GMat mul(const GMat& src1, const GMat& src2, double scale, int dtype)
{
return core::GMul::on(src1, src2, scale, dtype);
}
GMat mulC(const GMat& src, double scale, int dtype)
{
return core::GMulCOld::on(src, scale, dtype);
}
GMat mulC(const GMat& src, const GScalar& multiplier, int dtype)
{
return core::GMulC::on(src, multiplier, dtype);
}
GMat mulC(const GScalar& multiplier, const GMat& src, int dtype)
{
return core::GMulC::on(src, multiplier, dtype);
}
GMat div(const GMat& src1, const GMat& src2, double scale, int dtype)
{
return core::GDiv::on(src1, src2, scale, dtype);
}
GMat divC(const GMat& src, const GScalar& divisor, double scale, int dtype)
{
return core::GDivC::on(src, divisor, scale, dtype);
}
GMat divRC(const GScalar& divident, const GMat& src, double scale, int dtype)
{
return core::GDivRC::on(divident, src, scale, dtype);
}
GScalar mean(const GMat& src)
{
return core::GMean::on(src);
}
GMat mask(const GMat& src, const GMat& mask)
{
return core::GMask::on(src, mask);
}
std::tuple<GMat, GMat> polarToCart(const GMat& magnitude, const GMat& angle,
bool angleInDegrees)
{
return core::GPolarToCart::on(magnitude, angle, angleInDegrees);
}
std::tuple<GMat, GMat> cartToPolar(const GMat& x, const GMat& y,
bool angleInDegrees)
{
return core::GCartToPolar::on(x, y, angleInDegrees);
}
GMat phase(const GMat &x, const GMat &y, bool angleInDegrees)
{
return core::GPhase::on(x, y, angleInDegrees);
}
GMat cmpGT(const GMat& src1, const GMat& src2)
{
return core::GCmpGT::on(src1, src2);
}
GMat cmpLT(const GMat& src1, const GMat& src2)
{
return core::GCmpLT::on(src1, src2);
}
GMat cmpGE(const GMat& src1, const GMat& src2)
{
return core::GCmpGE::on(src1, src2);
}
GMat cmpLE(const GMat& src1, const GMat& src2)
{
return core::GCmpLE::on(src1, src2);
}
GMat cmpEQ(const GMat& src1, const GMat& src2)
{
return core::GCmpEQ::on(src1, src2);
}
GMat cmpNE(const GMat& src1, const GMat& src2)
{
return core::GCmpNE::on(src1, src2);
}
GMat cmpGT(const GMat& src1, const GScalar& src2)
{
return core::GCmpGTScalar::on(src1, src2);
}
GMat cmpLT(const GMat& src1, const GScalar& src2)
{
return core::GCmpLTScalar::on(src1, src2);
}
GMat cmpGE(const GMat& src1, const GScalar& src2)
{
return core::GCmpGEScalar::on(src1, src2);
}
GMat cmpLE(const GMat& src1, const GScalar& src2)
{
return core::GCmpLEScalar::on(src1, src2);
}
GMat cmpEQ(const GMat& src1, const GScalar& src2)
{
return core::GCmpEQScalar::on(src1, src2);
}
GMat cmpNE(const GMat& src1, const GScalar& src2)
{
return core::GCmpNEScalar::on(src1, src2);
}
GMat min(const GMat& src1, const GMat& src2)
{
return core::GMin::on(src1, src2);
}
GMat max(const GMat& src1, const GMat& src2)
{
return core::GMax::on(src1, src2);
}
GMat absDiff(const GMat& src1, const GMat& src2)
{
return core::GAbsDiff::on(src1, src2);
}
GMat absDiffC(const GMat& src, const GScalar& c)
{
return core::GAbsDiffC::on(src, c);
}
GMat bitwise_and(const GMat& src1, const GMat& src2)
{
return core::GAnd::on(src1, src2);
}
GMat bitwise_and(const GMat& src1, const GScalar& src2)
{
return core::GAndS::on(src1, src2);
}
GMat bitwise_or(const GMat& src1, const GMat& src2)
{
return core::GOr::on(src1, src2);
}
GMat bitwise_or(const GMat& src1, const GScalar& src2)
{
return core::GOrS::on(src1, src2);
}
GMat bitwise_xor(const GMat& src1, const GMat& src2)
{
return core::GXor::on(src1, src2);
}
GMat bitwise_xor(const GMat& src1, const GScalar& src2)
{
return core::GXorS::on(src1, src2);
}
GMat bitwise_not(const GMat& src1)
{
return core::GNot::on(src1);
}
GMat select(const GMat& src1, const GMat& src2, const GMat& mask)
{
return core::GSelect::on(src1, src2, mask);
}
GScalar sum(const GMat& src)
{
return core::GSum::on(src);
}
GMat addWeighted(const GMat& src1, double alpha, const GMat& src2, double beta, double gamma, int dtype)
{
return core::GAddW::on(src1, alpha, src2, beta, gamma, dtype);
}
GScalar normL1(const GMat& src)
{
return core::GNormL1::on(src);
}
GScalar normL2(const GMat& src)
{
return core::GNormL2::on(src);
}
GScalar normInf(const GMat& src)
{
return core::GNormInf::on(src);
}
std::tuple<GMat, GMat> integral(const GMat& src, int sdepth, int sqdepth)
{
return core::GIntegral::on(src, sdepth, sqdepth);
}
GMat threshold(const GMat& src, const GScalar& thresh, const GScalar& maxval, int type)
{
GAPI_Assert(type != cv::THRESH_TRIANGLE && type != cv::THRESH_OTSU);
return core::GThreshold::on(src, thresh, maxval, type);
}
std::tuple<GMat, GScalar> threshold(const GMat& src, const GScalar& maxval, int type)
{
GAPI_Assert(type == cv::THRESH_TRIANGLE || type == cv::THRESH_OTSU);
return core::GThresholdOT::on(src, maxval, type);
}
GMat inRange(const GMat& src, const GScalar& threshLow, const GScalar& threshUp)
{
return core::GInRange::on(src, threshLow, threshUp);
}
std::tuple<GMat, GMat, GMat> split3(const GMat& src)
{
return core::GSplit3::on(src);
}
std::tuple<GMat, GMat, GMat, GMat> split4(const GMat& src)
{
return core::GSplit4::on(src);
}
GMat merge3(const GMat& src1, const GMat& src2, const GMat& src3)
{
return core::GMerge3::on(src1, src2, src3);
}
GMat merge4(const GMat& src1, const GMat& src2, const GMat& src3, const GMat& src4)
{
return core::GMerge4::on(src1, src2, src3, src4);
}
GMat resize(const GMat& src, const Size& dsize, double fx, double fy, int interpolation)
{
return core::GResize::on(src, dsize, fx, fy, interpolation);
}
GMatP resizeP(const GMatP& src, const Size& dsize, int interpolation)
{
return core::GResizeP::on(src, dsize, interpolation);
}
GMat remap(const GMat& src, const Mat& map1, const Mat& map2,
int interpolation, int borderMode,
const Scalar& borderValue)
{
return core::GRemap::on(src, map1, map2, interpolation, borderMode, borderValue);
}
GMat flip(const GMat& src, int flipCode)
{
return core::GFlip::on(src, flipCode);
}
GMat crop(const GMat& src, const Rect& rect)
{
return core::GCrop::on(src, rect);
}
GMat copy(const GMat& src)
{
return core::GCopy::on(src);
}
GMat concatHor(const GMat& src1, const GMat& src2)
{
return core::GConcatHor::on(src1, src2);
}
GMat concatHor(const std::vector<GMat>& v)
{
GAPI_Assert(v.size() >= 2);
return std::accumulate(v.begin()+1, v.end(), v[0], core::GConcatHor::on);
}
GMat concatVert(const GMat& src1, const GMat& src2)
{
return core::GConcatVert::on(src1, src2);
}
GMat concatVert(const std::vector<GMat>& v)
{
GAPI_Assert(v.size() >= 2);
return std::accumulate(v.begin()+1, v.end(), v[0], core::GConcatVert::on);
}
GMat LUT(const GMat& src, const Mat& lut)
{
return core::GLUT::on(src, lut);
}
GMat convertTo(const GMat& m, int rtype, double alpha, double beta)
{
return core::GConvertTo::on(m, rtype, alpha, beta);
}
GMat sqrt(const GMat& src)
{
return core::GSqrt::on(src);
}
GMat normalize(const GMat& _src, double a, double b,
int norm_type, int ddepth)
{
return core::GNormalize::on(_src, a, b, norm_type, ddepth);
}
} //namespace gapi
} //namespace cv