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
32b3b4d2
Commit
32b3b4d2
authored
Apr 27, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1141 from alalek:fix_tests
parents
00ad211c
fdab64c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
7 deletions
+26
-7
test_features2d.cpp
modules/xfeatures2d/test/test_features2d.cpp
+24
-2
test_rolling_guidance_filter.cpp
modules/ximgproc/test/test_rolling_guidance_filter.cpp
+2
-5
No files found.
modules/xfeatures2d/test/test_features2d.cpp
View file @
32b3b4d2
...
...
@@ -1054,10 +1054,32 @@ TEST( Features2d_DescriptorExtractor_BRIEF, regression )
test
.
safe_run
();
}
template
<
int
threshold
=
0
>
struct
LUCIDEqualityDistance
{
typedef
unsigned
char
ValueType
;
typedef
int
ResultType
;
ResultType
operator
()(
const
unsigned
char
*
a
,
const
unsigned
char
*
b
,
int
size
)
const
{
int
res
=
0
;
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
if
(
threshold
==
0
)
res
+=
(
a
[
i
]
!=
b
[
i
])
?
1
:
0
;
else
res
+=
abs
(
a
[
i
]
-
b
[
i
])
>
threshold
?
1
:
0
;
}
return
res
;
}
};
TEST
(
Features2d_DescriptorExtractor_LUCID
,
regression
)
{
CV_DescriptorExtractorTest
<
Hamming
>
test
(
"descriptor-lucid"
,
1
,
LUCID
::
create
(
1
,
2
)
);
CV_DescriptorExtractorTest
<
LUCIDEqualityDistance
<
1
/*used blur is not bit-exact*/
>
>
test
(
"descriptor-lucid"
,
2
,
LUCID
::
create
(
1
,
2
)
);
test
.
safe_run
();
}
...
...
modules/ximgproc/test/test_rolling_guidance_filter.cpp
View file @
32b3b4d2
...
...
@@ -53,11 +53,8 @@ static std::string getOpenCVExtraDir()
static
void
checkSimilarity
(
InputArray
src
,
InputArray
ref
)
{
double
normInf
=
cvtest
::
norm
(
src
,
ref
,
NORM_INF
);
double
normL2
=
cvtest
::
norm
(
src
,
ref
,
NORM_L2
)
/
(
src
.
total
()
*
src
.
channels
());
EXPECT_LE
(
normInf
,
1.0
);
EXPECT_LE
(
normL2
,
1.0
/
16
);
// Doesn't work with bilateral filter: EXPECT_LE(cvtest::norm(src, ref, NORM_INF), 1.0);
EXPECT_LE
(
cvtest
::
norm
(
src
,
ref
,
NORM_L2
|
NORM_RELATIVE
),
1e-3
);
}
static
Mat
convertTypeAndSize
(
Mat
src
,
int
dstType
,
Size
dstSize
)
...
...
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