Watermark Processing Method, Device, Electronic Device and Computer Readable Storage Medium

By using uncertain length eigenvectors to embed frequency domain vectors in digital watermarking technology, the problem of fixed-length eigenvectors having a great impact on the work is solved, and the anti-interference of watermark information is improved.

CN115114596BActive Publication Date: 2025-06-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210621778.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-01
Publication Date
2025-06-13
Estimated Expiration
2042-06-01

AI Technical Summary

Technical Problem

In the prior art, fixed-length feature vectors are prone to affect the work, and when the work is disturbed, the watermark information is prone to be destroyed.

Method used

By obtaining the bit stream of pending works and their watermark information, performing frequency domain transformation, filtering out the target bits and determining their location, generating an indefinite length target feature vector based on the location, and embedding it into the frequency domain vector to add watermark information.

Benefits of technology

It reduces the impact of watermark information on the work and improves the anti-interference of watermark information, making the work less likely to be damaged by watermark information, and the watermark information is more difficult to destroy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115114596B_ABST
    Figure CN115114596B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a watermark processing method, apparatus, electronic device, and computer-readable storage medium. In the embodiments of the present application, a work to be processed and a bit stream of watermark information of the work to be processed are obtained, and the bit stream of watermark information includes a plurality of bits. The work to be processed is subjected to frequency domain transformation to obtain a frequency domain vector of the work to be processed. Target bits are screened out from the bit stream of watermark information, and target positions of the target bits in the bit stream of watermark information are determined. According to the target positions, target lengths of target feature vectors corresponding to the target bits are determined, and target feature vectors are generated according to the target lengths and the target bits. The target feature vectors are embedded into the frequency domain vector to add the watermark information corresponding to the bit stream of watermark information to the work to be processed. The embodiments of the present application can improve the anti-interference of watermark information while reducing the impact of watermark information on the work to be processed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of digital watermarking technology, and in particular, to a watermark processing method, apparatus, electronic device, and computer-readable storage medium. Background Art

[0002] With the development of society, users increasingly pay attention to the copyright of works. To ensure copyright, digital watermarking technology is applied to works. Currently, the process of applying digital watermarking technology to works is as follows: First, the watermark information is converted into a feature vector of a fixed length, and then the feature vector is added to the work.

[0003] However, a feature vector of a fixed length is likely to affect the work, and when the work is interfered with (for example, the interference can be clipping), the watermark information is easily damaged. Summary of the Invention

[0004] Embodiments of this application provide a watermark processing method, apparatus, electronic device, and computer-readable storage medium, which can solve the technical problem that the work is easily affected and the watermark information is easily damaged.

[0005] A watermark processing method includes:

[0006] Obtain a work to be processed and a bit stream of watermark information of the work to be processed, where the bit stream of watermark information includes multiple bits;

[0007] Perform a frequency-domain transformation on the work to be processed to obtain a frequency-domain vector of the work to be processed;

[0008] Screen out target bits from the bit stream of watermark information, and determine target positions of the target bits in the bit stream of watermark information;

[0009] According to the target positions, determine target lengths of target feature vectors corresponding to the target bits, and generate the target feature vectors according to the target lengths and the target bits;

[0010] Embed the target feature vectors into the frequency-domain vectors to add watermark information corresponding to the bit stream of watermark information to the work to be processed.

[0011] Correspondingly, an embodiment of this application provides a watermark processing apparatus, including:

[0012] An obtaining module, configured to obtain a work to be processed and a bit stream of watermark information of the work to be processed, where the bit stream of watermark information includes multiple bits;

[0013] A transformation module, configured to perform a frequency-domain transformation on the work to be processed to obtain a frequency-domain vector of the work to be processed;

[0014] A screening module, configured to screen out target bits from the above-mentioned watermark information bitstream and determine the target positions of the above-mentioned target bits in the above-mentioned watermark information bitstream;

[0015] A generating module, configured to determine the target length of the target feature vector corresponding to the above-mentioned target bits according to the above-mentioned target positions, and generate the above-mentioned target feature vector according to the above-mentioned target length and the above-mentioned target bits;

[0016] An embedding module, configured to embed the above-mentioned target feature vector into the above-mentioned frequency domain vector, so as to add the watermark information corresponding to the above-mentioned watermark information bitstream to the above-mentioned work to be processed.

[0017] Optionally, the above-mentioned watermark processing module further includes:

[0018] A return execution module, configured to execute:

[0019] If the above-mentioned target bit is not the last bit in the above-mentioned watermark information bitstream, return and execute the step of screening out the target bit from the above-mentioned watermark information bitstream until the above-mentioned target bit is the last bit in the above-mentioned watermark information bitstream;

[0020] If the above-mentioned target bit is the last bit in the above-mentioned watermark information bitstream, complete adding the watermark information corresponding to the above-mentioned watermark information bitstream to the above-mentioned work to be processed.

[0021] Optionally, the generating module is specifically configured to execute:

[0022] Obtain the minimum length and growth factor of the above-mentioned watermark information bitstream;

[0023] Determine the target length of the target feature vector corresponding to the above-mentioned target bits according to the above-mentioned minimum length, the above-mentioned growth factor and the target positions.

[0024] Optionally, the generating module is specifically configured to execute:

[0025] Determine the first initial length of the target feature vector corresponding to the above-mentioned target bits according to the above-mentioned minimum length, the above-mentioned growth factor and the target positions;

[0026] Obtain the maximum length of the above-mentioned watermark information bitstream;

[0027] Take the smaller value of the above-mentioned maximum length and the above-mentioned first initial length as the target length of the target feature vector corresponding to the above-mentioned target bits.

[0028] Optionally, the generating module is specifically configured to execute:

[0029] Determine the second initial length of the target feature vector corresponding to the above-mentioned target bits according to the above-mentioned target positions;

[0030] Obtain the intensity factor of the above watermark information bitstream, and determine the target length of the target feature vector corresponding to the above target bit according to the above intensity factor and the above second initial length.

[0031] Optionally, the generation module is specifically configured to execute:

[0032] Determine the type of the above target bit;

[0033] Obtain the initial feature vector corresponding to the above target bit according to the type of the above target bit;

[0034] Determine the above target feature vector according to the above target length and the above initial feature vector.

[0035] Optionally, the embedding module is specifically configured to execute:

[0036] Obtain the initial starting position in the above frequency domain vector and obtain the target offset between the above target bit and the above frequency domain vector;

[0037] Determine the target starting position of the above target feature vector in the above frequency domain vector according to the above initial starting position and the above target offset;

[0038] Embed the above target feature vector into the above frequency domain vector according to the above target starting position.

[0039] Optionally, the embedding module is specifically configured to execute:

[0040] If the above target bit is the first bit in the above watermark information bitstream, use the initialization offset as the target offset between the above target bit and the above frequency domain vector;

[0041] If the above target bit is not the first bit in the above watermark information bitstream, determine the above target offset according to the offset of the previous bit of the above target bit in the above watermark information bitstream and the previous length, where the previous length is the length corresponding to the feature vector of the previous bit.

[0042] Optionally, the above watermark processing module further includes:

[0043] A vector determination module, configured to determine a target difference vector according to the above frequency domain vector and the watermarked frequency domain vector, where the watermarked frequency domain vector is the vector obtained after embedding the above target feature vector into the above frequency domain vector.

[0044] A vector acquisition module, configured to acquire a reference feature vector.

[0045] An information screening module, configured to screen out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the above-mentioned target difference vector and the above-mentioned reference feature vector.

[0046] Optionally, the vector acquisition module is specifically configured to perform:

[0047] Obtain the current extraction length, the initial starting position in the above-mentioned frequency domain vector, and the current offset;

[0048] Screen out the detected feature vector from the above-mentioned target difference vector according to the above-mentioned current extraction length, the above-mentioned initial starting position, and the above-mentioned current offset;

[0049] Determine the reference feature vector according to the length of the above-mentioned detected feature vector.

[0050] Correspondingly, the information screening module is specifically configured to perform:

[0051] Determine the bit corresponding to the above-mentioned detected feature vector according to the above-mentioned detected feature vector and the above-mentioned reference feature vector;

[0052] Screen out the watermark information corresponding to the watermark information bit stream from the above-mentioned watermarked frequency domain vector according to the bit corresponding to the above-mentioned detected feature vector.

[0053] Optionally, the above-mentioned watermark processing module further includes:

[0054] An update module, configured to perform:

[0055] If the number of bits corresponding to the above-mentioned detected feature vector is less than the preset number, update the above-mentioned current offset according to the above-mentioned current extraction length to obtain the updated offset, and update the above-mentioned current extraction length to obtain the updated extraction length;

[0056] Use the above-mentioned updated offset as the above-mentioned current offset, use the above-mentioned updated extraction length as the above-mentioned current extraction length, and return to execute the step of screening out the detected feature vector from the above-mentioned target difference vector according to the above-mentioned current extraction length, the above-mentioned initial starting position, and the above-mentioned current offset.

[0057] Correspondingly, the information screening module is specifically configured to perform:

[0058] If the number of bits corresponding to the above-mentioned detected feature vector is equal to the above-mentioned preset number, screen out the watermark information corresponding to the watermark information bit stream from the above-mentioned watermarked frequency domain vector according to the bit corresponding to the above-mentioned detected feature vector.

[0059] In addition, an embodiment of the present application further provides an electronic device, including a processor and a memory. The memory stores a computer program, and the processor is configured to run the computer program in the memory to implement the watermark processing method provided by the embodiment of the present application.

[0060] In addition, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute any watermark processing method provided by the embodiment of the present application.

[0061] In addition, an embodiment of the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements any watermark processing method provided by the embodiment of the present application.

[0062] In an embodiment of the present application, first, a work to be processed and a bit stream of watermark information of the work to be processed are obtained. The bit stream of watermark information includes multiple bits. Then, a frequency-domain transformation is performed on the work to be processed to obtain a frequency-domain vector of the work to be processed, and target bits are selected from the bit stream of watermark information, and the target positions of the target bits in the bit stream of watermark information are determined. Next, according to the target positions, the target lengths of the target feature vectors corresponding to the target bits are determined, and according to the target lengths and the target bits, target feature vectors are generated. Finally, the target feature vectors are embedded into the frequency-domain vectors to add the watermark information corresponding to the bit stream of watermark information to the work to be processed.

[0063] That is, in an embodiment of the present application, after obtaining the bit stream of watermark information, target bits are selected from the bit stream of watermark information, and the target positions of the target bits in the bit stream of watermark information are determined. Then, according to the target positions, the target lengths of the target feature vectors corresponding to the target bits are determined. When the target positions of the target bits are different, the target lengths of the target feature vectors of the target bits are also different, that is, the feature vectors of each bit in the bit stream of watermark information are of variable length. After embedding the variable-length target feature vectors into the frequency-domain vectors of the work to be processed, the work to be processed is not easily affected by the watermark information, and the watermark information is not easily damaged, and the anti-interference ability is strong, realizing the improvement of the anti-interference ability of the watermark information while reducing the influence of the watermark information on the work to be processed. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0065] Figure 1 It is a schematic diagram of the application scenario of the watermark processing method provided by the embodiment of the present application;

[0066] Figure 2 It is a schematic flow diagram of the watermark processing method provided by the embodiment of the present application;

[0067] Figure 3 It is a schematic flow diagram of another watermark processing method provided by the embodiment of the present application;

[0068] Figure 4 It is a schematic structural diagram of the watermark processing device provided by the embodiment of the present application;

[0069] Figure 5 It is a schematic structural diagram of the electronic device provided by the embodiment of the present application. Detailed implementation manners

[0070] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0071] The embodiment of the present application provides a watermark processing method, device, electronic device and computer-readable storage medium. Among them, the electronic device can be a server or a device such as a terminal.

[0072] Among them, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, network acceleration services (Content Delivery Network, CDN), and big data and artificial intelligence platforms.

[0073] Moreover, multiple servers can form a blockchain, and the server is a node on the blockchain.

[0074] The terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart TV, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, and the present application does not make any restrictions here.

[0075] For example, as Figure 1As shown, the terminal can obtain the work to be processed and the bitstream of watermark information of the work to be processed. The bitstream of watermark information includes multiple bits, and then the work to be processed and the bitstream of watermark information of the work to be processed are sent to the server.

[0076] Then the server performs a frequency-domain transformation on the work to be processed to obtain the frequency-domain vector of the work to be processed; screens out the target bits from the bitstream of watermark information and determines the target positions of the target bits in the bitstream of watermark information; determines the target length of the target feature vector corresponding to the target bits according to the target positions, and generates a target feature vector according to the target length and the target bits; embeds the target feature vector into the frequency-domain vector to add the watermark information corresponding to the bitstream of watermark information to the work to be processed, obtaining a watermarked work.

[0077] The server then returns the watermarked work to the terminal, and the terminal thus obtains the watermarked work.

[0078] In addition, "multiple" in the embodiments of the present application refers to two or more. "First" and "second" in the embodiments of the present application are used for distinguishing descriptions and cannot be understood as implying relative importance.

[0079] The following will be described in detail respectively. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments.

[0080] The watermark processing method in the embodiments of the present application can be executed by the terminal or the server, or can be executed jointly by the terminal and the server. In this embodiment, the terminal is taken as an example of the execution subject for detailed description.

[0081] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the watermark processing method provided by an embodiment of the present application. The watermark processing method may include:

[0082] S201. Obtain the work to be processed and the bitstream of watermark information of the work to be processed, where the bitstream of watermark information includes multiple bits.

[0083] The work to be processed may be a video, an audio, a text, a picture, etc. The work to be processed may be a work locally stored in the terminal, or a work obtained by this terminal from other terminals. When the work to be processed is a video or a picture, the work to be processed may also be obtained through the camera of this terminal, and the work to be processed may also be obtained through the camera of other terminals, and then the other terminal sends the work to be processed to this terminal, and this terminal thus obtains the work to be processed.

[0084] The bitstream of the watermark information of the work to be processed is the bitstream corresponding to the watermark information of the work to be processed. The terminal can directly obtain the bitstream of the watermark information, or the terminal can also first obtain the watermark information and then encode the watermark information to obtain the bitstream of the watermark information corresponding to the watermark information. The watermark information can be picture information, text information, etc.

[0085] For the acquisition methods of the work to be processed and the bitstream of the watermark information, they can be selected according to the actual situation, and this embodiment does not limit them here.

[0086] The method of encoding the watermark information can be selected according to the actual situation. For example, in this embodiment, the watermark information is encoded into ASCII code by using the base64 method, and then the ASCII code is converted into a bitstream. This embodiment does not limit it here.

[0087] The bitstream of the watermark information refers to a data stream including multiple bits, and the bit can be a 0 bit or a 1 bit.

[0088] S202. Perform a frequency domain transformation on the work to be processed to obtain the frequency domain vector of the work to be processed.

[0089] The work to be processed is generally data in the spatial domain or the time domain. However, the data in the spatial domain or the time domain is unstable and is easily lost when interfered. The data in the frequency domain has strong anti-interference ability. Therefore, a frequency domain transformation is performed on the work to be processed to obtain the frequency domain vector of the work to be processed, so as to avoid losing the information of the work to be processed in the subsequent process of adding the watermark information to the work to be processed.

[0090] Among them, the method of performing a frequency domain transformation on the work to be processed can be selected according to the actual situation. For example, the discrete Fourier transform (DFT) method or the discrete cosine transform (DCT) method is used as the method for performing a frequency domain transformation on the work to be processed in this embodiment of the application. This embodiment of the application does not limit it here.

[0091] It should be understood that if the work to be processed is a video, before performing a frequency domain transformation on the work to be processed, a frame extraction operation can be first performed on the video to extract the video into image frames, and then a frequency domain transformation is performed on the image frames of the video. If the work to be processed is an audio, the audio can be segmented according to preset sampling points, and then a frequency domain transformation is performed on each segment of the audio.

[0092] S203. Screen out target bits from the bitstream of the watermark information and determine the target positions of the target bits in the bitstream of the watermark information.

[0093] After the terminal obtains the watermark information bitstream, if it is the first time to screen out the target bit from the watermark information bitstream, the terminal can directly use the first bit in the watermark information bitstream as the target bit. That is, the target position of the target bit in the watermark information bitstream is 1.

[0094] If it is not the first time to screen out the target bit from the watermark information bitstream, the terminal can view the position of the bit screened out last time, and then use the next bit of the position of the bit screened out last time as the target bit.

[0095] Optionally, a target variable can be set. Then, after the terminal obtains the watermark information bitstream, the value of the target variable is initialized to the first target value. The terminal views the value of the target variable. If the value of the target variable is the first target value, the terminal directly uses the first bit in the watermark information bitstream as the target bit. After the terminal obtains the target bit, the value of the target variable can be modified to the target position so that the terminal can screen out the target bit from the watermark information bitstream according to the value of the target variable next time.

[0096] For example, the first target value is 0. When the terminal first screens out the target bit from the watermark information bitstream, because the value of the target variable is 0, the terminal uses the first bit in the watermark information bitstream as the target bit, and then modifies the value of the target variable to 1, that is, modifies the value of the target variable to the target position. Then, when the terminal screens out the target bit from the watermark information bitstream for the second time, because the value of the target variable is 1, the terminal uses the second bit in the watermark information bitstream as the target bit. At this time, the target position of the target bit is 2, and then the value of the target variable is modified to 2. This step is executed cyclically until all the bits in the watermark information bitstream are screened out.

[0097] Optionally, the bits that have been screened out in the watermark information bitstream can also be marked. After the terminal obtains the watermark information bitstream, it checks whether there are marked bits in the watermark information bitstream. If there are no marked bits, the terminal uses the first bit in the watermark information bitstream as the target bit, and then marks the target bit, that is, marks the first bit. If there are marked bits, the next bit of the marked bit in the watermark information bitstream is used as the target bit.

[0098] For example, when the terminal first filters out the target bit from the watermark information bitstream, since there is no marked bit in the watermark information bitstream, the terminal takes the first bit in the watermark information bitstream as the target bit and then marks the first bit. When the terminal secondarily filters out the target bit from the watermark information bitstream, since the first bit in the watermark information bitstream is marked, the terminal takes the next bit of the first bit in the watermark information bitstream, that is, the second bit in the watermark information bitstream, as the target bit.

[0099] S204. Determine the target length of the target feature vector corresponding to the target bit according to the target position, and generate a target feature vector according to the target length and the target bit.

[0100] The target position and the target length can be associated and stored in a mapping table first. After the terminal obtains the target position, it then searches in the mapping table for the target length corresponding to the target position and takes the target length corresponding to the target position as the target length of the target feature vector corresponding to the target bit.

[0101] Alternatively, after the terminal obtains the target position, it can also substitute the target position into a preset relational expression for calculation to obtain the target length of the target feature vector corresponding to the target bit.

[0102] When substituting the target position into the preset relational expression for calculation to obtain the target length, determining the target length of the target feature vector corresponding to the target bit according to the target position includes:

[0103] Obtain the minimum length and the growth factor of the watermark information bitstream;

[0104] Determine the target length of the target feature vector corresponding to the target bit according to the minimum length, the growth factor, and the target position.

[0105] The minimum length and the growth factor are pre-set coefficients. Substitute the minimum length, the growth factor, and the target position into the following preset relational expression to obtain the target length, that is, the minimum length, the growth factor, and the target position satisfy the following relational expression:

[0106] Flen = Lmin + pos × α

[0107] Where Flen represents the target length, Lmin represents the minimum length, pos represents the target position, and α represents the growth factor.

[0108] To avoid the situation where the target length is too large, in some embodiments, determining the target length of the target feature vector corresponding to the target bit according to the minimum length, the growth factor, and the target position includes:

[0109] Determine the first initial length of the target feature vector corresponding to the target bit according to the minimum length, growth factor, and target position;

[0110] Obtain the maximum length of the watermark information bit stream;

[0111] Take the smaller value between the maximum length and the first initial length as the target length of the target feature vector corresponding to the target bit.

[0112] The maximum length is also a preset coefficient. At this time, the minimum length, growth factor, maximum length, and target position satisfy the following relationship:

[0113] Flen = min(Lmax, Lmin + pos × α)

[0114] Lmax represents the maximum length.

[0115] It should be understood that different watermark information bit streams can correspond to the same maximum length, the same minimum length, and the same growth factor, or different watermark information bit streams can also correspond to different maximum lengths, different minimum lengths, and different growth factors. This embodiment does not make any limitations here.

[0116] In some other embodiments, determining the target length of the target feature vector corresponding to the target bit according to the target position includes:

[0117] Determine the second initial length of the target feature vector corresponding to the target bit according to the target position;

[0118] Obtain the intensity factor of the watermark information bit stream, and determine the target length of the target feature vector corresponding to the target bit according to the intensity factor and the second initial length.

[0119] Or, taking the smaller value between the maximum length and the first initial length as the target length of the target feature vector corresponding to the target bit includes:

[0120] Take the smaller value between the maximum length and the first initial length as the second initial length of the target feature vector corresponding to the target bit;

[0121] Determine the target length of the target feature vector corresponding to the target bit according to the intensity factor and the second initial length.

[0122] The intensity factor is a preset coefficient. At this time, the intensity factor and the second initial length satisfy the following relationship:

[0123] Flen = Fa × β

[0124] Fa represents the second initial length, and β represents the intensity factor.

[0125] The low-frequency coefficients in the frequency-domain vector contain more information of the work to be processed and are relatively stable. The high-frequency coefficients in the frequency-domain vector contain the detailed information of the work to be processed and are relatively unstable. Modifying the low-frequency coefficients is likely to cause a sensory impact on the work to be processed (for example, when the work to be processed is a picture, modifying the low-frequency coefficients is likely to affect the picture quality). That is, embedding the watermark information into the low-frequency coefficients is likely to cause a sensory impact on the work to be processed.

[0126] Modifying the high-frequency coefficients will not cause a sensory impact on the work to be processed. However, when interfering with the work to be processed (for example, compressing a picture), it is easy to lose the detailed information of the work to be processed. That is, when embedding the watermark information into the high-frequency coefficients, if interfering with the work to be processed with the watermark information added, it is easy to lose the watermark information.

[0127] Therefore, in the process of setting the strength factor, a balance can be achieved between the impact on the work to be processed and the anti-interference ability of the watermark information.

