Watermark generation, decoding method, storage medium, and electronic device

By generating and embedding watermark patterns containing copyright information, the security issues during the company's sensitive data transmission are solved, and digital copyright protection and traceability of data are realized.

CN113392381BActive Publication Date: 2025-02-25HEFEI HIGH DIMENSIONAL DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110726587.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-29
Publication Date
2025-02-25
Estimated Expiration
2041-06-29

AI Technical Summary

Technical Problem

Sensitive data of company units is easily leaked or unauthorized when spreading, resulting in the impact of data security.

Method used

A watermark generation method is proposed, by generating a random template and identification code text for identifying copyright information, encode the watermark pattern containing copyright information, and realize the digital copyright protection of company data.

Benefits of technology

Through the embedding and decoding of watermark patterns, traceability and copyright protection of company data are realized, and the security of data is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113392381B_ABST
    Figure CN113392381B_ABST
Patent Text Reader

Abstract

The present invention discloses a watermark generation method, a watermark decoding method, a storage medium, and an electronic device. The watermark generation method comprises the following steps: A1, generating a random template R and an identification code text for identifying copyright information; B1, encoding the random template R according to the identification code text to obtain a watermark pattern containing copyright information. The watermark generation method can obtain a watermark pattern containing copyright information, and then the watermark pattern can be embedded into a picture to obtain a copyright picture with a blind watermark, so as to realize digital copyright protection of the image and traceability of the watermark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of digital watermarking, and in particular to a watermark generation and decoding method, a storage medium, and an electronic device. Background Art

[0002] Generally speaking, company data is sensitive or confidential information, and there are strict restrictions on the transmission of data. However, sensitive company data can still be leaked or transmitted by taking photos or screenshots, which has a certain impact on the security of the data. For this reason, watermarks can be added to web pages and documents containing sensitive data. Although it cannot prohibit users from taking photos or screenshots, it can add marks to the leaked data to indicate ownership. Summary of the invention

[0003] The present invention aims to solve one of the technical problems in the related art to at least some extent. To this end, the first object of the present invention is to propose a watermark generation method to obtain a watermark pattern containing copyright information, so as to facilitate the subsequent acquisition of a copyright image with a blind watermark and realize digital copyright protection of company data.

[0004] The second object of the present invention is to provide a watermark decoding method.

[0005] A third object of the present invention is to provide a computer-readable storage medium.

[0006] A fourth objective of the present invention is to provide an electronic device.

[0007] To achieve the above-mentioned purpose, the first aspect of the present invention proposes a watermark generation method, comprising the following steps: A1, generating a random template R and an identification code text for identifying copyright information; B1, encoding the random template R according to the identification code text to obtain a watermark pattern containing copyright information.

[0008] The watermark generation method of the embodiment of the present invention first generates a random template R and an identification code text for identifying copyright information, and then encodes the random template R according to the identification code text to obtain a watermark pattern containing copyright information. This facilitates the subsequent acquisition of a copyright image with a blind watermark, thereby realizing digital copyright protection of company data.

[0009] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a watermark decoding method, comprising the following steps: A2, obtaining a watermark pattern to be decoded; B2, decoding the watermark pattern to be decoded according to a known random template R to obtain an identification code text for identifying copyright information.

[0010] The watermark decoding method of the embodiment of the present invention can decode the watermark pattern obtained by the above-mentioned watermark embedding method to obtain a random template R and an identification code text for identifying copyright information, thereby tracing the watermark pattern.

[0011] To achieve the above objectives, a third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above watermark generation method, or implements the above watermark decoding method.

[0012] The computer-readable storage medium of an embodiment of the present invention, when the computer program for implementing the above-mentioned watermark generation method stored thereon is executed by a processor, can obtain a watermark pattern containing copyright information, thereby facilitating the subsequent acquisition of a copyright image with a blind watermark, thereby realizing digital copyright protection of company data; when the computer program for implementing the above-mentioned watermark decoding method stored thereon is executed by a processor, the watermark pattern to be decoded can be decoded according to a known random template R, and an identification code text for identifying copyright information can be obtained, thereby realizing the traceability of the company's copyright.

[0013] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the watermark generation method mentioned above is implemented, or the watermark decoding method mentioned above is implemented.

[0014] The electronic device of an embodiment of the present invention, when the computer program implementing the above-mentioned watermark generation method stored in its memory is executed by the processor, can obtain a watermark pattern containing copyright information, thereby facilitating the subsequent acquisition of a copyright image with a blind watermark, thereby realizing digital copyright protection of company data; when the computer program implementing the above-mentioned watermark decoding method stored in its memory is executed by the processor, the watermark pattern to be decoded can be decoded according to a known random template R, and an identification code text for identifying copyright information can be obtained, thereby realizing the traceability of the company's copyright.

[0015] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a watermark generation method according to an embodiment of the present invention;

[0017] Figure 2 is a schematic diagram of a watermark pattern generation process of an example of the present invention;

[0018] Figure 3 is a flow chart of a watermark generation method according to another embodiment of the present invention;

[0019] Figure 4 is a flow chart of a watermark generation method according to another embodiment of the present invention;

[0020] Figure 5 is a schematic diagram of a watermark pattern after flipping processing according to an example of the present invention;

[0021] Figure 6 is a flow chart of a watermark embedding process of an example of the present invention;

[0022] Figure 7 is a flow chart of a watermark decoding method according to an embodiment of the present invention;

[0023] Figure 8 is a flow chart of a watermark decoding method according to another embodiment of the present invention;

[0024] Fig. 9 is a flow chart of a watermark decoding method according to another embodiment of the present invention;

[0025] Fig.10 is a flow chart of a watermark pattern detection process of an example of the present invention;

[0026] Fig.11 It is a flowchart of a watermark pattern extraction process of an example of the present invention. DETAILED DESCRIPTION

[0027] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0028] The following describes the watermark generation and decoding methods, storage media, and electronic devices according to the embodiments of the present invention with reference to the accompanying drawings.

[0029] Figure 1 The figure is a flow chart of a watermark generation method according to an embodiment of the present invention.

[0030] like Figure 1 As shown, the watermark generation method includes the following steps:

[0031] A1. Generate a random template R and an identification code text for identifying copyright information.

[0032] Specifically, see Figure 2, the random template R is a binary image of a preset size. The random template R is generated by a key that is shared by the embedding party and the extraction party. We can adjust the size of R to adjust the performance of the generated watermark. Generally speaking, a larger R makes the watermark more robust to image processing, such as compression, filtering, etc.; because the principle of using a random template R to represent bits 0, 1 and spread spectrum is similar, using a larger R to represent a bit will be more robust. A smaller R can make the generated watermark more robust to geometric distortions, such as scaling and rotation; because a smaller R usually means that more watermark units can be embedded in a fixed-size area, which gives us more feature points to more accurately estimate the geometric distortion of the watermark.

[0033] The copyright information can be a company ID to form a company-specific watermark pattern, which is also convenient for tracing the source of the watermark pattern. Figure 2 The preset identity sequence 1101011111100000) is a binary number containing N bits of information, where N is an integer, such as 16.

[0034] B1. Encode the random template R according to the identification code text to obtain a watermark pattern containing copyright information.

[0035] In this implementation, in step B1, the random template R is encoded according to the following steps:

[0036] B11. Convert the N-bit binary number into a two-dimensional matrix;

[0037] B21. Use the positive and negative values ​​of the random template R to represent 1 and 0 in a two-dimensional matrix.

[0038] Specifically, see Figure 2 , convert the N-bit binary number 1101011111100000 into a 4*4 two-dimensional matrix (i.e. Figure 2 The reshaping information in the two-dimensional matrix). The places representing 1 in the two-dimensional matrix are directly represented by a positive random template, that is, 1×R, and the places representing 0 in the two-dimensional matrix are represented by a negative random template, that is, -1×R, that is, the inverse image of the binary image corresponding to R (such as Figure 2 The expansion unit shown in the figure) is finally obtained Figure 2 The watermark pattern shown. Since the random template enables the watermark unit to carry a large amount of information, and the preset identity sequence makes the watermark unit more robust, the watermark unit can carry a large amount of information and has strong robustness. It should be noted that the two-dimensional matrix here can be 4*4 or 2*8, which is selected according to actual needs. More preferably, a square two-dimensional matrix is ​​selected to facilitate the subsequent embedding and extraction of the watermark.

[0039] In one embodiment of the present invention, Figure 3 As shown, after step B1, the following steps may also be included:

[0040] C1. Use a random key matrix to encrypt the watermark pattern.

[0041] Specifically, the watermark pattern can be encrypted using a random key matrix to obtain an encrypted watermark pattern, thereby improving the security and randomness of the watermark pattern, thereby improving the robustness of the watermark unit.

[0042] In one embodiment of the present invention, Figure 4 As shown, after step C1, the following steps may also be included:

[0043] D1. Flip the encrypted watermark pattern.

[0044] Specifically, the encrypted watermark pattern can be flipped to obtain Figure 5 The symmetrical watermark pattern shown has strong symmetry, which makes it have very obvious characteristics in the frequency domain, facilitating the subsequent extraction of the watermark pattern.

