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

can' extract text exactly after crop the screen with some black blank #148

Open
linwaiwai opened this issue Nov 23, 2024 · 0 comments
Open

Comments

@linwaiwai
Copy link

linwaiwai commented Nov 23, 2024

can' extract text exactly after cropping the screen with some black blank or putting mutil pics in one

(x1, y1, x2, y2), image_o_shape, score, scale_infer = estimate_crop_parameters(original_file='output/embedded.png',
                                                                               template_file='output/4.png',
                                                                               scale=(0.2, 2), search_num=200)

print(f'Crop att estimate parameters: x1={x1},y1={y1},x2={x2},y2={y2}, scale_infer = {scale_infer}. score={score}')

# recover from attack:
recover_crop(template_file='output/4.png', output_file_name='output/4_a.png',
             loc=(x1, y1, x2, y2), image_o_shape=image_o_shape)

bwm1 = WaterMark(password_wm=1, password_img=1)
wm_extract = bwm1.extract('output/4_a.png', wm_shape=len_wm, mode='str')
print("截屏攻击,不知道攻击参数。提取结果:", wm_extract)
assert wm == wm_extract, '提取水印和原水印不一致'

输出

Welcome to use blind-watermark, version = 0.4.4
Make sure the version is the same when encode and decode
Your star means a lot: https://github.com/guofei9987/blind_watermark
This message only show once. To close it: `blind_watermark.bw_notes.close()`
            
Put down the length of wm_bit 215
Crop att estimate parameters: x1=165,y1=555,x2=395,y2=871, scale_infer = 0.2. score=0.2456810176372528
截屏攻击,不知道攻击参数。提取结果: 2p7�_GSx�ԟ���HuJ�jx���e
Traceback (most recent call last):
  File "/Users/linwaiwai/Documents/Project/opensource/blind_watermark/examples/example_str.py", line 79, in <module>
    assert wm == wm_extract, '提取水印和原水印不一致'
           ^^^^^^^^^^^^^^^^
AssertionError: 提取水印和原水印不一致

mutil pics in one

Screenshot 2024-11-23 at 17 26 46

crop with extra black blank

2
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

1 participant