Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
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
Commits
63715a89
Commit
63715a89
authored
Sep 26, 2014
by
Adrien BAK
Committed by
Adrien BAK
Oct 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix regressiont ests npr
parent
ed0eb139
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
test_npr.cpp
modules/photo/test/test_npr.cpp
+21
-10
No files found.
modules/photo/test/test_npr.cpp
View file @
63715a89
...
...
@@ -47,6 +47,7 @@
using
namespace
cv
;
using
namespace
std
;
static
const
double
numerical_precision
=
1.
;
TEST
(
Photo_NPR_EdgePreserveSmoothing_RecursiveFilter
,
regression
)
{
...
...
@@ -60,8 +61,9 @@ TEST(Photo_NPR_EdgePreserveSmoothing_RecursiveFilter, regression)
Mat
result
;
edgePreservingFilter
(
source
,
result
,
1
);
imwrite
(
folder
+
"smoothened_RF.png"
,
result
);
Mat
reference
=
imread
(
folder
+
"smoothened_RF_reference.png"
);
double
error
=
norm
(
reference
,
result
,
NORM_L1
);
EXPECT_LE
(
error
,
numerical_precision
);
}
TEST
(
Photo_NPR_EdgePreserveSmoothing_NormConvFilter
,
regression
)
...
...
@@ -76,7 +78,9 @@ TEST(Photo_NPR_EdgePreserveSmoothing_NormConvFilter, regression)
Mat
result
;
edgePreservingFilter
(
source
,
result
,
2
);
imwrite
(
folder
+
"smoothened_NCF.png"
,
result
);
Mat
reference
=
imread
(
folder
+
"smoothened_NCF_reference.png"
);
double
error
=
norm
(
reference
,
result
,
NORM_L1
);
EXPECT_LE
(
error
,
numerical_precision
);
}
...
...
@@ -92,8 +96,9 @@ TEST(Photo_NPR_DetailEnhance, regression)
Mat
result
;
detailEnhance
(
source
,
result
);
imwrite
(
folder
+
"detail_enhanced.png"
,
result
);
Mat
reference
=
imread
(
folder
+
"detail_enhanced_reference.png"
);
double
error
=
norm
(
reference
,
result
,
NORM_L1
);
EXPECT_LE
(
error
,
numerical_precision
);
}
TEST
(
Photo_NPR_PencilSketch
,
regression
)
...
...
@@ -105,12 +110,16 @@ TEST(Photo_NPR_PencilSketch, regression)
ASSERT_FALSE
(
source
.
empty
())
<<
"Could not load input image "
<<
original_path
;
Mat
result
,
result1
;
pencilSketch
(
source
,
result
,
result1
,
10
,
0.1
f
,
0.03
f
);
Mat
pencil_result
,
color_pencil_result
;
pencilSketch
(
source
,
pencil_result
,
color_pencil_result
,
10
,
0.1
f
,
0.03
f
);
imwrite
(
folder
+
"pencil_sketch.png"
,
result
);
imwrite
(
folder
+
"color_pencil_sketch.png"
,
result1
);
Mat
pencil_reference
=
imread
(
folder
+
"pencil_sketch_reference.png"
);
double
pencil_error
=
norm
(
pencil_reference
,
pencil_result
,
NORM_L1
);
EXPECT_LE
(
pencil_error
,
numerical_precision
);
Mat
color_pencil_reference
=
imread
(
folder
+
"color_pencil_sketch_reference.png"
);
double
color_pencil_error
=
norm
(
color_pencil_reference
,
color_pencil_result
,
NORM_L1
);
EXPECT_LE
(
color_pencil_error
,
numerical_precision
);
}
TEST
(
Photo_NPR_Stylization
,
regression
)
...
...
@@ -125,6 +134,8 @@ TEST(Photo_NPR_Stylization, regression)
Mat
result
;
stylization
(
source
,
result
);
imwrite
(
folder
+
"stylized.png"
,
result
);
Mat
stylized_reference
=
imread
(
folder
+
"stylized_reference.png"
);
double
stylized_error
=
norm
(
stylized_reference
,
result
,
NORM_L1
);
EXPECT_LE
(
stylized_error
,
numerical_precision
);
}
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