[0128] After obtaining the target length, the terminal can generate a target feature vector according to the target length and the target bit. Since the bits included in the watermark information bit stream are 0 bits or 1 bits, therefore, the first initial feature vector corresponding to 0 bits and the second initial feature vector corresponding to 1 bit can be preset in advance. Then, after the terminal obtains the target length, according to the type of the target bit, the initial feature vector corresponding to the target bit is screened out from the first initial feature vector or the second initial feature vector. Finally, the target feature vector with the target length is intercepted from the initial feature vector. That is, at this time, generating the target feature vector according to the target length and the target bit may include:

[0129] Determine the type of the target bit;

[0130] According to the type of the target bit, obtain the initial feature vector corresponding to the target bit;

[0131] According to the target length and the initial feature vector, determine the target feature vector.

[0132] The type of the target bit is type 0 or type 1. For example, the first initial feature vector corresponding to 0 bits is 01010101010101, the second initial feature vector corresponding to 1 bit is 10101010101010, and the target length is 5. When the target bit is 0 bit, the type of the target bit is type 0, then the initial feature vector corresponding to the target bit is the first initial feature vector 01010101010101. Then, the terminal intercepts the first 5 elements 01010 from the first initial feature vector 01010101010101 as the target feature vector.

[0133] It should be noted that the first initial feature vector corresponding to 0 bit and the second initial feature vector corresponding to 1 bit can be of variable length, that is, the first initial feature vector corresponding to 0 bit and the second initial feature vector corresponding to 1 bit of variable length are pre-generated, and then the target feature vector of the target length is intercepted from the first initial feature vector corresponding to 0 bit of variable length, or the target feature vector of the target length is intercepted from the second initial feature vector corresponding to 1 bit of variable length.

[0134] Alternatively, after obtaining the target length, the terminal can also pre-set the generation rules of the feature vector corresponding to 0 bit and the generation rules of the feature vector corresponding to 1 bit, and then after obtaining the target length, according to the type of the target bit, obtain the generation rules corresponding to the target bit, and generate the target feature vector according to the target generation and the generation rules corresponding to the target bit.

[0135] For example, the generation rule of the feature vector corresponding to 0 bit is 01, the generation rule of the feature vector corresponding to 1 bit is 10, the target length is 5, the target bit is 0 bit, the type of the target bit is 0 type, and the generation rule of the target feature vector corresponding to the target bit is 01. Then, by repeating 01, the target feature vector 01010 can be obtained.

[0136] In this embodiment, according to the target position of the target bit in the watermark information bit stream, the target length of the target feature vector corresponding to the target bit is determined. Different target bits have different target positions in the watermark information bit stream, so the target lengths of the target feature vectors corresponding to different target bits are also different, so that the later the bit position in the watermark information bit stream, the longer the target length, so that more target feature vectors corresponding to the target bits in the watermark information bit stream can be embedded into the high-frequency coefficients in the frequency domain vector, that is, more watermark information is embedded into the high-frequency information of the work to be processed, thereby reducing the impact of the watermark information on the work to be processed.

[0137] Moreover, although more target feature vectors corresponding to the target bits are embedded into the high-frequency coefficients in the frequency domain vector, since the target feature vector is of variable length, even if the target feature vector is embedded into the high-frequency coefficients in the frequency domain vector, the anti-interference ability of the watermark information can be guaranteed. Therefore, in this embodiment, it is possible to improve the anti-interference of the watermark information while reducing the impact of the watermark information on the work to be processed, that is, to improve the robustness of the watermark information while reducing the impact of the watermark information on the work to be processed.

[0138] S205. Embed the target feature vector into the frequency domain vector to add the watermark information corresponding to the watermark information bit stream to the work to be processed.

[0139] After obtaining the target feature vector, the terminal can directly add the target feature vector to the frequency-domain vector. Alternatively, in order to further embed less watermark information in the low-frequency coefficients of the frequency-domain vector and more watermark information in the high-frequency coefficients of the frequency-domain vector, the initial starting position of the frequency-domain vector can also be preset, and then starting from the initial starting position, the target feature vector is added to the frequency-domain feature vector.

[0140] When starting from the initial starting position and adding the target feature vector to the frequency-domain feature vector, embedding the target feature vector into the frequency-domain vector includes:

[0141] Obtain the initial starting position in the frequency-domain vector and obtain the target offset between the target bit and the frequency-domain vector;

[0142] According to the initial starting position and the target offset, determine the target starting position of the target feature vector in the frequency-domain vector;

[0143] According to the target starting position, embed the target feature vector into the frequency-domain vector.

[0144] The initial starting position is a preset position. The initial starting positions of different watermark information bit streams in the frequency-domain vector can be the same or different, which is not limited in this embodiment.

[0145] Optionally, since when the watermark information bit stream and the frequency-domain vector are determined, the target lengths of all the target feature vectors corresponding to the watermark information bit stream and the length of the frequency-domain vector can also be determined. Therefore, the initial starting position of the watermark information bit stream in the frequency-domain vector can be determined according to the target lengths of all the target feature vectors corresponding to the watermark information bit stream and the length of the frequency-domain vector, and the sum of the target lengths of all the target feature vectors corresponding to the watermark information bit stream and the initial starting position is less than or equal to the length of the frequency-domain vector.

[0146] It should be noted that in order to further embed less watermark information in the low-frequency coefficients of the frequency-domain vector and more watermark information in the high-frequency coefficients of the frequency-domain vector, the sum of the target lengths of all the target feature vectors corresponding to the watermark information bit stream and the initial starting position can be made equal to the length of the frequency-domain vector.

[0147] After the terminal obtains the initial starting position and the target offset, it can add the initial starting position and the target offset to obtain the target starting position of the target feature vector in the frequency-domain vector, and then starting from the target starting position, add the target feature vector to the frequency-domain vector.

[0148] For example, when the target starting position is 10, the first element of the target feature vector is aligned with the tenth coefficient of the frequency domain vector and then added together, that is, the first element of the target feature vector is added to the tenth coefficient of the frequency domain vector, the second element of the target feature vector is added to the eleventh coefficient of the frequency domain vector, until the addition of the elements of the target feature vector and the coefficients of the frequency domain vector is completed.

[0149] In some embodiments, when adding the target feature vector and the frequency domain vector starting from the target starting position, the sub-offset between the elements of the target feature vector can also be obtained, and then starting from the target starting position, according to the sub-offset, the target feature vector and the frequency domain vector are added together.

[0150] For example, the sub-offset is 2 and the target starting position is 10. The first element of the target feature vector is added to the tenth coefficient of the frequency domain vector, the second element of the target feature vector is added to the thirteenth coefficient of the frequency domain vector, until the addition of the elements of the target feature vector and the coefficients of the frequency domain vector is completed.

[0151] In other embodiments, obtaining the target offset between the target bit and the frequency domain vector includes:

[0152] If the target bit is the first bit in the watermark information bit stream, the initialization offset is used as the target offset between the target bit and the frequency domain vector;

[0153] If the target bit is not the first bit in the watermark information bit stream, the target offset is determined according to the offset of the previous bit of the target bit in the watermark information bit stream and the previous length, where the previous length is the length corresponding to the feature vector of the previous bit.

[0154] Among them, the offset of the previous bit can be added to the previous length of the previous bit to obtain the target offset of the target bit, that is:

[0155] offset = offset + Flen

[0156] offset represents the target offset.

