如何在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)
答案 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 Images
和import PythonImage
(反之亦然)。对于他们两个人来说,唯一不能做的就是using
,并希望一切顺利。