[0045] In some embodiments of the present invention, after obtaining the watermark pattern, the watermark pattern can be embedded into the image, that is, the original image is input, the watermark pattern is embedded into the original image, and the copyright image with a blind watermark is output to achieve digital copyright protection of the image. Figure 6 As shown, the watermark embedding step may include:

[0046] S101, calculating the watermark unit size according to the original image size.

[0047] S102: construct a watermark unit with frequency domain characteristics according to the watermark pattern and the watermark unit size.

[0048] Specifically, a watermark unit with strong symmetry frequency domain characteristics can be constructed.

[0049] S103, repeatedly tiling the watermark unit according to a set spatial rule to generate a grayscale matrix with the same length and width as the original image.

[0050] It should be noted that the set spatial rules include but are not limited to equilateral triangles, squares, and rectangles.

[0051] S104, processing the grayscale matrix and expanding it into an RGB three-channel embedding matrix.

[0052] Specifically, the grayscale matrix is ​​processed according to the grayscale consistency principle, that is, the RGB channels of the original image pixels are positively and negatively superimposed in proportion to the grayscale calculation formula, so that the fused superimposed watermark pattern has an excellent visual effect.

[0053] It should be noted that the grayscale consistency principle is as follows: the formula for converting RGB color space to grayscale is: Gray = R*0.299+G*0.587+B*0.114. Specifically, when two of the channels increase or decrease a certain value, and the other channel decreases or increases the corresponding value, the grayscale value can be kept basically unchanged. For example, in a specific embodiment, the embedding matrix coefficients are R+1, G+1, B-7, and the grayscale value will only increase by 0.088, so the conversion to an integer is exactly the same as before the modification.

[0054] S105, the original image and the RGB three-channel modified matrix are superimposed and fused and output to complete watermark embedding.

[0055] This embedding method, by adopting the grayscale consistency method, has an excellent visual effect for the fused and superimposed blind watermarks. In addition, the embedding speed is faster, that is, the embedding process is simple. When embedding, it is only necessary to tile the very small-sized watermark units according to a certain rule according to the size of the original picture to generate a watermark image, and then superimpose the watermark image with the original picture in a certain proportion. For example, in a specific embodiment, since the time for domain transformation of the original picture is eliminated, the embedding speed is extremely fast, and an ultra-high-definition large picture with a 4k resolution can be embedded in less than 0.5 seconds. In addition, this embedding method is more robust, that is, a part of the material in the copyright image after the watermark is embedded is processed by cropping, scaling, rotating, splicing, fusion, etc. The generated picture can still detect the embedded copyright information.

[0056] In summary, the watermark generation method of the embodiment of the present invention encodes the identification code text random template R used to identify copyright information to obtain a watermark pattern containing copyright information, so that the watermark pattern also has high robustness; the watermark pattern is encrypted and flipped, so that the watermark pattern has high security, randomness, and symmetry, thereby improving the robustness of the watermark; and further helps to improve the concealment and robustness of the watermark pattern when it is embedded.

[0057] Figure 7 The figure is a flow chart of a watermark decoding method according to an embodiment of the present invention.

[0058] like Figure 7 As shown, the watermark decoding method includes the following steps:

[0059] A2, obtaining the watermark pattern to be decoded.

[0060] B2, decoding the watermark pattern to be decoded according to a known random template R to obtain an identification code text for identifying copyright information.

[0061] Specifically, the watermark pattern to be decoded can be obtained as follows: Figure 2As shown, the identification code text used to identify the copyright information can be determined based on the positive and negative features of the random template R, and the source of the watermark pattern, such as the company it belongs to, can be determined based on the identification code text.

[0062] In one embodiment of the present invention, Figure 8 As shown, the following steps may also be included before step B2:

[0063] C2, uses a random key matrix to decrypt the watermark pattern to be decoded.

[0064] Specifically, if the watermark pattern to be decoded has been encrypted, the watermark pattern to be decoded needs to be decrypted first for subsequent decoding.

[0065] In one embodiment of the present invention, Fig. 9 As shown, the following steps may also be included before step C2:

[0066] D2, superimpose and enhance the watermark pattern to be decoded.

[0067] Specifically, if the watermark pattern to be decoded is Figure 5 As shown, the watermark pattern to be decoded can be superimposed first, so as to superimpose four symmetrically related "p", "q", "d", and "b" to obtain a positive watermark unit, such as "p", "q", "d" or "b", so as to reduce the noise in the watermark pattern to be decoded, thereby facilitating subsequent accurate decryption and decoding.

[0068] In a possible implementation of the present invention, the watermark pattern may be embedded in a picture. In this case, the submitted picture may be inspected first, and when the watermark pattern is detected, the watermark pattern is extracted and then decoded.

[0069] In this embodiment, if Fig.10 As shown, the inspection of the submitted images may include:

[0070] S201, separate the RGB three-channel of the image to be inspected, process it according to the ratio of the embedding matrix coefficients, and normalize it to generate a single-channel grayscale image.

[0071] S202, performing noise filtering on the single channel image to obtain a residual image.

[0072] Specifically, the single-channel image can be subjected to noise filtering by filtering out Gaussian noise, and the images before and after noise filtering are subjected to subtraction processing to obtain a residual image.

[0073] S203, processing the residual image to obtain a feature image having spatial arrangement characteristics of watermark units.

[0074] Specifically, the residual image may be processed by means of Fourier transform, frequency domain signal enhancement and inverse Fourier transform.

[0075] S204, extracting feature points in the feature map, determining whether the image contains a watermark pattern, and if so, calculating the watermark pattern position information to complete watermark detection.

[0076] Specifically, a feature detection algorithm may be used to extract feature points in the feature map.

[0077] The above detection method has a faster detection speed. That is, to detect and find copyrighted images from massive image files, it is only necessary to detect the primary watermark information expressed by the spatial arrangement rules to quickly distinguish whether it is a copyrighted image. For example, in a specific embodiment, the single-process detection speed can exceed 1 picture / second, which reduces resource consumption and allows multiple processes to be detected in parallel.

[0078] In this embodiment, if Fig.11 As shown, extracting a watermark pattern may include:

[0079] S301, extracting the watermarked portion from the image according to the watermark pattern position information, and segmenting the image containing the single watermarked unit.

[0080] S302, performing a superposition operation on the image containing a single watermark unit to obtain a watermark pattern, thereby completing watermark pattern extraction.

[0081] In summary, the watermark decoding method of the embodiment of the present invention can decode the watermark pattern to be decoded to obtain the identification code text used to identify the copyright information, thereby tracing the source of the watermark pattern to be decoded.

[0082] Furthermore, the present invention provides a computer-readable storage medium.

[0083] In this embodiment, a computer program is stored on a computer-readable storage medium. When the computer program is executed by a processor, the watermark generation method of the above embodiment is implemented, or the watermark decoding method of the above embodiment is implemented.

[0084] Furthermore, the present invention also provides an electronic device.

[0085] In this embodiment, the electronic device includes a memory, a processor and a computer program stored in the memory. When the processor executes the computer program, the watermark generation method of the above embodiment is implemented, or the watermark decoding method of the above embodiment is implemented.

[0086] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0087] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0088] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0089] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0090] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0091] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0092] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0093] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A watermark generation method, characterized in that: The steps include: A1, generating a random template R and an identification code text for identifying copyright information; B1, encoding the random template R according to the identification code text to obtain a watermark pattern containing copyright information; In step A1, the random template R is a binary image of a preset size, and the performance of the generated watermark is adjusted by adjusting the size of the random template R; The following steps are also included after step B1: C1. Encrypt the watermark pattern using a random key matrix.

2. The watermark generation method according to claim 1, characterized in that: In step A1, the copyright information is a company ID, and the identification code text is a binary number containing N bits of information, where N is an integer.

3. The watermark generation method according to claim 2, characterized in that: In step B1, the random template R is encoded according to the following steps: B11, converting the N-bit binary number into a two-dimensional matrix; B21. Use the positive and negative values ​​of the random template R to represent 1 and 0 in a two-dimensional matrix.

4. The watermark generation method according to claim 1, characterized in that: The following steps are also included after step C1: D1. Flip the encrypted watermark pattern.

5. A watermark decoding method, characterized in that: The steps include: A2, obtaining the watermark pattern to be decoded; B2, decoding the watermark pattern to be decoded according to a known random template R to obtain an identification code text for identifying copyright information; the random template R is a binary image of a preset size, and the performance of the generated watermark is adjusted by adjusting the size of the random template R; the watermark pattern is encrypted by a random key matrix; The following steps are also included before step B2: C2, decrypting the watermark pattern to be decoded using a random key matrix; The following steps are also included before step C2: D2, superimposing and enhancing the watermark pattern to be decoded.

6. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the watermark generation method according to any one of claims 1 to 4 is implemented, or the watermark decoding method according to claim 5 is implemented.

7. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory. When the processor executes the computer program, the watermark generation method according to any one of claims 1 to 4 is implemented, or the watermark decoding method according to claim 5 is implemented.

Citation Information

Patent Citations

  • An image copyright hidden digital watermark embedding method and device

    CN109685710A

  • Image digital copyright protection method and system based on frequency domain feature arrangement

    CN112579985A