Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/2.4' into merge-2.4
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Roman Donchenko committed Mar 11, 2014
2 parents 702a2a6 + 0084dee commit 95a5545
Show file tree
Hide file tree
Showing 29 changed files with 70 additions and 118 deletions.
2 changes: 1 addition & 1 deletion modules/calib3d/perf/perf_pnp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ PERF_TEST_P(PointsNum, DISABLED_SolvePnPRansac, testing::Values(4, 3*9, 7*13))
Mat tvec;

#ifdef HAVE_TBB
// limit concurrency to get determenistic result
// limit concurrency to get deterministic result
tbb::task_scheduler_init one_thread(1);
#endif

Expand Down
2 changes: 1 addition & 1 deletion modules/calib3d/test/test_solvepnp_ransac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ TEST(DISABLED_Calib3d_SolvePnPRansac, concurrency)
Mat tvec1, tvec2;

{
// limit concurrency to get determenistic result
// limit concurrency to get deterministic result
cv::theRNG().state = 20121010;
tbb::task_scheduler_init one_thread(1);
solvePnPRansac(object, image, camera_mat, dist_coef, rvec1, tvec1);
Expand Down
2 changes: 1 addition & 1 deletion modules/contrib/src/lda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Mat subspaceReconstruct(InputArray _W, InputArray _mean, InputArray _src)
String error_message = format("Wrong mean shape for the given eigenvector matrix. Expected %d, but was %d.", W.cols, mean.total());
CV_Error(Error::StsBadArg, error_message);
}
// initalize temporary matrices
// initialize temporary matrices
Mat X, Y;
// copy data & make sure we are using the correct type
src.convertTo(Y, W.type());
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/opencv2/core/core_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ CVAPI(void) cvResetImageROI( IplImage* image );
/* Retrieves image ROI */
CVAPI(CvRect) cvGetImageROI( const IplImage* image );

/* Allocates and initalizes CvMat header */
/* Allocates and initializes CvMat header */
CVAPI(CvMat*) cvCreateMatHeader( int rows, int cols, int type );

#define CV_AUTOSTEP 0x7fffffff
Expand Down
2 changes: 1 addition & 1 deletion modules/core/src/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2904,7 +2904,7 @@ cvCreateImage( CvSize size, int depth, int channels )
}


// initalize IplImage header, allocated by the user
// initialize IplImage header, allocated by the user
CV_IMPL IplImage*
cvInitImageHeader( IplImage * image, CvSize size, int depth,
int channels, int origin, int align )
Expand Down
12 changes: 6 additions & 6 deletions modules/cudafeatures2d/doc/feature_detection_and_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -39,7 +39,7 @@ Class used for corner detection using the FAST algorithm. ::

void release();

bool nonmaxSupression;
bool nonmaxSuppression;

int threshold;

Expand All @@ -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).

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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();

Expand Down
12 changes: 6 additions & 6 deletions modules/cudafeatures2d/include/opencv2/cudafeatures2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class CV_EXPORTS FAST_CUDA
// 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
Expand All @@ -232,19 +232,19 @@ class CV_EXPORTS FAST_CUDA
//! 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);

Expand Down Expand Up @@ -303,10 +303,10 @@ class CV_EXPORTS ORB_CUDA
//! 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
Expand Down
4 changes: 2 additions & 2 deletions modules/cudafeatures2d/perf/perf_features2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand Down
8 changes: 4 additions & 4 deletions modules/cudafeatures2d/src/cuda/fast.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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) );
Expand All @@ -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() );
Expand Down
14 changes: 7 additions & 7 deletions modules/cudafeatures2d/src/fast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}

Expand Down Expand Up @@ -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);
}
}}}

Expand All @@ -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_;
Expand All @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions modules/cudafeatures2d/test/test_features2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand All @@ -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))
{
Expand All @@ -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);
}
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions modules/cudaimgproc/perf/perf_hough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ PERF_TEST_P(Image, HoughLinesP,
const float rho = 1.0f;
const float theta = static_cast<float>(CV_PI / 180.0);
const int threshold = 100;
const int minLineLenght = 50;
const int minLineLength = 50;
const int maxLineGap = 5;

const cv::Mat image = cv::imread(fileName, cv::IMREAD_GRAYSCALE);
Expand All @@ -153,7 +153,7 @@ PERF_TEST_P(Image, HoughLinesP,
const cv::cuda::GpuMat d_mask(mask);
cv::cuda::GpuMat d_lines;

cv::Ptr<cv::cuda::HoughSegmentDetector> hough = cv::cuda::createHoughSegmentDetector(rho, theta, minLineLenght, maxLineGap);
cv::Ptr<cv::cuda::HoughSegmentDetector> hough = cv::cuda::createHoughSegmentDetector(rho, theta, minLineLength, maxLineGap);

TEST_CYCLE() hough->detect(d_mask, d_lines);

Expand All @@ -167,7 +167,7 @@ PERF_TEST_P(Image, HoughLinesP,
{
std::vector<cv::Vec4i> cpu_lines;

TEST_CYCLE() cv::HoughLinesP(mask, cpu_lines, rho, theta, threshold, minLineLenght, maxLineGap);
TEST_CYCLE() cv::HoughLinesP(mask, cpu_lines, rho, theta, threshold, minLineLength, maxLineGap);

SANITY_CHECK(cpu_lines);
}
Expand Down
6 changes: 3 additions & 3 deletions modules/features2d/doc/feature_detection_and_description.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ FAST
----
Detects corners using the FAST algorithm

.. ocv:function:: void FAST( InputArray image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression=true )
.. ocv:function:: void FAST( InputArray image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSupression, int type )
.. ocv:function:: void FAST( InputArray image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSuppression=true )
.. ocv:function:: void FAST( InputArray image, vector<KeyPoint>& keypoints, int threshold, bool nonmaxSuppression, int type )
.. ocv:pyfunction:: cv2.FastFeatureDetector([, threshold[, nonmaxSuppression]]) -> <FastFeatureDetector object>
.. ocv:pyfunction:: cv2.FastFeatureDetector(threshold, nonmaxSuppression, type) -> <FastFeatureDetector object>
Expand All @@ -25,7 +25,7 @@ Detects corners using the FAST algorithm

:param threshold: threshold on difference between intensity of the central pixel and pixels of a circle around this pixel.

:param nonmaxSupression: if true, non-maximum suppression is applied to detected corners (keypoints).
:param nonmaxSuppression: if true, non-maximum suppression is applied to detected corners (keypoints).

:param type: one of the three neighborhoods as defined in the paper: ``FastFeatureDetector::TYPE_9_16``, ``FastFeatureDetector::TYPE_7_12``, ``FastFeatureDetector::TYPE_5_8``

Expand Down
4 changes: 2 additions & 2 deletions modules/features2d/include/opencv2/features2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,10 @@ class CV_EXPORTS_W StarDetector : public FeatureDetector

//! detects corners using FAST algorithm by E. Rosten
CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,
int threshold, bool nonmaxSupression=true );
int threshold, bool nonmaxSuppression=true );

CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector<KeyPoint>& keypoints,
int threshold, bool nonmaxSupression, int type );
int threshold, bool nonmaxSuppression, int type );

class CV_EXPORTS_W FastFeatureDetector : public FeatureDetector
{
Expand Down
2 changes: 1 addition & 1 deletion modules/features2d/src/evaluation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class EllipticKeyPoint

Point2f center;
Scalar ellipse; // 3 elements a, b, c: ax^2+2bxy+cy^2=1
Size_<float> axes; // half lenght of elipse axes
Size_<float> axes; // half length of ellipse axes
Size_<float> boundingBox; // half sizes of bounding box which sides are parallel to the coordinate axes
};

Expand Down
Loading

0 comments on commit 95a5545

Please sign in to comment.