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
ccea0a83
Commit
ccea0a83
authored
7 years ago
by
Aditya Rohan
Committed by
Alexander Alekhin
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #10732 from Riyuzakii:10598
* Introduces error throw for line drawn with THICKNESS=0
parent
9698b93d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
CoreTest.java
modules/core/misc/java/test/CoreTest.java
+1
-1
drawing.cpp
modules/imgproc/src/drawing.cpp
+1
-1
test_drawing.cpp
modules/imgproc/test/test_drawing.cpp
+6
-0
No files found.
modules/core/misc/java/test/CoreTest.java
View file @
ccea0a83
...
...
@@ -876,7 +876,7 @@ public class CoreTest extends OpenCVTestCase {
Point
point1
=
new
Point
(
0
,
0
);
Point
point2
=
new
Point
(
nPoints
,
nPoints
);
Imgproc
.
line
(
gray0
,
point1
,
point2
,
colorWhite
,
0
);
Imgproc
.
line
(
gray0
,
point1
,
point2
,
colorWhite
,
1
);
assertTrue
(
nPoints
==
Core
.
countNonZero
(
gray0
));
}
...
...
This diff is collapsed.
Click to expand it.
modules/imgproc/src/drawing.cpp
View file @
ccea0a83
...
...
@@ -1814,7 +1814,7 @@ void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color,
if
(
line_type
==
CV_AA
&&
img
.
depth
()
!=
CV_8U
)
line_type
=
8
;
CV_Assert
(
0
<
=
thickness
&&
thickness
<=
MAX_THICKNESS
);
CV_Assert
(
0
<
thickness
&&
thickness
<=
MAX_THICKNESS
);
CV_Assert
(
0
<=
shift
&&
shift
<=
XY_SHIFT
);
double
buf
[
4
];
...
...
This diff is collapsed.
Click to expand it.
modules/imgproc/test/test_drawing.cpp
View file @
ccea0a83
...
...
@@ -750,5 +750,11 @@ TEST(Drawing, putText_no_garbage)
}
TEST
(
Drawing
,
line
)
{
Mat
mat
=
Mat
::
zeros
(
Size
(
100
,
100
),
CV_8UC1
);
ASSERT_THROW
(
line
(
mat
,
Point
(
1
,
1
),
Point
(
99
,
99
),
Scalar
(
255
),
0
),
cv
::
Exception
);
}
}
// namespace
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