把图像去噪算法用python实现

#coding:utf-8
import sys,os
from PIL import Image,ImageDraw

#二值数组
t2val = {}
def twoValue(image,G):
    for y in xrange(0,image.size[1]):
        for x in xrange(0,image.size[0]):
            g = image.getpixel((x,y))
            if g > G:
                t2val[(x,y)] = 1
            else:
                t2val[(x,y)] = 0

# 降噪 
# 根据一个点A的RGB值,与周围的8个点的RBG值比较,设定一个值N(0 

你可能感兴趣的:(图像处理)