代码拉取完成,页面将自动刷新
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)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。