我第一次使用 Python + Scipy + Scikit-image + numpy。
我正在使用此页面寻求帮助,我只是稍微更改了给定的代码以获取我喜欢的图像:
tree = misc.imread('C:\\Users\\app\\Pictures\\treephoto1.jpg')
type(tree)
<type 'numpy.ndarray' >
tree.shape, tree.dtype((512, 512), dtype('uint8'))
但我收到以下错误:
type(tree) <type 'numpy.ndarray'>
^
SyntaxError: invalid syntax
语法有什么问题?我在Windows上使用的是python 2.7,所有相关的工具包也是按照Python 2.7的。
我需要将图像转换为 2-D numpy 数组,以便我可以使用 canny 边缘检测器。