【发布时间】:2020-08-04 22:01:08
【问题描述】:
我正在尝试将高斯噪声添加到一组 tif 文件中。我同时使用了 scikit-image 和 cv2。
Scikit-Image:noise_img = random_noise(np_img, mode='gaussian', seed=None, clip=True)
CV2:
gauss = gauss.reshape(np_img.shape[0], np_img.shape[1], np_img.shape[2]).astype('uint8')
noise_img = cv2.add(np_img, gauss)
我在传统的 jpeg 和 png 图像上使用了这两种方法,它们都有效。但是,它们似乎不适用于 tif 文件。任何帮助将不胜感激!
【问题讨论】:
-
我猜你的 TIFF 图像有一个
shape或dtype与噪声函数不兼容,但由于你没有共享 TIFF 文件,我不能确定。跨度>
标签: python tensorflow scikit-image cv2