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

Function cmd_wm_verify

cli.py:112–131  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

110
111
112def cmd_wm_verify(args):
113 from StegaPy import StegaPy, StegaPyConfig
114 from StegaPy.plugin.dwtdugad import DWTDugadPlugin
115 cfg = StegaPyConfig(password=args.password)
116 plugin = DWTDugadPlugin(); plugin.config = cfg
117 sp = StegaPy(plugin, cfg)
118
119 stego = _read(args.input)
120 sig = _read(args.sig)
121 score = sp.check_mark(stego, os.path.basename(args.input), sig)
122
123 high = plugin.get_high_watermark_level()
124 low = plugin.get_low_watermark_level()
125 if score >= high:
126 verdict = "水印有效(高置信)"
127 elif score >= low:
128 verdict = "水印可能存在(低置信)"
129 else:
130 verdict = "未检测到水印"
131 print(f"相关性得分: {score:.4f} → {verdict}")
132
133
134def cmd_wm_generate_sig(args):

Callers 2

mainFunction · 0.85
run_interactiveFunction · 0.85

Calls 7

check_markMethod · 0.95
StegaPyConfigClass · 0.90
DWTDugadPluginClass · 0.90
StegaPyClass · 0.85
_readFunction · 0.85

Tested by

no test coverage detected