def output_pic(img_path, output_path, trans_path, fina_path, ps2, pix, point_path):
    img_pred = cv2.imread(img_path)
    point_pred = []
    trans_inv = []
    point_pred = np.loadtxt(output_path)
    point_pred = (384 * np.expand_dims(point_pred, axis=0))
    trans_inv = np.loadtxt(trans_path)
    trans_inv = trans_inv.reshape(3, 3)
    trans_inv = np.mat(trans_inv)
    point_ground = np.loadtxt(point_path)
    point_ground = np.expand_dims(point_ground, axis=0)
    point_ground2 = cv2.perspectiveTransform(point_ground, trans_inv)
    point_size = 1
    thickness = 4
    for i in range(4):
        cv2.circle(img_pred, (int(point_ground2[0][i][0]), int(point_ground2[0][i][1])), point_size, (0, 255, 0), thickness)
    cv2.imwrite(fina_path, img_pred)
    point_pred2 = cv2.perspectiveTransform(point_pred, trans_inv)
    point_color = (0, 0, 255)
    point_color2 = (0, 255, 0)
    for i in range(4):
        cv2.circle(img_pred, (int(point_pred2[0][i][0]), int(point_pred2[0][i][1])), point_size, point_color, thickness)
    cv2.imwrite(fina_path, img_pred)
    point_pred3 = point_pred2[0]
    ps2 = ps2[0].reshape(4, 2)
    tmp = get_acc(point_pred3, point_ground2[0], pix)
    return tmp
def output_pic(img_path, output_path, trans_path, fina_path, ps2, pix, point_path):
    img_pred = cv2.imread(img_path)
    point_pred = []
    trans_inv = []
    point_pred = np.loadtxt(output_path)
    point_pred = (384 * np.expand_dims(point_pred, axis=0))
    trans_inv = np.loadtxt(trans_path)
    trans_inv = trans_inv.reshape(3, 3)
    trans_inv = np.mat(trans_inv)
    point_ground = np.loadtxt(point_path)
    point_ground = np.expand_dims(point_ground, axis=0)
    point_ground2 = cv2.perspectiveTransform(point_ground, trans_inv)
    point_size = 1
    thickness = 4
    for i in range(4):
        cv2.circle(img_pred, (int(point_ground2[0][i][0]), int(point_ground2[0][i][1])), point_size, (0, 255, 0), thickness)
    cv2.imwrite(fina_path, img_pred)
    point_pred2 = cv2.perspectiveTransform(point_pred, trans_inv)
    point_color = (0, 0, 255)
    point_color2 = (0, 255, 0)
    for i in range(4):
        cv2.circle(img_pred, (int(point_pred2[0][i][0]), int(point_pred2[0][i][1])), point_size, point_color, thickness)
    cv2.imwrite(fina_path, img_pred)
    point_pred3 = point_pred2[0]
    ps2 = ps2[0].reshape(4, 2)
    tmp = get_acc(point_pred3, point_ground2[0], pix)
    return tmp