MCPcopy Create free account
hub / github.com/creatale/node-dv / arrowedLine

Function arrowedLine

deps/opencv/modules/core/src/drawing.cpp:1718–1735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1716}
1717
1718void arrowedLine(Mat& img, Point pt1, Point pt2, const Scalar& color,
1719 int thickness, int line_type, int shift, double tipLength)
1720{
1721 const double tipSize = norm(pt1-pt2)*tipLength;// Factor to normalize the size of the tip depending on the length of the arrow
1722
1723 line(img, pt1, pt2, color, thickness, line_type, shift);
1724
1725 const double angle = atan2( (double) pt1.y - pt2.y, (double) pt1.x - pt2.x );
1726
1727 Point p(cvRound(pt2.x + tipSize * cos(angle + CV_PI / 4)),
1728 cvRound(pt2.y + tipSize * sin(angle + CV_PI / 4)));
1729 line(img, p, pt2, color, thickness, line_type, shift);
1730
1731 p.x = cvRound(pt2.x + tipSize * cos(angle - CV_PI / 4));
1732 p.y = cvRound(pt2.y + tipSize * sin(angle - CV_PI / 4));
1733 line(img, p, pt2, color, thickness, line_type, shift);
1734
1735}
1736
1737void rectangle( Mat& img, Point pt1, Point pt2,
1738 const Scalar& color, int thickness,

Callers

nothing calls this directly

Calls 3

lineFunction · 0.85
cvRoundFunction · 0.85
normFunction · 0.70

Tested by

no test coverage detected