MCPcopy Create free account
hub / github.com/MearaY/StegaPy / reconstruct_subbands

Method reconstruct_subbands

StegaPy/util/dwt_util.py:65–89  ·  view source on GitHub ↗

从子带重构小波系数 Args: subbands: 修改后的子带列表 original_coeffs: 原始小波系数结构 wavelet: 小波基名称 Returns: 重构的小波系数列表

(subbands, original_coeffs, wavelet='db1')

Source from the content-addressed store, hash-verified

63
64 @staticmethod
65 def reconstruct_subbands(subbands, original_coeffs, wavelet='db1'):
66 """
67 从子带重构小波系数
68
69 Args:
70 subbands: 修改后的子带列表
71 original_coeffs: 原始小波系数结构
72 wavelet: 小波基名称
73
74 Returns:
75 重构的小波系数列表
76 """
77 # 重建系数结构
78 new_coeffs = [original_coeffs[0]] # 保留近似系数
79
80 # 按层级组织子带
81 max_level = max(s[0] for s in subbands)
82 for level in range(1, max_level + 1):
83 level_subbands = {s[1]: s[2] for s in subbands if s[0] == level}
84 cH = level_subbands.get('H', original_coeffs[level][0])
85 cV = level_subbands.get('V', original_coeffs[level][1])
86 cD = level_subbands.get('D', original_coeffs[level][2])
87 new_coeffs.append((cH, cV, cD))
88
89 return new_coeffs
90

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected