Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/calib3d/perf/perf_pnp.cpp
	modules/contrib/src/imagelogpolprojection.cpp
	modules/contrib/src/templatebuffer.hpp
	modules/core/perf/opencl/perf_gemm.cpp
	modules/cudafeatures2d/doc/feature_detection_and_description.rst
	modules/cudafeatures2d/perf/perf_features2d.cpp
	modules/cudafeatures2d/src/fast.cpp
	modules/cudafeatures2d/test/test_features2d.cpp
	modules/features2d/doc/feature_detection_and_description.rst
	modules/features2d/include/opencv2/features2d/features2d.hpp
	modules/features2d/perf/opencl/perf_brute_force_matcher.cpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/gpu/perf4au/main.cpp
	modules/imgproc/perf/opencl/perf_blend.cpp
	modules/imgproc/perf/opencl/perf_color.cpp
	modules/imgproc/perf/opencl/perf_moments.cpp
	modules/imgproc/perf/opencl/perf_pyramid.cpp
	modules/objdetect/perf/opencl/perf_hogdetect.cpp
	modules/ocl/perf/perf_arithm.cpp
	modules/ocl/perf/perf_bgfg.cpp
	modules/ocl/perf/perf_blend.cpp
	modules/ocl/perf/perf_brute_force_matcher.cpp
	modules/ocl/perf/perf_canny.cpp
	modules/ocl/perf/perf_filters.cpp
	modules/ocl/perf/perf_gftt.cpp
	modules/ocl/perf/perf_haar.cpp
	modules/ocl/perf/perf_imgproc.cpp
	modules/ocl/perf/perf_imgwarp.cpp
	modules/ocl/perf/perf_match_template.cpp
	modules/ocl/perf/perf_matrix_operation.cpp
	modules/ocl/perf/perf_ml.cpp
	modules/ocl/perf/perf_moments.cpp
	modules/ocl/perf/perf_opticalflow.cpp
	modules/ocl/perf/perf_precomp.hpp
	modules/ocl/src/cl_context.cpp
	modules/ocl/src/opencl/haarobjectdetect.cl
	modules/video/src/lkpyramid.cpp
	modules/video/src/precomp.hpp
	samples/gpu/morphology.cpp
This commit is contained in:
Roman Donchenko
2014-03-11 17:20:01 +04:00
29 changed files with 70 additions and 118 deletions

View File

