Skip to content
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

关于7X7频域的问题 #43

Open
Soso-developer opened this issue May 14, 2023 · 4 comments
Open

关于7X7频域的问题 #43

Soso-developer opened this issue May 14, 2023 · 4 comments

Comments

@Soso-developer
Copy link

大于7X7大小的图像,是如何选取在某个频域上的值呢?
例如:1414大小图像经过dct得到1414的dct结果,如果选取最低频的分量,那么实际的选取是,最左上角的2*2大小结果的平均值吗?
没有理解代码里的计算方式,希望得到答疑

@cfzd
Copy link
Owner

cfzd commented May 15, 2023

@Soso-developer
你的理解是对的,14x14的最低频和7x7的最低频是不一样的,可以说7x7每个频谱“更宽”一些,我们总是把图像缩放到7x7再提取频谱的。

@Soso-developer
Copy link
Author

@Soso-developer 你的理解是对的,14x14的最低频和7x7的最低频是不一样的,可以说7x7每个频谱“更宽”一些,我们总是把图像缩放到7x7再提取频谱的。

看到您讲的:“我们总是把图像缩放到7x7再提取频谱的”,也就是说不同大小图像均需要压缩到7X7
请问压缩具体是如何压缩的呢?这个操作会对图像本身频谱产生影响吗?

@cfzd
Copy link
Owner

cfzd commented May 17, 2023

@cfzd
抱歉,我搞错了,太久了都忘记了,实际上我们在提取频谱时会提取一个相对位置的频率,可以看看这部分代码:

FcaNet/model/layer.py

Lines 38 to 41 in aa5fb63

mapper_x = [temp_x * (dct_h // 7) for temp_x in mapper_x]
mapper_y = [temp_y * (dct_w // 7) for temp_y in mapper_y]
# make the frequencies in different sizes are identical to a 7x7 frequency space
# eg, (2,2) in 14x14 is identical to (1,1) in 7x7

所以当我们提取最低频时,在7x7的图上是(1,1)这个位置,而在14x14的图上是(2,2)这个位置

@Soso-developer
Copy link
Author

好的理解了,感谢您的回答!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants