把hdf5文件转换为灰度

时间:2016-06-13 22:56:49

标签: julia hdf5

如何在Julia中将.h5文件转换为灰度?

我试过这个

MATCH (n) 
WHERE any(x IN n.fruits WHERE x IN ['orange', 'grape', 'apple'])
RETURN n;

我收到此错误:

img = stack[:,:,100] #just some hdf5 file
img = convert(Image{Images.Gray}, img)

1 个答案:

答案 0 :(得分:2)

我猜你也是using定义Image的其他一些软件包,这与Images.jl中的定义有冲突。让我们假设其他包名为PythonImage。试试这样:

using Colors   # that way you don't have to say `Images.Gray`
import PythonImage, Images  # `import` rather than `using` prevents conflicts

imgg = convert(Images.Image{Gray}, img)

# ...if you need the other one, use `PythonImage.Image`

或者您可以using Imagesimport PythonImage(反之亦然)。对于他们两个人来说,唯一不能做的就是using,并希望一切顺利。