opencv/modules/gapi/src/api/kernels_video.cpp
OrestChura 05d5c284f6 gapi: buildOpticalFlowPyramid() interface, CPUkernel and CPUtests implementation
- kernel added to a cv::gapi::video namespace
     - tests to check a kernels (based on cv::video tests for cv::buildOpticalFlowPyramid())
     - tests for a combined G-API-pipeline (buildOpticalFlowPyramid() -> calcOpticalFlowPyrLK())
     - tests for internal purposes added
     - custom function for comparison in tests implemented
2020-04-21 14:36:42 +03:00

57 lines
2.7 KiB
C++

// 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) 2020 Intel Corporation
#include "precomp.hpp"
#include <opencv2/gapi/video.hpp>
namespace cv { namespace gapi {
using namespace video;
GBuildPyrOutput buildOpticalFlowPyramid(const GMat &img,
const Size &winSize,
const GScalar &maxLevel,
bool withDerivatives,
int pyrBorder,
int derivBorder,
bool tryReuseInputImage)
{
return GBuildOptFlowPyramid::on(img, winSize, maxLevel, withDerivatives, pyrBorder,
derivBorder, tryReuseInputImage);
}
GOptFlowLKOutput calcOpticalFlowPyrLK(const GMat &prevImg,
const GMat &nextImg,
const cv::GArray<cv::Point2f> &prevPts,
const cv::GArray<cv::Point2f> &predPts,
const Size &winSize,
const GScalar &maxLevel,
const TermCriteria &criteria,
int flags,
double minEigThresh)
{
return GCalcOptFlowLK::on(prevImg, nextImg, prevPts, predPts, winSize, maxLevel,
criteria, flags, minEigThresh);
}
GOptFlowLKOutput calcOpticalFlowPyrLK(const cv::GArray<cv::GMat> &prevPyr,
const cv::GArray<cv::GMat> &nextPyr,
const cv::GArray<cv::Point2f> &prevPts,
const cv::GArray<cv::Point2f> &predPts,
const Size &winSize,
const GScalar &maxLevel,
const TermCriteria &criteria,
int flags,
double minEigThresh)
{
return GCalcOptFlowLKForPyr::on(prevPyr, nextPyr, prevPts, predPts, winSize, maxLevel,
criteria, flags, minEigThresh);
}
} //namespace gapi
} //namespace cv