mirror of
https://github.com/opencv/opencv.git
synced 2025-06-10 11:03:03 +08:00
Merge pull request #10732 from Riyuzakii:10598
* Introduces error throw for line drawn with THICKNESS=0
This commit is contained in:
parent
9698b93d10
commit
ccea0a831a
@ -876,7 +876,7 @@ public class CoreTest extends OpenCVTestCase {
|
|||||||
Point point1 = new Point(0, 0);
|
Point point1 = new Point(0, 0);
|
||||||
Point point2 = new Point(nPoints, nPoints);
|
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));
|
assertTrue(nPoints == Core.countNonZero(gray0));
|
||||||
}
|
}
|
||||||
|
@ -1814,7 +1814,7 @@ void line( InputOutputArray _img, Point pt1, Point pt2, const Scalar& color,
|
|||||||
if( line_type == CV_AA && img.depth() != CV_8U )
|
if( line_type == CV_AA && img.depth() != CV_8U )
|
||||||
line_type = 8;
|
line_type = 8;
|
||||||
|
|
||||||
CV_Assert( 0 <= thickness && thickness <= MAX_THICKNESS );
|
CV_Assert( 0 < thickness && thickness <= MAX_THICKNESS );
|
||||||
CV_Assert( 0 <= shift && shift <= XY_SHIFT );
|
CV_Assert( 0 <= shift && shift <= XY_SHIFT );
|
||||||
|
|
||||||
double buf[4];
|
double buf[4];
|
||||||
|
@ -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
|
} // namespace
|
||||||
|
Loading…
Reference in New Issue
Block a user