def dslre(img):
timestep = 1.0
mu = 0.2/timestep
iter_basic = 1000
iter_refine = 10
lambdap = 5
alpha = 1.5 # -3
epsilon = 1.5
sigma = 1.5
smoothed = filters.gaussian_filter(img,sigma)
dy,dx = np.gradient(smoothed)
mag = (dx**2)+(dy**2)
edge = 1.0/(1.0+mag)
c0 = 2
initialLSF = c0*np.ones(img.shape)
initialLSF[10:50,10:50] = -c0
#initialLSF[10:55,10:75] = -c0
#initialLSF[25:35,20:25] -= c0
#initialLSF[25:35,40:50] -= c0
phi = initialLSF
drlse_edge(phi,edge,lambdap,mu,alpha,epsilon,timestep,iter_basic)
drlse_edge(phi,edge,lambdap,mu,0,epsilon,timestep,iter_refine)
return phi
评论列表
文章目录