CN114547563A - Picture watermark embedding method and system capable of adaptively adjusting embedding strength - Google Patents
Picture watermark embedding method and system capable of adaptively adjusting embedding strength Download PDFInfo
- Publication number
- CN114547563A CN114547563A CN202210184518.XA CN202210184518A CN114547563A CN 114547563 A CN114547563 A CN 114547563A CN 202210184518 A CN202210184518 A CN 202210184518A CN 114547563 A CN114547563 A CN 114547563A
- Authority
- CN
- China
- Prior art keywords
- watermark
- picture
- modification
- embedded
- embedding
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000004048 modification Effects 0.000 claims abstract description 63
- 238000012986 modification Methods 0.000 claims abstract description 63
- 239000011159 matrix material Substances 0.000 claims abstract description 32
- 230000008859 change Effects 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 230000000694 effects Effects 0.000 abstract description 8
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000004069 differentiation Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/10—Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
- G06F21/16—Program or content traceability, e.g. by watermarking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/0021—Image watermarking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2201/00—General purpose image data processing
- G06T2201/005—Image watermarking
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Technology Law (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- General Engineering & Computer Science (AREA)
- Editing Of Facsimile Originals (AREA)
- Image Processing (AREA)
Abstract
The invention particularly relates to a picture watermark embedding method capable of adaptively adjusting embedding strength, which comprises the following steps: s100, coding is carried out according to the random module R and the binaryzation information to be embedded to obtain a binaryzation watermark pattern; s200, horizontally and longitudinally tiling the watermark pattern to the width and height of the picture to be embedded to obtain a watermark matrix image; s300, modifying three-channel parameter values of each pixel point of the picture to be embedded according to the content of the watermark matrix image in the RGB color space, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point. During superposition, the embedding of the watermark is conveniently realized by modifying the pixel values of RGB three channels, and during modification, the modification amplitude is in inverse proportion to the gray value, namely the modification amplitude is small under a light color background and large under a dark color background, so that the self-adaptive modification of the modification amplitude is realized, the invisible effect of the watermark is improved, and the watermark is not easy to perceive.
Description
Technical Field
The invention relates to the technical field of watermark embedding, in particular to a picture watermark embedding method and a picture watermark embedding system capable of adaptively adjusting embedding strength.
Background
Copyright pictures are a concept relative to pirated pictures. Generally refers to authorizing a work of an image that may be used for business, publishing, exhibition, etc., by the copyright holder of the image, or the author or institution that created the image. After a picture is created, a picture owner generally adds a watermark to the picture to avoid being stolen, and currently, two common picture watermarking technologies are mainly used.
The first is visible watermarking, i.e. adding visible information or icons to the picture, which is relatively simple and fast, and has the disadvantages of being visible and easily erased by attack, and poor experience of the customer in watching the picture. The second is invisible watermarking, and the mainstream picture invisible watermarking algorithm in the market is mainly characterized in that an image is converted into a frequency domain from a spatial domain, then the watermark is embedded in the frequency domain and then is recovered to the spatial domain, and the invisible watermarking has the advantages of invisibility, uneasiness in perception, uneasiness in erasure and the like and is obviously superior to the visible watermarking.
There are many schemes for adding an invisible watermark to an image, and a method for adding a watermark to an image is disclosed in an invention patent "watermark generation and decoding method, storage medium, and electronic device" (application No.: 2021107265874), which was filed on 29/6/2021, where a watermark pattern is generated by a random template R and copyright information and then superimposed on an image to be embedded. Because the watermark embedding is realized by slightly modifying the channel value, compared with the original image, the superposed image has very small change, thereby having better invisible effect. However, since the above modifications are fixed values, the visibility of the watermark is different in different light and dark backgrounds, and the watermark is slightly obvious in a light background by the watermark in a dark background, for example, when there are a large number of areas left blank in the picture, the watermark will appear to be obvious.
Disclosure of Invention
The invention mainly aims to provide a picture watermark embedding method capable of adaptively adjusting embedding strength, and the visual effect consistency of watermarks under light color or dark color backgrounds is ensured.
In order to realize the purpose, the invention adopts the technical scheme that: a picture watermark embedding method capable of adaptively adjusting embedding strength comprises the following steps: s100, coding is carried out according to the random module R and the binaryzation information to be embedded to obtain a binaryzation watermark pattern; s200, horizontally and longitudinally tiling the watermark pattern to the width and height of the picture to be embedded to obtain a watermark matrix image; s300, modifying three-channel parameter values of each pixel point of the picture to be embedded according to the content of the watermark matrix image in the RGB color space, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point.
Another objective of the present invention is to provide a picture watermark embedding system capable of adaptively adjusting embedding strength, so as to ensure consistent visible effect of watermarks in light color or dark color backgrounds.
In order to realize the purpose, the invention adopts the technical scheme that: a picture watermark embedding system capable of adaptively adjusting embedding strength comprises a watermark pattern generating module, a watermark pattern generating module and a watermark pattern generating module, wherein the watermark pattern generating module is used for encoding according to a random module R and binarized information to be embedded to obtain a binarized watermark pattern; the watermark matrix generating module is used for generating a watermark matrix image with the same size as the picture to be embedded according to the watermark pattern; and the watermark superposition module is used for modifying the three-channel parameter value of each pixel point according to the gray value of the pixel point in the picture to be embedded, the watermark matrix image and a preset modification amplitude to obtain the picture embedded with the watermark, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point.
Compared with the prior art, the two schemes of the invention have the following technical effects: the watermark matrix image is generated according to the random template R and the information to be embedded, the watermark matrix image is generated according to the watermark pattern, the watermark image with the same size as the image to be embedded can be conveniently obtained, the embedding of the watermark is conveniently realized by modifying the pixel values of RGB three channels during the superposition, and the modification amplitude is in inverse proportion to the gray value during the modification, namely the modification amplitude is small under a light color background and the modification amplitude is large under a dark color background, so that the self-adaptive modification of the modification amplitude is realized, the invisible effect of the watermark is improved, and the watermark is not easy to perceive.
Drawings
FIG. 1 is a flow chart of the present invention;
FIG. 2 is a flow chart of the watermark pattern generation of the present invention;
fig. 3 is a system block diagram of the present invention.
Detailed Description
The present invention will be described in further detail with reference to fig. 1 to 3.
Referring to fig. 1, the invention discloses a picture watermark embedding method capable of adaptively adjusting embedding strength, comprising the following steps: s100, coding is carried out according to the random module R and the binaryzation information to be embedded to obtain a binaryzation watermark pattern; s200, horizontally and longitudinally tiling the watermark pattern to the width and height of the picture to be embedded to obtain a watermark matrix image; s300, modifying three-channel parameter values of each pixel point of the picture to be embedded according to the content of the watermark matrix image in the RGB color space, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point. The watermark matrix image is generated according to the random template R and the information to be embedded, the watermark matrix image is generated according to the watermark matrix image, the watermark image with the same size as the image to be embedded can be conveniently obtained, the embedding of the watermark is conveniently realized by modifying the pixel values of RGB three channels during the superposition, and the modification amplitude is inversely proportional to the gray value during the modification, namely the modification amplitude is small under a light color background and large under a dark color background, so that the self-adaptive modification of the modification amplitude is realized, the invisible effect of the watermark is improved, and the watermark matrix image is not easy to be perceived.
It should be noted that, the "modification amplitude is inversely proportional to the gray scale value of the pixel point" mentioned here, and it is not for any two pixel points P1 and P2 that if the gray scale value of P1 is greater than the gray scale value of P2, the modification amplitude of P1 is certainly less than the gray scale value of P2. This statement should be understood as follows: when the gray value is smaller, the modification amplitude is larger; and when the gray value is larger, the modification amplitude is small.
Further, in step S300, the amplitude is modifiedR, G, B, r, g and b represent three-channel parameter values of the pixel points before and after modification respectively, and the value with the maximum RGB three-channel change is defined as the modification amplitude, so that the relationship of the rest gray values can be calculated better; gray value of pixel pointThe gray value change of the pixel points before and after modification is smaller than a set threshold value, and the threshold value can be set to be about 0.1, so that the gray value of the pixel points before and after modification is basically unchanged.
Since the channel values are integers and the channel values are not modified greatly during modification, the modification amplitude k is very limited, in order to ensure that the modification amplitude is inversely proportional to the gray value, in step S300, a plurality of gray value intervals are set, the modification amplitudes of the pixel points in the gray value intervals are consistent, and the modification amplitude is large as long as the gray value is ensured to be small; when the gray value is larger, the modification amplitude is smaller.
The relationship between the modification amplitude and the gray scale value is described in detail by way of example, and specifically, the gray scale interval has three: when in useTime, modify amplitude(ii) a When in useTime, modify the amplitude(ii) a When the temperature is higher than the set temperatureTime, modify amplitude(ii) a WhereinI.e. when k2When taking 4, k3Can only take 2 or 3. The specific numerical values are only a preferable scheme,other values may actually be selected.
Further, because the contribution of the channel B to the gray value is small, in order to ensure the gray value consistency, in step S300, preferably, when the three-channel parameter values of the pixel points are modified, the change value of the channel B is the modification amplitude k, and the change values of the channel R and the channel G are equal to 0 or 1 or-1 to ensure that the gray value change of the pixel points before and after modification is smaller than the set threshold. Here, the channel B is selected as the main modification channel, the value range of the modification range k can be increased, and after the channel R or G is selected as the main modification channel, it is not beneficial to maintain the gray scale consistency.
More specifically, whenThen, the modified R, G and B three-channel parameter values of the pixel points are respectively equal to R +1, G +1 and B-8 or respectively equal to R +1, G +1 and B-7; when in useThen, the modified r, g and B three-channel parameter values of the pixel point are respectively equal to R, G +1 and B-5; when in useAnd then, the modified R, G and B three-channel parameter values of the pixel points are respectively equal to R +1 and G, B-3 or respectively equal to R-1, G +1 and B-3. The specific implementation mode is a preferable scheme with a very good modification effect. When in modification, for any pixel point of the picture to be embedded, firstly, whether the parameter of the pixel point corresponding to the watermark matrix image is 0 or 1 is judged, and if the parameter is 1, the grey value of the pixel point and the judgment step are combined to modify the RGB three-channel parameter value. If the value is 0, the watermark can be embedded without modification or in a reverse manner, the first modification mode is reverse modification of R +1, G +1 and B-8, namely R-1, G-1 and B +8, the specific modification condition is not detailed here, and the watermark can be embedded only by modification and reflection.
Referring to fig. 2, in the invention patent of my application, namely watermark generation and decoding method, storage medium and electronic device (application number: 2021107265874), a random template R is required to be used when decoding the watermark, which requires that an embedding party and an extraction party can communicate to transmit the random template R, and the use process is very inconvenient and unsafe. In the present invention, preferably, in the step S100, the random template R is a binarized image with a preset size; the information to be embedded comprises binary number of N bits of information, wherein N is an integer; the random template R is encoded as follows: s101, adding 1 to the first digit of the binary number with N bits, and then converting the binary number with N +1 bits into a two-dimensional matrix; s102, sequentially judging element values in the two-dimensional matrix from left to right and from top to bottom, if the element is a first row and a first column, representing the element by using an image of a random template R, if the element value is the same as the previous element value, representing the element by using the image of the random template R, and if the element value is different from the previous element value, representing the element by using a reverse image of the random template R. The encoding is carried out in the mode, the decoding can be carried out without using a random template R, because the binary information is embodied through differentiation, the encoding is carried out according to the steps, and the convenience and the safety of the decoding are improved.
Referring to fig. 3, a picture watermark embedding system capable of adaptively adjusting embedding intensity includes a watermark pattern generating module, configured to encode according to a random module R and binarized information to be embedded to obtain a binarized watermark pattern; the watermark matrix generating module is used for generating a watermark matrix image with the same size as the picture to be embedded according to the watermark pattern; and the watermark superposition module is used for modifying the three-channel parameter value of each pixel point according to the gray value of the pixel point in the picture to be embedded, the watermark matrix image and a preset modification amplitude to obtain the picture embedded with the watermark, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point. The watermark matrix image is generated according to the random template R and the information to be embedded, the watermark matrix image is generated according to the watermark matrix image, the watermark image with the same size as the image to be embedded can be conveniently obtained, the embedding of the watermark is conveniently realized by modifying the pixel values of RGB three channels during the superposition, and the modification amplitude is inversely proportional to the gray value during the modification, namely the modification amplitude is small under a light color background and large under a dark color background, so that the self-adaptive modification of the modification amplitude is realized, the invisible effect of the watermark is improved, and the watermark matrix image is not easy to be perceived.
The invention also discloses a computer readable storage medium and an electronic device, wherein the computer readable storage medium stores a computer program which is executed by a processor to realize any one of the picture watermark embedding methods capable of adaptively adjusting the embedding strength. An electronic device includes a memory, a processor and a computer program stored on the memory, where the processor implements any one of the foregoing picture watermark embedding methods capable of adaptively adjusting embedding strength when executing the computer program.
Claims (10)
1. A picture watermark embedding method capable of adaptively adjusting embedding strength is characterized in that: the method comprises the following steps:
s100, coding is carried out according to the random module R and the binaryzation information to be embedded to obtain a binaryzation watermark pattern;
s200, horizontally and longitudinally tiling the watermark pattern to the width and height of the picture to be embedded to obtain a watermark matrix image;
s300, modifying three-channel parameter values of each pixel point of the picture to be embedded according to the content of the watermark matrix image in the RGB color space, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point.
2. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 1, wherein: in the step S300, the amplitude is modifiedR, G, B, r, g and b respectively represent three channel parameter values of the pixel points before and after modification; gray value of pixel pointModifying the gray values of the pixels before and after modificationThe variation is less than a set threshold.
3. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 2, wherein: in the step S300, a plurality of gray value intervals are set, and the modification range of the pixel points in each gray value interval is consistent.
4. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 2, wherein: the gray scale interval has three:
5. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 2, wherein: in step S300, when the three-channel parameter values of the pixel points are modified, the change value of the channel B is the modification amplitude k, and the change values of the channel R and the channel G are equal to 0 or 1 or-1 to ensure that the change of the gray value of the pixel points before and after modification is less than the set threshold.
6. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 4, wherein:
when in useThen, the modified R, G and B three-channel parameter values of the pixel points are respectively equal to R +1, G +1 and B-8 or respectively equal to R +1, G +1 and B-7;
when in useThen, the modified r, g and B three-channel parameter values of the pixel point are respectively equal to R, G +1 and B-5;
7. The picture watermark embedding method capable of adaptively adjusting embedding strength according to claim 1, wherein: in the step S100, the random template R is a binarized image with a preset size; the information to be embedded comprises binary number of N bits of information, wherein N is an integer; the random template R is encoded as follows:
s101, adding 1 to the first digit of the binary number with N bits, and then converting the binary number with N +1 bits into a two-dimensional matrix;
s102, sequentially judging element values in the two-dimensional matrix from left to right and from top to bottom, if the element is a first row and a first column, representing the element by using an image of a random template R, if the element value is the same as the previous element value, representing the element by using the image of the random template R, and if the element value is different from the previous element value, representing the element by using a reverse image of the random template R.
8. A picture watermark embedding system capable of adaptively adjusting embedding strength is characterized in that: comprises that
The watermark pattern generation module is used for coding according to the random module R and the binarized information to be embedded to obtain a binarized watermark pattern;
the watermark matrix generating module is used for generating a watermark matrix image with the same size as the picture to be embedded according to the watermark pattern;
and the watermark superposition module is used for modifying the three-channel parameter value of each pixel point according to the gray value of the pixel point in the picture to be embedded, the watermark matrix image and a preset modification amplitude to obtain the picture embedded with the watermark, wherein the modification amplitude is in inverse proportion to the gray value of the pixel point.
9. A computer-readable storage medium characterized by: stored thereon a computer program which, when executed by a processor, implements the picture watermark embedding method with adaptively adjustable embedding strength as claimed in any one of claims 1 to 7.
10. An electronic device, characterized in that: comprising a memory, a processor and a computer program stored on the memory, the processor, when executing the computer program, implementing the picture watermarking embedding method with adaptively adjustable embedding strength as claimed in any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210184518.XA CN114547563A (en) | 2022-02-28 | 2022-02-28 | Picture watermark embedding method and system capable of adaptively adjusting embedding strength |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210184518.XA CN114547563A (en) | 2022-02-28 | 2022-02-28 | Picture watermark embedding method and system capable of adaptively adjusting embedding strength |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114547563A true CN114547563A (en) | 2022-05-27 |
Family
ID=81680038
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210184518.XA Pending CN114547563A (en) | 2022-02-28 | 2022-02-28 | Picture watermark embedding method and system capable of adaptively adjusting embedding strength |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114547563A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116150716A (en) * | 2023-04-24 | 2023-05-23 | 中国科学技术大学 | Database watermark embedding method, extraction method, storage medium and electronic device |
-
2022
- 2022-02-28 CN CN202210184518.XA patent/CN114547563A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116150716A (en) * | 2023-04-24 | 2023-05-23 | 中国科学技术大学 | Database watermark embedding method, extraction method, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Kang et al. | A novel hybrid of DCT and SVD in DWT domain for robust and invisible blind image watermarking with optimal embedding strength | |
Pereira et al. | Optimal transform domain watermark embedding via linear programming | |
Pei et al. | Hybrid pixel-based data hiding and block-based watermarking for error-diffused halftone images | |
TWI242140B (en) | Image processing method, image recording apparatus, printed material and printing method | |
CN105404817B (en) | It is based on(k, n)The user-friendly visual secret sharing scheme method of thresholding | |
Bakhsh et al. | A robust HDR images watermarking method using artificial bee colony algorithm | |
Ni et al. | Secure semi-blind watermarking based on iteration mapping and image features | |
TW201012223A (en) | Method of halftone watermarking for hiding multi-tone watermark or two-tone watermark | |
JP2005184603A (en) | Image processing method | |
Pei et al. | Data hiding in halftone images with noise-balanced error diffusion | |
CN114547563A (en) | Picture watermark embedding method and system capable of adaptively adjusting embedding strength | |
CN114549273A (en) | Self-adaptive robust watermark embedding method and system based on deep neural network | |
CN105160619B (en) | A kind of image watermark detection method | |
CN102263879B (en) | Image data processing system and related data hiding method thereof | |
CN115841413A (en) | Image processing method and device | |
CN113538197A (en) | Watermark extraction method, device, storage medium and electronic equipment | |
Su et al. | A robust color image watermarking scheme in the fusion domain based on LU factorization | |
Lee et al. | Stereoscopic watermarking by horizontal noise mean shifting | |
CN113240569A (en) | Fingerprint image encryption method, device and system | |
JP3881810B2 (en) | Digital watermark with adjustable watermark mark visibility | |
CN104408682B (en) | A kind of preparation method of the color watermark based on kinoform | |
RU2546558C2 (en) | Method of information embedding into image compressed by fractal method in view of power of domain pixels | |
CN113393363B (en) | Watermark embedding and extracting method, storage medium and electronic device | |
CN105427234A (en) | Sharing method and sharing system for WIFI password | |
JP4310031B2 (en) | Image processing apparatus, image processing method, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |