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
bcbe2f12
Commit
bcbe2f12
authored
Dec 08, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: move more drawing tests
parent
781ab3d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
41 deletions
+42
-41
test_contours.cpp
modules/imgproc/test/test_contours.cpp
+0
-41
test_drawing.cpp
modules/imgproc/test/test_drawing.cpp
+42
-0
No files found.
modules/imgproc/test/test_contours.cpp
View file @
bcbe2f12
...
@@ -410,47 +410,6 @@ _exit_:
...
@@ -410,47 +410,6 @@ _exit_:
TEST
(
Imgproc_FindContours
,
accuracy
)
{
CV_FindContourTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_FindContours
,
accuracy
)
{
CV_FindContourTest
test
;
test
.
safe_run
();
}
TEST
(
Core_Drawing
,
_914
)
{
const
int
rows
=
256
;
const
int
cols
=
256
;
Mat
img
(
rows
,
cols
,
CV_8UC1
,
Scalar
(
255
));
line
(
img
,
Point
(
0
,
10
),
Point
(
255
,
10
),
Scalar
(
0
),
2
,
4
);
line
(
img
,
Point
(
-
5
,
20
),
Point
(
260
,
20
),
Scalar
(
0
),
2
,
4
);
line
(
img
,
Point
(
10
,
0
),
Point
(
10
,
255
),
Scalar
(
0
),
2
,
4
);
double
x0
=
0.0
/
pow
(
2.0
,
-
2.0
);
double
x1
=
255.0
/
pow
(
2.0
,
-
2.0
);
double
y
=
30.5
/
pow
(
2.0
,
-
2.0
);
line
(
img
,
Point
(
int
(
x0
),
int
(
y
)),
Point
(
int
(
x1
),
int
(
y
)),
Scalar
(
0
),
2
,
4
,
2
);
int
pixelsDrawn
=
rows
*
cols
-
countNonZero
(
img
);
ASSERT_EQ
(
(
3
*
rows
+
cols
)
*
3
-
3
*
9
,
pixelsDrawn
);
}
TEST
(
Core_Drawing
,
polylines_empty
)
{
Mat
img
(
100
,
100
,
CV_8UC1
,
Scalar
(
0
));
vector
<
Point
>
pts
;
// empty
polylines
(
img
,
pts
,
false
,
Scalar
(
255
));
int
cnt
=
countNonZero
(
img
);
ASSERT_EQ
(
cnt
,
0
);
}
TEST
(
Core_Drawing
,
polylines
)
{
Mat
img
(
100
,
100
,
CV_8UC1
,
Scalar
(
0
));
vector
<
Point
>
pts
;
pts
.
push_back
(
Point
(
0
,
0
));
pts
.
push_back
(
Point
(
20
,
0
));
polylines
(
img
,
pts
,
false
,
Scalar
(
255
));
int
cnt
=
countNonZero
(
img
);
ASSERT_EQ
(
cnt
,
21
);
}
//rotate/flip a quadrant appropriately
//rotate/flip a quadrant appropriately
static
void
rot
(
int
n
,
int
*
x
,
int
*
y
,
int
rx
,
int
ry
)
static
void
rot
(
int
n
,
int
*
x
,
int
*
y
,
int
rx
,
int
ry
)
{
{
...
...
modules/imgproc/test/test_drawing.cpp
View file @
bcbe2f12
...
@@ -668,5 +668,47 @@ protected:
...
@@ -668,5 +668,47 @@ protected:
TEST
(
Drawing
,
utf8_support
)
{
CV_DrawingTest_UTF8
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
utf8_support
)
{
CV_DrawingTest_UTF8
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
_914
)
{
const
int
rows
=
256
;
const
int
cols
=
256
;
Mat
img
(
rows
,
cols
,
CV_8UC1
,
Scalar
(
255
));
line
(
img
,
Point
(
0
,
10
),
Point
(
255
,
10
),
Scalar
(
0
),
2
,
4
);
line
(
img
,
Point
(
-
5
,
20
),
Point
(
260
,
20
),
Scalar
(
0
),
2
,
4
);
line
(
img
,
Point
(
10
,
0
),
Point
(
10
,
255
),
Scalar
(
0
),
2
,
4
);
double
x0
=
0.0
/
pow
(
2.0
,
-
2.0
);
double
x1
=
255.0
/
pow
(
2.0
,
-
2.0
);
double
y
=
30.5
/
pow
(
2.0
,
-
2.0
);
line
(
img
,
Point
(
int
(
x0
),
int
(
y
)),
Point
(
int
(
x1
),
int
(
y
)),
Scalar
(
0
),
2
,
4
,
2
);
int
pixelsDrawn
=
rows
*
cols
-
countNonZero
(
img
);
ASSERT_EQ
(
(
3
*
rows
+
cols
)
*
3
-
3
*
9
,
pixelsDrawn
);
}
TEST
(
Drawing
,
polylines_empty
)
{
Mat
img
(
100
,
100
,
CV_8UC1
,
Scalar
(
0
));
vector
<
Point
>
pts
;
// empty
polylines
(
img
,
pts
,
false
,
Scalar
(
255
));
int
cnt
=
countNonZero
(
img
);
ASSERT_EQ
(
cnt
,
0
);
}
TEST
(
Drawing
,
polylines
)
{
Mat
img
(
100
,
100
,
CV_8UC1
,
Scalar
(
0
));
vector
<
Point
>
pts
;
pts
.
push_back
(
Point
(
0
,
0
));
pts
.
push_back
(
Point
(
20
,
0
));
polylines
(
img
,
pts
,
false
,
Scalar
(
255
));
int
cnt
=
countNonZero
(
img
);
ASSERT_EQ
(
cnt
,
21
);
}
}
// namespace
}
// 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