如何在脸上画一条垂直线

时间:2013-09-30 07:39:41

标签: opencv line

我需要画一条直线给出一条直线......我正在使用OpenCV用C ++编程,我希望用这种语言编写源代码,谢谢。

1 个答案:

答案 0 :(得分:0)

如果给定的行坐标类似于

 Point pt1(x1,y1);
 Point pt2(x2,y2);
 line(src, pt1, pt2, Scalar(255,255,255),1,8,0);

您可以像

一样绘制一条垂直线
 //Draw perpendicular line to middle of given line
 Point pt3(x2-x1,0);
 Point pt4(x2-x1,y2);
 line(src, pt3, pt4, Scalar(255,255,255),1,8,0);
相关问题