[0157] For example, the initialization offset is 0. When the target bit is the first bit in the watermark information bit stream, the target offset of the target bit is 0, the target starting position is the initial starting position, and the length of the first bit is 5. When the target bit is the second bit in the watermark information bit stream, the previous bit of the target bit in the watermark information bit stream is the first bit in the watermark information bit stream. Since the target offset of the first bit is 0 and the length of the first bit is 5, the target offset of the second bit is the previous length 5, and the target starting position of the second bit is the sum between the initial starting position and 5.

[0158] It should be noted that when there is a sub-offset between the elements of the target feature vector, the offset of the previous bit, the length of the bit before the previous bit, and the sub-offset between the feature vectors corresponding to the previous bit can also be added to obtain the target offset of the target bit.

[0159] After embedding the target feature vector of the target bit into the frequency-domain vector, if the target bit is not the last bit in the watermark information bit stream, the feature vectors corresponding to the bits in the watermark information bit stream that have not been embedded into the frequency-domain vector need to be embedded into the frequency-domain vector.

[0160] Therefore, after embedding the target feature vector corresponding to the target bit into the frequency-domain vector, if the target bit is not the last bit in the watermark information bit stream, return to execute the step of screening out the target bit from the watermark information bit stream until the target bit is the last bit in the watermark information bit stream. If the target bit is the last bit in the watermark information bit stream, the watermark information corresponding to the watermark information bit stream is added to the work to be processed.

[0161] Optionally, if the target bit is not the last bit in the watermark information bit stream, the target offset of the next bit in the watermark information bit stream can also be determined according to the target length and target offset of the target bit, so that when the next bit is used as the target bit, the target offset of the next bit can be directly obtained without further calculation, and then return to execute the step of screening out the target bit from the watermark information bit stream.

[0162] After embedding the feature vectors corresponding to all the bits in the watermark information bit stream into the frequency-domain vector, a watermarked frequency-domain vector can be obtained, and then the inverse frequency-domain transform is performed on the watermarked frequency-domain vector to obtain the watermarked work corresponding to the work to be processed.

[0163] It should be understood that if the work to be processed is a video, after performing the inverse frequency-domain transform on the watermarked frequency-domain vector, the obtained is a watermarked image frame. At this time, the watermarked image frames need to be reassembled to obtain the watermarked video.

[0164] If the work to be processed is an audio, after performing the inverse frequency-domain transform on the watermarked frequency-domain vector, the obtained is a watermarked audio segment. At this time, the watermarked audio segments need to be spliced to obtain the watermarked audio.

[0165] After the terminal obtains the watermarked frequency-domain vector or the watermarked work, the watermark information in the watermarked work can be extracted. Therefore, in some embodiments, after embedding the target feature vector into the frequency-domain vector, it further includes:

[0166] Determine a target difference vector according to the frequency-domain vector and the watermarked frequency-domain vector, where the watermarked frequency-domain vector is a vector obtained after embedding the target feature vector into the frequency-domain vector;

[0167] Obtain a reference feature vector;

[0168] According to the target difference vector and the reference feature vector, screen out the watermark information corresponding to the watermark information bit stream from the watermarked frequency-domain vector.

[0169] Among them, the terminal can subtract the frequency-domain vector from the watermarked frequency-domain vector to obtain the target difference vector. The reference feature vector can be a pre-set vector or a vector set according to the target difference vector.

[0170] When the reference feature vector is a vector set according to the target difference vector, obtaining the reference feature vector may include:

[0171] Obtain the current extraction length, the initial starting position in the frequency-domain vector, and the current offset;

[0172] According to the current extraction length, the initial starting position, and the current offset, screen out the detected feature vector from the target difference vector;

[0173] Determine the reference feature vector according to the length of the detected feature vector;

[0174] According to the target difference vector and the reference feature vector, screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency-domain vector includes:

[0175] Determine the bit corresponding to the detected feature vector according to the detected feature vector and the reference feature vector;

[0176] According to the bit corresponding to the detected feature vector, screen out the watermark information corresponding to the watermark information bit stream from the watermarked frequency-domain vector.

[0177] After the terminal obtains the watermarked frequency-domain vector, the terminal can initialize the current position to 0, and then determine the current extraction length according to the current position. The method for determining the current extraction length according to the current position can refer to the method for determining the target length according to the target position above, which will not be elaborated in this embodiment.

[0178] Optionally, the process of screening out the detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset may be:

[0179] Add the initial starting position and the current offset to obtain the left boundary value of the target interval. Add the initial starting position, the current offset, and the current extraction length to obtain the right boundary value of the target interval. Then, use the elements in the target difference vector that belong to the target interval as the detected feature vector.

[0180] For example, when the initial starting position is S, the current extraction length is Flen’, and the current offset is offset’, the target interval is [S + offset’, S + offset’ + Flen’]. The elements from the (S + offset’) - th element to the (S + offset’ + Flen’) - th element in the target difference vector form the detected feature vector.

[0181] After the terminal obtains the detected feature vector, it can determine the length of the detected feature vector, that is, it can determine the truncation length according to the target interval (the truncation length is the length of the detected feature vector).

[0182] Then, starting from the first element of the first initial feature vector corresponding to 0 bit, extract the first reference feature vector with the truncation length, and starting from the first element of the second initial feature vector corresponding to 1 bit, extract the second reference feature vector with the truncation length. That is, the reference feature vector includes the first reference feature vector and the second reference feature vector.

[0183] Alternatively, after the terminal obtains the detected feature vector, it generates the first reference feature vector with the truncation length according to the generation rule of the feature vector corresponding to 0 bit, and generates the second reference feature vector with the truncation length according to the generation rule of the feature vector corresponding to 1 bit.

[0184] For example, the generation rule of the feature vector corresponding to 0 bit is 01, the generation rule of the feature vector corresponding to 1 bit is 10, and the truncation length is 5. According to the generation rule of the feature vector corresponding to 0 bit which is 01, repeating 01, the first reference feature vector 01010 can be obtained. According to the generation rule of the feature vector corresponding to 1 bit which is 10, repeating 10, the second reference feature vector 10101 can be obtained.

[0185] Next, the terminal calculates the first similarity between the detected feature vector and the first reference feature vector, and calculates the second similarity between the detected feature vector and the second reference feature vector. If the first similarity is higher than the second similarity, the bit corresponding to the detected feature vector is 0 bit. If the first similarity is lower than the second similarity, the bit corresponding to the detected feature vector is 1 bit.

[0186] After obtaining the bits corresponding to the detected feature vectors, the bits corresponding to the detected feature vectors form a watermark information bit stream, so that the watermark information corresponding to the watermark information bit stream can be obtained. That is, after obtaining the bits corresponding to the detected feature vectors, the watermark information corresponding to the watermark information bit stream can be screened out from the watermarked frequency domain vector.

[0187] It should be noted that after obtaining the bits corresponding to the detected feature vectors, if the number of bits corresponding to the detected feature vectors is less than the number of all bits included in the watermark information bit stream (one detected feature vector can correspond to one bit, and when multiple detected vectors are obtained, multiple bits can be obtained), the number of all bits included in the watermark information bit stream is the preset number, indicating that not all bits included in the watermark information bit stream have been obtained, and then the detected feature vectors need to be continuously screened out from the target difference vector. If the number of bits corresponding to the detected feature vectors is equal to the preset number, the watermark information corresponding to the watermark information bit stream can be screened out from the watermarked frequency domain vector according to the bits corresponding to the detected feature vectors.

[0188] Therefore, before screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the bits corresponding to the detected feature vectors, it further includes:

[0189] If the number of bits corresponding to the detected feature vectors is less than the preset number, the current offset is updated according to the current extraction length to obtain the updated offset, and the current extraction length is updated to obtain the updated extraction length;

