1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2018-2019 Intel Corporation
10 #include "opencv2/gapi/gscalar.hpp"
11 #include "opencv2/gapi/gcall.hpp"
12 #include "opencv2/gapi/gkernel.hpp"
13 #include "opencv2/gapi/imgproc.hpp"
15 namespace cv { namespace gapi {
17 GMat sepFilter(const GMat& src, int ddepth, const Mat& kernelX, const Mat& kernelY, const Point& anchor,
18 const Scalar& delta, int borderType, const Scalar& borderVal)
20 return imgproc::GSepFilter::on(src, ddepth, kernelX, kernelY, anchor, delta, borderType, borderVal);
23 GMat filter2D(const GMat& src, int ddepth, const Mat& kernel, const Point& anchor, const Scalar& delta, int borderType,
24 const Scalar& bordVal)
26 return imgproc::GFilter2D::on(src, ddepth, kernel, anchor, delta, borderType, bordVal);
29 GMat boxFilter(const GMat& src, int dtype, const Size& ksize, const Point& anchor,
30 bool normalize, int borderType, const Scalar& bordVal)
32 return imgproc::GBoxFilter::on(src, dtype, ksize, anchor, normalize, borderType, bordVal);
35 GMat blur(const GMat& src, const Size& ksize, const Point& anchor,
36 int borderType, const Scalar& bordVal)
38 return imgproc::GBlur::on(src, ksize, anchor, borderType, bordVal);
41 GMat gaussianBlur(const GMat& src, const Size& ksize, double sigmaX, double sigmaY,
42 int borderType, const Scalar& bordVal)
44 return imgproc::GGaussBlur::on(src, ksize, sigmaX, sigmaY, borderType, bordVal);
47 GMat medianBlur(const GMat& src, int ksize)
49 return imgproc::GMedianBlur::on(src, ksize);
52 GMat erode(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,
53 int borderType, const Scalar& borderValue )
55 return imgproc::GErode::on(src, kernel, anchor, iterations, borderType, borderValue);
58 GMat erode3x3(const GMat& src, int iterations,
59 int borderType, const Scalar& borderValue )
61 return erode(src, cv::Mat(), cv::Point(-1, -1), iterations, borderType, borderValue);
64 GMat dilate(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,
65 int borderType, const Scalar& borderValue)
67 return imgproc::GDilate::on(src, kernel, anchor, iterations, borderType, borderValue);
70 GMat dilate3x3(const GMat& src, int iterations,
71 int borderType, const Scalar& borderValue)
73 return dilate(src, cv::Mat(), cv::Point(-1,-1), iterations, borderType, borderValue);
76 GMat Sobel(const GMat& src, int ddepth, int dx, int dy, int ksize,
77 double scale, double delta,
78 int borderType, const Scalar& bordVal)
80 return imgproc::GSobel::on(src, ddepth, dx, dy, ksize, scale, delta, borderType, bordVal);
83 GMat equalizeHist(const GMat& src)
85 return imgproc::GEqHist::on(src);
88 GMat Canny(const GMat& src, double thr1, double thr2, int apertureSize, bool l2gradient)
90 return imgproc::GCanny::on(src, thr1, thr2, apertureSize, l2gradient);
93 GMat RGB2Gray(const GMat& src)
95 return imgproc::GRGB2Gray::on(src);
98 GMat RGB2Gray(const GMat& src, float rY, float gY, float bY)
100 return imgproc::GRGB2GrayCustom::on(src, rY, gY, bY);
103 GMat BGR2Gray(const GMat& src)
105 return imgproc::GBGR2Gray::on(src);
108 GMat RGB2YUV(const GMat& src)
110 return imgproc::GRGB2YUV::on(src);
113 GMat BGR2LUV(const GMat& src)
115 return imgproc::GBGR2LUV::on(src);
118 GMat LUV2BGR(const GMat& src)
120 return imgproc::GLUV2BGR::on(src);
123 GMat BGR2YUV(const GMat& src)
125 return imgproc::GBGR2YUV::on(src);
128 GMat YUV2BGR(const GMat& src)
130 return imgproc::GYUV2BGR::on(src);
133 GMat YUV2RGB(const GMat& src)
135 return imgproc::GYUV2RGB::on(src);
138 GMat RGB2Lab(const GMat& src)
140 return imgproc::GRGB2Lab::on(src);