Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
给定一条线,我需要画一条垂直线...我正在使用 OpenCV 用 C++ 编程,我想要这种语言的源代码,谢谢。
如果您给定的线坐标类似于
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);