【发布时间】:2016-07-12 09:44:05
【问题描述】:
所以,我正在尝试使用 scikit-image 获取二进制图像并使用以下代码将其保存在磁盘上:
gray = color.rgb2gray(img)
thresh = filters.threshold_otsu(gray)
binary = gray >= thresh
io.imsave("./testout/" + img_name, binary)
当我执行 io.imshow(binary) 时,我得到了我所期望的结果。但是 imsave() 返回给我的是完全黑色的图像,好像它把 True 和 False 值都变成了 rgb 或其他东西的 (0,0,0)。
那么正确的做法是什么?
【问题讨论】:
-
你能用随机生成的数组重现这个吗?
标签: python image scikit-image