

a=[0,0,0,0]
b=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]]
step=[[1,0],[0,1],[-1,0],[0,-1]]
for k in range(100):
for i in range(4):
for j in range(4):
t=0
for e in step:
x=i-e[0]
y = j-e[1]
b[0][0]=0
b[3][3]=0
if x>=0 and x<4 and y>=0 and y<4:
t=t+b[x][y]
else:
t = t+ b[i][j]
b[i][j]=-1+0.25*t
b[0][0]=0
b[3][3]=0
#print( 'ij---',b[i][j], i,j)
print( b)
四步算法实现动态图像模糊处理
本文通过Python代码展示了如何使用四步算法更新图像矩阵,实现局部像素的模糊效果,适用于图像处理入门。核心步骤包括计算邻域像素、权重分配、模糊运算和边界处理。
1505

被折叠的 条评论
为什么被折叠?



