加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build_3D_group.py 636 Bytes
一键复制 编辑 原始数据 按行查看 历史
Shuai_Yan 提交于 2020-04-16 17:41 . Added some notes
import numpy as np
def build_3D_group(fre_all_patches, N__ni_nj, nSx_r):
"""
:stack frequency patches into a 3D block
:param fre_all_patches: all frequency patches
:param N__ni_nj: the position of the N most similar patches
:param nSx_r: how many similar patches according to threshold
:return: the 3D block
"""
_, _, k, k_ = fre_all_patches.shape
assert k == k_
group_3D = np.zeros((nSx_r, k, k))
for n in range(nSx_r):
ni, nj = N__ni_nj[n]
group_3D[n, :, :] = fre_all_patches[ni, nj]
group_3D = group_3D.transpose((1, 2, 0))
return group_3D # shape=(k, k, nSx_r)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化