Skip to content

Commit 35972a1

Browse files
committed
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
2 parents 64961f3 + d1fc1c6 commit 35972a1

File tree

14 files changed

+43
-65
lines changed

14 files changed

+43
-65
lines changed

modules/line_descriptor/test/test_descriptors_regression.cpp

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
100100
curMaxDist = dist;
101101
}
102102

103-
std::stringstream ss;
104-
ss << "Max distance between valid and computed descriptors " << curMaxDist;
105-
106-
if( curMaxDist < maxDist )
107-
ss << "." << std::endl;
108-
109-
else
110-
{
111-
ss << ">" << maxDist << " - bad accuracy!" << "\n";
112-
ts->set_failed_test_info( cvtest::TS::FAIL_BAD_ACCURACY );
113-
}
114-
115-
ts->printf( cvtest::TS::LOG, ss.str().c_str() );
103+
EXPECT_LT(curMaxDist, maxDist) << "Max distance between valid and computed descriptors";
116104
}
117105

118106
Mat readDescriptors()
@@ -286,25 +274,11 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
286274
ts->printf( cvtest::TS::LOG, "\nAverage time of computing one descriptor = %g ms.\n",
287275
t / ( (double) getTickFrequency() * 1000. ) / calcDescriptors.rows );
288276

289-
if( calcDescriptors.rows != (int) keylines.size() )
290-
{
291-
ts->printf( cvtest::TS::LOG, "Count of computed descriptors and keylines count must be equal.\n" );
292-
ts->printf( cvtest::TS::LOG, "Count of keylines is %d.\n", (int) keylines.size() );
293-
ts->printf( cvtest::TS::LOG, "Count of computed descriptors is %d.\n", calcDescriptors.rows );
294-
ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
295-
return;
296-
}
277+
ASSERT_EQ((int)keylines.size(), calcDescriptors.rows)
278+
<< "Count of computed descriptors and keylines count must be equal";
297279

298-
if( calcDescriptors.cols != bd->descriptorSize() / 8 || calcDescriptors.type() != bd->descriptorType() )
299-
{
300-
ts->printf( cvtest::TS::LOG, "Incorrect descriptor size or descriptor type.\n" );
301-
ts->printf( cvtest::TS::LOG, "Expected size is %d.\n", bd->descriptorSize() );
302-
ts->printf( cvtest::TS::LOG, "Calculated size is %d.\n", calcDescriptors.cols );
303-
ts->printf( cvtest::TS::LOG, "Expected type is %d.\n", bd->descriptorType() );
304-
ts->printf( cvtest::TS::LOG, "Calculated type is %d.\n", calcDescriptors.type() );
305-
ts->set_failed_test_info( cvtest::TS::FAIL_INVALID_OUTPUT );
306-
return;
307-
}
280+
ASSERT_EQ(bd->descriptorSize() / 8, calcDescriptors.cols);
281+
ASSERT_EQ(bd->descriptorType(), calcDescriptors.type());
308282

309283
// TODO read and write descriptor extractor parameters and check them
310284
Mat validDescriptors = readDescriptors();

modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,6 @@ struct GPCTrainingParams
135135
CV_Assert( check() );
136136
}
137137

138-
GPCTrainingParams( const GPCTrainingParams &params )
139-
: maxTreeDepth( params.maxTreeDepth ), minNumberOfSamples( params.minNumberOfSamples ), descriptorType( params.descriptorType ),
140-
printProgress( params.printProgress )
141-
{
142-
CV_Assert( check() );
143-
}
144-
145138
bool check() const { return maxTreeDepth > 1 && minNumberOfSamples > 1; }
146139
};
147140

modules/sfm/src/libmv_light/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS -Winconsistent-missing-override -Wsuggest-o
77
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
88
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wclass-memaccess)
99
endif()
10+
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.0)
11+
ocv_warnings_disable(CMAKE_CXX_FLAGS -Wdeprecated-copy)
12+
endif()
1013

1114
add_subdirectory(libmv)

modules/surface_matching/src/ppf_match_3d.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,10 @@ static KeyType hashPPF(const Vec4d& f, const double AngleStep, const double Dist
8282
(int)(f[1] / AngleStep),
8383
(int)(f[2] / AngleStep),
8484
(int)(f[3] / DistanceStep));
85-
KeyType hashKey = 0;
85+
KeyType hashKey[2] = {0, 0}; // hashMurmurx64() fills two values
8686

87-
murmurHash(key.val, 4*sizeof(int), 42, &hashKey);
88-
return hashKey;
87+
murmurHash(key.val, 4*sizeof(int), 42, &hashKey[0]);
88+
return hashKey[0];
8989
}
9090

