CN111738899B - Method, apparatus, device and computer readable medium for generating watermark - Google Patents

Method, apparatus, device and computer readable medium for generating watermark Download PDF

Info

Publication number
CN111738899B
CN111738899B CN202010579026.1A CN202010579026A CN111738899B CN 111738899 B CN111738899 B CN 111738899B CN 202010579026 A CN202010579026 A CN 202010579026A CN 111738899 B CN111738899 B CN 111738899B
Authority
CN
China
Prior art keywords
matrix
watermark
image
generate
target user
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.)
Active
Application number
CN202010579026.1A
Other languages
Chinese (zh)
Other versions
CN111738899A (en
Inventor
孙婉轩
何轶
陈扬羽
李磊
王长虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202010579026.1A priority Critical patent/CN111738899B/en
Publication of CN111738899A publication Critical patent/CN111738899A/en
Application granted granted Critical
Publication of CN111738899B publication Critical patent/CN111738899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2201/00General purpose image data processing
    • G06T2201/005Image watermarking

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

Embodiments of the present disclosure disclose methods, apparatuses, electronic devices, and computer-readable media for generating watermarks. One embodiment of the method comprises the following steps: generating a first matrix based on the watermark image to be added; generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; performing numerical adjustment on elements of the second matrix to generate a third matrix; the watermark is generated using the value elements of the third matrix as pixel values. The embodiment realizes that the adding position of the watermark does not need to be determined based on the image to be added with the watermark, so that the watermark is not easy to discard when the image is compressed after the watermark is added onto the image, and the target user information in the watermark can be decoded more accurately.

Description

Method, apparatus, device and computer readable medium for generating watermark
Technical Field
Embodiments of the present disclosure relate to the field of computer technology, and in particular, to a method, apparatus, device, and computer readable medium for generating watermarks.
Background
With the development of internet technology and the popularization of electronic devices, such as mobile phones, users upload a large number of images onto a network. A watermark is information added to an image and can be used to determine the original user of the image and protect the copyright of the original user.
Related methods for generating watermarks typically require determining the location of the watermark to be added based on the image to be watermarked, in such a way that the watermark is easily discarded during compression, resulting in difficulties in watermark decoding.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
Some embodiments of the present disclosure propose methods, apparatuses, devices and computer readable media for generating watermarks to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method for generating a watermark, the method comprising: generating a first matrix based on the watermark image to be added; generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; performing numerical adjustment on the elements of the second matrix to generate a third matrix; the values of the elements in the third matrix are used as pixel values to generate the watermark.
In a second aspect, some embodiments of the present disclosure provide an apparatus for generating a watermark, the apparatus comprising: a first generation unit configured to generate a first matrix based on an image to be watermarked; a second generation unit configured to generate a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; the third generation unit is configured to carry out numerical adjustment on elements of the second matrix to generate a third matrix; and a fourth generation unit configured to generate a watermark using the elements in the third matrix as pixel values.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement the method as described in any of the implementations of the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method as described in any of the implementations of the first aspect.
One of the above embodiments of the present disclosure has the following advantageous effects: it is achieved that the watermark adding position does not need to be determined based on the image to be watermarked. The method realizes that the watermark is not easy to discard when the image is compressed after the watermark is added to the image, thereby providing a basis for more accurately decoding the target user information in the watermark.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a schematic diagram of one application scenario of a method for generating a watermark according to some embodiments of the present disclosure;
fig. 2 is a flow chart of some embodiments of a method for generating a watermark according to the present disclosure;
fig. 3 is an exemplary schematic diagram of a second matrix generation method of a method for generating a watermark according to the present disclosure;
fig. 4 is an exemplary schematic diagram of converting a matrix into a watermark in a method for generating a watermark according to some embodiments of the present disclosure;
fig. 5 is a flow chart of further embodiments of a method for generating a watermark according to the present disclosure;
fig. 6 is an exemplary schematic diagram of generating a watermarked image in a method for generating a watermark according to some embodiments of the present disclosure;
fig. 7 is a schematic structural diagram of some embodiments of an apparatus for generating watermarks according to the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a method for generating a watermark according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the computing device 101 may receive the image 102 to be watermarked. In the present application scenario, the watermark image 102 to be added is a color picture, and the number of channels is 3. The computing device 101 may then convert the image 102 to be watermarked into a matrix form, generating a first matrix 103. The target user information 104 obtained in advance is expressed as a vector form, and the vector form of the target user information is subjected to inner product with the first matrix 103 to generate a second matrix 105. As an example, the target user information 104 may include a user number, such as "147" shown in fig. 1. Thereafter, the computing device 101 performs numerical adjustment on the second matrix 105, and generates a third matrix 106. Wherein the numerical adjustment of the second matrix 105 may include adding a preset weight to each element in the second matrix 105. For example, each element in the second matrix 105 described above is multiplied by 0.01. Finally, the computing device 101 converts the third matrix to an image format, generating the watermark 107.
The computing device 101 may be hardware or software. When the computing device is hardware, the computing device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the computing device is embodied as software, it may be implemented as a plurality of software or software modules, for example, to provide distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of computing devices 101 in fig. 1 is merely illustrative. There may be any number of computing devices 101 as desired for an implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a method for generating a watermark according to the present disclosure is shown. The method for generating a watermark comprises the steps of:
a first matrix is generated based on the image to be watermarked, step 201.
In some embodiments, as an example, the execution subject of the method for generating a watermark may determine the size of the first matrix, i.e. the first dimension length, the second dimension length, the third dimension length, the fourth dimension length, according to the size of the image to be watermarked, i.e. the length, the width, the number of channels of the image. For example: the lengths from the first dimension to the third dimension of the first matrix may be the length, the width, and the number of channels of the watermark image to be added. While the fourth dimension length of the first matrix and the values of the elements in the first matrix may be randomly generated.
In some embodiments, the size of the first matrix may be in any proportion to the size of the image to be watermarked under the condition that the size of the image to be watermarked is smaller.
Step 202, generating a second matrix adapted to the image to be watermarked based on the target user information and the first matrix.
In some embodiments, the executing entity may represent the target user information in a numerical form, and then superimpose the numerical target user information on an element of the first matrix to generate the second matrix. The superposition position can be flexibly selected according to actual needs.
In some alternative implementations of some embodiments, the target user information may include a sequence of values for characterizing the target user. And generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix may include performing inner product on the first matrix and a vector corresponding to the numerical sequence to generate a second matrix, where a size of the second matrix is adapted to a size of a pixel matrix corresponding to the watermark image to be added.
With further reference to fig. 3, fig. 3 is an exemplary schematic diagram of a second matrix generation method of the method for generating a watermark according to the present disclosure.
As an example, the execution subject may first represent the target user information in a bit form, taking the case where the target user information is represented as "101". As shown in fig. 3, wherein reference numerals 301, 302, 303 are a first three-dimensional component, a second three-dimensional component, and a third three-dimensional component, respectively, in a fourth dimension of the first matrix. Then, the first matrix is inner-integrated with the user information "101", i.e. the first three-dimensional component 301 in the fourth dimension of the first matrix is added to the third three-dimensional component 303 in the fourth dimension of the first matrix, resulting in the second matrix 304.
And 203, performing numerical adjustment on the elements of the second matrix to generate a third matrix.
In some embodiments, performing numerical adjustment on elements of the second matrix may include the execution body adding a preset weight to each element of the second matrix.
In some alternative implementations of some embodiments, the execution body may apply an appropriate function to the elements of the second matrix to control the elements of the second matrix to be within a range of values. And then, adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
In step 204, the values of the elements in the third matrix are used as pixel values to generate the watermark.
With further reference to fig. 4, fig. 4 is an exemplary schematic diagram of generating a watermark using values of elements in a third matrix as pixel values in a method for generating a watermark according to some embodiments of the present disclosure.
In some embodiments, as an example, the execution body may set the size of the watermark to be the same as the size of the third matrix. On this basis, as shown in fig. 4, the third matrix is a three-dimensional matrix. Reference numeral 401 refers to the first two-dimensional component in its third dimension. Reference numeral 402 refers to a second two-dimensional component in its third dimension. Reference numeral 403 refers to a third two-dimensional component in its third dimension. Each pixel in the watermark 404 is composed of three values, representing the values of the three primary colors, respectively. Specifically, the value "1" in the first component 401 in the third dimension, the value "4" in the second component 402 in the third dimension, and the value "3" in the third component 403 in the third dimension form three values "1", "4", "3" of the first pixel "(1, 4, 3) in the watermark 404, respectively. Similarly, other pixels in the watermark 404 may be obtained using this method.
In some embodiments, the executing body may further use the watermark size to be any value smaller than the third matrix size. On the basis, according to actual needs, the corresponding relation between the elements in the third matrix and the pixel points in the watermark can be determined according to preset rules.
Some embodiments of the present disclosure provide methods that enable the determination of the addition location of a watermark without the need to base the image to be watermarked. After the watermark is added to the image in the follow-up process, the watermark is not easy to discard during image compression, so that the target user information in the watermark can be decoded more accurately.
With further reference to fig. 5, a flow 500 of further embodiments of a method for generating a watermark is shown. The flow 500 of the method for generating a watermark comprises the steps of:
step 501, a first matrix is generated based on an image to be watermarked.
In some embodiments, the specific implementation of step 501 and the technical effects thereof may refer to step 201 in the embodiment corresponding to fig. 2, which is not described herein.
Step 502, based on the target user information and the first matrix, generating a second matrix adapted to the image to be watermarked.
In some embodiments, the target user information may be a user number.
In some alternative embodiments of some embodiments, the target user information may also be a sequence of values used to characterize the target user information.
In some embodiments, the execution body may represent the target user information in a bit form, for example when the target user information is represented as "101". As shown in fig. 3, wherein reference numerals 301, 302, 303 are a first three-dimensional component, a second three-dimensional component, and a third three-dimensional component, respectively, in a fourth dimension of the first matrix. The first matrix is inner-product with the user information 101, i.e. the first three-dimensional component 301 in the fourth dimension of the first matrix is added to the third three-dimensional component 303 in the fourth dimension of the first matrix, resulting in a second matrix 304.
Step 503, performing numerical adjustment on the elements of the second matrix to generate a third matrix
In some embodiments, the execution body may apply an appropriate function to the elements of the second matrix to control the elements of the second matrix within a range of values. And then, adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
At step 504, the values of the elements in the third matrix are used as pixel values to generate the watermark.
In some embodiments, the specific implementation of step 504 and the technical effects thereof may refer to step 204 in the corresponding embodiment of fig. 2, which is not described herein.
And 505, superposing the values of the pixels in the watermark and the values of the pixels in the image to be watermarked to generate the image with the watermark. With further reference to fig. 6, fig. 6 is an exemplary schematic diagram of generating a watermarked image in a method for generating a watermark according to some embodiments of the present disclosure.
As shown in fig. 6, where reference numeral 601 is an image to be watermarked, the values of pixels in the image to be watermarked are shown. Reference numeral 602 is a watermark, which shows the values of pixels in the watermark. Reference numeral 603 is a watermarked image showing the values of the pixels in the watermarked image. For example, the pixel "(146,229,204)" in the image 601 to be watermarked is superimposed with the pixel "(1, 4, 3)" in the watermark 602 to obtain the pixel "(147,233,207)" in the watermarked image. The "146" and "1" are added to obtain "147". The addition of "229" and "4" yields "233". The "204" and "3" are added to obtain "207".
Step 506, performing image processing on the watermarked image to generate an attacked watermarked image.
In some embodiments, the method for performing image processing on a watermarked image by a subject may include: affine transformation, gaussian filtering, image compression coding, and the like. The execution subject may randomly combine the image processing methods according to actual needs. Further, parameters in the image processing method may also be selected randomly.
And step 507, decoding the attacked watermark image to obtain the target user information in the watermark.
In some embodiments, the executing entity may apply an image recognition technique to the attacked watermarked image to determine the target user information in the watermark.
In some embodiments, the executing entity may further apply an artificial neural network technology to the attacked watermarked image to determine target user information in the watermark.
Some embodiments of the present disclosure provide methods to hide user information in a watermark by generating the watermark with target user information. The original user of the picture can be screened through the watermark, and the viewing experience of the user viewing the picture can be improved. The use of functions and super-parameters to adjust the invisibility of the watermark and the accuracy of decoding allows the method to be flexibly applied to scenes with different requirements. By performing image processing on the watermarked image, the robustness of watermark decoding is enhanced. The method can cope with the situation that the original image is processed by users on the network in the real scene.
With further reference to fig. 7, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of an apparatus for generating watermarks, which apparatus embodiments correspond to those shown in fig. 2, and which apparatus is particularly applicable in various electronic devices.
As shown in fig. 7, an apparatus 700 for generating a watermark of some embodiments includes: a first generation unit 701, a second generation unit 702, a third generation unit 703, and a fourth generation unit 704. Wherein the first generating unit 701 is configured to generate a first matrix based on the image to be watermarked, and the second generating unit 702 is configured to generate a second matrix adapted to the image to be watermarked based on the target user information and the first matrix; the third generating unit 703 is configured to perform numerical adjustment on the elements of the second matrix to generate a third matrix; the fourth generation unit 704 is configured to generate a watermark using the values of the elements in the third matrix as pixel values.
In an alternative implementation of some embodiments, the apparatus 700 may further include: a fifth generating unit (not shown in the figure) configured to superimpose the values of the pixels in the watermark with the values of the pixels in the image to be watermarked, to generate the watermarked image.
In an alternative implementation of some embodiments, the second generating unit 702 is further configured to: the target user information includes a sequence of values for characterizing the target user. And generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix, including: and carrying out inner product on the vectors corresponding to the first matrix and the numerical sequence to generate a second matrix, wherein the size of the second matrix is matched with the size of the pixel matrix corresponding to the image to be watermarked.
In an alternative implementation of some embodiments, the third generating unit 703 is further configured to: applying a preset function to the second matrix element, and restricting the element of the matrix within a preset numerical range; and adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
In an alternative implementation of some embodiments, the apparatus 700 may further include: a sixth generation unit (not shown in the figure) is configured to perform image processing on the watermarked image, and generate an attacked watermarked image.
In an alternative implementation of some embodiments, the apparatus 700 may further include: and a determining unit (not shown in the figure) decodes the attacked watermarked image to obtain target user information in the watermark.
It will be appreciated that the elements described in the apparatus 700 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting benefits described above for the method are equally applicable to the apparatus 700 and the units contained therein, and are not described in detail herein.
Referring now to fig. 8, a schematic diagram of an electronic device (e.g., server or terminal device of fig. 1) 800 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example, and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 8, the electronic device 800 may include a processing means (e.g., a central processor, a graphics processor, etc.) 801, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
In general, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, etc.; storage 808 including, for example, magnetic tape, hard disk, etc.; communication means 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 shows an electronic device 800 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 8 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communication device 809, or from storage device 808, or from ROM 802. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 801.
It should be noted that the computer readable medium according to some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: generating a first matrix based on the watermark image to be added; generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; adjusting the values of the elements in the second matrix to generate a third matrix; the watermark is generated using the value elements of the third matrix as pixel values.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a first generation unit, a second generation unit, a third generation unit, and a fourth generation unit. The names of these units do not in any way constitute a limitation of the unit itself, for example, the first generation unit may also be described as "unit generating the first matrix".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
According to one or more embodiments of the present disclosure, there is provided a method for generating a watermark, comprising: generating a first matrix based on the watermark image to be added; generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; performing numerical adjustment on elements of the second matrix to generate a third matrix; the watermark is generated using the value elements of the third matrix as pixel values.
In accordance with one or more embodiments of the present disclosure, a method for generating a watermark further comprises: and superposing the values of the pixel points in the watermark and the values of the pixel points in the image to be watermarked to generate the image with the watermark.
According to one or more embodiments of the present disclosure, the target user information includes a sequence of values for characterizing the target user; and generating a second matrix adapted to the image to be watermarked based on the target user information and the first matrix, comprising: and carrying out inner product on the vectors corresponding to the first matrix and the numerical sequence to generate a second matrix, wherein the size of the second matrix is matched with the size of the pixel matrix corresponding to the watermark image to be added.
According to one or more embodiments of the present disclosure, performing a numerical adjustment on the second matrix element, generating an adjusted second matrix as a watermark includes: applying a preset function to the second matrix element, and restricting the element of the matrix within a preset numerical range; and adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
According to one or more embodiments of the present disclosure, the method further comprises: and performing image processing on the watermarked image to generate the attacked watermarked image.
According to one or more embodiments of the present disclosure, the method further comprises: and decoding the attacked image with the watermark to obtain the target user information in the watermark.
According to one or more embodiments of the present disclosure, there is provided an apparatus for generating a watermark, comprising: a first generation unit configured to generate a first matrix based on an image to be watermarked; a second generation unit configured to generate a second matrix adapted to the watermark image to be added based on the target user information and the first matrix; the third generation unit is configured to carry out numerical adjustment on elements of the second matrix to generate a third matrix; and a fourth generation unit configured to generate a watermark using values of elements in the third matrix as pixel values.
According to one or more embodiments of the present disclosure, the apparatus further comprises: and a fifth generation unit configured to superimpose the values of the pixels in the watermark with the values of the pixels in the image to be watermarked, and generate the watermarked image.
According to one or more embodiments of the present disclosure, the second generation unit is further configured to: the target user information includes a sequence of values for characterizing the target user. And generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix, including: and carrying out inner product on the vectors corresponding to the first matrix and the numerical sequence to generate a second matrix, wherein the size of the second matrix is matched with the size of the pixel matrix corresponding to the image to be watermarked.
According to one or more embodiments of the present disclosure, the third generation unit is further configured to: applying a preset function to the second matrix element, and restricting the element of the matrix within a preset numerical range; and adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
According to one or more embodiments of the present disclosure, the apparatus further comprises: and a sixth generation unit configured to perform image processing on the watermarked image to generate an attacked watermarked image.
According to one or more embodiments of the present disclosure, the apparatus further comprises: and the determining unit is used for decoding the attacked image with the watermark to obtain target user information in the watermark.
According to one or more embodiments of the present disclosure, there is provided an electronic device including: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement a method as described above.
According to one or more embodiments of the present disclosure, a computer readable medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements a method as described in any of the above.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.

Claims (8)

1. A method for generating a watermark, comprising:
generating a first matrix based on the watermark image to be added;
generating a second matrix adapted to the watermark image to be added based on target user information and the first matrix;
performing numerical adjustment on elements of the second matrix to generate a third matrix;
using the values of the elements in the third matrix as pixel values to generate a watermark;
wherein the target user information comprises a sequence of values for characterizing a target user; and
the generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix comprises:
and carrying out inner product on the vectors corresponding to the first matrix and the numerical sequence to generate a second matrix, wherein the size of the second matrix is matched with the size of the pixel matrix corresponding to the image to be added with the watermark.
2. The method of claim 1, wherein the method further comprises:
and superposing the value of the pixel point in the watermark with the value of the pixel point in the image to be watermarked to generate the image with the watermark.
3. The method of claim 1, wherein the numerically adjusting the elements of the second matrix to generate a third matrix comprises:
applying a preset function to the elements of the second matrix, and restricting the elements of the second matrix to be within a preset numerical range;
and adjusting the numerical value of the constrained second matrix element by using the super parameter to obtain a third matrix.
4. The method of claim 2, wherein the method further comprises:
and performing image processing on the watermarked image to generate an attacked watermarked image.
5. The method of claim 4, wherein the method further comprises:
and decoding the attacked image with the watermark to obtain the target user information in the watermark.
6. An apparatus for generating a watermark, comprising:
a first generation unit configured to generate a first matrix based on an image to be watermarked;
a second generation unit configured to generate a second matrix adapted to the watermark image to be added based on the target user information and the first matrix;
the third generation unit is configured to carry out numerical adjustment on elements of the second matrix to generate a third matrix;
a fourth generation unit configured to generate a watermark using values of elements in the third matrix as pixel values;
wherein the second generation unit is further configured to: the target user information comprises a numerical sequence for representing a target user; and
the generating a second matrix adapted to the watermark image to be added based on the target user information and the first matrix comprises:
and carrying out inner product on the vectors corresponding to the first matrix and the numerical sequence to generate a second matrix, wherein the size of the second matrix is matched with the size of the pixel matrix corresponding to the image to be added with the watermark.
7. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-5.
8. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1-5.
CN202010579026.1A 2020-06-23 2020-06-23 Method, apparatus, device and computer readable medium for generating watermark Active CN111738899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010579026.1A CN111738899B (en) 2020-06-23 2020-06-23 Method, apparatus, device and computer readable medium for generating watermark

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010579026.1A CN111738899B (en) 2020-06-23 2020-06-23 Method, apparatus, device and computer readable medium for generating watermark

Publications (2)

Publication Number Publication Date
CN111738899A CN111738899A (en) 2020-10-02
CN111738899B true CN111738899B (en) 2023-12-22

Family

ID=72650574

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010579026.1A Active CN111738899B (en) 2020-06-23 2020-06-23 Method, apparatus, device and computer readable medium for generating watermark

Country Status (1)

Country Link
CN (1) CN111738899B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064375A (en) * 2018-07-23 2018-12-21 北京信息科技大学 A kind of big data property right discrimination method and system based on zero watermarking
CN109685710A (en) * 2018-12-29 2019-04-26 北京奇虎科技有限公司 A kind of method and device of the hidden digital watermark embedding of image copyright
CN109948700A (en) * 2019-03-19 2019-06-28 北京字节跳动网络技术有限公司 Method and apparatus for generating characteristic pattern
CN110148100A (en) * 2019-05-10 2019-08-20 腾讯科技(深圳)有限公司 A kind of image conversion method, device, storage medium and computer equipment
CN110517182A (en) * 2019-08-29 2019-11-29 海南大学 A kind of medical image zero watermarking embedding grammar based on NSCT combined transformation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109064375A (en) * 2018-07-23 2018-12-21 北京信息科技大学 A kind of big data property right discrimination method and system based on zero watermarking
CN109685710A (en) * 2018-12-29 2019-04-26 北京奇虎科技有限公司 A kind of method and device of the hidden digital watermark embedding of image copyright
CN109948700A (en) * 2019-03-19 2019-06-28 北京字节跳动网络技术有限公司 Method and apparatus for generating characteristic pattern
CN110148100A (en) * 2019-05-10 2019-08-20 腾讯科技(深圳)有限公司 A kind of image conversion method, device, storage medium and computer equipment
CN110517182A (en) * 2019-08-29 2019-11-29 海南大学 A kind of medical image zero watermarking embedding grammar based on NSCT combined transformation

Also Published As

Publication number Publication date
CN111738899A (en) 2020-10-02

Similar Documents

Publication Publication Date Title
CN110413812B (en) Neural network model training method and device, electronic equipment and storage medium
CN110728622B (en) Fisheye image processing method, device, electronic equipment and computer readable medium
CN110211030B (en) Image generation method and device
CN112752118B (en) Video generation method, device, equipment and storage medium
CN112419179B (en) Method, apparatus, device and computer readable medium for repairing image
CN112330788A (en) Image processing method, image processing device, readable medium and electronic equipment
CN112418249A (en) Mask image generation method and device, electronic equipment and computer readable medium
CN111754600B (en) Poster image generation method and device and electronic equipment
CN111459364A (en) Icon updating method and device and electronic equipment
CN111325792A (en) Method, apparatus, device, and medium for determining camera pose
CN111669476B (en) Watermark processing method, device, electronic equipment and medium
CN110751251B (en) Method and device for generating and transforming two-dimensional code image matrix
CN111815508A (en) Image generation method, device, equipment and computer readable medium
CN116596748A (en) Image stylization processing method, apparatus, device, storage medium, and program product
CN111738899B (en) Method, apparatus, device and computer readable medium for generating watermark
CN114125485B (en) Image processing method, device, equipment and medium
CN116309137A (en) Multi-view image deblurring method, device and system and electronic medium
CN116363239A (en) Method, device, equipment and storage medium for generating special effect diagram
CN114723600A (en) Method, device, equipment, storage medium and program product for generating cosmetic special effect
CN112070888B (en) Image generation method, device, equipment and computer readable medium
CN112418233B (en) Image processing method and device, readable medium and electronic equipment
CN115170395A (en) Panoramic image stitching method, panoramic image stitching device, electronic equipment, panoramic image stitching medium and program product
CN114419298A (en) Virtual object generation method, device, equipment and storage medium
CN116188254A (en) Fourier domain-based super-resolution image processing method, device, equipment and medium
CN114170341A (en) Image processing method, device, equipment and 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant