split gpuvideo onto gpuoptflow and gpubgsegm

This commit is contained in:
Vladislav Vinogradov
2013-04-17 18:35:09 +04:00
parent eda124ec32
commit ac0f506d0e
53 changed files with 1613 additions and 900 deletions

View File

@@ -556,3 +556,34 @@ Downloads results from :ocv:func:`gpu::HoughCircles` to host memory.
:param h_circles: Output host array.
.. seealso:: :ocv:func:`gpu::HoughCircles`
gpu::GoodFeaturesToTrackDetector_GPU
------------------------------------
.. ocv:class:: gpu::GoodFeaturesToTrackDetector_GPU
Class used for strong corners detection on an image. ::
class GoodFeaturesToTrackDetector_GPU
{
public:
explicit GoodFeaturesToTrackDetector_GPU(int maxCorners_ = 1000, double qualityLevel_ = 0.01, double minDistance_ = 0.0,
int blockSize_ = 3, bool useHarrisDetector_ = false, double harrisK_ = 0.04);
void operator ()(const GpuMat& image, GpuMat& corners, const GpuMat& mask = GpuMat());
int maxCorners;
double qualityLevel;
double minDistance;
int blockSize;
bool useHarrisDetector;
double harrisK;
void releaseMemory();
};
The class finds the most prominent corners in the image.
.. seealso:: :ocv:func:`goodFeaturesToTrack`

View File

@@ -1092,3 +1092,42 @@ PERF_TEST_P(Sz_Depth_Cn_KernelSz, BilateralFilter,
CPU_SANITY_CHECK(dst);
}
}
//////////////////////////////////////////////////////
// GoodFeaturesToTrack
DEF_PARAM_TEST(Image_MinDistance, string, double);
PERF_TEST_P(Image_MinDistance, GoodFeaturesToTrack,
Combine(Values<string>("gpu/perf/aloe.png"),
Values(0.0, 3.0)))
{
const string fileName = GET_PARAM(0);
const double minDistance = GET_PARAM(1);
const cv::Mat image = readImage(fileName, cv::IMREAD_GRAYSCALE);
ASSERT_FALSE(image.empty());
const int maxCorners = 8000;
const double qualityLevel = 0.01;
if (PERF_RUN_GPU())
{
cv::gpu::GoodFeaturesToTrackDetector_GPU d_detector(maxCorners, qualityLevel, minDistance);
const cv::gpu::GpuMat d_image(image);
cv::gpu::GpuMat pts;
TEST_CYCLE() d_detector(d_image, pts);
GPU_SANITY_CHECK(pts);
}
else
{
cv::Mat pts;
TEST_CYCLE() cv::goodFeaturesToTrack(image, pts, maxCorners, qualityLevel, minDistance);
CPU_SANITY_CHECK(pts);
}
}