[0190] The updated offset is used as the current offset, the updated extraction length is used as the current extraction length, and the step of screening out the detected feature vectors from the target difference vector according to the current extraction length, the initial starting position, and the current offset is returned for execution;

[0191] Screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the bits corresponding to the detected feature vectors includes:

[0192] If the number of bits corresponding to the detected feature vectors is equal to the preset number, the watermark information corresponding to the watermark information bit stream is screened out from the watermarked frequency domain vector according to the bits corresponding to the detected feature vectors.

[0193] Among them, the process of updating the current offset according to the current extraction length to obtain the updated offset can be: the current extraction length and the current offset can be added to obtain the updated offset.

[0194] The process of updating the current extraction length to obtain the updated extraction length can be as follows: increment the current position by 1 to obtain the incremented current position, and use the incremented current position as the new current position. Then, calculate the updated extraction length based on the new current position.

[0195] It should be understood that when the terminal obtains the watermarked frequency-domain vector, the current offset can be initialized to 0 and the current position can be initialized to 0. If the terminal extracts the detected feature vector from the watermarked frequency-domain vector for the first time, the current offset is 0 and the current extraction length is the minimum length.

[0196] In this embodiment, the target difference vector is determined through the frequency-domain vector and the watermarked frequency-domain vector. Then, based on the target difference vector and the reference feature vector, the watermark information bitstream is extracted from the watermarked frequency-domain vector, so as to obtain the watermark information corresponding to the watermark information bitstream, and further realize the extraction of the watermark information from the watermarked work (the watermarked work is obtained by performing inverse frequency-domain transformation on the watermarked frequency-domain vector).

[0197] As can be seen from the above, in the embodiments of the present application, first, the work to be processed and the watermark information bitstream of the work to be processed are obtained, and the watermark information bitstream includes multiple bits. Then, the frequency-domain transformation is performed on the work to be processed to obtain the frequency-domain vector of the work to be processed, and the target bit is screened out from the watermark information bitstream, and the target position of the target bit in the watermark information bitstream is determined. Next, according to the target position, the target length of the target feature vector corresponding to the target bit is determined, and the target feature vector is generated based on the target length and the target bit. Finally, the target feature vector is embedded into the frequency-domain vector to add the watermark information corresponding to the watermark information bitstream to the work to be processed.

[0198] That is, in the embodiments of the present application, after obtaining the watermark information bitstream, the target bit is screened out from the watermark information bitstream, and the target position of the target bit in the watermark information bitstream is determined. Then, according to the target position, the target length of the target feature vector corresponding to the target bit is determined. When the target positions of the target bits are different, the target lengths of the target feature vectors of the target bits are also different, that is, the feature vectors of each bit in the watermark information bitstream are of variable length. After embedding the variable-length target feature vector into the frequency-domain vector of the work to be processed, the work to be processed is not easily affected by the watermark information, and the watermark information is not easily damaged, with strong anti-interference ability, realizing the improvement of the anti-interference ability of the watermark information while reducing the influence of the watermark information on the work to be processed.

[0199] According to the method described in the above embodiments, the following will give further detailed examples.

[0200] Please refer to Figure 3 ,Figure 3 The figure is a schematic flowchart of the watermark processing method provided by an embodiment of the present application. The watermark processing method of the embodiment of the present application can be executed by a terminal or a server, or can be executed collaboratively by the terminal and the server. In this embodiment, the terminal is taken as an example of the execution subject for detailed description. The watermark processing method flow may include:

[0201] S301. The terminal obtains the work to be processed and the watermark information of the work to be processed.

[0202] S302. The terminal performs a frequency domain transformation on the work to be processed to obtain a frequency domain vector of the work to be processed.

[0203] If the work to be processed is a video, before performing the frequency domain transformation on the work to be processed, a frame extraction operation may be first performed on the video to extract the video into image frames, and then the frequency domain transformation is performed on the image frames of the video. If the work to be processed is an audio, the audio may be segmented according to preset sampling points, and then the frequency domain transformation is performed on each segment of the audio.

[0204] S303. The terminal encodes the watermark information to obtain a watermark information bit stream.

[0205] The terminal first encodes the watermark information into ASCII codes by using the base64 method, and then converts the ASCII codes into a bit stream.

[0206] S304. The terminal generates a first initial feature vector corresponding to 0 bits and a second initial feature vector corresponding to 1 bit. The second initial feature vector and the second initial feature vector are variable-length vectors.

[0207] For example, the first initial feature vector is 01010101010101…, and the second initial feature vector is 10101010101010….

[0208] S305. The terminal filters out the target bits from the watermark information bit stream and determines the target position of the target bits in the watermark information bit stream.

[0209] S306. The terminal obtains the minimum length, the maximum length, and the growth factor of the watermark information bit stream, and determines the first initial length of the target feature vector corresponding to the target bits according to the minimum length, the growth factor, and the target position.

[0210] S307. The terminal takes the smaller value of the maximum length and the first initial length as the second initial length of the target feature vector corresponding to the target bits, and determines the target length of the target feature vector according to the strength factor and the second initial length.

[0211] S308. The terminal determines the type of the target bit, and based on the type of the target bit, filters out the initial feature vector corresponding to the target bit from the first initial feature vector and the second initial feature vector.

[0212] S309. The terminal extracts a target feature vector of a target length from the initial feature vector.

[0213] S3010. The terminal obtains the initial starting position in the frequency-domain vector and obtains the target offset, and based on the initial starting position and the target offset, determines the target starting position of the target feature vector in the frequency-domain vector.

[0214] S3011. The terminal embeds the target feature vector into the frequency-domain vector according to the target starting position.

[0215] S3012. If the target bit is not the last bit in the watermark information bit stream, the terminal updates the target offset according to the target length to obtain an updated target offset, takes the updated target offset as the target offset, and returns to execute step S305.

[0216] S3013. If the target bit is the last bit in the watermark information bit stream, the terminal completes adding the watermark information corresponding to the watermark information bit stream to the work to be processed.

[0217] S3014. The terminal determines a target difference vector based on the frequency-domain vector and the watermarked frequency-domain vector, where the watermarked frequency-domain vector is the vector obtained after embedding the target feature vector into the frequency-domain vector.

[0218] S3015. The terminal obtains the current extraction length, the initial starting position in the frequency-domain vector, and the current offset.

[0219] S3016. The terminal filters out a detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset.

[0220] S3017. The terminal extracts a first reference feature vector with the same length as the detected feature vector from the first initial feature vector, and extracts a second reference feature vector with the same length as the detected feature vector from the second initial feature vector.

[0221] S3018. The terminal calculates a first similarity between the detected feature vector and the first reference feature vector, and calculates a second similarity between the detected feature vector and the second reference feature vector.

[0222] S3019. If the first similarity is higher than the second similarity, the bit corresponding to the detected feature vector is a 0 bit; if the first similarity is less than the second similarity, the bit corresponding to the detected feature vector is a 1 bit.

[0223] S3020. If the number of bits corresponding to the detected feature vector is less than the preset number, the terminal updates the current offset according to the current extraction length to obtain an updated offset, and updates the current extraction length to obtain an updated extraction length.

[0224] S3021. The terminal uses the updated offset as the current offset, uses the updated extraction length as the current extraction length, and returns to step S3016.

[0225] S3022. If the number of bits corresponding to the detected feature vector is equal to the preset number, the terminal filters out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the bits of the detected feature vector.

[0226] It should be understood that the execution order of each step in the above embodiments is not limited.

