Merge pull request #16717 from OrestChura:oc/goodFeatures

- cv::gapi::goodFeaturesToTrack() kernel is implemented
- tests (for exact check with cv::goodFeaturesToTrack() and for internal cases) are implemented
- a custom comparison function for vectors and a custom test fixture implemented
  - some posiible issues as wrong/inexact sorting of two compared vectors are
 not taken into account
- initializations of an input Mat using a picture from opencv_extra implemented (function from gapi_streaming_test used)
This commit is contained in:
Orest Chura
2020-04-07 18:53:24 +03:00
committed by GitHub
parent ab4dbff150
commit 2fe9c87433
11 changed files with 389 additions and 31 deletions
+9 -1
View File
@@ -2,7 +2,7 @@
// 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
// Copyright (C) 2018-2020 Intel Corporation
#include "precomp.hpp"
@@ -97,6 +97,14 @@ GMat Canny(const GMat& src, double thr1, double thr2, int apertureSize, bool l2g
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);
}
GMat RGB2Gray(const GMat& src)
{
return imgproc::GRGB2Gray::on(src);
+13 -1
View File
@@ -2,7 +2,7 @@
// 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
// Copyright (C) 2018-2020 Intel Corporation
#include "precomp.hpp"
@@ -182,6 +182,17 @@ GAPI_OCV_KERNEL(GCPUCanny, cv::gapi::imgproc::GCanny)
}
};
GAPI_OCV_KERNEL(GCPUGoodFeatures, cv::gapi::imgproc::GGoodFeatures)
{
static void run(const cv::Mat& image, int maxCorners, double qualityLevel, double minDistance,
const cv::Mat& mask, int blockSize, bool useHarrisDetector, double k,
std::vector<cv::Point2f> &out)
{
cv::goodFeaturesToTrack(image, out, maxCorners, qualityLevel, minDistance,
mask, blockSize, useHarrisDetector, k);
}
};
GAPI_OCV_KERNEL(GCPURGB2YUV, cv::gapi::imgproc::GRGB2YUV)
{
static void run(const cv::Mat& in, cv::Mat &out)
@@ -412,6 +423,7 @@ cv::gapi::GKernelPackage cv::gapi::imgproc::cpu::kernels()
, GCPUSobel
, GCPUSobelXY
, GCPUCanny
, GCPUGoodFeatures
, GCPUEqualizeHist
, GCPURGB2YUV
, GCPUYUV2RGB