-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sos #7
Comments
1、函数 2、其中 3、 4、 整个过程就是把图像和kernel转到频域中,再利用**公式(16)和公式(13)**完成特征去卷积运算。在代码中复数x[:, :, :, :, 0]表示实部,x[:, :, :, :, 1]表示虚部。 |
谢谢您,获益良多 |
没事,感谢关注我们的工作。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
您好,您在CLS的forward()方法中有一个循环16次的语句:
for i in range(feature_pad.shape[1]):
#对16个通道中的每个通道进行操作
feature_ch = feature_pad[:, i:i+1, :, :]
clear_feature_ch = get_uperleft_denominator(feature_ch, kernel, kernel_P[:, i:i+1, :, :])
clear_features[:, i:i+1, :, :] = clear_feature_ch[:, :, ks:-ks, ks:-ks]
其中get_uperleft_denominator(feature_ch, kernel, kernel_P[:, i:i+1, :, :])方法我看了好多遍,完全看不懂,只知道这个方法是对经过填充的原始特征,预测的平滑滤波器,模糊核进行一些傅里叶变换操作。您能对下列的4~8行解释下这几行代码是在干嘛吗?跪跪谢!
ps(第四行方法里进行的循环移位操作看的怀疑人生,能看懂但是不知道为什么要这样做!哭)
1.# ------------------------------------------------------
2.# -----------Constraint Least Square Filter-------------
3.def get_uperleft_denominator(img, kernel, grad_kernel):
4. ker_f = convert_psf2otf(kernel, img.size()) # discrete fourier transform of kernel 对模糊核进行离散傅里叶操作
5. ker_p = convert_psf2otf(grad_kernel, img.size()) # discrete fourier transform of kernel
6. denominator = inv_fft_kernel_est(ker_f, ker_p)
7. numerator = torch.rfft(img, 3, onesided=False)
8. deblur = deconv(denominator, numerator)
9. return deblur
The text was updated successfully, but these errors were encountered: