lines = cv2.HoughLinesP(edges, 1, np.pi / 180, 275, minLineLength=600,
    maxLineGap=100)[0].tolist()
for x1, y1, x2, y2 in lines:
    for index, (x3, y3, x4, y4) in enumerate(lines):
        if y1 == y2 and y3 == y4:
            diff = abs(y1 - y3)
Обнаружение линии сетки Python cv2 HoughLines