◆ line()
void cv::line ( InputOutputArray img,
Point pt1,
Point pt2,
const Scalar & color,
int thickness = 1,
int lineType = LINE_8,
int shift = 0
)
rectangle() [1/2]
void cv::rectangle ( InputOutputArray img,
Point pt1,
Point pt2,
const Scalar & color,
int thickness = 1,
int lineType = LINE_8,
int shift = 0
)
circle()
void cv::circle ( InputOutputArray img,
Point center,
int radius,
const Scalar & color,
int thickness = 1,
int lineType = LINE_8,
int shift = 0
)
几乎每个绘图函数后面都有一个int类型的shift参数,这个参数到底是干什么的呢?经过我的测试,我发现shift是用来做图像缩小的,会把中心点坐标以及线的长度按比例缩小,假设原来的数字为D,变换后的数字为d,则具体公式是:
d = D/2shift
https://blog.youkuaiyun.com/qq_41741344/article/details/104347443