|
import cv2
def cal(point,here):
# here不断增大,delta不断减少
if delta==0:
x = point[1]/delta # 投影在屏幕上x坐标
r = point[3]/delta # 星球半径
def display_all(sakura,here):
for i in range(sakura_num):
result.append(position)
if __name__ == "__main__":
width=1920
min_r = 1
sakura_num = 150
y_far = width*x_far
here = 0
cv2.namedWindow('sakura',0)
canvas=np.zeros((height,width,3),dtype=np.uint8)
for i in range(sakura_num):
position = cal(sakura,here)
0 <= position[1] < height and sakura[0]>here):
else:
sakura[1] = random.randint(0, 2*y_far)
sakura[3] = random.randint(min_r, max_r)
result=np.uint16(result).tolist()
radius=np.random.randint(3,15,size=(1,2)).tolist()[0]
[color=(233,192,255),thickness] cv2.imshow('sakura',canvas)
cv2.destroyAllWindows()
来源:https://www.52pojie.cn/thread-1641953-1-1.html
|
|