CN113822783A - Watermark adding method and device - Google Patents

Watermark adding method and device Download PDF

Info

Publication number
CN113822783A
CN113822783A CN202010612941.6A CN202010612941A CN113822783A CN 113822783 A CN113822783 A CN 113822783A CN 202010612941 A CN202010612941 A CN 202010612941A CN 113822783 A CN113822783 A CN 113822783A
Authority
CN
China
Prior art keywords
color value
pixel point
code
reference pixel
information
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
Application number
CN202010612941.6A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010612941.6A priority Critical patent/CN113822783A/en
Publication of CN113822783A publication Critical patent/CN113822783A/en
Pending legal-status Critical Current

Links

Images

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
    • G06T2201/0083Image watermarking whereby only watermarked image required at decoder, e.g. source-based, blind, oblivious

Abstract

The invention discloses a watermark adding method and a watermark adding device, and relates to the technical field of computers. One specific implementation mode of the method comprises the steps of obtaining watermark information, and carrying out word-by-word coding on the watermark information to obtain an information code with preset digits; adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information. Therefore, the embodiment of the invention can solve the problems that the existing watermark adding mode is lack of concealment and low in anti-interference performance.

Description

Watermark adding method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for adding a watermark.
Background
Nowadays, society has entered the information-oriented era and the data-oriented era. The collection, processing and display of data have great commercial value, and new requirements on confidentiality and ownership protection of data come along with the commercial value.
Currently, for a data display interface with commercial value and needing confidentiality, a method of adding watermarks in a mobile phone picture is generally adopted to prevent random information transmission and trace information leakage sources. The watermarking mode is that a corresponding plaintext pattern is generated through a series of information which can identify a specific user, such as but not limited to a user name, a user ID, an account number and the like, and then the plaintext pattern is superposed on an actual picture to generate a new picture with a watermark identification through synthesizing a new picture layer.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
the watermark added in the prior art is added in a plaintext mode, and in order to obtain clear watermark information from a picture, the watermark information is generally more obvious, extremely lacks of concealment and has low anti-interference performance. Moreover, because the watermark is added in a plaintext mode, the human eyes can easily distinguish the size, the position and the contained information of the watermark.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for adding a watermark, which can solve the problems that the existing watermark adding method lacks concealment and has low interference resistance.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a watermark adding method, including obtaining watermark information, and performing word-by-word encoding on the watermark information to obtain an information code with a preset number of bits; adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
Optionally, the encoding the watermark information word by word includes:
and carrying out word-by-word encoding on the watermark information by using a Unicode encoding mode.
Optionally, based on the target binary code, performing watermarking processing on the received picture to obtain a picture containing watermark information, including:
according to the digits of the target binary code, sequentially selecting corresponding reference pixel points in the picture to obtain the coordinate and the color value of each reference pixel point;
selecting corresponding comparison pixel points based on the coordinates of each reference pixel point to obtain color values of the comparison pixel points;
and adjusting the color value of each contrast pixel point according to the numerical value of the corresponding bit in the target binary code, thereby finishing the watermarking processing of the picture.
Optionally, adjusting the color value of each contrast pixel point according to the value of the corresponding bit in the target binary code, including:
if the numerical value of the corresponding bit in the target binary code is 1, judging whether the color value of the corresponding reference pixel point is smaller than the color value of the comparison pixel point, if so, not adjusting the color value of the comparison pixel point, and if not, adjusting the color value of the comparison pixel point to enable the color value of the reference pixel point to be smaller than the color value of the comparison pixel point;
if the numerical value of the corresponding bit in the target binary code is 0, judging whether the color value of the corresponding reference pixel point is larger than or equal to the color value of the contrast pixel point, if so, not adjusting the color value of the contrast pixel point, and if not, adjusting the color value of the contrast pixel point to enable the color value of the reference pixel point to be larger than or equal to the color value of the contrast pixel point.
Optionally, obtaining a color value of the reference pixel point includes:
selecting a color value of one of three colors of the reference pixel point as a color value of the reference pixel point; and
obtaining the color value of the contrast pixel point, including:
and selecting the color value corresponding to the color type of the reference pixel point as the color value of the contrast pixel point.
Optionally, selecting a corresponding contrast pixel point based on the coordinate of each reference pixel point, including:
and selecting corresponding comparison pixel points from adjacent rows in the same column of the coordinates according to the coordinates of the reference pixel points.
Optionally, adjusting the color value of each contrast pixel point includes:
and adjusting the color values of the comparison pixel points, so that the difference between the color values of the reference pixel points and the color values of the comparison pixel points is a preset number of numerical value scales.
In addition, the invention also provides a watermark adding device, which comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring the watermark information and carrying out word-by-word encoding on the watermark information to obtain an information code with preset digits;
the processing module is used for adding a preset start code at the head of the information code and adding a preset stop code at the tail of the information code so as to generate a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
One embodiment of the above invention has the following advantages or benefits: the invention does not generate watermark pattern, but extracts watermark information to store, encodes the watermark information into binary representation, and uses the color difference between reference pixel and contrast pixel to represent 0 and 1 of binary code, thus providing high-concealment and high-anti-interference watermark.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a watermarking method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a main flow of a watermarking method according to another embodiment of the present invention;
fig. 3 is a schematic diagram of the main blocks of a watermarking apparatus according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a watermarking method according to an embodiment of the present invention, as shown in fig. 1, the watermarking method including:
step S101, acquiring watermark information, and carrying out word-by-word encoding on the watermark information to obtain an information code with preset digit.
In some embodiments, the watermark information is encoded word by word using Unicode encoding, so as to obtain a binary code with a certain number of bits, which includes all watermark information, for example, the binary code is "10110101". Among them, Unicode is also called Unicode and universal code, which is an industry standard in the field of computer science.
And step S102, adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code.
For example: the start code 0011 and the end code 1100 are added to obtain the target binary code (0011101101011100).
It should be noted that the start code and the end code may be any form of information, and when in use, the information in any form may be converted into binary information. For example: the start code and stop code may be a piece of text.
And step S103, carrying out watermarking processing on the received picture based on the target binary code to obtain a picture containing watermarking information.
In some embodiments, based on the target binary code, performing watermarking on the received picture to obtain a picture containing watermark information includes:
according to the digits of the target binary code, sequentially selecting corresponding reference pixel points in the picture to obtain the coordinate and the color value of each reference pixel point; selecting corresponding comparison pixel points based on the coordinates of each reference pixel point to obtain color values of the comparison pixel points; and adjusting the color value of each contrast pixel point according to the numerical value of the corresponding bit in the target binary code, thereby finishing the watermarking processing of the picture.
In a preferred embodiment, a color value of one of the three colors of the reference pixel is selected as a color value of the reference pixel, and a color value corresponding to the color type of the reference pixel is selected as a color value of the contrast pixel. Wherein, the picture all comprises the pixel, and every pixel all has own coordinate, for example: the coordinate of the first pixel point in the upper left corner of the picture is (0,0), then the coordinate of the next pixel point to the right of the picture is (0,1), and the coordinate of the next pixel point to the bottom of the picture is (1, 0). Each pixel point has its own color value, and if expressed by an RGB color expression, the color of each pixel point can be decomposed into three values, red (R), green (G), and blue (B), and the value range of each value is generally 0 to 255 in a computer.
In addition, preferably, when the corresponding contrast pixel is selected based on the coordinate of each reference pixel, the corresponding contrast pixel is selected from the adjacent rows in the same column of the coordinate according to the coordinate of the reference pixel. Such as: the picture is composed of 100 pixels in 10 rows and 10 columns, ten pixels in the 5 th row are selected as reference points, and then ten pixels in the 4 th row or the 6 th row are selected as comparison pixels.
For example: and selecting a first reference pixel point (for example, a pixel point with coordinates of (0, 0)) on the picture, and obtaining the color value of red (R) in three colors of the pixel point after selecting the reference pixel point. Then, a pixel point (e.g., a pixel point with coordinates (2, 0)) below the first reference pixel point is selected as a first comparison pixel point, and a color value representing red (R) is also selected from the comparison pixel points. If only the red color value has small difference between the colors of the two pixel points, the color difference seen by human eyes is small, and the color difference seen by human eyes of other colors is large.
Further, the embodiment adjusts the color value of each contrast pixel according to the value of the corresponding bit in the target binary code, including:
if the value of the corresponding bit in the target binary code is 1, determining whether the color value of the corresponding reference pixel is smaller than the color value of the comparison pixel, if so, not adjusting the color value of the comparison pixel, otherwise, adjusting the color value of the comparison pixel so that the color value of the reference pixel is smaller than the color value of the comparison pixel (for example, modifying the value representing red (R) in the first comparison pixel).
If the numerical value of the corresponding bit in the target binary code is 0, judging whether the color value of the corresponding reference pixel point is larger than or equal to the color value of the contrast pixel point, if so, not adjusting the color value of the contrast pixel point, and if not, adjusting the color value of the contrast pixel point to enable the color value of the reference pixel point to be larger than or equal to the color value of the contrast pixel point.
It should be noted that, the color value of each contrast pixel may be adjusted, so that the difference between the color value of the reference pixel and the color value of the contrast pixel is a numerical scale of a preset number. Preferably, the difference between 2 and 3 numerical scales is taken as a standard, so that the color difference between the modified contrast pixel and the reference pixel is small. For example: the RGB representation of the reference pixel point is (100, 100, 100) and the RGB representation of the contrast pixel point is (98, 100, 100).
In summary, the present invention creatively provides a brand new watermark adding method, that is, a watermark pattern is not generated first, but watermark information is extracted first for storage, then the watermark information is encoded into a binary representation, and the color difference between reference pixel points and contrast pixel points is used to represent 0 and 1 of a binary code, thereby providing a high-concealment and high-interference-resistance watermark, which is difficult to be identified by human eyes, but a computer can scan all reference pixel points and contrast pixel points on a picture to restore a target binary code, and obtain watermark information. In addition, the pixel distortion only occurs at the watermark position, only occupies a small part of the whole picture, the numerical value difference between the modified contrast pixel and the reference pixel is small, the color difference of the pixel is also small, and the pixel is difficult to distinguish by human eyes, so the use and the information expression of the whole picture are not influenced.
Fig. 2 is a schematic diagram of a main flow of a watermarking method according to another embodiment of the present invention, which may include:
step S201, acquiring watermark information, and performing word-by-word encoding on the watermark information to obtain an information code with a preset number of bits.
Step S202, adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code.
And step S203, sequentially selecting corresponding reference pixel points in the picture according to the digits of the target binary code so as to obtain the coordinate and the color value of each reference pixel point.
Step S204, based on the coordinates of each reference pixel point, selecting a corresponding contrast pixel point to obtain the color value of the contrast pixel point.
Step S205, determine whether the value of the corresponding bit in the target binary code is 1, if yes, go to step S206, otherwise go to step S207.
Step S206, determining whether the color value of the corresponding reference pixel is smaller than the color value of the contrast pixel, if so, performing step S208, otherwise, performing step S209.
Step S207, if the value of the corresponding bit in the target binary code is 0, determining whether the color value of the corresponding reference pixel is greater than or equal to the color value of the contrast pixel, if so, performing step S208, otherwise, performing step S210.
In step S208, the color value of the comparison pixel is not adjusted, and step S211 is performed.
Step S209, adjusting the color value of the contrast pixel point, so that the difference between the color value of the reference pixel point and the color value of the contrast pixel point is a numerical scale of a preset number, and the color value of the reference pixel point is smaller than the color value of the contrast pixel point, and performing step S211.
Step S210 is to adjust the color value of the contrast pixel point, so that the difference between the color value of the reference pixel point and the color value of the contrast pixel point is a numerical scale of a preset number, and whether the color value of the reference pixel point is greater than or equal to the color value of the contrast pixel point, and step S211 is performed.
Step S211, determining whether all corresponding bits of the target binary code have been completely traversed, if yes, performing step S212, otherwise, returning to step S205.
In step S212, a picture containing watermark information is obtained.
Fig. 3 is a schematic diagram of main modules of a watermarking apparatus according to an embodiment of the present invention, and as shown in fig. 3, the watermarking apparatus 300 includes an obtaining module 301 and a processing module 302. The obtaining module 301 obtains watermark information, and performs word-by-word encoding on the watermark information to obtain an information code with a preset number of bits; the processing module 302 adds a preset start code to the head of the information code, and adds a preset stop code to the tail of the information code, thereby generating a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
In some embodiments, the obtaining module 301 performs a verbatim encoding on the watermark information, including:
and carrying out word-by-word encoding on the watermark information by using a Unicode encoding mode.
In some embodiments, the processing module 302 performs watermarking on the received picture to obtain a picture containing watermark information based on the target binary code, including:
according to the digits of the target binary code, sequentially selecting corresponding reference pixel points in the picture to obtain the coordinate and the color value of each reference pixel point;
selecting corresponding comparison pixel points based on the coordinates of each reference pixel point to obtain color values of the comparison pixel points;
and adjusting the color value of each contrast pixel point according to the numerical value of the corresponding bit in the target binary code, thereby finishing the watermarking processing of the picture.
In some embodiments, the adjusting the color value of each contrast pixel according to the value of the corresponding bit in the target binary code by the processing module 302 includes:
if the numerical value of the corresponding bit in the target binary code is 1, judging whether the color value of the corresponding reference pixel point is smaller than the color value of the comparison pixel point, if so, not adjusting the color value of the comparison pixel point, and if not, adjusting the color value of the comparison pixel point to enable the color value of the reference pixel point to be smaller than the color value of the comparison pixel point;
if the numerical value of the corresponding bit in the target binary code is 0, judging whether the color value of the corresponding reference pixel point is larger than or equal to the color value of the contrast pixel point, if so, not adjusting the color value of the contrast pixel point, and if not, adjusting the color value of the contrast pixel point to enable the color value of the reference pixel point to be larger than or equal to the color value of the contrast pixel point.
In some embodiments, the processing module 302 obtains the color value of the reference pixel point, including:
selecting a color value of one of three colors of the reference pixel point as a color value of the reference pixel point; and
obtaining the color value of the contrast pixel point, including:
and selecting the color value corresponding to the color type of the reference pixel point as the color value of the contrast pixel point.
In some embodiments, the processing module 302 selects a corresponding contrast pixel point based on the coordinates of each reference pixel point, including:
and selecting corresponding comparison pixel points from adjacent rows in the same column of the coordinates according to the coordinates of the reference pixel points.
In some embodiments, the processing module 302 adjusts the color value of each contrast pixel point, including:
and adjusting the color values of the comparison pixel points, so that the difference between the color values of the reference pixel points and the color values of the comparison pixel points is a preset number of numerical value scales.
It should be noted that the watermarking method and the watermarking apparatus of the present invention have a corresponding relationship in the specific implementation content, and therefore the repeated content is not described again.
Fig. 4 shows an exemplary system architecture 400 of a watermarking method or apparatus, a watermarking decision or apparatus, to which embodiments of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a watermarking screen or watermarking discrimination screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 401, 402, 403. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the watermarking method or the watermarking judging method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the computing device is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the computer system 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 806 including a keyboard, a mouse, and the like; an output section 507 including a display such as a Cathode Ray Tube (CRT), a liquid crystal watermark adder (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 505 as needed. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, 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 illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination 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 the present invention, 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 the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. 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: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart 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 invention. 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 or flowchart illustration, and combinations of blocks in the block diagrams 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 modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes an acquisition module and a processing module. Wherein the names of the modules do not in some cases constitute a limitation of the module itself.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs, and when the one or more programs are executed by the device, the device comprises a watermark information acquisition unit, a watermark information encoding unit and a watermark information generation unit, wherein the watermark information acquisition unit acquires watermark information and encodes the watermark information word by word to obtain an information code with a preset number of bits; adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
According to the technical scheme of the embodiment of the invention, the problems that the existing watermark adding mode is lack of concealment and low in anti-interference performance can be solved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A watermarking method, comprising:
acquiring watermark information, and carrying out word-by-word encoding on the watermark information to obtain an information code with a preset digit;
adding a preset start code at the head of the information code, and adding a preset stop code at the tail of the information code, thereby generating a target binary code;
and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
2. The method of claim 1, wherein encoding the watermark information verbatim comprises:
and carrying out word-by-word encoding on the watermark information by using a Unicode encoding mode.
3. The method of claim 1, wherein watermarking the received picture based on the target binary code to obtain a picture containing watermark information comprises:
according to the digits of the target binary code, sequentially selecting corresponding reference pixel points in the picture to obtain the coordinate and the color value of each reference pixel point;
selecting corresponding comparison pixel points based on the coordinates of each reference pixel point to obtain color values of the comparison pixel points;
and adjusting the color value of each contrast pixel point according to the numerical value of the corresponding bit in the target binary code, thereby finishing the watermarking processing of the picture.
4. The method of claim 3, wherein adjusting the color value of each of the compared pixels according to the value of the corresponding bit in the target binary code comprises:
if the numerical value of the corresponding bit in the target binary code is 1, judging whether the color value of the corresponding reference pixel point is smaller than the color value of the comparison pixel point, if so, not adjusting the color value of the comparison pixel point, and if not, adjusting the color value of the comparison pixel point to enable the color value of the reference pixel point to be smaller than the color value of the comparison pixel point;
if the numerical value of the corresponding bit in the target binary code is 0, judging whether the color value of the corresponding reference pixel point is larger than or equal to the color value of the contrast pixel point, if so, not adjusting the color value of the contrast pixel point, and if not, adjusting the color value of the contrast pixel point to enable the color value of the reference pixel point to be larger than or equal to the color value of the contrast pixel point.
5. The method of claim 3, wherein obtaining the color value of the reference pixel comprises:
selecting a color value of one of three colors of the reference pixel point as a color value of the reference pixel point; and
obtaining the color value of the contrast pixel point, including:
and selecting the color value corresponding to the color type of the reference pixel point as the color value of the contrast pixel point.
6. The method of claim 3, wherein selecting a corresponding contrast pixel based on the coordinates of each reference pixel comprises:
and selecting corresponding comparison pixel points from adjacent rows in the same column of the coordinates according to the coordinates of the reference pixel points.
7. The method of any of claims 3-6, wherein adjusting the color value of each of the compared pixels comprises:
and adjusting the color values of the comparison pixel points, so that the difference between the color values of the reference pixel points and the color values of the comparison pixel points is a preset number of numerical value scales.
8. A watermarking apparatus, comprising:
the acquisition module is used for acquiring watermark information and carrying out word-by-word encoding on the watermark information to obtain an information code with preset digits;
the processing module is used for adding a preset start code at the head of the information code and adding a preset stop code at the tail of the information code so as to generate a target binary code; and based on the target binary code, carrying out watermarking processing on the received picture to obtain the picture containing the watermark information.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010612941.6A 2020-06-30 2020-06-30 Watermark adding method and device Pending CN113822783A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010612941.6A CN113822783A (en) 2020-06-30 2020-06-30 Watermark adding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010612941.6A CN113822783A (en) 2020-06-30 2020-06-30 Watermark adding method and device

Publications (1)

Publication Number Publication Date
CN113822783A true CN113822783A (en) 2021-12-21

Family

ID=78912150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010612941.6A Pending CN113822783A (en) 2020-06-30 2020-06-30 Watermark adding method and device

Country Status (1)

Country Link
CN (1) CN113822783A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757405B1 (en) * 1998-11-30 2004-06-29 Kabushiki Kaisha Toshiba Digital watermark embedding device, digital watermark detection device and recording medium recording computer readable program for realizing functions of two devices
CN102184516A (en) * 2011-04-18 2011-09-14 北京工业大学 Digital watermarking method based on 2DPCA (two-dimensional principal component analysis)
CN110213458A (en) * 2019-05-31 2019-09-06 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium
CN110942322A (en) * 2018-09-21 2020-03-31 北京京东尚科信息技术有限公司 Anti-counterfeiting method, system, electronic equipment and medium for coupon getting interface screenshot

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6757405B1 (en) * 1998-11-30 2004-06-29 Kabushiki Kaisha Toshiba Digital watermark embedding device, digital watermark detection device and recording medium recording computer readable program for realizing functions of two devices
CN102184516A (en) * 2011-04-18 2011-09-14 北京工业大学 Digital watermarking method based on 2DPCA (two-dimensional principal component analysis)
CN110942322A (en) * 2018-09-21 2020-03-31 北京京东尚科信息技术有限公司 Anti-counterfeiting method, system, electronic equipment and medium for coupon getting interface screenshot
CN110213458A (en) * 2019-05-31 2019-09-06 腾讯科技(深圳)有限公司 A kind of image processing method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
秦娜;: "基于差错控制编码的数字水印", 太原师范学院学报(自然科学版), no. 02, 30 June 2006 (2006-06-30) *

Similar Documents

Publication Publication Date Title
CN107766492B (en) Image searching method and device
CN109376234B (en) Method and device for training abstract generation model
CN112184367A (en) Order processing method and device
CN113808231B (en) Information processing method and device, image rendering method and device, and electronic device
CN111274341A (en) Site selection method and device for network points
CN114612600A (en) Virtual image generation method and device, electronic equipment and storage medium
CN115546331A (en) Data rendering method and device, electronic equipment and computer readable medium
CN111191255A (en) Information encryption processing method, server, terminal, device and storage medium
CN110764770A (en) Method and device for conversion and assignment between objects
CN111368697A (en) Information identification method and device
CN113904943A (en) Account detection method and device, electronic equipment and storage medium
CN109582654B (en) PDF document compression method and device, computer equipment and storage medium
CN112436943A (en) Request deduplication method, device, equipment and storage medium based on big data
CN111368693A (en) Identification method and device for identity card information
CN112256254A (en) Method and device for generating layout code
CN110895699B (en) Method and apparatus for processing feature points of image
CN113822783A (en) Watermark adding method and device
CN115563942A (en) Contract generation method and device, electronic equipment and computer readable medium
CN115358911A (en) Screen watermark generation method, device, equipment and computer readable storage medium
CN110851522A (en) Method and device for displaying data
CN111737572B (en) Search statement generation method and device and electronic equipment
CN108881953B (en) Video encryption method and device
CN108882029B (en) Video decryption method and device
CN113284174A (en) Method and device for processing pictures
CN112580762A (en) Dynamic two-dimensional code and identification method and identification device thereof

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