# -*- coding: utf-8 -*-
import os
import time
import numpy as np
import cv2
#coding=utf-8
import numpy as np
import cv2
import os
from utils.data_augment_1114 import rotate_3
class Point(object):
x =0
y= 0
# 定义构造方法
def __init__(self, x=0, y=0):
self.x = x
self.y = y
class Line(object):
def __init__(self, x1,y1,x2,y2 ):
self.p1 = Point(x1,y1)
self.p2 = Point(x2,y2)
def GetLinePara(line):
line.a =line.p1.y - line.p2.y;
line.b = line.p2.x - line.p1.x;
line.c = line.p1.x *line.p2.y - line.p2.x * line.p1.y;
def GetCrossPoint(l1,l2):
GetLinePara(l1);
GetLinePara(l2);
d = l1.a * l2.b - l2.a * l1.b
p=Point()
if d==0:
return (-1,-1)
else:
p.x = int((l1.b * l2.c - l2.b * l1.c)*1.0 / d)
p.y = int((l1.c * l2.a - l2.c * l1.a)*1.0 / d)
return (p.x,p.y)
# coordina