opencv_python 如何让中间点一直在左边?
不同box
如何保证这点黄色点 一直在左边中间线
如图所示:
import cv2import numpy as np
image = np.zeros([2500,2500,3],np.uint8)
box = ([[1273,890],
[1277,814],
[1381,819],
[1378,895],])
# box = ([[1293,820],
# [1400,806],
# [1410,884],
# [1303,898]])
# box = ([[880,979],
# [888,963],
# [901,970],
# [892,986]])
# box = ([[886,977],
# [904,977],
# [904,998],
# [886,998]])
# box = ([[1288,962],
# [1380,958],
# [1382,991],
# [1290,995]])
# box = ([[879,954],
# [892,954],
# [892,972],
# [879,972]])
cv2.line(image,box[0],box[1],(0,0,255),2)
cv2.line(image,box[1],box[2],(0,255,0),2)
cv2.line(image,box[0],box[3],(255,0,0),2)
cv2.line(image,box[2],box[3],(100,100,100),2)
xx = int((box[0][0]+box[1][0])/2)
yy = int((box[0][1]+box[1][1])/2)
cv2.circle(image, (int(xx), int(yy)),4 ,(0, 255, 255), 4)
以上是 opencv_python 如何让中间点一直在左边? 的全部内容, 来源链接: utcz.com/p/938611.html