You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
365 B

# 导入库
import numpy as np
import cv2
def lt(image_path,pa,pb,pc,pd):
X = cv2.imread(image_path, 0)
# 对 X 进行线性变换
a = int(pa)
b = int(pb)
c = int(pc)
d = int(pd)
result = (d - c) / (b - a) * X + (b * c - a * d) / (b - a)
cv2.imshow('result',result)
cv2.waitKey(0)
cv2.destroyAllWindows()