ImageNoiseGenerator.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:NGImageProcessor 作者: artzers 项目源码 文件源码
def GuassNoiseDemo(self, img, miu, theta, noiseNum):
        sz = img.shape
        noiseImg = self.GuassNoise(img, miu, theta, noiseNum)
        gImg = img + noiseImg
        #pdf = self.GuassianPDF(miu, theta)
        # for i in xrange(0, noiseNum):
        #     x = np.random.random() * (sz[0] - 1)
        #     y = np.random.random() * (sz[1] - 1)
        #     noise = self.PDFMap(pdf, np.random.random())
        #     print noise
        #     noiseImg[x, y] = noiseImg[x, y] + noise
        cv2.namedWindow("lena")
        cv2.namedWindow("gauss noise")
        cv2.namedWindow("dst")
        cv2.imshow("lena", img)
        cv2.imshow("gauss noise", np.uint8(noiseImg))
        cv2.imshow("dst", np.uint8(gImg))
        cv2.waitKey(0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号