No account yet ?
Tested in Anaconda and Python 3.7
import cv2 import numpy as np import math def Speckle_noise_add(img): row, col, depth = np.shape(img) mean = 0 var = 0.1 gauss = np.random.normal(mean, math.sqrt(var), (row, col, depth)) noisy = img + img * gauss noisy = np.array(noisy, dtype=np.uint8) return noisy if __name__ == "__main__": img = cv2.imread("Lenna.jpg") noisy_img = Speckle_noise_add(img) cv2.imwrite("lena_speckle_noise.jpg", noisy_img)
Image-Restoration-in-Digital-Image-Processing - GitHub
Original image
Speckle image noise
Welcome, my name is Eric Soupet and I am the administrator of the site elodees.com. elodees.com is a state of the art of Artificial Intelligence and aims to be collaborative, you can now offer content such as articles, events, tutorials, ... so don't hesitate !
Platform images credit : Pixabay - Pixabay License | Pexels - Pexels License