当前位置: 首页> 健康> 母婴 > 网站快速优化排名排名_茂名网站建设系统_网页设计软件有哪些_互联网推广软件

网站快速优化排名排名_茂名网站建设系统_网页设计软件有哪些_互联网推广软件

时间:2025/7/11 15:14:43来源:https://blog.csdn.net/lovechris00/article/details/143740355 浏览次数:0次
网站快速优化排名排名_茂名网站建设系统_网页设计软件有哪些_互联网推广软件

文章目录

    • 一、关于 blind-watermark
      • 安装
    • 二、bash 中使用
    • 三、Python 调用
      • 1、基本使用
      • 2、attacks on Watermarked Image
      • 3、embed images
      • 4、embed array of bits
    • 四、并发
    • 五、相关 Project


一、关于 blind-watermark

Blind watermark 基于 DWT-DCT-SVD.

  • github : https://github.com/guofei9987/blind_watermark
  • Documentation: https://blindwatermark.github.io/blind_watermark/#/en/
  • 文档: https://blindwatermark.github.io/blind_watermark/#/zh/
  • Source code: https://github.com/guofei9987/blind_watermark
  • Discussions : https://github.com/guofei9987/blind_watermark/discussions

安装

pip install blind-watermark

源码安装当前开发版本

git clone git@github.com:guofei9987/blind_watermark.git
cd blind_watermark
pip install .


二、bash 中使用

# embed watermark into image:
blind_watermark --embed --pwd 1234 examples/pic/ori_img.jpeg "watermark text" examples/output/embedded.png# extract watermark from image:
blind_watermark --extract --pwd 1234 --wm_shape 111 examples/output/embedded.png

三、Python 调用

1、基本使用

Original Image + Watermark = Watermarked Image

origin_image + ‘@guofei9987 开源万岁!’ = 打上水印的图


See the codes

嵌入水印:

from blind_watermark import WaterMarkbwm1 = WaterMark(password_img=1, password_wm=1)
bwm1.read_img('pic/ori_img.jpg')
wm = '@guofei9987 开源万岁!'
bwm1.read_wm(wm, mode='str')
bwm1.embed('output/embedded.png')
len_wm = len(bwm1.wm_bit)
print('Put down the length of wm_bit {len_wm}'.format(len_wm=len_wm))

提取水印:

bwm1 = WaterMark(password_img=1, password_wm=1)
wm_extract = bwm1.extract('output/embedded.png', wm_shape=len_wm, mode='str')
print(wm_extract)

输出:

@guofei9987 开源万岁!


2、attacks on Watermarked Image

attack methodimage after attackextracted watermark
Rotate 45 Degrees在这里插入图片描述‘@guofei9987 开源万岁!’
Random crop在这里插入图片描述‘@guofei9987 开源万岁!’
Masks在这里插入图片描述‘@guofei9987 开源万岁!’
Vertical cut横向裁剪攻击‘@guofei9987 开源万岁!’
Horizontal cut纵向裁剪攻击‘@guofei9987 开源万岁!’
Resize缩放攻击‘@guofei9987 开源万岁!’
Pepper Noise椒盐攻击‘@guofei9987 开源万岁!’
Brightness 10% Down亮度攻击‘@guofei9987 开源万岁!’

3、embed images

嵌入水印:

from blind_watermark import WaterMarkbwm1 = WaterMark(password_wm=1, password_img=1)
# read original image
bwm1.read_img('pic/ori_img.jpg')
# read watermark
bwm1.read_wm('pic/watermark.png')
# embed
bwm1.embed('output/embedded.png')

提取水印:

bwm1 = WaterMark(password_wm=1, password_img=1)
# notice that wm_shape is necessary
bwm1.extract(filename='output/embedded.png', wm_shape=(128, 128), out_wm_name='output/extracted.png', )

attack methodimage after attackextracted watermark
Rotate 45 Degrees[旋转攻击在这里插入图片描述
Random crop在这里插入图片描述多遮挡_提取水印
Mask多遮挡攻击多遮挡_提取水印

4、embed array of bits

See it here

作为 demo,我们嵌入 6 bytes 数据:

wm = [True, False, True, True, True, False]

嵌入:

from blind_watermark import WaterMarkbwm1 = WaterMark(password_img=1, password_wm=1)
bwm1.read_ori_img('pic/ori_img.jpg')
bwm1.read_wm([True, False, True, True, True, False], mode='bit')
bwm1.embed('output/embedded.png')

提取:

bwm1 = WaterMark(password_img=1, password_wm=1, wm_shape=6)
wm_extract = bwm1.extract('output/打上水印的图.png', mode='bit')
print(wm_extract)

请注意,wm_shape(水印的形状)是必需的

输出 wm_extract 是一个浮点数组。设置阈值,例如0.5。


四、并发

WaterMark(..., processes=None)

  • processes 进程数可以是整数。默认为 None,这意味着使用所有进程。

五、相关 Project

  • text_blind_watermark (将消息嵌入文本): https://github.com/guofei9987/text_blind_watermark
  • HideInfo(隐藏为图像、隐藏为声音、隐藏为文本):https://github.com/guofei9987/HideInfo

关键字:网站快速优化排名排名_茂名网站建设系统_网页设计软件有哪些_互联网推广软件

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: