1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-09-15 00:52:21 +03:00
committed by Alexander Alekhin
235 changed files with 18422 additions and 3526 deletions
+3 -3
View File
@@ -7936,7 +7936,7 @@ static void OAST_9_16(InputArray _img, std::vector<KeyPoint>& keypoints, int thr
void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
AGAST(_img, keypoints, threshold, nonmax_suppression, AgastFeatureDetector::OAST_9_16);
}
@@ -7950,7 +7950,7 @@ public:
void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(_image.empty())
{
@@ -8013,7 +8013,7 @@ Ptr<AgastFeatureDetector> AgastFeatureDetector::create( int threshold, bool nonm
void AGAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
std::vector<KeyPoint> kpts;
+1 -1
View File
@@ -167,7 +167,7 @@ namespace cv
OutputArray descriptors,
bool useProvidedKeypoints) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( ! image.empty() );
+4 -4
View File
@@ -89,7 +89,7 @@ BOWKMeansTrainer::BOWKMeansTrainer( int _clusterCount, const TermCriteria& _term
Mat BOWKMeansTrainer::cluster() const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( !descriptors.empty() );
@@ -108,7 +108,7 @@ BOWKMeansTrainer::~BOWKMeansTrainer()
Mat BOWKMeansTrainer::cluster( const Mat& _descriptors ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat labels, vocabulary;
kmeans( _descriptors, clusterCount, labels, termcrit, attempts, flags, vocabulary );
@@ -143,7 +143,7 @@ const Mat& BOWImgDescriptorExtractor::getVocabulary() const
void BOWImgDescriptorExtractor::compute( InputArray image, std::vector<KeyPoint>& keypoints, OutputArray imgDescriptor,
std::vector<std::vector<int> >* pointIdxsOfClusters, Mat* descriptors )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
imgDescriptor.release();
@@ -174,7 +174,7 @@ int BOWImgDescriptorExtractor::descriptorType() const
void BOWImgDescriptorExtractor::compute( InputArray keypointDescriptors, OutputArray _imgDescriptor, std::vector<std::vector<int> >* pointIdxsOfClusters )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( !vocabulary.empty() );
CV_Assert(!keypointDescriptors.empty());
+2 -2
View File
@@ -190,7 +190,7 @@ void SimpleBlobDetectorImpl::write( cv::FileStorage& fs ) const
void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImage, std::vector<Center> &centers) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat image = _image.getMat(), binaryImage = _binaryImage.getMat();
CV_UNUSED(image);
@@ -308,7 +308,7 @@ void SimpleBlobDetectorImpl::findBlobs(InputArray _image, InputArray _binaryImag
void SimpleBlobDetectorImpl::detect(InputArray image, std::vector<cv::KeyPoint>& keypoints, InputArray mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
keypoints.clear();
CV_Assert(params.minRepeatability != 0);
+1 -1
View File
@@ -91,7 +91,7 @@ static inline void _drawKeypoint( InputOutputArray img, const KeyPoint& p, const
void drawKeypoints( InputArray image, const std::vector<KeyPoint>& keypoints, InputOutputArray outImage,
const Scalar& _color, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( !(flags & DrawMatchesFlags::DRAW_OVER_OUTIMG) )
{
+6 -6
View File
@@ -179,7 +179,7 @@ void EllipticKeyPoint::calcProjection( const Mat_<double>& H, EllipticKeyPoint&
void EllipticKeyPoint::convert( const std::vector<KeyPoint>& src, std::vector<EllipticKeyPoint>& dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( !src.empty() )
{
@@ -196,7 +196,7 @@ void EllipticKeyPoint::convert( const std::vector<KeyPoint>& src, std::vector<El
void EllipticKeyPoint::convert( const std::vector<EllipticKeyPoint>& src, std::vector<KeyPoint>& dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( !src.empty() )
{
@@ -460,7 +460,7 @@ void cv::evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H
float& repeatability, int& correspCount,
const Ptr<FeatureDetector>& _fdetector )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Ptr<FeatureDetector> fdetector(_fdetector);
std::vector<KeyPoint> *keypoints1, *keypoints2, buf1, buf2;
@@ -498,7 +498,7 @@ void cv::computeRecallPrecisionCurve( const std::vector<std::vector<DMatch> >& m
const std::vector<std::vector<uchar> >& correctMatches1to2Mask,
std::vector<Point2f>& recallPrecisionCurve )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( matches1to2.size() == correctMatches1to2Mask.size() );
@@ -534,7 +534,7 @@ void cv::computeRecallPrecisionCurve( const std::vector<std::vector<DMatch> >& m
float cv::getRecall( const std::vector<Point2f>& recallPrecisionCurve, float l_precision )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int nearestPointIndex = getNearestPoint( recallPrecisionCurve, l_precision );
@@ -548,7 +548,7 @@ float cv::getRecall( const std::vector<Point2f>& recallPrecisionCurve, float l_p
int cv::getNearestPoint( const std::vector<Point2f>& recallPrecisionCurve, float l_precision )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int nearestPointIndex = -1;
+3 -3
View File
@@ -474,7 +474,7 @@ static inline int hal_FAST(cv::Mat& src, std::vector<KeyPoint>& keypoints, int t
void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(_img.isUMat() && type == FastFeatureDetector::TYPE_9_16,
ocl_FAST(_img, keypoints, threshold, nonmax_suppression, 10000));
@@ -505,7 +505,7 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
FAST(_img, keypoints, threshold, nonmax_suppression, FastFeatureDetector::TYPE_9_16);
}
@@ -520,7 +520,7 @@ public:
void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(_image.empty())
{
+5 -5
View File
@@ -60,7 +60,7 @@ void Feature2D::detect( InputArray image,
std::vector<KeyPoint>& keypoints,
InputArray mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( image.empty() )
{
@@ -75,7 +75,7 @@ void Feature2D::detect( InputArrayOfArrays _images,
std::vector<std::vector<KeyPoint> >& keypoints,
InputArrayOfArrays _masks )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
vector<Mat> images, masks;
@@ -106,7 +106,7 @@ void Feature2D::compute( InputArray image,
std::vector<KeyPoint>& keypoints,
OutputArray descriptors )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( image.empty() )
{
@@ -120,7 +120,7 @@ void Feature2D::compute( InputArrayOfArrays _images,
std::vector<std::vector<KeyPoint> >& keypoints,
OutputArrayOfArrays _descriptors )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( !_descriptors.needed() )
return;
@@ -149,7 +149,7 @@ void Feature2D::detectAndCompute( InputArray, InputArray,
OutputArray,
bool )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Error(Error::StsNotImplemented, "");
}
+1 -1
View File
@@ -78,7 +78,7 @@ public:
void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(_image.empty())
{
+1 -1
View File
@@ -110,7 +110,7 @@ namespace cv
OutputArray descriptors,
bool useProvidedKeypoints) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
cv::Mat img = image.getMat();
if (img.channels() > 1)
+14 -14
View File
@@ -44,7 +44,7 @@ AKAZEFeatures::AKAZEFeatures(const AKAZEOptions& options) : options_(options) {
* @brief This method allocates the memory for the nonlinear diffusion evolution
*/
void AKAZEFeatures::Allocate_Memory_Evolution(void) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
float rfactor = 0.0f;
int level_height = 0, level_width = 0;
@@ -127,7 +127,7 @@ static inline int getGaussianKernelSize(float sigma) {
static inline void
nld_step_scalar_one_lane(const Mat& Lt, const Mat& Lf, Mat& Lstep, float step_size, int row_begin, int row_end)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
/* The labeling scheme for this five star stencil:
[ a ]
[ -1 c +1 ]
@@ -277,7 +277,7 @@ ocl_non_linear_diffusion_step(InputArray Lt_, InputArray Lf_, OutputArray Lstep_
static inline void
non_linear_diffusion_step(InputArray Lt_, InputArray Lf_, OutputArray Lstep_, float step_size)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Lstep_.create(Lt_.size(), Lt_.type());
@@ -302,7 +302,7 @@ non_linear_diffusion_step(InputArray Lt_, InputArray Lf_, OutputArray Lstep_, fl
static inline float
compute_kcontrast(InputArray Lx_, InputArray Ly_, float perc, int nbins)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(nbins > 2);
CV_Assert(!Lx_.empty());
@@ -379,7 +379,7 @@ ocl_pm_g2(InputArray Lx_, InputArray Ly_, OutputArray Lflow_, float kcontrast)
static inline void
compute_diffusivity(InputArray Lx, InputArray Ly, OutputArray Lflow, float kcontrast, int diffusivity)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Lflow.create(Lx.size(), Lx.type());
@@ -432,7 +432,7 @@ static inline void
create_nonlinear_scale_space(InputArray image, const AKAZEOptions &options,
const std::vector<std::vector<float > > &tsteps_evolution, std::vector<Evolution<MatType> > &evolution)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(evolution.size() > 0);
// convert input to grayscale float image if needed
@@ -575,7 +575,7 @@ ocl_compute_determinant(InputArray Lxx_, InputArray Lxy_, InputArray Lyy_,
static inline void compute_determinant(InputArray Lxx_, InputArray Lxy_, InputArray Lyy_,
OutputArray Ldet_, float sigma)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Ldet_.create(Lxx_.size(), Lxx_.type());
@@ -647,7 +647,7 @@ private:
*/
static inline void
Compute_Determinant_Hessian_Response(UMatPyramid &evolution) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
DeterminantHessianResponse<UMat> body (evolution);
body(Range(0, (int)evolution.size()));
@@ -660,7 +660,7 @@ Compute_Determinant_Hessian_Response(UMatPyramid &evolution) {
*/
static inline void
Compute_Determinant_Hessian_Response(Pyramid &evolution) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
parallel_for_(Range(0, (int)evolution.size()), DeterminantHessianResponse<Mat>(evolution));
}
@@ -673,7 +673,7 @@ Compute_Determinant_Hessian_Response(Pyramid &evolution) {
*/
void AKAZEFeatures::Feature_Detection(std::vector<KeyPoint>& kpts)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
kpts.clear();
std::vector<Mat> keypoints_by_layers;
@@ -791,7 +791,7 @@ private:
*/
void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<Mat>& keypoints_by_layers)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
keypoints_by_layers.resize(evolution_.size());
@@ -872,7 +872,7 @@ void AKAZEFeatures::Find_Scale_Space_Extrema(std::vector<Mat>& keypoints_by_laye
void AKAZEFeatures::Do_Subpixel_Refinement(
std::vector<Mat>& keypoints_by_layers, std::vector<KeyPoint>& output_keypoints)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for (size_t i = 0; i < keypoints_by_layers.size(); i++) {
const MEvolution &e = evolution_[i];
@@ -1185,7 +1185,7 @@ private:
*/
void AKAZEFeatures::Compute_Descriptors(std::vector<KeyPoint>& kpts, OutputArray descriptors)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for(size_t i = 0; i < kpts.size(); i++)
{
@@ -1466,7 +1466,7 @@ private:
*/
void AKAZEFeatures::Compute_Keypoints_Orientation(std::vector<KeyPoint>& kpts) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
parallel_for_(Range(0, (int)kpts.size()), ComputeKeypointOrientation(kpts, evolution_));
}
@@ -123,7 +123,7 @@ void pm_g1(InputArray _Lx, InputArray _Ly, OutputArray _dst, float k) {
* @param k Contrast factor parameter
*/
void pm_g2(InputArray _Lx, InputArray _Ly, OutputArray _dst, float k) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
_dst.create(_Lx.size(), _Lx.type());
Mat Lx = _Lx.getMat();
@@ -227,7 +227,7 @@ void charbonnier_diffusivity(InputArray _Lx, InputArray _Ly, OutputArray _dst, f
* @return k contrast factor
*/
float compute_k_percentile(const cv::Mat& img, float perc, float gscale, int nbins, int ksize_x, int ksize_y) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int nbin = 0, nelements = 0, nthreshold = 0, k = 0;
float kperc = 0.0, modg = 0.0;
@@ -326,7 +326,7 @@ void compute_scharr_derivatives(const cv::Mat& src, cv::Mat& dst, int xorder, in
* @param scale_ Scale factor or derivative size
*/
void compute_derivative_kernels(cv::OutputArray _kx, cv::OutputArray _ky, int dx, int dy, int scale) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int ksize = 3 + 2 * (scale - 1);
@@ -424,7 +424,7 @@ private:
* dL_by_ds = d(c dL_by_dx)_by_dx + d(c dL_by_dy)_by_dy
*/
void nld_step_scalar(cv::Mat& Ld, const cv::Mat& c, cv::Mat& Lstep, float stepsize) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
cv::parallel_for_(cv::Range(1, Lstep.rows - 1), Nld_Step_Scalar_Invoker(Ld, c, Lstep, stepsize), (double)Ld.total()/(1 << 16));
+1 -1
View File
@@ -156,7 +156,7 @@ private:
void KeyPointsFilter::runByPixelsMask( std::vector<KeyPoint>& keypoints, const Mat& mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( mask.empty() )
return;
+19 -10
View File
@@ -44,7 +44,16 @@
#include "opencl_kernels_features2d.hpp"
#if defined(HAVE_EIGEN) && EIGEN_WORLD_VERSION == 2
#include <Eigen/Array>
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4701) // potentially uninitialized local variable
# pragma warning(disable:4702) // unreachable code
# pragma warning(disable:4714) // const marked as __forceinline not inlined
# endif
# include <Eigen/Array>
# if defined(_MSC_VER)
# pragma warning(pop)
# endif
#endif
namespace cv
@@ -567,7 +576,7 @@ void DescriptorMatcher::train()
void DescriptorMatcher::match( InputArray queryDescriptors, InputArray trainDescriptors,
std::vector<DMatch>& matches, InputArray mask ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Ptr<DescriptorMatcher> tempMatcher = clone(true);
tempMatcher->add(trainDescriptors);
@@ -578,7 +587,7 @@ void DescriptorMatcher::knnMatch( InputArray queryDescriptors, InputArray trainD
std::vector<std::vector<DMatch> >& matches, int knn,
InputArray mask, bool compactResult ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Ptr<DescriptorMatcher> tempMatcher = clone(true);
tempMatcher->add(trainDescriptors);
@@ -589,7 +598,7 @@ void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray tra
std::vector<std::vector<DMatch> >& matches, float maxDistance, InputArray mask,
bool compactResult ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Ptr<DescriptorMatcher> tempMatcher = clone(true);
tempMatcher->add(trainDescriptors);
@@ -598,7 +607,7 @@ void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, InputArray tra
void DescriptorMatcher::match( InputArray queryDescriptors, std::vector<DMatch>& matches, InputArrayOfArrays masks )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
std::vector<std::vector<DMatch> > knnMatches;
knnMatch( queryDescriptors, knnMatches, 1, masks, true /*compactResult*/ );
@@ -630,7 +639,7 @@ void DescriptorMatcher::checkMasks( InputArrayOfArrays _masks, int queryDescript
void DescriptorMatcher::knnMatch( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, int knn,
InputArrayOfArrays masks, bool compactResult )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( empty() || queryDescriptors.empty() )
return;
@@ -646,7 +655,7 @@ void DescriptorMatcher::knnMatch( InputArray queryDescriptors, std::vector<std::
void DescriptorMatcher::radiusMatch( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, float maxDistance,
InputArrayOfArrays masks, bool compactResult )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
matches.clear();
if( empty() || queryDescriptors.empty() )
@@ -1142,7 +1151,7 @@ void FlannBasedMatcher::clear()
void FlannBasedMatcher::train()
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( !flannIndex || mergedDescriptors.size() < addedDescCount )
{
@@ -1398,7 +1407,7 @@ void FlannBasedMatcher::convertToDMatches( const DescriptorCollection& collectio
void FlannBasedMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<std::vector<DMatch> >& matches, int knn,
InputArrayOfArrays /*masks*/, bool /*compactResult*/ )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat queryDescriptors = _queryDescriptors.getMat();
Mat indices( queryDescriptors.rows, knn, CV_32SC1 );
@@ -1411,7 +1420,7 @@ void FlannBasedMatcher::knnMatchImpl( InputArray _queryDescriptors, std::vector<
void FlannBasedMatcher::radiusMatchImpl( InputArray _queryDescriptors, std::vector<std::vector<DMatch> >& matches, float maxDistance,
InputArrayOfArrays /*masks*/, bool /*compactResult*/ )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat queryDescriptors = _queryDescriptors.getMat();
const int count = mergedDescriptors.size(); // TODO do count as param?
+2 -2
View File
@@ -1036,7 +1036,7 @@ extractMSER_8uC3( const Mat& src,
void MSER_Impl::detectRegions( InputArray _src, vector<vector<Point> >& msers, vector<Rect>& bboxes )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
@@ -1074,7 +1074,7 @@ void MSER_Impl::detectRegions( InputArray _src, vector<vector<Point> >& msers, v
void MSER_Impl::detect( InputArray _image, vector<KeyPoint>& keypoints, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
vector<Rect> bboxes;
vector<vector<Point> > msers;
+1 -1
View File
@@ -957,7 +957,7 @@ void ORB_Impl::detectAndCompute( InputArray _image, InputArray _mask,
std::vector<KeyPoint>& keypoints,
OutputArray _descriptors, bool useProvidedKeypoints )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(patchSize >= 2);