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
d3b0cb87
Commit
d3b0cb87
authored
9 years ago
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for
http://code.opencv.org/issues/2736
parent
71002e0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
test_filter.cpp
modules/imgproc/test/test_filter.cpp
+34
-0
No files found.
modules/imgproc/test/test_filter.cpp
View file @
d3b0cb87
...
...
@@ -1918,3 +1918,37 @@ TEST(Imgproc_Blur, borderTypes)
EXPECT_EQ
(
expected_dst
.
size
(),
dst
.
size
());
EXPECT_DOUBLE_EQ
(
0.0
,
cvtest
::
norm
(
expected_dst
,
dst
,
NORM_INF
));
}
TEST
(
Imgproc_Morphology
,
iterated
)
{
RNG
&
rng
=
theRNG
();
for
(
int
iter
=
0
;
iter
<
30
;
iter
++
)
{
int
width
=
rng
.
uniform
(
5
,
33
);
int
height
=
rng
.
uniform
(
5
,
33
);
int
cn
=
rng
.
uniform
(
1
,
5
);
int
iterations
=
rng
.
uniform
(
1
,
11
);
int
op
=
rng
.
uniform
(
0
,
2
);
Mat
src
(
height
,
width
,
CV_8UC
(
cn
)),
dst0
,
dst1
,
dst2
;
randu
(
src
,
0
,
256
);
if
(
op
==
0
)
dilate
(
src
,
dst0
,
Mat
(),
Point
(
-
1
,
-
1
),
iterations
);
else
erode
(
src
,
dst0
,
Mat
(),
Point
(
-
1
,
-
1
),
iterations
);
for
(
int
i
=
0
;
i
<
iterations
;
i
++
)
if
(
op
==
0
)
dilate
(
i
==
0
?
src
:
dst1
,
dst1
,
Mat
(),
Point
(
-
1
,
-
1
),
1
);
else
erode
(
i
==
0
?
src
:
dst1
,
dst1
,
Mat
(),
Point
(
-
1
,
-
1
),
1
);
Mat
kern
=
getStructuringElement
(
MORPH_RECT
,
Size
(
3
,
3
));
if
(
op
==
0
)
dilate
(
src
,
dst2
,
kern
,
Point
(
-
1
,
-
1
),
iterations
);
else
erode
(
src
,
dst2
,
kern
,
Point
(
-
1
,
-
1
),
iterations
);
ASSERT_EQ
(
0.0
,
norm
(
dst0
,
dst1
,
NORM_INF
));
ASSERT_EQ
(
0.0
,
norm
(
dst0
,
dst2
,
NORM_INF
));
}
}
This diff is collapsed.
Click to expand it.
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