[0227] For the specific implementation manner and corresponding beneficial effects in this embodiment, reference may be specifically made to the watermark processing method embodiment above, and this embodiment will not be elaborated here.

[0228] To facilitate better implementation of the watermark processing method provided in the embodiments of the present application, the embodiments of the present application also provide a device based on the above watermark processing method. The meanings of the nouns are the same as those in the above watermark processing method, and the specific implementation details can refer to the description in the method embodiments.

[0229] For example, as Figure 4 shown, the watermark processing device may include:

[0230] An acquisition module 401, configured to acquire a work to be processed and a watermark information bit stream of the work to be processed, where the watermark information bit stream includes multiple bits.

[0231] A transformation module 402, configured to perform a frequency domain transformation on the work to be processed to obtain a frequency domain vector of the work to be processed.

[0232] A screening module 403, configured to screen out target bits from the watermark information bit stream and determine target positions of the target bits in the watermark information bit stream.

[0233] A generation module 404, configured to determine a target length of a target feature vector corresponding to the target bits according to the target positions, and generate a target feature vector according to the target length and the target bits.

[0234] An embedding module 405, configured to embed the target feature vector into the frequency domain vector to add the watermark information corresponding to the watermark information bit stream to the work to be processed.

[0235] Optionally, the watermark processing device further includes:

[0236] A return execution module, configured to execute:

[0237] If the target bit is not the last bit in the watermark information bit stream, return and execute the step of screening out the target bit from the watermark information bit stream until the target bit is the last bit in the watermark information bit stream;

[0238] If the target bit is the last bit in the watermark information bit stream, complete adding the watermark information corresponding to the watermark information bit stream to the work to be processed.

[0239] Optionally, the generation module 404 is specifically configured to execute:

[0240] Obtain the minimum length and growth factor of the watermark information bit stream;

[0241] Determine the target length of the target feature vector corresponding to the target bit according to the minimum length, growth factor, and target position.

[0242] Optionally, the generation module 404 is specifically configured to execute:

[0243] Determine the first initial length of the target feature vector corresponding to the target bit according to the minimum length, growth factor, and target position;

[0244] Obtain the maximum length of the watermark information bit stream;

[0245] Use the smaller value of the maximum length and the first initial length as the target length of the target feature vector corresponding to the target bit.

[0246] Optionally, the generation module 404 is specifically configured to execute:

[0247] Determine the second initial length of the target feature vector corresponding to the target bit according to the target position;

[0248] Obtain the strength factor of the watermark information bit stream, and determine the target length of the target feature vector corresponding to the target bit according to the strength factor and the second initial length.

[0249] Optionally, the generation module 404 is specifically configured to execute:

[0250] Determine the type of the target bit;

[0251] Obtain the initial feature vector corresponding to the target bit according to the type of the target bit;

[0252] Determine the target feature vector according to the target length and the initial feature vector.

[0253] Optionally, the embedding module 405 is specifically configured to execute:

[0254] Obtain the initial starting position in the frequency domain vector and obtain the target offset between the target bit and the frequency domain vector;

[0255] Determine the target starting position of the target feature vector in the frequency domain vector according to the initial starting position and the target offset;

[0256] Embed the target feature vector into the frequency domain vector according to the target starting position.

[0257] Optionally, the embedding module 405 is specifically configured to execute:

[0258] If the target bit is the first bit in the watermark information bit stream, use the initialization offset as the target offset between the target bit and the frequency domain vector;

[0259] If the target bit is not the first bit in the watermark information bit stream, determine the target offset according to the offset of the previous bit of the target bit in the watermark information bit stream and the previous length, where the previous length is the length corresponding to the feature vector of the previous bit.

[0260] Optionally, the watermark processing device further includes:

[0261] A vector determination module, configured to determine a target difference vector according to the frequency domain vector and the watermarked frequency domain vector, where the watermarked frequency domain vector is the vector obtained after embedding the target feature vector into the frequency domain vector.

[0262] A vector acquisition module, configured to acquire a reference feature vector.

[0263] An information screening module, configured to screen out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the target difference vector and the reference feature vector.

[0264] Optionally, the vector acquisition module is specifically configured to execute:

[0265] Obtain the current extraction length, the initial starting position in the frequency domain vector, and the current offset;

[0266] Screen out the detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset;

[0267] Determine the reference feature vector according to the length of the detected feature vector.

[0268] Correspondingly, the information screening module is specifically configured to execute:

[0269] Determine the bit corresponding to the detected feature vector according to the detected feature vector and the reference feature vector;

[0270] Select the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the bits corresponding to the detected feature vector.

[0271] Optionally, the watermark processing module further includes:

[0272] An update module for performing:

[0273] If the number of bits corresponding to the detected feature vector is less than the preset number, update the current offset according to the current extraction length to obtain the updated offset, and update the current extraction length to obtain the updated extraction length;

[0274] Use the updated offset as the current offset, use the updated extraction length as the current extraction length, and return to execute the step of screening out the detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset.

[0275] Correspondingly, the information screening module is specifically used to perform:

[0276] If the number of bits corresponding to the detected feature vector is equal to the preset number, select the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector.

[0277] In specific implementation, each of the above modules can be implemented as an independent entity, or can be combined arbitrarily to be implemented as the same or several entities. For the specific implementation manners of the above modules and the corresponding beneficial effects, reference can be made to the method embodiments above, which will not be elaborated here.

[0278] An embodiment of the present application further provides an electronic device, which may be a server or a terminal, etc. As Figure 5 shown, it shows a schematic structural diagram of the electronic device involved in the embodiment of the present application. Specifically:

[0279] The electronic device may include a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, an input unit 504, and other components. Those skilled in the art can understand that Figure 5 the structural diagram of the electronic device shown in

[0280] The processor 501 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits. By running or executing computer programs and / or modules stored in the memory 502, and by invoking the data stored in the memory 502, it executes various functions of the electronic device and processes data. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 501 either.

[0281] The memory 502 can be used to store computer programs and modules. The processor 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502. The memory 502 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, computer programs required for at least one function (such as the sound playback function, image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0282] The electronic device further includes a power supply 503 that powers each component. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 503 may also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0283] In some embodiments, the electronic device may further include an input unit 504, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.

[0284] Although not shown, the electronic device may also include a display unit, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 501 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 502 according to the following instructions, and the processor 501 will run the computer programs stored in the memory 502 to implement various functions, such as:

[0285] Obtain a work to be processed and a bit stream of watermark information of the work to be processed, where the bit stream of watermark information includes multiple bits;

[0286] Perform a frequency-domain transformation on the work to be processed to obtain a frequency-domain vector of the work to be processed;

[0287] Screen out target bits from the bit stream of watermark information and determine the target positions of the target bits in the bit stream of watermark information;

[0288] Determine the target length of the target feature vector corresponding to the target bit according to the target position, and generate a target feature vector according to the target length and the target bit;

[0289] Embed the target feature vector into the frequency-domain vector to add the watermark information corresponding to the bit stream of watermark information to the work to be processed.

[0290] For the specific implementation manners of the above operations and the corresponding beneficial effects, reference may be made to the detailed description of the watermark processing method above, which will not be elaborated here.

[0291] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or the relevant hardware can be controlled by a computer program. The computer program can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0292] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any watermark processing method provided by the embodiment of the present application. For example, the computer program can execute the following steps:

[0293] Obtain a work to be processed and a bit stream of watermark information of the work to be processed, where the bit stream of watermark information includes multiple bits;

[0294] Perform a frequency-domain transformation on the work to be processed to obtain a frequency-domain vector of the work to be processed;

