Python凸包OSError在scipy和skimag中

2024-03-28 15:14:00 发布

您现在位置:Python中文网/ 问答频道 /正文

当我尝试使用创建凸包的例子时,出现了一些问题

import matplotlib.pyplot as plt

from skimage.morphology import convex_hull_image
from skimage import data, img_as_float
from skimage.util import invert

# The original image is inverted as the object must be white.
image = invert(data.horse())

chull = convex_hull_image(image)

fig, axes = plt.subplots(1, 2, figsize=(8, 4))
ax = axes.ravel()

ax[0].set_title('Original picture')
ax[0].imshow(image, cmap=plt.cm.gray, interpolation='nearest')
ax[0].set_axis_off()

ax[1].set_title('Transformed picture')
ax[1].imshow(chull, cmap=plt.cm.gray, interpolation='nearest')
ax[1].set_axis_off()

plt.tight_layout()
plt.show()

OSError: Failed to open file b'C:\\Users\\\xd0\x9a\xd0\xbe\xd1\x82\\AppData\\Local\\Temp\\scipy-1alpxmub'

或者

import scipy as sp
import scipy.spatial

print (points)
df = subset[['lat','lng']].sort_values('lat')
df=df.values
df
hull = ConvexHull(df)
#hull = sp.spatial.qhull.Delaunay(df).convex_hull

OSError: Failed to open file b'C:\\Users\\\xd0\x9a\xd0\xbe\xd1\x82\\AppData\\Local\\Temp\\scipy-v_autexa'

我在Windows10x64上使用Anaconda的Python3,通过Jupyter笔记本使用它。值得一提的是,我已经重新安装了scipy和skimage。你知道吗

有人知道解决这个问题的办法吗?你知道吗


Tags: fromimageimportdfdataaspltscipy