Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

voronoi - 在照片上方打印voronoi图(Printing voronoi diagram ontop of a photo)

I'm trying to create voronoi lines ontop of the pictures with the points.

(我正在尝试在带点的图片上创建voronoi线。)

I already extracted the points (x,y), but I want to plot them on the image they were taken from.

(我已经提取了点(x,y),但是我想将它们绘制在从中获取的图像上。)

points = [[point[0] * (img.shape[0]) / max_x, point[1] * (img.shape[1]) / max_y] for point in original_pints]
vor = Voronoi(points)
fig = plt.figure(figsize=(20,20))
ax = fig.add_subplot(111)
ax.imshow(ndimage.rotate(img, 0))
voronoi_plot_2d(vor , show_points=False, show_vertices=False, line_colors='red', ax=ax)
plt.show()

The code generates this image When I try to change the figure dimension to the image dimension, I get this error:

(代码生成此图像,当我尝试将图形尺寸更改为图像尺寸时,出现此错误:)

ValueError: Image size of 216000x256000 pixels is too large. It must be less than 2^16 in each direction.

What can I do to make the image fit?

(我该怎么做才能使图像合适?)

  ask by liran sagie translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...