[0295] Screen out target bits from the bit stream of watermark information and determine the target positions of the target bits in the bit stream of watermark information;

[0296] Determine the target length of the target feature vector corresponding to the target bit according to the target position, and generate a target feature vector according to the target length and the target bit;

[0297] Embed the target feature vector into the frequency-domain vector to add the watermark information corresponding to the bit stream of watermark information to the work to be processed.

[0298] For the specific implementation manners of the above operations and the corresponding beneficial effects, reference may be made to the previous embodiments, which will not be elaborated herein.

[0299] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

[0300] Since the computer program stored in the computer-readable storage medium can execute the steps in any of the watermark processing methods provided in the embodiments of the present application, the beneficial effects achievable by any of the watermark processing methods provided in the embodiments of the present application can be achieved. For details, reference may be made to the previous embodiments, which will not be elaborated herein.

[0301] Among them, according to one aspect of the present application, a computer program product is provided, and the computer program product stores a computer program. The processor of the computer device can load the computer program, so that the computer device executes the above watermark processing method.

[0302] The above has introduced in detail a watermark processing method, device, electronic device and computer-readable storage medium provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.

Claims

1. A watermark processing method, characterized in that, comprising: obtaining a work to be processed and a bit stream of watermark information of the work to be processed, the bit stream of watermark information including a plurality of bits; performing a frequency domain transformation on the work to be processed to obtain a frequency domain vector of the work to be processed; screening out a target bit from the bit stream of watermark information and determining a target position of the target bit in the bit stream of watermark information; determining a target length of a target feature vector corresponding to the target bit according to the target position, and generating the target feature vector according to the target length and the target bit; wherein, if the target positions of the target bits in the bit stream of watermark information are different, the target lengths of the target feature vectors corresponding to the target bits are also different; embedding the target feature vector into the frequency domain vector to add the watermark information corresponding to the bit stream of watermark information to the work to be processed.

2. The watermark processing method according to claim 1, characterized in that, after embedding the target feature vector into the frequency domain vector, further comprising: if the target bit is not the last bit in the bit stream of watermark information, returning to execute the step of screening out the target bit from the bit stream of watermark information until the target bit is the last bit in the bit stream of watermark information; if the target bit is the last bit in the bit stream of watermark information, completing adding the watermark information corresponding to the bit stream of watermark information to the work to be processed.

3. The watermark processing method according to claim 1, characterized in that, the determining the target length of the target feature vector corresponding to the target bit according to the target position includes: obtaining a minimum length and a growth factor of the bit stream of watermark information; determining the target length of the target feature vector corresponding to the target bit according to the minimum length, the growth factor and the target position.

4. The watermark processing method according to claim 3, characterized in that, the determining the target length of the target feature vector corresponding to the target bit according to the minimum length, the growth factor and the target position includes: determining a first initial length of the target feature vector corresponding to the target bit according to the minimum length, the growth factor and the target position; obtaining a maximum length of the bit stream of watermark information; taking the smaller value of the maximum length and the first initial length as the target length of the target feature vector corresponding to the target bit.

5. The watermark processing method according to claim 1, characterized in that, the determining the target length of the target feature vector corresponding to the target bit according to the target position includes: determining a second initial length of the target feature vector corresponding to the target bit according to the target position; obtaining an intensity factor of the bit stream of watermark information, and determining the target length of the target feature vector corresponding to the target bit according to the intensity factor and the second initial length.

6. The watermark processing method according to claim 1, characterized in that, Generating the target feature vector according to the target length and the target bit includes: Determining the type of the target bit; Obtaining an initial feature vector corresponding to the target bit according to the type of the target bit; Determining the target feature vector according to the target length and the initial feature vector.

7. The watermark processing method according to claim 1, wherein, Embedding the target feature vector into the frequency domain vector includes: Obtaining an initial starting position in the frequency domain vector and obtaining a target offset between the target bit and the frequency domain vector; Determining a target starting position of the target feature vector in the frequency domain vector according to the initial starting position and the target offset; Embedding the target feature vector into the frequency domain vector according to the target starting position.

8. The watermark processing method according to claim 7, wherein, Obtaining the target offset between the target bit and the frequency domain vector includes: If the target bit is the first bit in the watermark information bit stream, using the initialized offset as the target offset between the target bit and the frequency domain vector; If the target bit is not the first bit in the watermark information bit stream, determining the target offset according to the offset of the previous bit of the target bit in the watermark information bit stream and the previous length, where the previous length is the length corresponding to the feature vector of the previous bit.

9. The watermark processing method according to claim 1, wherein, After embedding the target feature vector into the frequency domain vector, it further includes: Determining a target difference vector according to the frequency domain vector and the watermarked frequency domain vector, where the watermarked frequency domain vector is the vector obtained after embedding the target feature vector into the frequency domain vector; Obtaining a reference feature vector; Screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the target difference vector and the reference feature vector.

10. The watermark processing method according to claim 9, wherein, Obtaining the reference feature vector includes: Obtaining the current extraction length, the initial starting position in the frequency domain vector, and the current offset; Screening out a detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset; Determining a reference feature vector according to the length of the detected feature vector; Screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the target difference vector and the reference feature vector includes: Determining the bit corresponding to the detected feature vector according to the detected feature vector and the reference feature vector; Screening out the watermark information corresponding to the watermark information bit stream from the watermarked frequency domain vector according to the bit corresponding to the detected feature vector.

11. The watermark processing method according to claim 10, wherein, Before screening out the watermark information corresponding to the watermark information bit stream from the watermark-containing frequency domain vector according to the bits corresponding to the detected feature vector, the following steps are further included: If the number of bits corresponding to the detected feature vector is less than a preset number, update the current offset according to the current extraction length to obtain an updated offset, and update the current extraction length to obtain an updated extraction length; Use the updated offset as the current offset, use the updated extraction length as the current extraction length, and return to execute the step of screening out the detected feature vector from the target difference vector according to the current extraction length, the initial starting position, and the current offset; The step of screening out the watermark information corresponding to the watermark information bit stream from the watermark-containing frequency domain vector according to the bits corresponding to the detected feature vector includes If the number of bits corresponding to the detected feature vector is equal to the preset number, screen out the watermark information corresponding to the watermark information bit stream from the watermark-containing frequency domain vector according to the bits corresponding to the detected feature vector.

12. A watermark processing device, characterized in that it includes: An acquisition module, configured to acquire a work to be processed and the watermark information bit stream of the work to be processed, where the watermark information bit stream includes a plurality of bits; A transformation module, configured to perform a frequency domain transformation on the work to be processed to obtain a frequency domain vector of the work to be processed; A screening module, configured to screen out target bits from the watermark information bit stream and determine the target position of the target bits in the watermark information bit stream; A generation module, configured to determine the target length of the target feature vector corresponding to the target bit according to the target position, and generate the target feature vector according to the target length and the target bit; wherein, if the target positions of the target bits in the watermark information bit stream are different, the target lengths of the target feature vectors corresponding to the target bits are also different; An embedding module, configured to embed the target feature vector into the frequency domain vector to add the watermark information corresponding to the watermark information bit stream to the work to be processed.

13. An electronic device, characterized in that it includes a processor and a memory, the memory stores a computer program, and the processor is configured to run the computer program in the memory to execute the watermark processing method according to any one of claims 1 to 11.

14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the watermark processing method according to any one of claims 1 to 11.

15. A computer program product, characterized in that the computer program product stores a computer program, and the computer program is suitable for being loaded by a processor to execute the watermark processing method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Video watermark adding method and device, video watermark extracting method and device, equipment and storage medium

    CN112040337A