Path: blob/master/modules/gapi/src/api/kernels_imgproc.cpp
16338 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018 Intel Corporation567#include "precomp.hpp"89#include "opencv2/gapi/gscalar.hpp"10#include "opencv2/gapi/gcall.hpp"11#include "opencv2/gapi/gkernel.hpp"12#include "opencv2/gapi/imgproc.hpp"1314namespace cv { namespace gapi {1516GMat sepFilter(const GMat& src, int ddepth, const Mat& kernelX, const Mat& kernelY, const Point& anchor,17const Scalar& delta, int borderType, const Scalar& borderVal)18{19return imgproc::GSepFilter::on(src, ddepth, kernelX, kernelY, anchor, delta, borderType, borderVal);20}2122GMat filter2D(const GMat& src, int ddepth, const Mat& kernel, const Point& anchor, const Scalar& delta, int borderType,23const Scalar& bordVal)24{25return imgproc::GFilter2D::on(src, ddepth, kernel, anchor, delta, borderType, bordVal);26}2728GMat boxFilter(const GMat& src, int dtype, const Size& ksize, const Point& anchor,29bool normalize, int borderType, const Scalar& bordVal)30{31return imgproc::GBoxFilter::on(src, dtype, ksize, anchor, normalize, borderType, bordVal);32}3334GMat blur(const GMat& src, const Size& ksize, const Point& anchor,35int borderType, const Scalar& bordVal)36{37return imgproc::GBlur::on(src, ksize, anchor, borderType, bordVal);38}3940GMat gaussianBlur(const GMat& src, const Size& ksize, double sigmaX, double sigmaY,41int borderType, const Scalar& bordVal)42{43return imgproc::GGaussBlur::on(src, ksize, sigmaX, sigmaY, borderType, bordVal);44}4546GMat medianBlur(const GMat& src, int ksize)47{48return imgproc::GMedianBlur::on(src, ksize);49}5051GMat erode(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,52int borderType, const Scalar& borderValue )53{54return imgproc::GErode::on(src, kernel, anchor, iterations, borderType, borderValue);55}5657GMat erode3x3(const GMat& src, int iterations,58int borderType, const Scalar& borderValue )59{60return erode(src, cv::Mat(), cv::Point(-1, -1), iterations, borderType, borderValue);61}6263GMat dilate(const GMat& src, const Mat& kernel, const Point& anchor, int iterations,64int borderType, const Scalar& borderValue)65{66return imgproc::GDilate::on(src, kernel, anchor, iterations, borderType, borderValue);67}6869GMat dilate3x3(const GMat& src, int iterations,70int borderType, const Scalar& borderValue)71{72return dilate(src, cv::Mat(), cv::Point(-1,-1), iterations, borderType, borderValue);73}7475GMat Sobel(const GMat& src, int ddepth, int dx, int dy, int ksize,76double scale, double delta,77int borderType, const Scalar& bordVal)78{79return imgproc::GSobel::on(src, ddepth, dx, dy, ksize, scale, delta, borderType, bordVal);80}8182GMat equalizeHist(const GMat& src)83{84return imgproc::GEqHist::on(src);85}8687GMat Canny(const GMat& src, double thr1, double thr2, int apertureSize, bool l2gradient)88{89return imgproc::GCanny::on(src, thr1, thr2, apertureSize, l2gradient);90}9192GMat RGB2Gray(const GMat& src)93{94return imgproc::GRGB2Gray::on(src);95}9697GMat RGB2Gray(const GMat& src, float rY, float gY, float bY)98{99return imgproc::GRGB2GrayCustom::on(src, rY, gY, bY);100}101102GMat BGR2Gray(const GMat& src)103{104return imgproc::GBGR2Gray::on(src);105}106107GMat RGB2YUV(const GMat& src)108{109return imgproc::GRGB2YUV::on(src);110}111112GMat BGR2LUV(const GMat& src)113{114return imgproc::GBGR2LUV::on(src);115}116117GMat LUV2BGR(const GMat& src)118{119return imgproc::GLUV2BGR::on(src);120}121122GMat BGR2YUV(const GMat& src)123{124return imgproc::GBGR2YUV::on(src);125}126127GMat YUV2BGR(const GMat& src)128{129return imgproc::GYUV2BGR::on(src);130}131132GMat YUV2RGB(const GMat& src)133{134return imgproc::GYUV2RGB::on(src);135}136137GMat RGB2Lab(const GMat& src)138{139return imgproc::GRGB2Lab::on(src);140}141142} //namespace gapi143} //namespace cv144145146