【发布时间】:2019-03-30 17:42:28
【问题描述】:
我的 mac 10.13.6 上出现 Segmentation fault: 11 错误
我正在使用 Python 3.6.5 Anaconda 运行 virtualenv
我正在运行像素洪水填充脚本
img = cv2.imread(image,1)
surface = cv2.Canny(img,100,200)
def floodfill(x, y, oldColor, newColor):
# assume surface is a 2D image and surface[x][y] is the color at x, y.
if surface[x][y] != oldColor: # the base case
return
surface[x][y] = newColor
floodfill(x + 1, y, oldColor, newColor) # right
floodfill(x - 1, y, oldColor, newColor) # left
floodfill(x, y + 1, oldColor, newColor) # down
floodfill(x, y - 1, oldColor, newColor) # up
floodfill(0, 0, 0, 100)
plt.imshow(edges, cmap='gray')
plt.show()
有什么建议吗?
【问题讨论】:
-
你能显示你正在运行的代码/命令是什么吗?
-
是的,使用包含的代码编辑
标签: python-3.x macos segmentation-fault virtualenv