xxxxxxxxxx
import numpy as np
angle = np.arctan2(y2 - y1, x2 - x1) * 180. / np.pi
xxxxxxxxxx
import cv2 as cv
import math
# If the lines are horizontal, they have pt1 and pt2 with same y coordinate
if math.isclose(point1[1], point2[1], rel_tol = .1): # if they have "same" y
cv.line(image, point1, point2, (0,0,255), 3, cv.LINE_AA)