Watermark embedding method and apparatus, watermark extraction method and apparatus, and electronic device and storage medium
By increasing the number of video frames corresponding to the watermark encoding in the video and using the first watermark and the second watermark protection, the problem in the existing technology that the watermark is difficult to extract after the video content is transformed is solved, and the reliability and security of the watermark are improved. Effective detection of video property rights is achieved.
Patent Information
- Application Number
- PCT/CN2024/086828
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-14
- Filing Date
- 2024-04-09
- Publication Date
- 2024-10-17
AI Technical Summary
Existing digital watermarking technology is easily changed or removed after compression, shearing and frame rate conversion operations of video content, resulting in the inability to effectively detect video property rights. Watermark reliability is particularly low under multi-video pixel median conversion operations.
By dividing the original video, increasing the number of video frames corresponding to the watermark encoding, and using the first watermark and the second watermark for protection, it is ensured that the watermark can be accurately extracted after content transformation, and effective detection of video property rights is achieved.
It improves the reliability and security of watermarks under multi-video pixel median transformation operations, ensures that watermarks can be accurately extracted after content transformation, effectively prevents watermarks from being changed or removed, and ensures effective detection of video property rights.
Smart Images

Figure CN2024086828_17102024_PF_FP_ABST
Abstract
Description
Watermark embedding and watermark extraction method, device, electronic device and storage medium
[0001] This application claims priority to Chinese patent application No. 202310403593.5 filed on April 14, 2023, the entire text of which is incorporated herein by reference as a part of this application. Technical Field
[0002] The present disclosure relates to a watermark embedding and watermark extraction method, device, electronic device and storage medium. Background Art
[0003] Digital watermarking technology involves embedding specific information into digital products, such as audio, images, or videos. If a watermarked product is copied, the embedded information will also be copied. Common digital watermarks fall into two categories: visible watermarks and hidden (or invisible) watermarks. Both types can be used to identify the copyright of digital products. For example, digital watermarks can leverage data redundancy to embed specific identifying information within a digital product, identifying the version of the content. This embedded digital watermark can accurately determine whether the product has been used infringing copyrights.
[0004] However, the watermark added by conventional digital watermarking technology is easily changed or removed after the digital product content undergoes various content transformation operations such as compression, cropping and frame rate conversion. As a result, it is impossible to extract the accurate watermark from the digital product content after the content transformation, which in turn makes it impossible to effectively detect the property rights issues of the digital product content.
[0005] Summary of the Invention
[0006] The embodiments of the present disclosure at least provide a watermark embedding and watermark extraction method, device, electronic device and storage medium.
[0007] In a first aspect, an embodiment of the present disclosure provides a watermark embedding method, comprising:
[0008] Acquire multiple original videos corresponding to the same video content, as well as video numbers corresponding to the respective original videos and watermarks to be embedded; the watermarks to be embedded include at least one watermark code;
[0009] For any of the original videos, dividing the original video according to a first number of the original videos and a second number of video frames corresponding to the watermark codes in the watermark to be embedded, to obtain respective frame sequences of the original video; the frame sequence includes a first number of watermark units, the watermark unit includes a first number of subunits, and the subunits include the second number of consecutive video frames;
[0010] assigning a watermark code to each frame sequence according to the time sequence of each frame sequence and the order of each watermark code, and determining a first watermark and a second watermark corresponding to each frame sequence according to the watermark code assigned to each frame sequence;
[0011] According to the video number of the original video, the first number of each watermark unit in each frame sequence and the second number of the subunit in each watermark unit, a target watermark is added to each subunit to obtain a watermark video corresponding to the original video; the target watermark is one of the first watermark, the second watermark and the watermark code.
[0012] In a possible implementation, determining the first watermark and the second watermark corresponding to each of the frame sequences according to the watermark codes respectively assigned to each of the frame sequences includes:
[0013] For any of the frame sequences, determining the watermark code corresponding to each of the subunits in the frame sequence according to the watermark code assigned to the frame sequence;
[0014] Determining, according to the watermark code corresponding to any of the subunits, a subcode corresponding to each of the video frames in the subunits;
[0015] According to the sub-code corresponding to each of the video frames in the sub-unit, a first watermark and a second watermark corresponding to the frame sequence are determined.
[0016] In a possible implementation, determining the first watermark and the second watermark corresponding to the frame sequence according to the sub-code corresponding to each video frame in the sub-unit includes:
[0017] Filtering at least one first video frame and at least one second video frame from the video frames in the subunit using the second number and a preset filtering method;
[0018] According to the frame order of the first video frames, the subcodes corresponding to the first video frames are sequentially inverted to obtain a first watermark corresponding to the frame sequence;
[0019] According to the frame sequence of the second video frames, the subcodes corresponding to the second video frames are sequentially inverted to obtain a second watermark corresponding to the frame sequence.
[0020] In a possible implementation, adding a target watermark to each subunit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit includes:
[0021] For any target watermark unit in any frame sequence, determining whether a target first number of the target watermark unit is consistent with a video number of the original video;
[0022] If so, the watermark corresponding to the frame sequence is encoded, determined as the target watermark corresponding to each subunit in the target watermark unit, and added.
[0023] In one possible implementation, the method further includes:
[0024] In a case where the target first number is inconsistent with the video number of the original video, selecting a target subunit whose second number is consistent with the video number from the subunits included in the target watermark unit;
[0025] The first watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the target subunit and added.
[0026] In a possible implementation manner, after screening out the target subunit whose second number is consistent with the video number, the method further includes:
[0027] The second watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the subunits other than the target subunit in the target watermark unit and is added.
[0028] In a second aspect, the present disclosure provides a watermark extraction method, including:
[0029] Get the target video to be watermarked;
[0030] The target video is divided according to a third number and a fourth number to obtain respective frame sequences to be extracted corresponding to the target video; the third number is the number of original videos used when embedding the target video watermark in the target video, and the fourth number is the number of video frames corresponding to the watermark encoding in the target video watermark; the frame sequences to be extracted include a third number of watermark units to be extracted, each watermark unit to be extracted includes a third number of sub-units to be extracted; and each sub-unit to be extracted includes a fourth number of continuous video frames;
[0031] For any of the sub-units to be extracted in any of the watermark units to be extracted, determining the sub-unit watermark corresponding to the sub-unit to be extracted according to the pixel values of each video frame in the sub-unit to be extracted;
[0032] Each target video watermark corresponding to the target video is extracted according to the unit number of each to-be-extracted watermark unit in each to-be-extracted frame sequence, the sub-unit watermark corresponding to each to-be-extracted sub-unit, and the watermark type.
[0033] In a possible implementation, extracting each target video watermark corresponding to the target video according to the unit number of each to-be-extracted watermark unit in each to-be-extracted frame sequence, the sub-unit watermark corresponding to each to-be-extracted sub-unit, and the watermark type includes:
[0034] filtering out the sub-unit watermarks of a preset type according to the watermark type of the sub-unit watermarks corresponding to the sub-units to be extracted;
[0035] For any of the watermark units to be extracted, determining a target watermark code corresponding to the watermark unit to be extracted according to the filtered sub-unit watermarks included in the watermark unit to be extracted;
[0036] According to the unit number and target watermark code corresponding to each watermark unit to be extracted, each target video watermark corresponding to the target video is extracted.
[0037] In a third aspect, the present disclosure further provides a watermark embedding device, comprising:
[0038] A first acquisition module is configured to acquire a plurality of original videos corresponding to the same video content, a video number corresponding to each of the original videos, and a watermark to be embedded; the watermark to be embedded includes at least one watermark code;
[0039] a first division module, configured to divide any of the original videos according to a first number of the original videos and a second number of video frames corresponding to the watermark codes in the watermark to be embedded, to obtain frame sequences of the original video; the frame sequence comprising a first number of watermark units, the watermark units comprising a first number of subunits, and the subunits comprising the second number of consecutive video frames;
[0040] a first determining module, configured to assign a watermark code to each frame sequence according to a time sequence of each frame sequence and an order of each watermark code, and determine a first watermark and a second watermark corresponding to each frame sequence according to the watermark code assigned to each frame sequence;
[0041] An adding module is used to add a target watermark to each subunit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit to obtain a watermarked video corresponding to the original video; the target watermark is one of the first watermark, the second watermark, and the watermark code.
[0042] In a fourth aspect, the present disclosure further provides a watermark extraction device, comprising:
[0043] The second acquisition module is used to obtain the target video to be watermarked;
[0044] a second division module, configured to divide the target video according to a third number and a fourth number to obtain respective to-be-extracted frame sequences corresponding to the target video; the third number being the number of original videos used when embedding the target video watermark in the target video, and the fourth number being the number of video frames corresponding to the watermark encoding in the target video watermark; the to-be-extracted frame sequences comprising a third number of to-be-extracted watermark units, the to-be-extracted watermark units comprising a third number of to-be-extracted sub-units; and the to-be-extracted sub-units comprising a fourth number of continuous video frames;
[0045] A second determining module is configured to determine, for any of the sub-units to be extracted in any of the watermark units to be extracted, a sub-unit watermark corresponding to the sub-unit to be extracted according to pixel values of each video frame in the sub-unit to be extracted;
[0046] The extraction module is used to extract each target video watermark corresponding to the target video according to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the subunit watermark corresponding to each subunit to be extracted, and the watermark type.
[0047] In a fifth aspect, an embodiment of the present disclosure further provides an electronic device comprising a processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions execute the steps of the first aspect or any possible implementation of the first aspect; or, when the machine-readable instructions are executed by the processor, the machine-readable instructions execute the steps of the second aspect or any possible implementation of the second aspect.
[0048] In a sixth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run, the computer program executes the steps of the above-mentioned first aspect, or any possible implementation of the first aspect; or, when the computer program is run, the computer program executes the above-mentioned second aspect, or any possible implementation of the second aspect.
[0049] For a description of the effects of the above-mentioned watermark embedding and watermark extraction apparatus, electronic device, and computer-readable storage medium, please refer to the description of the above-mentioned watermark embedding and watermark extraction method, which will not be repeated here.
[0050] In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and easy to understand, optional embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for use in the embodiments. The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and, together with the specification, are used to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without inventive effort.
[0052] FIG1 shows a flow chart of a watermark embedding method provided by an embodiment of the present disclosure;
[0053] FIG2 shows a specific implementation flow chart of a watermark embedding method provided by an embodiment of the present disclosure;
[0054] FIG3 shows a schematic diagram of watermark encoding under four original videos provided by an embodiment of the present disclosure;
[0055] FIG4 shows a specific implementation flow chart of adding a target watermark provided by an embodiment of the present disclosure;
[0056] FIG5 shows a flow chart of a watermark extraction method provided by an embodiment of the present disclosure;
[0057] FIG6 shows a specific implementation flow chart of extracting a target video watermark corresponding to a target video provided by an embodiment of the present disclosure;
[0058] FIG7 shows a schematic diagram of an implementation flow of a watermark embedding and extraction method provided by an embodiment of the present disclosure;
[0059] FIG8 shows a schematic diagram of a watermark embedding device provided by an embodiment of the present disclosure;
[0060] FIG9 shows a schematic diagram of a watermark extraction device provided by an embodiment of the present disclosure;
[0061] FIG10 shows a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure.
[0063] In addition, the terms "first," "second," and the like in the description and claims of the embodiments of the present disclosure and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments described herein can be practiced in an order other than that shown or described herein.
[0064] In this document, "multiple or several" refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0065] Research has found that with the rapid development of mobile internet and video technologies, a vast amount of video content is disseminated daily across various social platforms and websites. This, however, presents a challenge: if a user's video content is uploaded to a social platform or website without authorization, it constitutes a copyright infringement. Therefore, strengthening the detection of copyright violations has become increasingly important. Digital watermarking technology, a key technology for securing the intellectual property rights of digital products, can be effectively used to detect copyright violations in video content. For example, video watermarking can be used to add digital watermarks to videos, enabling copyright identification and detection.
[0066] However, a range of video content transformation methods have also emerged. For example, by performing various content transformation operations on videos, such as compression, cropping, and frame rate conversion, digital watermarks can be altered or removed. Among these video content transformation methods, those with the highest difficulty and effectiveness are multi-video joint transformation operations, such as multi-video pixel median transformation and multi-video pixel mean transformation. The multi-video pixel median transformation method involves obtaining multiple videos with different digital watermarks (where multiple videos correspond to the same content), sorting pixels at the same temporal and spatial locations in the videos by pixel value, and taking the median of the sorted values as the pixel value at that location in the transformed video. This results in a video that is not only highly resistant to digital watermark erasure but also maintains no significant differences in content from the original video. Therefore, improving the reliability of digital watermarking technology using multi-video pixel median transformation has become a technical challenge.
[0067] Based on the above research, the present disclosure provides a watermark embedding and watermark extraction method, device, electronic device and storage medium. In the watermark embedding method, the original video is divided based on the first number of the original video and the second number of video frames corresponding to the watermark code. This not only allows the video frames to be divided according to the time sequence of the video frames, so that one watermark code corresponds to one frame sequence, but also effectively increases the number of video frames corresponding to one watermark code, that is, enriches the number of video frames that represent each watermark code. The more video frames a watermark code corresponds to, the more information that can be referenced. After the watermark video is subjected to a content transformation operation, the success rate and accuracy of extracting the watermark code are higher. Therefore, by increasing the number of video frames corresponding to a watermark code, the accuracy and success rate of extracting the original watermark to be embedded from the content-transformed video after the watermark video is subjected to a content transformation operation can be improved. In addition, by using the actual watermark codes in the watermark to be embedded, the first watermark and the second watermark corresponding to each frame sequence are determined and added to the original video, so that the original watermark to be embedded can be protected by the first watermark and the second watermark, and then the accuracy and success rate of the original watermark to be embedded can be further improved after the watermark video is subjected to the content transformation operation. Based on the watermark embedding method provided by the embodiment of the present disclosure, the security and reliability of the embedded video watermark can be effectively improved (especially the reliability of the watermark under the pixel median transformation operation based on multiple videos), and the watermark can be effectively prevented from being easily changed or removed, resulting in the problem of being unable to identify the ownership of the video, thereby increasing the security of the watermarked video after the watermark is embedded, and then based on the security and reliability of the watermark, the ownership of the digital product content can be effectively detected.
[0068] In the watermark extraction method, after obtaining a target video, the original video is segmented using a third number of the original video used when embedding the target video watermark and a fourth number of video frames corresponding to the watermark encoding, thereby accurately segmenting each frame sequence in the target video. By utilizing the regularity of the pixel values of each video frame in the sub-unit to be extracted in the frame sequence, the sub-unit watermark and watermark type included in the sub-unit to be extracted can be accurately determined. Finally, using the unit number, sub-unit watermark, and watermark type of each watermark unit to be extracted, each original target video watermark included in the target video can be accurately restored. Furthermore, based on the video provider corresponding to the restored target video watermark, the video leaker can be accurately located, thereby achieving the purpose of video leak detection.
[0069] The defects in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by this disclosure for the above problems below should be the contributions made by the inventors to this disclosure during the disclosure process.
[0070] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0071] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0072] To facilitate understanding of this embodiment, a watermark embedding method disclosed in an embodiment of the present disclosure is first introduced in detail. The execution subject of the watermark embedding method provided in the embodiment of the present disclosure is generally a terminal device or other processing device with certain computing capabilities, where the terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant (PDA), a handheld device, a computer device, etc.; in some possible implementations, the watermark embedding method can be implemented by a processor calling computer-readable instructions stored in a memory.
[0073] The watermark embedding method provided by the embodiment of the present disclosure is described below by taking an electronic device as an example.
[0074] As shown in FIG1 , which is a flow chart of a watermark embedding method provided by an embodiment of the present disclosure, the method may include the following steps:
[0075] S101: Acquire multiple original videos corresponding to the same video content, as well as video numbers corresponding to the respective original videos and watermarks to be embedded; the watermark to be embedded includes at least one watermark code.
[0076] Here, the original video is the video without a watermark embedded in it, and the watermark to be embedded is the watermark to be embedded in the original video, which may include at least one watermark code. The watermark to be embedded can be a string consisting of binary codes "0" and "1", and each binary code in the string is the watermark code. For example, the watermark to be embedded can be 00101110, where the "0" and "1" are the watermark codes included in the watermark to be embedded. Multiple original videos correspond to the same video content, that is, multiple original videos are the same video.
[0077] Each original video corresponds to a watermark to be embedded. Different original videos correspond to different watermarks to be embedded. Different watermarks to be embedded identify different information, that is, different watermarks to be embedded correspond to different watermark identifiers (Identity Document, abbreviated as ID). The watermark to be embedded has a certain watermark length, which can be represented by m bits (wherein, bit is a bit) (m is an integer greater than 1). One watermark bit corresponds to n consecutive video frames. At the same time, one watermark bit corresponds to one watermark code. The number n can be set based on experience and is not specifically limited in the embodiment of the present disclosure, but is usually an odd number.
[0078] For example, when a watermark to be embedded is 00101110, the watermark length is 8 bits, and the watermark code corresponding to one bit is a 0 or a 1. When one bit corresponds to four consecutive video frames, these four consecutive video frames can be used to embed the watermark code corresponding to the bit, that is, these four consecutive video frames can be used to represent 1 bit.
[0079] Each original video has a video number, and the video number can match the number of original videos. For example, if the number of original videos is 4, the video numbers can be 1 to 4.
[0080] For example, the number of original videos can be determined based on the maximum number of videos and / or the number of video frames allowed to participate in the multi-video-based pixel median transform operation. For example, if four videos are allowed to participate in the multi-video-based pixel median transform operation, the number of original videos obtained can be four. The maximum number of videos allowed to participate in the multi-video-based pixel median transform operation is denoted by K below. It should be noted that in the embodiments of the present disclosure, the value of K is not specifically limited.
[0081] Alternatively, for the original video, if the number of corresponding video distributors is less than the maximum number, the number of original videos obtained may also be the number of video distributors, wherein each video distributor corresponding to the original video is used to distribute the original video with a different watermark to be embedded.
[0082] In specific implementation, you can first obtain an original video, then copy the original video according to the number K to obtain K original videos. At the same time, you can obtain the watermark to be embedded corresponding to each original video and the video number of each original video. Alternatively, you can directly obtain the K original videos to be watermarked, as well as the watermark to be embedded and the video number corresponding to each original video in the memory.
[0083] S102: For any original video, divide the original video according to a first number of original videos and a second number of video frames corresponding to the watermark encoding to be embedded in the watermark, to obtain frame sequences of the original video; the frame sequence includes a first number of watermark units, the watermark unit includes a first number of subunits, and the subunits include a second number of continuous video frames.
[0084] Here, the first number is the number of original videos obtained, which is equal to the K value mentioned above. The second number is the number of consecutive video frames corresponding to one watermark bit to be embedded, that is, the number of consecutive video frames corresponding to one watermark code, which is equal to the n value mentioned above. The number of video frames corresponding to one frame sequence can be K*K*n. In this way, it is possible to use K*K*n consecutive video frames to represent one watermark bit to be embedded. In other words, use K*K*n consecutive video frames to represent one watermark code to be embedded.
[0085] In a specific implementation, for any original video, the original video can be divided according to the time sequence of each video frame in the original video according to the first number and the second number to obtain the frame sequences corresponding to the original video. Here, a frame sequence includes K watermark units, each watermark unit includes K subunits, and each subunit includes n consecutive video frames. In other words, each consecutive K*K*n video frames in the original video can represent a watermark bit to be embedded.
[0086] For any frame sequence, the frame sequence corresponds to a watermark bit to be embedded in the watermark. At the same time, each watermark unit in the frame sequence corresponds to a watermark code, which is the watermark code corresponding to the watermark bit. Moreover, the watermark code corresponding to each sub-unit in a watermark unit is the watermark code corresponding to the watermark unit. Each of the consecutive n frames in a sub-unit is
[0087] Each video frame corresponds to a video frame code, and the video frame codes corresponding to n consecutive video frames are used to represent the watermark code corresponding to the sub-unit.
[0088] Each watermark unit included in each frame sequence may have a corresponding first number. For example, when a frame sequence includes 4 video units, the first numbers of the watermark units may be 1 to 4, i.e., watermark units 1 to 4. At the same time, each sub-unit in a watermark unit may have a corresponding second number. For example, when a watermark unit includes 4 sub-units, the second numbers of the sub-units may be 1 to 4, i.e., sub-units 1 to 4.
[0089] For example, for the original video 1 with video number 1, its corresponding first frame sequence may include 4 watermark units, the first numbers of which are 1 to 4, that is, the first frame sequence includes watermark units 1 to 4. The second frame sequence also includes 4 watermark units, the first numbers of which are 1 to 4, that is, the second frame sequence includes watermark units 1 to 4, and the watermark units 1 to 4 in the first frame sequence are different from the watermark units 1 to 4 in the second frame sequence. Each watermark unit may include 4 sub-units, the second numbers of which are 1 to 4, that is, watermark unit 1 includes sub-units 1 to 4, watermark unit 2 includes sub-units 1 to 4, watermark unit 3 includes sub-units 1 to 4, and watermark unit 4 includes sub-units 1 to 4. Each sub-unit includes n consecutive video frames. For example, sub-unit 1 in watermark unit 1 includes frames 1 to n, sub-unit 2 includes frames n+1 to 2n, sub-unit 3 includes frames 2n+1 to 3n, sub-unit 4 includes frames 3n+1 to 4n, sub-unit 1 in watermark unit 2 includes frames 4n+1 to 5n, sub-unit 2 in watermark unit 2 includes frames 5n+1 to 6n, and so on. Different sub-units correspond to different n consecutive video frames.
[0090] The number of watermarks to be embedded in an original video can be determined based on the total number of frames in the original video, the length of the watermark to be embedded, and the number of frames corresponding to each frame sequence. For example, if the total number of frames in the original video is Z, the number of watermarks to be embedded is Z / (m×(K*K*n)). For example, watermark ID1 can be embedded a total of 6 times in original video 1.
[0091] Based on the above S102, each original video may be divided into respective frame sequences corresponding to the original video.
[0092] S103: allocating watermark codes to each frame sequence according to the time sequence of each frame sequence and the order of each watermark code, and determining the first watermark and the second watermark corresponding to each frame sequence according to the watermark codes allocated to each frame sequence.
[0093] Here, the timing of the frame sequence can be determined based on the timing of each video frame in the frame sequence. For example, frame sequence 1 includes frames 1 to x, frame sequence 2 includes frames x+1 to 2x, and frame sequence 3 includes frames 2x+1 to 3x. Then, the timing order of frame sequences 1 to 3 is: frame sequence 1 precedes frame sequence 2, which precedes frame sequence 3. The order of the watermark codes is the order in which the watermark codes are embedded in the watermark.
[0094] The watermark code assigned to a frame sequence is the watermark code indicated by the watermark bit corresponding to the frame sequence. For example, the watermark identifier corresponding to a watermark 1 to be embedded is 1001, and the frame sequence corresponding to the original video includes 8 frames. Then the watermark code corresponding to the first frame sequence is 1, the watermark code corresponding to the second frame sequence is 0, the watermark code corresponding to the third frame sequence is 0, and the watermark code corresponding to the fourth frame sequence is 1. At this point, after the first 4 watermark codes are embedded, it means that a complete watermark 1 to be embedded has been successfully embedded once. After that, the watermark 1 to be embedded can be embedded for the second time. Specifically, the watermark code corresponding to the fifth frame sequence is 1, the watermark code corresponding to the sixth frame sequence is 0, the watermark code corresponding to the seventh frame sequence is 0, and the watermark code corresponding to the eighth frame sequence is 1. At this point, it can be said that a complete watermark 1 to be embedded has been successfully embedded for the second time.
[0095] In a specific implementation, watermark codes can be assigned to each frame sequence according to the temporal order of each frame sequence and the order of each watermark code to be embedded in the watermark. Then, for any frame sequence, the source code of the watermark code corresponding to the frame sequence can be inverted to obtain the first watermark corresponding to the frame sequence, and the complement code of the watermark code corresponding to the frame sequence can be inverted to obtain the second watermark corresponding to the frame sequence.
[0096] In one embodiment, the step of determining the first watermark and the second watermark in S103 may be implemented according to the following steps:
[0097] S103 - 1 : For any frame sequence, determine the watermark code corresponding to each sub-unit in the frame sequence according to the watermark code allocated to the frame sequence.
[0098] Exemplarily, for any frame sequence, the watermark code allocated to the frame sequence may be directly used as the watermark code corresponding to each sub-unit in the frame sequence.
[0099] S103-2: Determine the sub-code corresponding to each video frame in the sub-unit according to the watermark code corresponding to any sub-unit.
[0100] Here, the subcode corresponding to the video frame is the video frame code of the video frame. The subcodes of each video frame in a subunit are different. The subcodes of n consecutive video frames in a subunit are used to represent the watermark code corresponding to the subunit.
[0101] During specific implementation, for any sub-unit, the sub-code of each video frame in the sub-unit can be determined according to the watermark code corresponding to the sub-unit.
[0102] S103-3: Determine a first watermark and a second watermark corresponding to the frame sequence according to the sub-code corresponding to each video frame in the sub-unit.
[0103] It should be noted that, since the watermark codes corresponding to each watermark unit in a frame sequence are all the watermark codes corresponding to the frame sequence, and the watermark codes corresponding to each sub-unit in a watermark unit are all the watermark codes corresponding to the watermark unit, each sub-unit in a frame sequence corresponds to the same watermark code. Therefore, in the specific implementation of the above S103, the first and second watermarks corresponding to each sub-unit can also be determined directly based on the watermark code corresponding to the sub-unit, and then the first and second watermarks are used as the first and second watermarks corresponding to the frame sequence in which the sub-unit is located.
[0104] Exemplarily, the subcodes of each video frame in a subunit can be determined based on the watermark code corresponding to any subunit in the frame sequence. For example, the subcodes of the first x video frames in the subunit can be inverted frame by frame in time sequence to obtain a first watermark. Simultaneously, the subcodes of the last x video frames in the subunit can be inverted frame by frame in time sequence to obtain a second watermark. The first and second watermarks are used as the first and second watermarks corresponding to the frame sequence in which the subunit is located.
[0105] In one embodiment, the above S103-3 can be implemented according to the following steps:
[0106] S103-3-1: Filter out at least one first video frame and at least one second video frame from the video frames in the sub-unit using the second quantity and a preset filtering method.
[0107] Here, the preset screening method can be represented by the following formula 1:
[0108] Wherein, Y represents the number of video frames that need to be screened out, and n represents the second number, that is, the number of video frames corresponding to one watermark bit.
[0109] In specific implementation, for the subunit currently being processed, the previous The frame video frame is taken as the first video frame filtered out, and the subsequent frames in the sub-unit are The video frame is used as the filtered second video frame.
[0110] S103-3-2: Invert the subcodes corresponding to the first video frames in sequence according to the frame order of the first video frames to obtain a first watermark corresponding to the frame sequence;
[0111] S103-3-3: According to the frame sequence of the second video frame, the sub-codes corresponding to the second video frame are sequentially inverted to obtain a second watermark corresponding to the frame sequence.
[0112] Here, the frame sequence of the first video frame and the second video frame is the time sequence of each first video frame and each second video frame.
[0113] In specific implementation, the sub-codes of each first video frame can be inverted frame by frame according to the timing of the first video frame to obtain the first watermark corresponding to the sub-unit; at the same time, the sub-codes of each second video frame can be inverted frame by frame according to the timing of the second video frame to obtain the second watermark corresponding to the sub-unit.
[0114] In this way, since the first watermark and the second watermark are watermarks obtained by inverting them, it can be guaranteed that after the watermarked video to which the watermark to be embedded is added is subjected to a multi-video based pixel median transformation operation, there must be at least one sub-unit in the multiple sub-units in each frame sequence, and the watermark code corresponding to the sub-unit is the original watermark code located between the first watermark and the second watermark. Therefore, when watermark extraction is performed on the video after the content transformation, the original watermark to be embedded in the video can be accurately extracted, and then the leakage party corresponding to the video can be accurately determined, thereby achieving the purpose of video leakage detection.
[0115] S104: According to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit, a target watermark is added to each subunit to obtain a watermarked video corresponding to the original video; the target watermark is one of the first watermark, the second watermark, and the watermark code.
[0116] Here, a target watermark can be determined for each subunit. The target watermark can be one of the first watermark, second watermark, or watermark code corresponding to the subunit. One original video corresponds to one watermarked video. The watermarked video is obtained by adding the corresponding watermark to the original video. For example, the original videos include 1 to 4, and the watermarks corresponding to the watermarks to be embedded are identified as watermark IDs 1 to 4. Finally, watermarked videos 1 to 4 can be obtained, where watermark ID 1 is embedded in watermarked video 1, watermark ID 2 is embedded in watermarked video 2, watermark ID 3 is embedded in watermarked video 3, and watermark ID 4 is embedded in watermarked video 4.
[0117] In a specific implementation, for each original video, the subunits in each frame sequence that need to be watermarked can be determined based on the video number of the original video and the first number of each watermark unit. Simultaneously, the subunits that need to be watermarked can be determined based on the second number of the subunits in each watermark unit and the video number of the original video. Finally, the second watermark can be added to the subunits of the original video except for the subunits to which the first watermark and the subunits to which the watermark is added. In this way, the corresponding target watermark can be added to each subunit in the original video, ultimately obtaining a watermarked video that is successfully embedded with the intended watermark.
[0118] In this way, dividing the original video based on the first number of original video frames and the second number of video frames corresponding to the watermark codes not only allows the video frames to be divided according to their time sequence, achieving a correspondence between one watermark code and one frame sequence, but also effectively increases the number of video frames corresponding to each watermark code, thereby enriching the number of video frames representing each watermark code. The more video frames a watermark code corresponds to, the more reference information is available, and the higher the success rate and accuracy of extracting the watermark code after the watermarked video is subjected to a content transformation operation. Therefore, by increasing the number of video frames corresponding to a watermark code, the accuracy and success rate of extracting the original watermark to be embedded from the transformed video after the watermarked video is subjected to a content transformation operation can be improved. Furthermore, by utilizing the individual watermark codes in the actual watermark to be embedded, the first and second watermarks corresponding to each frame sequence are determined and added to the original video. This allows the first and second watermarks to protect the original watermark to be embedded, thereby further improving the accuracy and success rate of extracting the original watermark to be embedded after the watermarked video is subjected to a content transformation operation. Based on the watermark embedding method provided in the embodiment of the present disclosure, watermark embedding can effectively improve the security and reliability of the embedded video watermark (especially the watermark reliability under the pixel median transform operation based on multiple videos), effectively prevent the watermark from being easily changed or removed, resulting in the inability to identify the ownership of the video, and increase the security of the watermarked video after the watermark is embedded. Furthermore, based on the security and reliability of the watermark, effective detection of the ownership of the content of digital products can be achieved.
[0119] As shown in FIG2 , a specific implementation flow chart of a watermark embedding method provided by an embodiment of the present disclosure may include the following steps:
[0120] S201: Obtain K original videos.
[0121] S202: Obtain the video number corresponding to each original video and the watermark to be embedded.
[0122] S203: Determine the number of video frames corresponding to each frame sequence according to the value of K and the second number of video frames corresponding to one watermark code in the watermark to be embedded.
[0123] The number of continuous video frames included in each frame sequence is K*K*n frames.
[0124] S204: For each original video, after each frame sequence is obtained by division, each watermark unit is determined according to the value of K.
[0125] S205: For each watermark unit, divide each sub-unit according to the value of K and the second number.
[0126] S206: For each frame sequence, determine a first watermark according to a first video frame filtered out from any subunit of the frame sequence.
[0127] S207: Determine a second watermark according to the second video frame selected from the sub-unit.
[0128] Here, there is no strict execution order between S206 and S207, and they can be executed synchronously or asynchronously.
[0129] S208: Add a target watermark to each sub-unit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the sub-unit in each watermark unit to obtain a watermarked video corresponding to the original video.
[0130] Regarding the specific implementation steps of S201 to S208 above, reference may be made to the above embodiments and will not be repeated here.
[0131] FIG3 is a schematic diagram of watermark encoding for four original videos provided by an embodiment of the present disclosure. A frame sequence of each original video (i.e., videos 1 to 4) corresponds to four watermark units, but FIG3 shows only two watermark units as an example. Each watermark unit includes four subunits, each of which has a corresponding target watermark. The specific implementation steps of S104 described above will be described in detail below with reference to FIG3:
[0132] S104-1: For any target watermark unit in any frame sequence, determine whether the target first number of the target watermark unit is consistent with the video number of the original video.
[0133] Here, the target watermark unit is a watermark unit in the frame sequence that currently needs to be embedded with a watermark, and the target first number is the first number corresponding to the target watermark unit in the frame sequence to which it belongs.
[0134] In a specific implementation, for any original video currently being watermarked, it is first determined whether the corresponding target watermark is embedded in each frame sequence corresponding to the original video. If so, it can be determined that the corresponding watermark to be embedded has been successfully embedded in the original video, and the watermarked video corresponding to the original video can be obtained. If not, when adding a watermark to any target watermark unit in any frame sequence of the original video, the watermark code corresponding to the frame sequence can be obtained. In addition, it can be determined whether the target first number of the target watermark unit is equal to the video number of the original video.
[0135] S104-2: If yes, encode the watermark corresponding to the frame sequence, determine it as the target watermark corresponding to each sub-unit in the target watermark unit, and add it.
[0136] Here, when the target first number of the target watermark unit is equal to the video number of the original video, the watermark code corresponding to the frame sequence to which the target watermark unit belongs can be added as the target watermark corresponding to each subunit in the target watermark unit.
[0137] For example, for video 1, the watermark code corresponding to frame sequence 1 can be added to each subunit of watermark unit 1 in the first frame sequence of video 1; the watermark code corresponding to frame sequence 2 can be added to each subunit of watermark unit 1 in the second frame sequence of video 1; the watermark code corresponding to frame sequence 3 can be added to each subunit of watermark unit 1 in the third frame sequence of video 1, and so on, ..., ultimately achieving the addition of corresponding target watermarks to the subunits in watermark unit 1 in each frame sequence.
[0138] For example, in Figure 3, the watermark code corresponding to the first frame sequence of video 1 is watermark code 1, the watermark code corresponding to the first frame sequence of video 2 is watermark code 2, the watermark code corresponding to the first frame sequence of video 3 is watermark code 3, and the watermark code corresponding to the first frame sequence of video 4 is watermark code 4. The values corresponding to watermark codes 1-4 are binary codes 0 or 1. When adding a target watermark to the first frame sequence of video 1, it can be determined that the unit number of watermark unit 1 is consistent with the video number of video 1. In this case, watermark code 1 can be used as the target watermark for each subunit in watermark unit 1 and added. Similarly, watermark code 2 can be added to each subunit in watermark unit 2 in the first frame sequence of video 2 (as shown in Figure 3), watermark code 3 can be added to each subunit in watermark unit 3 in the first frame sequence of video 3 (not shown in Figure 3), and watermark code 4 can be added to each subunit in watermark unit 4 in the first frame sequence of video 4 (also not shown in Figure 3).
[0139] In another embodiment, when the target first number is inconsistent with the video number of the original video, the target sub-unit whose second number is consistent with the video number can be screened out from the sub-units included in the target watermark unit. Then, the first watermark corresponding to the frame sequence to which the target sub-unit belongs can be determined as the target watermark corresponding to the target sub-unit and added.
[0140] Taking the target watermark unit as watermark unit 2 corresponding to video 1 in Figure 3 as an example, if the video numbers of watermark unit 2 and video 1 are inconsistent, the watermark code corresponding to the first frame sequence cannot be used as the target watermark for each sub-unit in watermark unit 2. In this case, it is still necessary to continue to determine the target watermark corresponding to each sub-unit in watermark unit 2. Therefore, sub-unit 1, which is the second number 1 in watermark unit 2, can be used as the target sub-unit.
[0141] Then, the first watermark 1 corresponding to the first frame sequence of video 1 can be obtained. Optionally, the first watermark and the second watermark corresponding to the target subunit can be directly determined based on the first video frame and the second video frame selected from the target subunit. Here, whether the first watermark corresponding to the obtained first frame sequence or the first watermark directly calculated is the same watermark, because the watermark code corresponding to a frame sequence is consistent with the watermark code corresponding to each subunit in the frame sequence. Finally, the first watermark 1 can be used as the target watermark of the target subunit and added.
[0142] Furthermore, after the target sub-units are screened, the second watermark corresponding to the frame sequence to which the target sub-unit belongs can be determined as the target watermark corresponding to the sub-units other than the target sub-unit in the target watermark unit and added. That is, after determining the sub-units in a frame sequence to which the watermark encoding corresponding to the frame sequence needs to be added and the target sub-units to which the first watermark corresponding to the frame sequence needs to be added, the second watermark corresponding to the frame sequence can be determined as the target watermark for the remaining sub-units in the frame sequence and added.
[0143] For example, after sub-unit 1, numbered second 1, in watermark unit 2 corresponding to video 1 in FIG3 is used as the target sub-unit, it is necessary to determine target watermarks other than the target sub-unit in watermark unit 2. In this case, the second watermark 1 corresponding to the first frame sequence can be obtained, and then the second watermark can be used as the target watermark other than the target sub-unit in watermark unit 2 and added.
[0144] For another example, in Figure 3, the target watermark of subunit 2 in watermark unit 1 of video 2 is the first watermark 2 corresponding to the first frame sequence; the target watermarks of the other subunits in watermark unit 1 are the second watermark 2 corresponding to the first frame sequence. The target watermark of subunit 3 in watermark unit 1 of video 3 is the first watermark 3 corresponding to the first frame sequence, and the target watermark of subunit 3 in watermark unit 2 is also the first watermark 3 corresponding to the first frame sequence; the target watermarks of the other subunits in watermark unit 1 and watermark unit 2 are the second watermark 3 corresponding to the first frame sequence. The target watermark of subunit 4 in watermark unit 1 of video 4 is the first watermark 4 corresponding to the first frame sequence, and the target watermark of subunit 4 in watermark unit 2 is also the first watermark 4 corresponding to the first frame sequence; the target watermarks of the other subunits in watermark unit 1 and watermark unit 2 are the second watermark 4 corresponding to the first frame sequence.
[0145] Furthermore, after adding the corresponding target watermark to each sub-unit in the target watermark unit, it is possible to further determine whether there are other watermark units in the frame sequence that have not been watermarked. If not, the process returns to determine whether the corresponding target watermarks are embedded in each frame sequence corresponding to the original video. If so, the watermark embedding method provided in the above embodiments can be continued to add corresponding target watermarks to other watermark units until the corresponding target watermarks are added to the sub-units in each watermark unit in the frame sequence, and the process returns to determine whether the corresponding target watermarks are embedded in each frame sequence corresponding to the original video.
[0146] In this way, for each frame sequence, by arranging the three codes, namely the watermark code, the first watermark and the second watermark, corresponding to the frame sequence in each sub-unit in the frame sequence, it is possible to ensure that the watermark code can be extracted as the median after the watermark video is subjected to the pixel median transformation operation based on multiple videos, thereby achieving accurate extraction of each original watermark in the video after the content transformation.
[0147] As shown in FIG4 , a specific implementation flow chart of adding a target watermark provided by an embodiment of the present disclosure may include the following steps:
[0148] Start watermark embedding.
[0149] S401: Determine whether each frame sequence corresponding to the original video is embedded with the corresponding target watermark.
[0150] If yes, the watermark embedding is terminated and the watermarked video corresponding to the original video is obtained; if no, the following S402 is executed.
[0151] S402: For any target watermark unit in any frame sequence, determine whether the target first number of the target watermark unit is consistent with the video number of the original video.
[0152] If so, execute the following S403; if not, execute the following S404 to S406.
[0153] S403: Encode the watermark corresponding to the frame sequence and add it as the target watermark of each sub-unit in the target watermark unit, and then execute the following S407.
[0154] S404: Filter out the target sub-units whose second numbers are consistent with the video numbers from the sub-units included in the target watermark unit.
[0155] S405: Determine the first watermark corresponding to the frame sequence as the target watermark corresponding to the target sub-unit and add it.
[0156] S406: Determine the second watermark corresponding to the frame sequence as the target watermark corresponding to the sub-unit other than the target sub-unit in the target watermark unit and add the second watermark.
[0157] S407: Determine whether there are other watermark units without watermark added in the frame sequence.
[0158] If so, the process returns to step S402 until all sub-units in each watermark unit in the frame sequence are added with the corresponding target watermark, and then returns to determine whether all frame sequences corresponding to the original video are embedded with the corresponding target watermark.
[0159] If not, the process returns to S401 to determine whether each frame sequence corresponding to the original video is embedded with the corresponding target watermark, until the watermark embedding is completed to obtain the watermarked video corresponding to the original video.
[0160] Regarding the specific implementation steps of S401 to S407 above, reference may be made to the above embodiments and will not be repeated here.
[0161] In one embodiment, the present disclosure also provides a watermark extraction method that matches the watermark embedding method provided in the above embodiments. This watermark extraction method can be used to extract watermarks from videos that have been watermarked using the watermark embedding methods provided in the above embodiments. As shown in Figure 5, a flow chart of a watermark extraction method provided in the present disclosure may include the following steps:
[0162] S501: Obtain the target video from which the watermark is to be extracted.
[0163] In specific implementation, for any video obtained on the video platform, after obtaining the video, the similarity between the video and the copyright holder's video can be calculated. If the similarity is greater than a preset threshold, if the provider of the video is inconsistent with the copyright holder, it means that the video may be an infringing video and can be determined as the target video to be watermarked. It is necessary to use the following steps S502 to S504 to extract the watermark from the target video. If the watermark can be extracted, the extracted watermark can be used to determine the video leaker of the target video.
[0164] S502: Divide the target video according to the third quantity and the fourth quantity to obtain frame sequences to be extracted corresponding to the target video; the third quantity is the number of original videos used when the target video is embedded with the target video watermark, and the fourth quantity is the number of video frames corresponding to the watermark encoding in the target video watermark; the frame sequence to be extracted includes the third number of watermark units to be extracted, the watermark unit to be extracted includes the third number of sub-units to be extracted; and the sub-units to be extracted include the fourth number of continuous video frames.
[0165] Here, the target video watermark is the watermark included in the target video, which may include one or more watermarks. Exemplarily, when the target video is a video embedded with a watermark using the above-mentioned watermark embedding method, the third number may be the number of original videos used when embedding the target video watermark in the target video, and the fourth number may be the number of consecutive video frames corresponding to one watermark encoding. For example, when the target video is a video obtained by performing a multi-video pixel median transformation operation using the above-mentioned watermark videos 1, 2, and 3, the third number may be equal to the above-mentioned first number, the fourth number may be equal to the above-mentioned second number, and the target video watermark in the target video may include watermark IDs 1 to 3.
[0166] Optionally, the third number can be predetermined based on the number of original videos used when watermarking the copyright holder's video. For example, if four original videos are used when watermarking any video of copyright holder 1, a mapping relationship between the copyright holder and the number of original videos (4) can be established. If it is determined that the similarity between the target video and the copyright holder's video is greater than a preset threshold, the number 4 can be determined as the third number based on the mapping relationship corresponding to the copyright holder. The fourth number can be predetermined based on the number of consecutive video frames corresponding to one watermark bit.
[0167] The frame sequence to be extracted is a frame sequence obtained by dividing the target video, the watermark unit to be extracted is a watermark unit included in the frame sequence to be extracted, and the subunit to be extracted is a subunit included in the watermark unit to be extracted. One frame sequence to be extracted includes the third number of watermark units to be extracted, one watermark unit to be extracted includes the third number of subunits to be extracted, and each subunit to be extracted includes a fourth number of consecutive video frames in the target video.
[0168] During specific implementation, the specific steps of dividing the target video according to the third number and the fourth number may refer to the above S102 and will not be repeated here.
[0169] S503: For any sub-unit to be extracted in any watermark unit to be extracted, determine the sub-unit watermark corresponding to the sub-unit to be extracted according to the pixel values of each video frame in the sub-unit to be extracted.
[0170] Here, the sub-unit watermark is the watermark extracted from the sub-unit to be extracted.
[0171] In specific implementation, since pixel values are encoded regularly within a frame, the sub-unit watermark that can be extracted from the sub-unit to be extracted can be determined based on the regularity of pixel values of each video frame in the sub-unit to be extracted.
[0172] S504: extracting each target video watermark corresponding to the target video according to the unit number of each to-be-extracted watermark unit in each to-be-extracted frame sequence, the sub-unit watermark corresponding to each to-be-extracted sub-unit, and the watermark type.
[0173] Here, the watermark type may specifically include a preset type (also called a guard type) and a target type, wherein the preset type watermark may be the first watermark and the second watermark, and the target type watermark is the watermark code corresponding to the frame sequence.
[0174] In specific implementation, after obtaining the sub-unit watermarks corresponding to each sub-unit to be extracted, the watermark units to be extracted with the same unit number can be determined from each frame sequence to be extracted, and these watermark units to be extracted can be regarded as a watermark unit group. For each watermark unit group, the target sub-unit watermark of the target type can be determined from each sub-unit to be extracted according to the watermark type of the sub-unit watermark corresponding to each sub-unit to be extracted included in the watermark unit group. According to each target sub-unit watermark, the target watermark code corresponding to each watermark unit to be extracted in the watermark unit group is determined. Finally, according to the time sequence of each watermark unit to be extracted in the watermark unit group, the target video watermark corresponding to the watermark unit group can be determined according to the target watermark code corresponding to each watermark unit to be extracted. It should be noted that the target video watermark corresponding to a watermark unit group can be empty.
[0175] Thus, after acquiring the target video, the original video is segmented using the third number of original video frames used to embed the target video watermark and the fourth number of video frames corresponding to the watermark encoding, thereby accurately segmenting the target video's frame sequences. By utilizing the regularity of the pixel values of each video frame within the sub-unit to be extracted within the frame sequence, the sub-unit watermarks and watermark types included in the sub-unit to be extracted can be accurately determined. Finally, using the unit number, sub-unit watermark, and watermark type of each watermark unit to be extracted, the original target video watermarks included in the target video can be accurately restored. Furthermore, based on the video provider corresponding to the restored target video watermark, the video leaker can be accurately located, achieving the purpose of video leak detection.
[0176] In one embodiment, the above S504 may be implemented according to the following sub-steps:
[0177] Sub-step 1: filtering out sub-unit watermarks of a preset type according to the watermark type of the sub-unit watermark corresponding to each sub-unit to be extracted.
[0178] In a specific implementation, after determining the sub-unit watermarks corresponding to the sub-units to be extracted, sub-unit watermarks of a preset type may be filtered out, so that sub-unit watermarks of the target type may be retained.
[0179] Sub-step 2: for any watermark unit to be extracted, determine the target watermark code corresponding to the watermark unit to be extracted according to the filtered sub-unit watermarks included in the watermark unit to be extracted.
[0180] Here, the filtered sub-unit watermark is the retained watermark of the target type.
[0181] In a specific implementation, for any watermark unit to be extracted, if the filtered sub-unit watermark included in the watermark unit to be extracted is only one, the filtered sub-unit watermark can be directly used as the target watermark code corresponding to the watermark unit to be extracted. Conversely, if the filtered sub-unit watermark included in the watermark unit to be extracted is multiple, the most sub-unit watermark among the multiple sub-unit watermarks can be used as the target watermark code corresponding to the watermark unit to be extracted. The most sub-unit watermark is the watermark with the largest number of sub-unit watermarks.
[0182] In this way, since the first watermark and the second watermark of the preset type try their best to ensure the distinguishability from the watermark coding of the target type in coding, and try their best to ensure that the watermark type of the currently extracted sub-unit watermark can be accurately determined during extraction in terms of coding distance, based on the determined watermark type of each sub-unit watermark, the target watermark coding of the target type corresponding to each watermark unit to be extracted can be determined.
[0183] Sub-step three: extracting each target video watermark corresponding to the target video according to the unit number corresponding to each watermark unit to be extracted and the target watermark code.
[0184] Here, the target video watermark extracted from the target video can be a watermark embedded using the watermark embedding method provided by the embodiment of the present disclosure. After extracting each target video watermark from the target video, it can be determined whether the target video is an infringing video based on whether the target video watermark is consistent with the copyright holder's watermark.
[0185] Moreover, when there are multiple target video watermarks extracted from the target video, not only can the target video be described as the video obtained by performing the multi-video based pixel median transformation operation on the watermark video in which each target video watermark is respectively embedded, but also when it is determined that the target video is an infringing video, the number of videos participating in the multi-video based pixel median transformation operation can be determined according to the number of target video watermarks.
[0186] In a specific implementation, the watermark unit group corresponding to the same unit number can be determined based on the unit number corresponding to each watermark unit to be extracted. According to the time sequence of the video frames included in each watermark unit to be extracted in each watermark unit group, the target watermark codes in each watermark unit group are sorted to obtain the watermark to be embedded corresponding to the watermark unit group, and the watermark to be embedded is used as a watermark to be embedded extracted from the target video. In this way, by dividing each watermark unit group and the target watermark codes corresponding to the watermark units to be extracted in each watermark unit group, each target video watermark can be accurately extracted from the target video. Then, when it is determined that the target video watermark is consistent with the copyright holder's watermark, it can be said that the target video is a video used infringingly. Otherwise, it means that the target video is only similar to the copyright holder's video and is not necessarily a video used infringingly.
[0187] In this way, by embedding the first watermark, the second watermark and the original watermark code together, the accuracy and success rate of the original watermark extracted from the watermarked video can be improved after the pixel median transformation operation based on multiple videos is performed.
[0188] Exemplarily, the target video may be a video obtained by performing a multi-video based pixel median transformation operation on at least part of the multiple watermark videos obtained by the watermark embedding method provided by the embodiment of the present disclosure. The target video is the video from which the target video watermark is to be extracted, and the target video watermark may be the watermark respectively included in each watermark video participating in the multi-video based pixel median transformation operation. Exemplarily, the watermark to be embedded in watermark video 1 is watermark ID1, the watermark to be embedded in watermark video 2 is watermark ID2, and the watermark to be embedded in watermark video 3 is watermark ID3. After the target video is obtained by participating in the multi-video based pixel median transformation operation using watermark videos 1 to 3, the target video watermark corresponding to the target video is watermark ID1 to 3.
[0189] As shown in FIG6 , a specific implementation flow chart of extracting a target video watermark corresponding to a target video provided by an embodiment of the present disclosure may include the following steps:
[0190] S601: Acquire a target video.
[0191] Here, if the similarity between the target video and the copyright holder's video is greater than a preset threshold, it can be explained that the target video may be a video subjected to a pixel median transformation operation based on multiple videos, and the following S602 to S606 can be used for specific judgment.
[0192] S602: Divide the target video into frame sequences according to the third quantity and the fourth quantity to obtain frame sequences to be extracted, watermark units to be extracted, and sub-units to be extracted.
[0193] Specifically, this step may refer to the above S502.
[0194] S603: Extract the sub-unit watermark corresponding to each sub-unit to be extracted.
[0195] S604: Filter out sub-unit watermarks of a preset type.
[0196] S605: Determine the target watermark code corresponding to the watermark unit to be extracted according to the filtered sub-unit watermarks included in the watermark unit to be extracted.
[0197] S606: extracting each target video watermark corresponding to the target video according to the unit number corresponding to each to-be-extracted watermark unit and the target watermark code.
[0198] Regarding the specific implementation steps of S601 to S606 above, reference may be made to the above embodiments and will not be repeated here.
[0199] FIG7 is a flow chart showing an implementation of a watermark embedding and extraction method provided by an embodiment of the present disclosure, which may include the following steps:
[0200] Obtain the original video, and according to the watermark embedding method provided in the embodiment of the present disclosure, embed the corresponding watermark to be embedded into multiple original videos respectively, and obtain the watermark video corresponding to each original video. In Figure 7, the watermark to be embedded may include watermark ID1, watermark ID2 and watermark ID3, and the obtained watermark videos correspond to watermark videos 1 to 3. Afterwards, perform a pixel median transformation operation based on multiple videos using watermark videos 1 to 3 to obtain the target video after content transformation. Finally, the watermark extraction method provided in the embodiment of the present disclosure can be used to perform a watermark extraction operation to extract each target video watermark (i.e., watermark ID1, watermark ID2 and watermark ID3) from the target video, that is, according to the method of steps S501 to S504 above, perform watermark extraction on the target video to obtain each target video watermark corresponding to the target video.
[0201] Thus, because the watermark embedding method provided by the embodiment of the present disclosure has good robustness, after the video is subjected to the multi-video-based pixel median transformation operation, the watermark ID that participated in the multi-video-based pixel median transformation operation can be accurately extracted from the video after the content transformation, thereby achieving the purpose of video leakage detection. As shown in Table 1 below, after the watermark is embedded using the watermark embedding method provided by the embodiment of the present disclosure, a portion of the watermark video is randomly selected to perform the multi-video-based pixel median transformation operation, and then the watermark extraction method provided by the embodiment of the present disclosure is used to extract the watermark from the content-transformed video.
[0202] (Table 1)
[0203] Based on the above Table 1, it can be seen that when the number of videos participating in the pixel median transformation operation based on multiple videos is less than or equal to the number of watermarked videos, the watermarked video obtained after embedding the watermark using the watermark embedding method provided by the embodiment of the present disclosure will not be easily changed or removed under the pixel median transformation operation based on multiple videos, and the security of the watermarked video is guaranteed.
[0204] Those skilled in the art will understand that in the above-mentioned method of the specific implementation method, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0205] Based on the same inventive concept, the embodiment of the present disclosure also provides a watermark embedding device corresponding to the watermark embedding method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned watermark embedding method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0206] FIG8 is a schematic diagram of a watermark embedding device provided by an embodiment of the present disclosure, including:
[0207] The first acquisition module 801 is configured to acquire multiple original videos corresponding to the same video content, as well as a video number corresponding to each of the original videos and a watermark to be embedded; the watermark to be embedded includes at least one watermark code;
[0208] A first division module 802 is configured to divide any of the original videos according to a first number of the original videos and a second number of video frames corresponding to the watermark codes in the watermark to be embedded, to obtain frame sequences of the original video; the frame sequence includes a first number of watermark units, each of which includes a first number of subunits, each of which includes the second number of consecutive video frames;
[0209] a first determining module 803 configured to assign a watermark code to each frame sequence according to a time sequence of each frame sequence and an order of each watermark code, and determine a first watermark and a second watermark corresponding to each frame sequence according to the watermark code assigned to each frame sequence;
[0210] The adding module 804 is used to add a target watermark to each subunit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit to obtain a watermarked video corresponding to the original video; the target watermark is one of the first watermark, the second watermark, and the watermark code.
[0211] In a possible implementation manner, the first determining module 803, when determining the first watermark and the second watermark corresponding to each of the frame sequences according to the watermark codes respectively assigned to the frame sequences, is configured to:
[0212] For any of the frame sequences, determining the watermark code corresponding to each of the subunits in the frame sequence according to the watermark code assigned to the frame sequence;
[0213] Determining, according to the watermark code corresponding to any of the subunits, a subcode corresponding to each of the video frames in the subunits;
[0214] According to the sub-code corresponding to each of the video frames in the sub-unit, a first watermark and a second watermark corresponding to the frame sequence are determined.
[0215] In a possible implementation, the first determining module 803, when determining the first watermark and the second watermark corresponding to the frame sequence according to the sub-code corresponding to each video frame in the sub-unit, is configured to:
[0216] Filtering at least one first video frame and at least one second video frame from the video frames in the subunit using the second number and a preset filtering method;
[0217] According to the frame order of the first video frames, the subcodes corresponding to the first video frames are sequentially inverted to obtain a first watermark corresponding to the frame sequence;
[0218] According to the frame sequence of the second video frames, the subcodes corresponding to the second video frames are sequentially inverted to obtain a second watermark corresponding to the frame sequence.
[0219] In a possible implementation, the adding module 804, when adding the target watermark to each subunit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit, is configured to:
[0220] For any target watermark unit in any frame sequence, determining whether a target first number of the target watermark unit is consistent with a video number of the original video;
[0221] If so, the watermark corresponding to the frame sequence is encoded, determined as the target watermark corresponding to each subunit in the target watermark unit, and added.
[0222] In a possible implementation, the adding module 804 is further configured to:
[0223] In a case where the target first number is inconsistent with the video number of the original video, selecting a target subunit whose second number is consistent with the video number from the subunits included in the target watermark unit;
[0224] The first watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the target subunit and added.
[0225] In a possible implementation, after filtering out the target subunit whose second number is consistent with the video number, the adding module 804 is further configured to:
[0226] The second watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the subunits other than the target subunit in the target watermark unit and is added.
[0227] Based on the same inventive concept, the embodiment of the present disclosure also provides a watermark extraction device corresponding to the watermark extraction method. Since the principle of solving the problem by the device in the embodiment of the present disclosure is similar to the above-mentioned watermark extraction method in the embodiment of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0228] FIG9 is a schematic diagram of a watermark extraction device provided by an embodiment of the present disclosure, including:
[0229] The second acquisition module 901 is used to acquire the target video to be watermarked;
[0230] The second division module 902 is configured to divide the target video according to a third number and a fourth number to obtain respective frame sequences to be extracted corresponding to the target video; the third number is the number of original videos used when embedding the target video watermark in the target video, and the fourth number is the number of video frames corresponding to the watermark encoding in the target video watermark; the frame sequences to be extracted include a third number of watermark units to be extracted, each watermark unit to be extracted includes a third number of sub-units to be extracted, and each sub-unit to be extracted includes a fourth number of consecutive video frames;
[0231] The second determining module 903 is configured to determine, for any of the sub-units to be extracted in any of the watermark units to be extracted, a sub-unit watermark corresponding to the sub-unit to be extracted according to the pixel values of each video frame in the sub-unit to be extracted;
[0232] The extraction module 904 is configured to extract target video watermarks corresponding to the target video according to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the sub-unit watermark corresponding to each sub-unit to be extracted, and the watermark type.
[0233] In a possible implementation, the extraction module 904, when extracting each target video watermark corresponding to the target video according to the unit number of each to-be-extracted watermark unit in each to-be-extracted frame sequence, the sub-unit watermark corresponding to each to-be-extracted sub-unit, and the watermark type, is configured to:
[0234] filtering out the sub-unit watermarks of a preset type according to the watermark type of the sub-unit watermarks corresponding to the sub-units to be extracted;
[0235] For any of the watermark units to be extracted, determining a target watermark code corresponding to the watermark unit to be extracted according to the filtered sub-unit watermarks included in the watermark unit to be extracted;
[0236] According to the unit number and target watermark code corresponding to each watermark unit to be extracted, each target video watermark corresponding to the target video is extracted.
[0237] For descriptions of the processing flow of each module in the device and the interaction flow between each module, reference can be made to the relevant descriptions in the above method embodiment, which will not be described in detail here.
[0238] Based on the same technical concept, the present disclosure also provides an electronic device. Referring to FIG10 , there is shown a schematic diagram of the structure of an electronic device provided by the present disclosure, including:
[0239] Processor 1001, memory 1002 and bus 1003. Memory 1002 stores machine-readable instructions executable by processor 1001, and processor 1001 is configured to execute the machine-readable instructions stored in memory 1002. When the machine-readable instructions are executed by processor 1001, processor 1001 performs the following steps: S101: Acquire multiple original videos corresponding to the same video content, and video numbers and watermarks to be embedded corresponding to each original video; the watermark to be embedded includes at least one watermark code; S102: For any original video, based on a first number of original videos and a second number of video frames corresponding to the watermark code in the watermark to be embedded, The original video is divided to obtain each frame sequence of the original video; the frame sequence includes a first number of watermark units, the watermark unit includes a first number of subunits, and the subunit includes a second number of continuous video frames; S103: according to the time sequence of each frame sequence and the order of each watermark code, a watermark code is assigned to each frame sequence, and according to the watermark code assigned to each frame sequence, a first watermark and a second watermark corresponding to each frame sequence are determined; and S104: according to the video number of the original video, the first number of each watermark unit in each frame sequence and the second number of the subunit in each watermark unit, Each sub-unit adds a target watermark to obtain a watermarked video corresponding to the original video; the target watermark is one of the first watermark, the second watermark, and the watermark code; or, when the machine-readable instruction is executed by the processor 1001, the processor 1001 performs the following steps: S501: obtaining a target video to be watermarked; S502: dividing the target video according to the third number and the fourth number to obtain each frame sequence to be extracted corresponding to the target video; the third number is the number of the original video used when the target video is embedded with the target video watermark, and the fourth number is the number of video frames corresponding to the watermark code in the target video watermark the frame sequence to be extracted includes a third number of watermark units to be extracted, the watermark unit to be extracted includes a third number of sub-units to be extracted; the sub-units to be extracted include a fourth number of continuous video frames; S503: for any sub-unit to be extracted in any watermark unit to be extracted, determining the sub-unit watermark corresponding to the sub-unit to be extracted according to the pixel values of each video frame in the sub-unit to be extracted; and S504: extracting each target video watermark corresponding to the target video according to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the sub-unit watermark corresponding to each sub-unit to be extracted, and the watermark type.
[0240] The above-mentioned memory 1002 includes internal memory 1021 and external memory 1022; the memory 1021 here is also called internal memory, which is used to temporarily store the calculation data in the processor 1001, as well as the data exchanged with the external memory 1022 such as the hard disk. The processor 1001 exchanges data with the external memory 1022 through the memory 1021. When the electronic device is running, the processor 1001 and the memory 1002 communicate through the bus 1003, so that the processor 1001 executes the execution instructions mentioned in the above method embodiment.
[0241] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the computer program executes the steps of the watermark embedding or watermark extraction method described in the above method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0242] The computer program product of the watermark embedding method provided in the embodiments of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the watermark embedding or watermark extraction method described in the above method embodiments. For details, please refer to the above method embodiments and will not be repeated here.
[0243] The computer program product may be implemented in hardware, software, or a combination thereof. In one embodiment, the computer program product is implemented as a computer storage medium. In another embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0244] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0245] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0246] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0247] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the known technology, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0248] If the technical solution disclosed herein involves personal information, the product applying the technical solution disclosed herein has clearly informed the individual of the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution disclosed herein involves sensitive personal information, the product applying the technical solution disclosed herein has obtained the individual's separate consent before processing the sensitive personal information and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, a clear and prominent sign is set to inform that the individual has entered the personal information collection scope and that personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that they agree to the collection of their personal information; or on the personal information processing device, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload their personal information. The personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
[0249] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The scope of protection of the present disclosure is not limited thereto. Although the present disclosure has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed in the present disclosure, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure shall be subject to the scope of protection of the claims.
Claims
1. A watermark embedding method, comprising: Acquire multiple original videos corresponding to the same video content and the video numbers and watermarks to be embedded corresponding to the original videos; The watermark to be embedded includes at least one watermark code; For any of the original videos, the original video is divided according to a first number of the original videos and a second number of video frames corresponding to the watermark codes in the watermark to be embedded, so as to obtain respective frame sequences of the original video; the frame sequence comprises a first number of watermark units, the watermark unit comprises a first number of sub-units, and the sub-units comprise the second number of continuous video frames; Allocating watermark codes to each of the frame sequences according to the time sequence of each of the frame sequences and the order of each of the watermark codes, and determining first watermarks and second watermarks corresponding to each of the frame sequences according to the watermark codes respectively allocated to each of the frame sequences; According to the video number of the original video, the first number of each watermark unit in each frame sequence and the second number of the subunit in each watermark unit, a target watermark is added to each subunit to obtain a watermark video corresponding to the original video; the target watermark is one of the first watermark, the second watermark and the watermark code.
2. The method according to claim 1, wherein: Determining the first watermark and the second watermark corresponding to each of the frame sequences according to the watermark codes respectively assigned to each of the frame sequences comprises: For any of the frame sequences, determining the watermark code corresponding to each of the subunits in the frame sequence according to the watermark code assigned to the frame sequence; Determine, according to the watermark code corresponding to any of the sub-units, a sub-code corresponding to each of the video frames in the sub-units; According to the sub-code corresponding to each of the video frames in the sub-unit, a first watermark and a second watermark corresponding to the frame sequence are determined.
3. The method according to claim 2, wherein: The determining, according to the sub-code corresponding to each of the video frames in the sub-units, the first watermark and the second watermark corresponding to the frame sequence comprises: Using the second number and a preset screening method, screening out at least one first video frame and at least one second video frame from the video frames in the subunit; According to the frame order of the first video frames, the subcodes corresponding to the first video frames are sequentially Inverting the frame sequence to obtain a first watermark corresponding to the frame sequence; According to the frame sequence of the second video frames, the subcodes corresponding to the second video frames are sequentially inverted to obtain a second watermark corresponding to the frame sequence.
4. The method according to any one of claims 1 to 3, wherein: The adding a target watermark to each of the sub-units according to the video number of the original video, the first number of each of the watermark units in each of the frame sequences, and the second number of the sub-units in each of the watermark units comprises: For any target watermark unit in any of the frame sequences, determining whether a target first number of the target watermark unit is consistent with a video number of the original video; If yes, the watermark corresponding to the frame sequence is encoded, determined as the target watermark corresponding to each sub-unit in the target watermark unit, and added.
5. The method according to claim 4, further comprising: In the case that the target first number is inconsistent with the video number of the original video, selecting a target subunit whose second number is consistent with the video number from the subunits included in the target watermark unit; The first watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the target subunit and added.
6. The method according to claim 5, wherein: After the target subunit with the second number being consistent with the video number is screened out, the method further includes: The second watermark corresponding to the frame sequence to which the target subunit belongs is determined as the target watermark corresponding to the subunit other than the target subunit in the target watermark unit and added.
7. A watermark extraction method, comprising: Get the target video to be watermarked; According to the third number and the fourth number, the target video is divided to obtain each frame sequence to be extracted corresponding to the target video; the third number is the number of original videos used when the target video is embedded with a target video watermark, and the fourth number is the number of video frames corresponding to the watermark encoding in the target video watermark; the frame sequence to be extracted includes a third number of watermark units to be extracted, the watermark unit to be extracted includes a third number of sub-units to be extracted; the sub-unit to be extracted includes a fourth number of continuous video frames; For any of the sub-units to be extracted in any of the watermark units to be extracted, the sub-unit watermark corresponding to the sub-unit to be extracted is determined according to the pixel values of each video frame in the sub-unit to be extracted. print; According to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the subunit watermark corresponding to each subunit to be extracted, and the watermark type, each target video watermark corresponding to the target video is extracted.
8. The method according to claim 7, characterized in that The step of extracting each target video watermark corresponding to the target video according to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the sub-unit watermark corresponding to each sub-unit to be extracted, and the watermark type comprises: According to the watermark type of the sub-unit watermark corresponding to each of the sub-units to be extracted, filtering out the sub-unit watermarks of a preset type; For any of the watermark units to be extracted, according to the filtered sub-unit watermarks included in the watermark unit to be extracted, determine the target watermark code corresponding to the watermark unit to be extracted; According to the unit number and the target watermark code corresponding to each watermark unit to be extracted, each target video watermark corresponding to the target video is extracted.
9. A watermark embedding device, comprising: A first acquisition module is used to acquire multiple original videos corresponding to the same video content and the video number and the watermark to be embedded corresponding to each of the original videos; The watermark to be embedded includes at least one watermark code; A first division module is used for dividing any of the original videos according to a first number of the original videos and a second number of video frames corresponding to the watermark code in the watermark to be embedded, so as to obtain respective frame sequences of the original video; the frame sequence comprises a first number of watermark units, the watermark unit comprises a first number of sub-units, and the sub-units comprise the second number of continuous video frames; A first determining module is used to assign watermark codes to each of the frame sequences according to the time sequence of each of the frame sequences and the order of each of the watermark codes, and determine the first watermark and the second watermark corresponding to each of the frame sequences according to the watermark codes assigned to each of the frame sequences; An adding module is used to add a target watermark to each subunit according to the video number of the original video, the first number of each watermark unit in each frame sequence, and the second number of the subunit in each watermark unit to obtain a watermark video corresponding to the original video; the target watermark is one of the first watermark, the second watermark and the watermark code.
10. A watermark extraction device, comprising: The second acquisition module is used to acquire the target video to be watermarked; The second division module is used to divide the target video according to a third number and a fourth number to obtain each frame sequence to be extracted corresponding to the target video; the third number is the number of original videos used when the target video is embedded with a target video watermark, and the fourth number is the number of video frames corresponding to the watermark encoding in the target video watermark; the frame sequence to be extracted includes a third number of watermark units to be extracted, the watermark unit to be extracted includes a third number of sub-units to be extracted; the sub-unit to be extracted includes a fourth number of continuous video frames; A second determination module is used to determine, for any of the sub-units to be extracted in any of the watermark units to be extracted, a sub-unit watermark corresponding to the sub-unit to be extracted according to the pixel values of each video frame in the sub-unit to be extracted; The extraction module is used to extract each target video watermark corresponding to the target video according to the unit number of each watermark unit to be extracted in each frame sequence to be extracted, the subunit watermark corresponding to each subunit to be extracted, and the watermark type.
11. An electronic device, comprising: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and the processor is used to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the watermark embedding method as described in any one of claims 1 to 6; or, the processor executes the steps of the watermark extraction method as described in claim 7 or 8.
12. A computer-readable storage medium, wherein: The computer-readable storage medium stores a computer program. When the computer program is executed by an electronic device, the electronic device executes the steps of the watermark embedding method as described in any one of claims 1 to 6; or, the electronic device executes the steps of the watermark extraction method as described in claim 7 or 8.
Citation Information
Patent Citations
Watermark embedding method and device, watermark extracting method and device, electronic equipment and storage medium
CN118870140A
Video watermark embedding method and device
CN103997652A
Method and equipment for adding and detection video watermark
CN109379642A
Video watermark adding and extracting method, device and apparatus
CN112040336A
Watermark processing method and device, electronic equipment and medium
CN115797138A
