kernels_imgproc.cpp
9.49 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
323
324
325
326
327
328
329
330
331
// 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-2020 Intel Corporation
#include "precomp.hpp"
#include <opencv2/gapi/gscalar.hpp>
#include <opencv2/gapi/gcall.hpp>
#include <opencv2/gapi/gkernel.hpp>
#include <opencv2/gapi/imgproc.hpp>
namespace cv { namespace gapi {
GMat sepFilter(const GMat& src, int ddepth, const Mat& kernelX, const Mat& kernelY, const Point& anchor,
const Scalar& delta, int borderType, const Scalar& borderVal)
{
return imgproc::GSepFilter::on(src, ddepth, kernelX, kernelY, anchor, delta, borderType, borderVal);
}
GMat filter2D(const GMat& src, int ddepth, const Mat& kernel, const Point& anchor, const Scalar& delta, int borderType,
const Scalar& bordVal)
{
return imgproc::GFilter2D::on(src, ddepth, kernel, anchor, delta, borderType, bordVal);
}
GMat boxFilter(const GMat& src, int dtype, const Size& ksize, const Point& anchor,
bool normalize, int borderType, const Scalar& bordVal)
{
return imgproc::GBoxFilter::on(src, dtype, ksize, anchor, normalize, borderType, bordVal);
}
GMat blur(const GMat& src, const Size& ksize, const Point& anchor,
int borderType, const Scalar& bordVal)
{
return imgproc::GBlur::on(src, ksize, anchor, borderType, bordVal);
}
GMat gaussianBlur(const GMat& src, const Size& ksize, double sigmaX, double sigmaY,
int borderType, const Scalar& bordVal)
{
return imgproc::GGaussBlur::on(src, ksize, sigmaX, sigmaY, borderType, bordVal);
}
GMat medianBlur(const GMat& src, int ksize)
{
return imgproc::GMedianBlur::on(src, ksize);
}
GMat erode(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,
int borderType, const Scalar& borderValue )
{
return imgproc::GErode::on(src, kernel, anchor, iterations, borderType, borderValue);
}
GMat erode3x3(const GMat& src, int iterations,
int borderType, const Scalar& borderValue )
{
return erode(src, cv::Mat(), cv::Point(-1, -1), iterations, borderType, borderValue);
}
GMat dilate(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,
int borderType, const Scalar& borderValue)
{
return imgproc::GDilate::on(src, kernel, anchor, iterations, borderType, borderValue);
}
GMat dilate3x3(const GMat& src, int iterations,
int borderType, const Scalar& borderValue)
{
return dilate(src, cv::Mat(), cv::Point(-1,-1), iterations, borderType, borderValue);
}
GMat morphologyEx(const GMat &src, const MorphTypes op, const Mat &kernel, const Point &anchor,
const int iterations, const BorderTypes borderType, const Scalar &borderValue)
{
return imgproc::GMorphologyEx::on(src, op, kernel, anchor, iterations,
borderType, borderValue);
}
GMat Sobel(const GMat& src, int ddepth, int dx, int dy, int ksize,
double scale, double delta,
int borderType, const Scalar& bordVal)
{
return imgproc::GSobel::on(src, ddepth, dx, dy, ksize, scale, delta, borderType, bordVal);
}
std::tuple<GMat, GMat> SobelXY(const GMat& src, int ddepth, int order, int ksize,
double scale, double delta,
int borderType, const Scalar& bordVal)
{
return imgproc::GSobelXY::on(src, ddepth, order, ksize, scale, delta, borderType, bordVal);
}
GMat Laplacian(const GMat& src, int ddepth, int ksize, double scale, double delta, int borderType)
{
return imgproc::GLaplacian::on(src, ddepth, ksize, scale, delta, borderType);
}
GMat bilateralFilter(const GMat& src, int d, double sigmaColor, double sigmaSpace, int borderType)
{
return imgproc::GBilateralFilter::on(src, d, sigmaColor, sigmaSpace, borderType);
}
GMat equalizeHist(const GMat& src)
{
return imgproc::GEqHist::on(src);
}
GMat Canny(const GMat& src, double thr1, double thr2, int apertureSize, bool l2gradient)
{
return imgproc::GCanny::on(src, thr1, thr2, apertureSize, l2gradient);
}
cv::GArray<cv::Point2f> goodFeaturesToTrack(const GMat& image, int maxCorners, double qualityLevel,
double minDistance, const Mat& mask, int blockSize,
bool useHarrisDetector, double k)
{
return imgproc::GGoodFeatures::on(image, maxCorners, qualityLevel, minDistance, mask, blockSize,
useHarrisDetector, k);
}
GArray<GArray<Point>>
findContours(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method,
const GOpaque<Point> &offset)
{
return imgproc::GFindContours::on(src, mode, method, offset);
}
GArray<GArray<Point>>
findContours(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method)
{
return imgproc::GFindContoursNoOffset::on(src, mode, method);
}
std::tuple<GArray<GArray<Point>>,GArray<Vec4i>>
findContoursH(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method,
const GOpaque<Point> &offset)
{
return imgproc::GFindContoursH::on(src, mode, method, offset);
}
std::tuple<GArray<GArray<Point>>,GArray<Vec4i>>
findContoursH(const GMat &src, const RetrievalModes mode, const ContourApproximationModes method)
{
return imgproc::GFindContoursHNoOffset::on(src, mode, method);
}
GOpaque<Rect> boundingRect(const GMat& src)
{
return imgproc::GBoundingRectMat::on(src);
}
GOpaque<Rect> boundingRect(const GArray<Point2i>& src)
{
return imgproc::GBoundingRectVector32S::on(src);
}
GOpaque<Rect> boundingRect(const GArray<Point2f>& src)
{
return imgproc::GBoundingRectVector32F::on(src);
}
GOpaque<Vec4f> fitLine2D(const GMat& src, const DistanceTypes distType, const double param,
const double reps, const double aeps)
{
return imgproc::GFitLine2DMat::on(src, distType, param, reps, aeps);
}
GOpaque<Vec4f> fitLine2D(const GArray<Point2i>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine2DVector32S::on(src, distType, param, reps, aeps);
}
GOpaque<Vec4f> fitLine2D(const GArray<Point2f>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine2DVector32F::on(src, distType, param, reps, aeps);
}
GOpaque<Vec4f> fitLine2D(const GArray<Point2d>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine2DVector64F::on(src, distType, param, reps, aeps);
}
GOpaque<Vec6f> fitLine3D(const GMat& src, const DistanceTypes distType, const double param,
const double reps, const double aeps)
{
return imgproc::GFitLine3DMat::on(src, distType, param, reps, aeps);
}
GOpaque<Vec6f> fitLine3D(const GArray<Point3i>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine3DVector32S::on(src, distType, param, reps, aeps);
}
GOpaque<Vec6f> fitLine3D(const GArray<Point3f>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine3DVector32F::on(src, distType, param, reps, aeps);
}
GOpaque<Vec6f> fitLine3D(const GArray<Point3d>& src, const DistanceTypes distType,
const double param, const double reps, const double aeps)
{
return imgproc::GFitLine3DVector64F::on(src, distType, param, reps, aeps);
}
GMat BGR2RGB(const GMat& src)
{
return imgproc::GBGR2RGB::on(src);
}
GMat RGB2Gray(const GMat& src)
{
return imgproc::GRGB2Gray::on(src);
}
GMat RGB2Gray(const GMat& src, float rY, float gY, float bY)
{
return imgproc::GRGB2GrayCustom::on(src, rY, gY, bY);
}
GMat BGR2Gray(const GMat& src)
{
return imgproc::GBGR2Gray::on(src);
}
GMat RGB2YUV(const GMat& src)
{
return imgproc::GRGB2YUV::on(src);
}
GMat BGR2LUV(const GMat& src)
{
return imgproc::GBGR2LUV::on(src);
}
GMat LUV2BGR(const GMat& src)
{
return imgproc::GLUV2BGR::on(src);
}
GMat BGR2YUV(const GMat& src)
{
return imgproc::GBGR2YUV::on(src);
}
GMat YUV2BGR(const GMat& src)
{
return imgproc::GYUV2BGR::on(src);
}
GMat YUV2RGB(const GMat& src)
{
return imgproc::GYUV2RGB::on(src);
}
GMat BGR2I420(const GMat& src)
{
return imgproc::GBGR2I420::on(src);
}
GMat RGB2I420(const GMat& src)
{
return imgproc::GRGB2I420::on(src);
}
GMat I4202BGR(const GMat& src)
{
return imgproc::GI4202BGR::on(src);
}
GMat I4202RGB(const GMat& src)
{
return imgproc::GI4202RGB::on(src);
}
GMat NV12toRGB(const GMat& src_y, const GMat& src_uv)
{
return imgproc::GNV12toRGB::on(src_y, src_uv);
}
GMat NV12toBGR(const GMat& src_y, const GMat& src_uv)
{
return imgproc::GNV12toBGR::on(src_y, src_uv);
}
GMat RGB2Lab(const GMat& src)
{
return imgproc::GRGB2Lab::on(src);
}
GMat BayerGR2RGB(const GMat& src_gr)
{
return imgproc::GBayerGR2RGB::on(src_gr);
}
GMat RGB2HSV(const GMat& src)
{
return imgproc::GRGB2HSV::on(src);
}
GMat RGB2YUV422(const GMat& src)
{
return imgproc::GRGB2YUV422::on(src);
}
GMat NV12toGray(const GMat &y, const GMat &uv)
{
return imgproc::GNV12toGray::on(y, uv);
}
GMatP NV12toRGBp(const GMat &y, const GMat &uv)
{
return imgproc::GNV12toRGBp::on(y, uv);
}
GMatP NV12toBGRp(const GMat &y, const GMat &uv)
{
return imgproc::GNV12toBGRp::on(y, uv);
}
} //namespace gapi
} //namespace cv