9191
/*static size_t hashMurmur(uint key)

modules/xfeatures2d/test/test_gms_matcher.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ CV_GMSMatcherTest::CV_GMSMatcherTest()
3737
eps[1][2] = 0.80;
3838
eps[1][3] = 0.78;
3939

40-
eps[2][0] = 0.70;
41-
eps[2][1] = 0.66;
42-
eps[2][2] = 0.68;
43-
eps[2][3] = 0.63;
40+
eps[2][0] = 0.6;
41+
eps[2][1] = 0.6;
42+
eps[2][2] = 0.6;
43+
eps[2][3] = 0.6;
4444

4545
correctMatchDistThreshold = 5.0;
4646
}

modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ INSTANTIATE_TEST_CASE_P(SIFT, DescriptorRotationInvariance, Values(
3333
));
3434

3535
INSTANTIATE_TEST_CASE_P(LATCH, DescriptorRotationInvariance, Values(
36-
make_tuple(IMAGE_TSUKUBA, SIFT::create(), LATCH::create(), 0.9999f)
36+
make_tuple(IMAGE_TSUKUBA, SIFT::create(), LATCH::create(), 0.98f)
3737
));
3838

3939
#endif // NONFREE
@@ -154,7 +154,6 @@ INSTANTIATE_TEST_CASE_P(BoostDesc_BINBOOST_256, DescriptorRotationInvariance, Va
154154

155155
// ============================ SCALE INVARIANCE ==============================
156156

157-
158157
#ifdef OPENCV_ENABLE_NONFREE
159158
INSTANTIATE_TEST_CASE_P(SURF, DetectorScaleInvariance, Values(
160159
make_tuple(IMAGE_BIKES, SURF::create(), 0.64f, 0.84f)
@@ -284,6 +283,7 @@ TEST(Features2d_RotationInvariance2_Detector_SURF, regression)
284283
ASSERT_LT(fabs(keypoints[i1].response - keypoints[i].response) / keypoints[i1].response, 1e-6);
285284
}
286285
}
286+
287287
#endif // NONFREE
288288

289289
}} // namespace

modules/ximgproc/src/structured_edge_detection.cpp

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,24 @@
3737
//
3838
//M*/
3939

40+
#include "precomp.hpp"
41+
4042
#include <vector>
4143
#include <algorithm>
4244
#include <iterator>
4345
#include <iostream>
4446
#include <cmath>
4547

46-
#include "precomp.hpp"
47-
4848
#include "advanced_types.hpp"
4949

50+
#ifdef CV_CXX11
51+
#define CV_USE_PARALLEL_PREDICT_EDGES_1 1
52+
#define CV_USE_PARALLEL_PREDICT_EDGES_2 0 //1, see https://github.com/opencv/opencv_contrib/issues/2346
53+
#else
54+
#define CV_USE_PARALLEL_PREDICT_EDGES_1 0
55+
#define CV_USE_PARALLEL_PREDICT_EDGES_2 0
56+
#endif
57+
5058
/********************* Helper functions *********************/
5159

5260
/*!
@@ -730,7 +738,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
730738
}
731739
// lookup tables for mapping linear index to offset pairs
732740

733-
#ifdef CV_CXX11
741+
#if CV_USE_PARALLEL_PREDICT_EDGES_1
734742
parallel_for_(cv::Range(0, height), [&](const cv::Range& range)
735743
#else
736744
const cv::Range range(0, height);
@@ -779,7 +787,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
779787
}
780788
}
781789
}
782-
#ifdef CV_CXX11
790+
#if CV_USE_PARALLEL_PREDICT_EDGES_1
783791
);
784792
#endif
785793

@@ -788,8 +796,10 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
788796
dstM.setTo(0);
789797

790798
float step = 2.0f * CV_SQR(stride) / CV_SQR(ipSize) / nTreesEval;
791-
#ifdef CV_CXX11
799+
#if CV_USE_PARALLEL_PREDICT_EDGES_2
792800
parallel_for_(cv::Range(0, height), [&](const cv::Range& range)
801+
#elif CV_USE_PARALLEL_PREDICT_EDGES_1
802+
const cv::Range range(0, height);
793803
#endif
794804
{
795805
for(int i = range.start; i < range.end; ++i)
@@ -816,7 +826,7 @@ class StructuredEdgeDetectionImpl : public StructuredEdgeDetection
816826
}
817827
}
818828
}
819-
#ifdef CV_CXX11
829+
#if CV_USE_PARALLEL_PREDICT_EDGES_2
820830
);
821831
#endif
822832

modules/ximgproc/test/test_edgeboxes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace opencv_test { namespace {
77

8-
TEST(ximpgroc_Edgeboxes, DISABLED_regression)
8+
TEST(ximgproc_Edgeboxes, regression)
99
{
1010
//Testing Edgeboxes implementation by asking for one proposal
1111
//on a simple test image from the PASCAL VOC 2012 dataset.

modules/ximgproc/test/test_fourier_descriptors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace opencv_test { namespace {
88

99

10-
TEST(ximpgroc_fourierdescriptors,test_FD_AND_FIT)
10+
TEST(ximgproc_fourierdescriptors,test_FD_AND_FIT)
1111
{
1212
Mat fd;
1313
vector<Point2f> ctr(16);

modules/ximgproc/test/test_matchcolortemplate.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace opencv_test { namespace {
88

99

10-
TEST(ximpgroc_matchcolortemplate,test_QFFT)
10+
TEST(ximgproc_matchcolortemplate,test_QFFT)
1111
{
1212
String openCVExtraDir = cvtest::TS::ptr()->get_data_path();
1313
String dataPath = openCVExtraDir;
@@ -58,7 +58,7 @@ TEST(ximpgroc_matchcolortemplate,test_QFFT)
5858
}
5959
}
6060

61-
TEST(ximpgroc_matchcolortemplate, test_COLORMATCHTEMPLATE)
61+
TEST(ximgproc_matchcolortemplate, test_COLORMATCHTEMPLATE)
6262
{
6363
String openCVExtraDir = cvtest::TS::ptr()->get_data_path();
6464
String dataPath = openCVExtraDir + "cv/ximgproc/corr.yml.gz";

0 commit comments

Comments
 (0)