@@ -24,7 +24,7 @@ Class used for corner detection using the FAST algorithm. ::
// all features have same size
static const int FEATURE_SIZE = 7;
explicit FAST_CUDA(int threshold, bool nonmaxSupression = true,
explicit FAST_CUDA(int threshold, bool nonmaxSuppression = true,
double keypointsRatio = 0.05);
void operator ()(const GpuMat& image, const GpuMat& mask, GpuMat& keypoints);
@@ -39,7 +39,7 @@ Class used for corner detection using the FAST algorithm. ::
void release();
bool nonmaxSupression;
bool nonmaxSuppression;
int threshold;
@@ -61,11 +61,11 @@ cuda::FAST_CUDA::FAST_CUDA
--------------------------
Constructor.
.. ocv:function:: cuda::FAST_CUDA::FAST_CUDA(int threshold, bool nonmaxSupression = true, double keypointsRatio = 0.05)
.. ocv:function:: cuda::FAST_CUDA::FAST_CUDA(int threshold, bool nonmaxSuppression = true, double keypointsRatio = 0.05)
:param threshold: Threshold on difference between intensity of the central pixel and pixels on a circle around this pixel.
:param nonmaxSupression: If it is true, non-maximum suppression is applied to detected corners (keypoints).
:param nonmaxSuppression: If it is true, non-maximum suppression is applied to detected corners (keypoints).
:param keypointsRatio: Inner buffer size for keypoints store is determined as (keypointsRatio * image_width * image_height).
@@ -115,7 +115,7 @@ Releases inner buffer memory.
cuda::FAST_CUDA::calcKeyPointsLocation
--------------------------------------
Find keypoints and compute it's response if ``nonmaxSupression`` is true.
Find keypoints and compute it's response if ``nonmaxSuppression`` is true.
.. ocv:function:: int cuda::FAST_CUDA::calcKeyPointsLocation(const GpuMat& image, const GpuMat& mask)
@@ -185,7 +185,7 @@ Class for extracting ORB features and descriptors from an image. ::
int descriptorSize() const;
void setParams(size_t n_features, const ORB::CommonParams& detector_params);
void setFastParams(int threshold, bool nonmaxSupression = true);
void setFastParams(int threshold, bool nonmaxSuppression = true);
void release();

View File

@@ -216,7 +216,7 @@ public:
// all features have same size
static const int FEATURE_SIZE = 7;
explicit FAST_CUDA(int threshold, bool nonmaxSupression = true, double keypointsRatio = 0.05);
explicit FAST_CUDA(int threshold, bool nonmaxSuppression = true, double keypointsRatio = 0.05);
//! finds the keypoints using FAST detector
//! supports only CV_8UC1 images
@@ -232,19 +232,19 @@ public:
//! release temporary buffer's memory
void release();
bool nonmaxSupression;
bool nonmaxSuppression;
int threshold;
//! max keypoints = keypointsRatio * img.size().area()
double keypointsRatio;
//! find keypoints and compute it's response if nonmaxSupression is true
//! find keypoints and compute it's response if nonmaxSuppression is true
//! return count of detected keypoints
int calcKeyPointsLocation(const GpuMat& image, const GpuMat& mask);
//! get final array of keypoints
//! performs nonmax supression if needed
//! performs nonmax suppression if needed
//! return final count of keypoints
int getKeyPoints(GpuMat& keypoints);
@@ -303,10 +303,10 @@ public:
//! returns the descriptor size in bytes
inline int descriptorSize() const { return kBytes; }
inline void setFastParams(int threshold, bool nonmaxSupression = true)
inline void setFastParams(int threshold, bool nonmaxSuppression = true)
{
fastDetector_.threshold = threshold;
fastDetector_.nonmaxSupression = nonmaxSupression;
fastDetector_.nonmaxSuppression = nonmaxSuppression;
}
//! release temporary buffer's memory

View File

@@ -49,9 +49,9 @@ using namespace perf;
//////////////////////////////////////////////////////////////////////
// FAST
DEF_PARAM_TEST(Image_Threshold_NonMaxSupression, string, int, bool);
DEF_PARAM_TEST(Image_Threshold_NonMaxSuppression, string, int, bool);
PERF_TEST_P(Image_Threshold_NonMaxSupression, FAST,
PERF_TEST_P(Image_Threshold_NonMaxSuppression, FAST,
Combine(Values<string>("gpu/perf/aloe.png"),
Values(20),
Bool()))

View File

@@ -318,9 +318,9 @@ namespace cv { namespace cuda { namespace device
}
///////////////////////////////////////////////////////////////////////////
// nonmaxSupression
// nonmaxSuppression
__global__ void nonmaxSupression(const short2* kpLoc, int count, const PtrStepSzi scoreMat, short2* locFinal, float* responseFinal)
__global__ void nonmaxSuppression(const short2* kpLoc, int count, const PtrStepSzi scoreMat, short2* locFinal, float* responseFinal)
{
#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 110)
@@ -356,7 +356,7 @@ namespace cv { namespace cuda { namespace device
#endif
}
int nonmaxSupression_gpu(const short2* kpLoc, int count, PtrStepSzi score, short2* loc, float* response)
int nonmaxSuppression_gpu(const short2* kpLoc, int count, PtrStepSzi score, short2* loc, float* response)
{
void* counter_ptr;
cudaSafeCall( cudaGetSymbolAddress(&counter_ptr, g_counter) );
@@ -368,7 +368,7 @@ namespace cv { namespace cuda { namespace device
cudaSafeCall( cudaMemset(counter_ptr, 0, sizeof(unsigned int)) );
nonmaxSupression<<<grid, block>>>(kpLoc, count, score, loc, response);
nonmaxSuppression<<<grid, block>>>(kpLoc, count, score, loc, response);
cudaSafeCall( cudaGetLastError() );
cudaSafeCall( cudaDeviceSynchronize() );

View File

@@ -58,8 +58,8 @@ int cv::cuda::FAST_CUDA::getKeyPoints(GpuMat&) { throw_no_cuda(); return 0; }
#else /* !defined (HAVE_CUDA) */
cv::cuda::FAST_CUDA::FAST_CUDA(int _threshold, bool _nonmaxSupression, double _keypointsRatio) :
nonmaxSupression(_nonmaxSupression), threshold(_threshold), keypointsRatio(_keypointsRatio), count_(0)
cv::cuda::FAST_CUDA::FAST_CUDA(int _threshold, bool _nonmaxSuppression, double _keypointsRatio) :
nonmaxSuppression(_nonmaxSuppression), threshold(_threshold), keypointsRatio(_keypointsRatio), count_(0)
{
}
@@ -113,7 +113,7 @@ namespace cv { namespace cuda { namespace device
namespace fast
{
int calcKeypoints_gpu(PtrStepSzb img, PtrStepSzb mask, short2* kpLoc, int maxKeypoints, PtrStepSzi score, int threshold);
int nonmaxSupression_gpu(const short2* kpLoc, int count, PtrStepSzi score, short2* loc, float* response);
int nonmaxSuppression_gpu(const short2* kpLoc, int count, PtrStepSzi score, short2* loc, float* response);
}
}}}
@@ -128,13 +128,13 @@ int cv::cuda::FAST_CUDA::calcKeyPointsLocation(const GpuMat& img, const GpuMat&
ensureSizeIsEnough(1, maxKeypoints, CV_16SC2, kpLoc_);
if (nonmaxSupression)
if (nonmaxSuppression)
{
ensureSizeIsEnough(img.size(), CV_32SC1, score_);
score_.setTo(Scalar::all(0));
}
count_ = calcKeypoints_gpu(img, mask, kpLoc_.ptr<short2>(), maxKeypoints, nonmaxSupression ? score_ : PtrStepSzi(), threshold);
count_ = calcKeypoints_gpu(img, mask, kpLoc_.ptr<short2>(), maxKeypoints, nonmaxSuppression ? score_ : PtrStepSzi(), threshold);
count_ = std::min(count_, maxKeypoints);
return count_;
@@ -149,8 +149,8 @@ int cv::cuda::FAST_CUDA::getKeyPoints(GpuMat& keypoints)
ensureSizeIsEnough(ROWS_COUNT, count_, CV_32FC1, keypoints);
if (nonmaxSupression)
return nonmaxSupression_gpu(kpLoc_.ptr<short2>(), count_, score_, keypoints.ptr<short2>(LOCATION_ROW), keypoints.ptr<float>(RESPONSE_ROW));
if (nonmaxSuppression)
return nonmaxSuppression_gpu(kpLoc_.ptr<short2>(), count_, score_, keypoints.ptr<short2>(LOCATION_ROW), keypoints.ptr<float>(RESPONSE_ROW));
GpuMat locRow(1, count_, kpLoc_.type(), keypoints.ptr(0));
kpLoc_.colRange(0, count_).copyTo(locRow);

View File

@@ -52,20 +52,20 @@ using namespace cvtest;
namespace
{
IMPLEMENT_PARAM_CLASS(FAST_Threshold, int)
IMPLEMENT_PARAM_CLASS(FAST_NonmaxSupression, bool)
IMPLEMENT_PARAM_CLASS(FAST_NonmaxSuppression, bool)
}
PARAM_TEST_CASE(FAST, cv::cuda::DeviceInfo, FAST_Threshold, FAST_NonmaxSupression)
PARAM_TEST_CASE(FAST, cv::cuda::DeviceInfo, FAST_Threshold, FAST_NonmaxSuppression)
{
cv::cuda::DeviceInfo devInfo;
int threshold;
bool nonmaxSupression;
bool nonmaxSuppression;
virtual void SetUp()
{
devInfo = GET_PARAM(0);
threshold = GET_PARAM(1);
nonmaxSupression = GET_PARAM(2);
nonmaxSuppression = GET_PARAM(2);
cv::cuda::setDevice(devInfo.deviceID());
}
@@ -77,7 +77,7 @@ CUDA_TEST_P(FAST, Accuracy)
ASSERT_FALSE(image.empty());
cv::cuda::FAST_CUDA fast(threshold);
fast.nonmaxSupression = nonmaxSupression;
fast.nonmaxSuppression = nonmaxSuppression;
if (!supportFeature(devInfo, cv::cuda::GLOBAL_ATOMICS))
{
@@ -97,7 +97,7 @@ CUDA_TEST_P(FAST, Accuracy)
fast(loadMat(image), cv::cuda::GpuMat(), keypoints);
std::vector<cv::KeyPoint> keypoints_gold;
cv::FAST(image, keypoints_gold, threshold, nonmaxSupression);
cv::FAST(image, keypoints_gold, threshold, nonmaxSuppression);
ASSERT_KEYPOINTS_EQ(keypoints_gold, keypoints);
}
@@ -106,7 +106,7 @@ CUDA_TEST_P(FAST, Accuracy)
INSTANTIATE_TEST_CASE_P(CUDA_Features2D, FAST, testing::Combine(
ALL_DEVICES,
testing::Values(FAST_Threshold(25), FAST_Threshold(50)),
testing::Values(FAST_NonmaxSupression(false), FAST_NonmaxSupression(true))));
testing::Values(FAST_NonmaxSuppression(false), FAST_NonmaxSuppression(true))));
/////////////////////////////////////////////////////////////////////////////////////////////////
// ORB