Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
d1fc1c64
Unverified
Commit
d1fc1c64
authored
Nov 17, 2019
by
Alexander Alekhin
Committed by
GitHub
Nov 17, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2342 from alalek:issue_9863
parents
62c969dd
f452bd49
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
69 deletions
+32
-69
test_descriptors_regression.cpp
modules/line_descriptor/test/test_descriptors_regression.cpp
+5
-31
test_gms_matcher.cpp
modules/xfeatures2d/test/test_gms_matcher.cpp
+6
-6
test_rotation_and_scale_invariance.cpp
...s/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
+19
-28
test_ridge_detection_filter.cpp
modules/ximgproc/test/test_ridge_detection_filter.cpp
+2
-4
No files found.
modules/line_descriptor/test/test_descriptors_regression.cpp
View file @
d1fc1c64
...
...
@@ -100,19 +100,7 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
curMaxDist
=
dist
;
}
std
::
stringstream
ss
;
ss
<<
"Max distance between valid and computed descriptors "
<<
curMaxDist
;
if
(
curMaxDist
<
maxDist
)
ss
<<
"."
<<
std
::
endl
;
else
{
ss
<<
">"
<<
maxDist
<<
" - bad accuracy!"
<<
"
\n
"
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
}
ts
->
printf
(
cvtest
::
TS
::
LOG
,
ss
.
str
().
c_str
()
);
EXPECT_LT
(
curMaxDist
,
maxDist
)
<<
"Max distance between valid and computed descriptors"
;
}
Mat
readDescriptors
()
...
...
@@ -286,25 +274,11 @@ class CV_BD_DescriptorsTest : public cvtest::BaseTest
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"
\n
Average time of computing one descriptor = %g ms.
\n
"
,
t
/
(
(
double
)
getTickFrequency
()
*
1000.
)
/
calcDescriptors
.
rows
);
if
(
calcDescriptors
.
rows
!=
(
int
)
keylines
.
size
()
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Count of computed descriptors and keylines count must be equal.
\n
"
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Count of keylines is %d.
\n
"
,
(
int
)
keylines
.
size
()
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Count of computed descriptors is %d.
\n
"
,
calcDescriptors
.
rows
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
return
;
}
ASSERT_EQ
((
int
)
keylines
.
size
(),
calcDescriptors
.
rows
)
<<
"Count of computed descriptors and keylines count must be equal"
;
if
(
calcDescriptors
.
cols
!=
bd
->
descriptorSize
()
/
8
||
calcDescriptors
.
type
()
!=
bd
->
descriptorType
()
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Incorrect descriptor size or descriptor type.
\n
"
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Expected size is %d.
\n
"
,
bd
->
descriptorSize
()
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Calculated size is %d.
\n
"
,
calcDescriptors
.
cols
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Expected type is %d.
\n
"
,
bd
->
descriptorType
()
);
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Calculated type is %d.
\n
"
,
calcDescriptors
.
type
()
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
);
return
;
}
ASSERT_EQ
(
bd
->
descriptorSize
()
/
8
,
calcDescriptors
.
cols
);
ASSERT_EQ
(
bd
->
descriptorType
(),
calcDescriptors
.
type
());
// TODO read and write descriptor extractor parameters and check them
Mat
validDescriptors
=
readDescriptors
();
...
...
modules/xfeatures2d/test/test_gms_matcher.cpp
View file @
d1fc1c64
...
...
@@ -29,19 +29,19 @@ CV_GMSMatcherTest::CV_GMSMatcherTest()
//Threshold = truncate(min(acc_win32, acc_win64))
eps
[
0
][
0
]
=
0.9313
;
eps
[
0
][
1
]
=
0.92
23
;
eps
[
0
][
1
]
=
0.92
;
eps
[
0
][
2
]
=
0.9313
;
eps
[
0
][
3
]
=
0.92
23
;
eps
[
0
][
3
]
=
0.92
;
eps
[
1
][
0
]
=
0.8199
;
eps
[
1
][
1
]
=
0.7964
;
eps
[
1
][
2
]
=
0.8199
;
eps
[
1
][
3
]
=
0.7964
;
eps
[
2
][
0
]
=
0.
7098
;
eps
[
2
][
1
]
=
0.6
659
;
eps
[
2
][
2
]
=
0.6
939
;
eps
[
2
][
3
]
=
0.6
457
;
eps
[
2
][
0
]
=
0.
6
;
eps
[
2
][
1
]
=
0.6
;
eps
[
2
][
2
]
=
0.6
;
eps
[
2
][
3
]
=
0.6
;
correctMatchDistThreshold
=
5.0
;
}
...
...
modules/xfeatures2d/test/test_rotation_and_scale_invariance.cpp
View file @
d1fc1c64
...
...
@@ -352,6 +352,8 @@ protected:
const
int
maxAngle
=
360
,
angleStep
=
15
;
for
(
int
angle
=
0
;
angle
<
maxAngle
;
angle
+=
angleStep
)
{
SCOPED_TRACE
(
cv
::
format
(
"angle=%d"
,
angle
));
Mat
H
=
rotateImage
(
image0
,
static_cast
<
float
>
(
angle
),
image1
,
mask1
);
vector
<
KeyPoint
>
keypoints1
;
...
...
@@ -374,16 +376,10 @@ protected:
}
}
float
descInliersRatio
=
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
();
if
(
descInliersRatio
<
minDescInliersRatio
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Incorrect descInliersRatio: curr = %f, min = %f.
\n
"
,
descInliersRatio
,
minDescInliersRatio
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
return
;
}
EXPECT_GE
(
descInliersCount
,
keypoints0
.
size
()
*
minDescInliersRatio
)
<<
"minDescInliersRatio="
<<
minDescInliersRatio
<<
" keypoints0.size()="
<<
keypoints0
.
size
();
#if SHOW_DEBUG_LOG
std
::
cout
<<
"
descInliersRatio
"
<<
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"
angle="
<<
angle
<<
" descInliersRatio=
"
<<
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
()
<<
std
::
endl
;
#endif
}
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
...
...
@@ -558,6 +554,7 @@ protected:
for
(
int
scaleIdx
=
1
;
scaleIdx
<=
3
;
scaleIdx
++
)
{
float
scale
=
1.
f
+
scaleIdx
*
0.5
f
;
SCOPED_TRACE
(
cv
::
format
(
"scale=%g"
,
scale
));
Mat
image1
;
resize
(
image0
,
image1
,
Size
(),
1.
/
scale
,
1.
/
scale
,
INTER_LINEAR_EXACT
);
...
...
@@ -583,16 +580,10 @@ protected:
}
}
float
descInliersRatio
=
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
();
if
(
descInliersRatio
<
minDescInliersRatio
)
{
ts
->
printf
(
cvtest
::
TS
::
LOG
,
"Incorrect descInliersRatio: curr = %f, min = %f.
\n
"
,
descInliersRatio
,
minDescInliersRatio
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
);
return
;
}
EXPECT_GE
(
descInliersCount
,
keypoints0
.
size
()
*
minDescInliersRatio
)
<<
"minDescInliersRatio="
<<
minDescInliersRatio
<<
" keypoints0.size()="
<<
keypoints0
.
size
();
#if SHOW_DEBUG_LOG
std
::
cout
<<
"
descInliersRatio
"
<<
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
()
<<
std
::
endl
;
std
::
cout
<<
"
scale="
<<
scale
<<
" descInliersRatio=
"
<<
static_cast
<
float
>
(
descInliersCount
)
/
keypoints0
.
size
()
<<
std
::
endl
;
#endif
}
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
...
...
@@ -653,7 +644,7 @@ TEST(Features2d_RotationInvariance_Descriptor_LATCH, regression)
DescriptorRotationInvarianceTest
test
(
SIFT
::
create
(),
LATCH
::
create
(),
NORM_HAMMING
,
0.9
999
f
);
0.9
8
f
);
test
.
safe_run
();
}
#endif // NONFREE
...
...
@@ -672,7 +663,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG120, regression)
DescriptorRotationInvarianceTest
test
(
KAZE
::
create
(),
VGG
::
create
(
VGG
::
VGG_120
,
1.4
f
,
true
,
true
,
48.0
f
,
false
),
NORM_L1
,
1.00
f
);
0.98
f
);
test
.
safe_run
();
}
...
...
@@ -681,7 +672,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG80, regression)
DescriptorRotationInvarianceTest
test
(
KAZE
::
create
(),
VGG
::
create
(
VGG
::
VGG_80
,
1.4
f
,
true
,
true
,
48.0
f
,
false
),
NORM_L1
,
1.00
f
);
0.98
f
);
test
.
safe_run
();
}
...
...
@@ -690,7 +681,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG64, regression)
DescriptorRotationInvarianceTest
test
(
KAZE
::
create
(),
VGG
::
create
(
VGG
::
VGG_64
,
1.4
f
,
true
,
true
,
48.0
f
,
false
),
NORM_L1
,
1.00
f
);
0.98
f
);
test
.
safe_run
();
}
...
...
@@ -699,7 +690,7 @@ TEST(Features2d_RotationInvariance_Descriptor_VGG48, regression)
DescriptorRotationInvarianceTest
test
(
KAZE
::
create
(),
VGG
::
create
(
VGG
::
VGG_48
,
1.4
f
,
true
,
true
,
48.0
f
,
false
),
NORM_L1
,
1.00
f
);
0.98
f
);
test
.
safe_run
();
}
...
...
@@ -746,7 +737,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_BGM, regression)
DescriptorRotationInvarianceTest
test
(
SURF
::
create
(),
BoostDesc
::
create
(
BoostDesc
::
BGM
,
true
,
6.25
f
),
NORM_HAMMING
,
0.9
99
f
);
0.9
8
f
);
test
.
safe_run
();
}
...
...
@@ -773,7 +764,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_LBGM, regression)
DescriptorRotationInvarianceTest
test
(
SURF
::
create
(),
BoostDesc
::
create
(
BoostDesc
::
LBGM
,
true
,
6.25
f
),
NORM_L1
,
0.9
99
f
);
0.9
8
f
);
test
.
safe_run
();
}
...
...
@@ -800,7 +791,7 @@ TEST(Features2d_RotationInvariance_Descriptor_BoostDesc_BINBOOST_256, regression
DescriptorRotationInvarianceTest
test
(
SURF
::
create
(),
BoostDesc
::
create
(
BoostDesc
::
BINBOOST_256
,
true
,
6.25
f
),
NORM_HAMMING
,
0.9
99
f
);
0.9
8
f
);
test
.
safe_run
();
}
...
...
@@ -819,7 +810,7 @@ TEST(Features2d_ScaleInvariance_Detector_SIFT, regression)
{
DetectorScaleInvarianceTest
test
(
SIFT
::
create
(),
0.69
f
,
0.9
9
f
);
0.9
8
f
);
test
.
safe_run
();
}
...
...
@@ -889,7 +880,7 @@ TEST(Features2d_ScaleInvariance_Descriptor_VGG120, regression)
DescriptorScaleInvarianceTest
test
(
KAZE
::
create
(),
VGG
::
create
(
VGG
::
VGG_120
,
1.4
f
,
true
,
true
,
48.0
f
,
false
),
NORM_L1
,
0.9
9
f
);
0.9
8
f
);
test
.
safe_run
();
}
...
...
modules/ximgproc/test/test_ridge_detection_filter.cpp
View file @
d1fc1c64
...
...
@@ -20,10 +20,8 @@ TEST(ximgproc_ridgedetectionfilter, ReferenceAccuracy)
rdf
->
getRidgeFilteredImage
(
src
,
out
);
Mat
out_cmp
;
out
.
convertTo
(
out_cmp
,
CV_8UC1
);
Mat
sb
;
subtract
(
out_cmp
,
n_ref
,
sb
);
int
zeros
=
countNonZero
(
sb
);
EXPECT_EQ
(
zeros
,
0
);
EXPECT_LE
(
cvtest
::
norm
(
out
,
ref
,
NORM_INF
),
0.0
f
);
EXPECT_LE
(
cvtest
::
norm
(
out
,
ref
,
NORM_L2
|
NORM_RELATIVE
),
.0
f
);
}
}}
// namespace
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment