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
2ce3606e
Commit
2ce3606e
authored
Nov 07, 2014
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #108 from ludv1x/master
Adaptive manifold filter improvements
parents
38bdd6f3
b1b36cd2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
edge_filter.hpp
modules/ximgproc/include/opencv2/ximgproc/edge_filter.hpp
+0
-2
adaptive_manifold_filter_n.cpp
modules/ximgproc/src/adaptive_manifold_filter_n.cpp
+0
-0
test_adaptive_manifold.cpp
modules/ximgproc/test/test_adaptive_manifold.cpp
+13
-4
No files found.
modules/ximgproc/include/opencv2/ximgproc/edge_filter.hpp
View file @
2ce3606e
...
...
@@ -64,8 +64,6 @@ public:
CV_WRAP
virtual
void
filter
(
InputArray
src
,
OutputArray
dst
,
int
dDepth
=
-
1
)
=
0
;
};
typedef
Ptr
<
DTFilter
>
DTFilterPtr
;
/*Fabric function for DT filters*/
CV_EXPORTS_W
Ptr
<
DTFilter
>
createDTFilter
(
InputArray
guide
,
double
sigmaSpatial
,
double
sigmaColor
,
int
mode
=
DTF_NC
,
int
numIters
=
3
);
...
...
modules/ximgproc/src/adaptive_manifold_filter_n.cpp
View file @
2ce3606e
This diff is collapsed.
Click to expand it.
modules/ximgproc/test/test_adaptive_manifold.cpp
View file @
2ce3606e
...
...
@@ -54,19 +54,21 @@ static string getOpenCVExtraDir()
return
cvtest
::
TS
::
ptr
()
->
get_data_path
();
}
static
void
checkSimilarity
(
InputArray
res
,
InputArray
ref
)
static
void
checkSimilarity
(
InputArray
res
,
InputArray
ref
,
double
maxNormInf
=
1
,
double
maxNormL2
=
1.0
/
64
)
{
double
normInf
=
cvtest
::
norm
(
res
,
ref
,
NORM_INF
);
double
normL2
=
cvtest
::
norm
(
res
,
ref
,
NORM_L2
)
/
res
.
total
();
EXPECT_LE
(
normInf
,
1
);
EXPECT_LE
(
normL2
,
1.0
/
64
);
if
(
maxNormInf
>=
0
)
EXPECT_LE
(
normInf
,
maxNormInf
);
if
(
maxNormL2
>=
0
)
EXPECT_LE
(
normL2
,
maxNormL2
);
}
TEST
(
AdaptiveManifoldTest
,
SplatSurfaceAccuracy
)
{
RNG
rnd
(
0
);
cv
::
setNumThreads
(
cv
::
getNumberOfCPUs
());
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
Size
sz
(
rnd
.
uniform
(
512
,
1024
),
rnd
.
uniform
(
512
,
1024
));
...
...
@@ -126,6 +128,8 @@ TEST(AdaptiveManifoldTest, AuthorsReferenceAccuracy)
Mat
srcImg
=
imread
(
getOpenCVExtraDir
()
+
srcImgPath
);
ASSERT_TRUE
(
!
srcImg
.
empty
());
cv
::
setNumThreads
(
cv
::
getNumberOfCPUs
());
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
Mat
refRes
=
imread
(
getOpenCVExtraDir
()
+
refPaths
[
i
]);
...
...
@@ -190,14 +194,19 @@ TEST_P(AdaptiveManifoldRefImplTest, RefImplAccuracy)
double
sigma_r
=
rnd
.
uniform
(
0.1
,
0.9
);
bool
adjust_outliers
=
(
iter
%
2
==
0
);
cv
::
setNumThreads
(
cv
::
getNumberOfCPUs
());
Mat
res
;
amFilter
(
guide
,
src
,
res
,
sigma_s
,
sigma_r
,
adjust_outliers
);
cv
::
setNumThreads
(
1
);
Mat
resRef
;
Ptr
<
AdaptiveManifoldFilter
>
amf
=
createAMFilterRefImpl
(
sigma_s
,
sigma_r
,
adjust_outliers
);
amf
->
filter
(
src
,
resRef
,
guide
);
checkSimilarity
(
res
,
resRef
);
//results of reference implementation may differ on small sigma_s into small isolated region
//due to low single-precision floating point numbers accuracy
//therefore the threshold of inf norm was increased
checkSimilarity
(
res
,
resRef
,
25
);
}
}
...
...
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