Encoding method and decoding method of video watermark
By embedding watermark and location information in different channels of local image blocks in a video and using anchor point groups to mark the position, the problems of low efficiency and poor image quality in video watermarking coding are solved, achieving efficient coding and robust decoding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2026-03-03
Smart Images

Figure CN119484902B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video watermarking technology, and in particular to a video watermarking encoding and decoding method, apparatus, computer equipment, and computer-readable storage medium. Background Technology
[0002] With technological advancements, copyright infringement such as copying and altering video content has become easier. Various video platforms are rife with unauthorized reposting, secondary editing, and distribution of videos to other platforms, all of which harm the rights of content creators and video platforms. Protecting the legitimate interests of content creators and video platforms has become a major challenge, leading to the development of various video watermarking technologies, such as digital video watermarking. Video watermarking embeds a watermark into the video image, and once copyright infringement is discovered, the watermark information can be extracted from the video to achieve the goal of protecting rights.
[0003] However, due to the massive amount of video content on video platforms, the encoding and decoding efficiency of video watermarks is relatively low. Furthermore, because video watermarking technology struggles to maintain the image quality of the watermarked video, the resulting image quality is often poor.
[0004] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the Invention
[0005] This application provides a method, apparatus, computer device, and computer-readable storage medium for encoding and decoding video watermarks to solve or alleviate one or more of the technical problems mentioned above.
[0006] One aspect of this application provides a video watermark encoding method, the method comprising:
[0007] Obtain the target frame image of the video;
[0008] An image to be processed is extracted from the target frame image, wherein the image to be processed is a local image patch of the target frame image;
[0009] The image to be processed is decomposed into multiple channels; wherein the multiple channels include a first channel and a second channel.
[0010] The watermark information is embedded into the first channel to obtain a first channel containing the watermark information;
[0011] The location information is embedded into the second channel to obtain a second channel containing location information;
[0012] Based on the first channel containing watermark information and the second channel containing location information, a target image corresponding to the image to be processed is generated;
[0013] The target image is embedded into the target frame image to obtain a watermarked video.
[0014] Optionally, the location information includes anchor point information; correspondingly, embedding the location information into the second channel to obtain a second channel containing location information includes:
[0015] The positional information of the image to be processed is determined by the original anchor point group;
[0016] The original anchor point group includes multiple original anchor points, which are used to indicate the relative position of the image to be processed in the target frame image.
[0017] Optionally, a circular area is defined with the original anchor point as the center;
[0018] The circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors;
[0019] The value of the target sector is retained, and the values of the other sectors are set to fixed values;
[0020] The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
[0021] Optionally, there are four original anchor points, and the method further includes:
[0022] Determine the orientation of each of the original anchor points; and
[0023] Based on the location of each original anchor point, a corresponding target sector is selected for each original anchor point.
[0024] Optionally, the original anchor point is represented in the form of a Gaussian kernel.
[0025] Optionally, the original anchor points can be of different categories, including Gaussian kernels with different numerical distributions and different sectors.
[0026] Another aspect of this application provides a video watermark encoding method, the method comprising:
[0027] Obtain the target frame image of the video;
[0028] The target frame image is decomposed into multiple channels; wherein the multiple channels include a first channel and a second channel.
[0029] Extract a first image block from the first channel, where the first image block is a local image block in the layer corresponding to the first channel;
[0030] The watermark information is embedded into the first image block to obtain the first channel containing the watermark information;
[0031] A second image block is extracted from the second channel, and the second image block corresponds to the position of the first image block;
[0032] Position information is embedded into the second image block to obtain a second channel containing position information;
[0033] A target frame image with a watermark is generated based on the first channel containing watermark information and the second channel containing location information.
[0034] Another aspect of this application provides a method for decoding video watermarks, the method comprising:
[0035] The target frame image of the video is acquired. The target frame image has watermark information loaded in the first channel and position information loaded in the second channel.
[0036] The target frame image is decomposed into channels to obtain the first channel and the second channel;
[0037] The second channel is decoded to obtain location information, which includes anchor point group information;
[0038] Adjust the layer corresponding to the first channel based on the anchor point group information;
[0039] The adjusted layer is then watermarked to obtain the watermark information of the video.
[0040] Another aspect of this application provides a video watermark encoding apparatus, the apparatus comprising:
[0041] The acquisition module is used to acquire the target frame image of the video;
[0042] The cropping module is used to crop an image to be processed from the target frame image, wherein the image to be processed is a local image block of the target frame image;
[0043] The decomposition module is used to perform channel decomposition on the image to be processed to obtain multiple channels; wherein, the multiple channels include a first channel and a second channel;
[0044] The first embedding module is used to embed watermark information into the first channel to obtain a first channel containing watermark information;
[0045] The second embedding module is used to embed location information into the second channel to obtain a second channel containing location information;
[0046] The generation module is used to generate a target image corresponding to the image to be processed based on the first channel containing watermark information and the second channel containing location information;
[0047] The third embedding module is used to embed the target image into the target frame image to obtain a watermarked video.
[0048] Another aspect of this application provides a video watermark decoding apparatus, the apparatus comprising:
[0049] The acquisition module is used to acquire the target frame image of the video. The target frame image has watermark information loaded in the first channel and position information loaded in the second channel.
[0050] The decomposition module is used to perform channel decomposition on the target frame image to obtain the first channel and the second channel;
[0051] A decoding module is used to decode the second channel to obtain position information, the position information including anchor point group information;
[0052] The adjustment module is used to adjust the layer corresponding to the first channel according to the anchor point group information;
[0053] The watermark decoding module is used to decode the watermark on the adjusted layer to obtain the watermark information of the video.
[0054] Another aspect of this application provides a computer device, including:
[0055] At least one processor; and
[0056] A memory that is communicatively connected to the at least one processor;
[0057] Wherein: the memory stores instructions that can be executed by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method as described above.
[0058] Another aspect of this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method described above.
[0059] The embodiments of this application employing the above-described technical solution may have the following advantages:
[0060] A local image block (the image to be processed) is extracted from the target frame image of the video. This image is then decomposed into channels to obtain a first channel and a second channel. Watermark information is embedded into the first channel, resulting in a first channel containing watermark information. Simultaneously, position information is embedded into the second channel, resulting in a second channel containing position information. A target image is generated based on the first channel containing watermark information and the second channel containing position information. This target image is then embedded into the target frame image, thus obtaining a watermarked video. It is understood that this embodiment of the application, without changing the video resolution, can simultaneously embed watermark information and position information into different channels of a local image in the target frame image, without needing to embed watermark information and position information into the entire target frame image. This improves the efficiency of adding watermarks to videos (video watermark encoding) and reduces resource and computing power consumption. In other words, it can achieve efficient encoding of video watermarks and low computing power consumption while maintaining the video quality after watermarking. Attached Figure Description
[0061] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0062] Figure 1 The diagram illustrates the operating environment of the video watermarking encoding method according to Embodiment 1 of this application;
[0063] Figure 2 A flowchart illustrating a video watermarking encoding method according to Embodiment 1 of this application is shown schematically.
[0064] Figure 3 Schematic illustration Figure 2 Flowchart of the sub-steps in step S208;
[0065] Figure 4 Schematic illustration Figure 2 Flowchart of the sub-steps in step S208;
[0066] Figure 5 Schematic illustration Figure 2 Flowchart of the sub-steps in step S208;
[0067] Figure 6 Schematic illustration Figure 2 Flowchart of the sub-steps in step S208;
[0068] Figure 7 Schematic illustration Figure 2 Flowchart of the sub-steps in step S208;
[0069] Figure 8 This illustration shows a schematic diagram of channel decomposition of the image to be processed and the addition of watermark information to the first channel according to Embodiment 1 of this application;
[0070] Figure 9 This illustration shows a schematic diagram of the target sector corresponding to the anchor point according to Embodiment 1 of this application;
[0071] Figure 10 This diagram illustrates the value of the target sector according to Embodiment 1 of this application.
[0072] Figure 11 This schematic diagram illustrates the embedding of position information into a second channel according to Embodiment 1 of this application;
[0073] Figure 12 A schematic diagram illustrating a Gaussian kernel morphology is shown.
[0074] Figure 13 This illustration shows a schematic diagram of merging multiple channels and embedding them into a target frame image according to Embodiment 1 of this application;
[0075] Figure 14 A flowchart illustrating a video watermark decoding method according to Embodiment 3 of this application is shown schematically.
[0076] Figure 15 Schematic illustration Figure 14 Flowchart of the sub-steps in step S1404;
[0077] Figure 16 Schematic illustration Figure 14 Flowchart of the sub-steps in step S1406;
[0078] Figure 17 This illustration schematically shows a target frame image after a geometric transformation operation according to Embodiment 3 of this application;
[0079] Figure 18 The illustration shows a schematic diagram of the image watermark decoding process after being attacked by geometric transformation according to Embodiment 3 of this application;
[0080] Figure 19 This diagram illustrates the training flowchart for the location information decoder.
[0081] Figure 20 The flowchart illustrating the application of the video watermarking encoding method is shown in the diagram.
[0082] Figure 21 The flowchart illustrating the application of the video watermark decoding method is shown in the diagram.
[0083] Figure 22A block diagram of a video watermarking encoding device according to Embodiment 4 of this application is shown schematically;
[0084] Figure 23 A block diagram schematically illustrates a video watermark decoding apparatus according to Embodiment 5 of this application; and
[0085] Figure 24 A schematic diagram of the hardware architecture of a computer device according to Embodiment Six of this application is shown. Detailed Implementation
[0086] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0087] It should be noted that the descriptions involving "first," "second," etc., in the embodiments of this application are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of that feature. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0088] In the description of this application, it should be understood that the numerical labels before the steps do not indicate the order of the steps, but are only used to facilitate the description of this application and to distinguish each step, and therefore should not be construed as a limitation of this application.
[0089] First, a definition of the terminology used in this application is provided:
[0090] Video digital watermark: A type of identifier embedded in a video. Video digital watermarks can be used for various purposes, including preventing piracy, tracking data breaches, and providing copyright information.
[0091] Channels: The different color or grayscale components that make up an image. The color information of an image can be composed of multiple channels, each corresponding to different color or grayscale information. Channel types for color images include RGB, YUV, and HVS.
[0092] Computing power: The computing ability of a device, generally referring specifically to the computing power of the CPU and GPU.
[0093] Watermarking: The process of embedding specific information into a digital carrier.
[0094] Watermark decoding: The process of extracting specific information from a digital carrier.
[0095] Watermark encoding and decoding: refers to the two processes of watermark encoding and watermark decoding.
[0096] Anchor point: A specific point or location in an image that has special meaning or purpose and can be used to mark location information.
[0097] Gaussian kernel: a two-dimensional rectangular matrix in which the values satisfy a two-dimensional Gaussian distribution with the center point as the origin.
[0098] Gaussian kernel-like matrix: A two-dimensional rectangular matrix with a distribution similar to that of a Gaussian kernel.
[0099] Secondly, to facilitate understanding of the technical solutions provided in the embodiments of this application by those skilled in the art, the relevant technologies are described below:
[0100] Various platforms (such as Bilibili) contain a large amount of video content, which is the product of content creators' labor and a form of virtual asset. However, at the same time, there are also many instances of unauthorized reproduction, secondary editing, and distribution of videos to other platforms, which infringe on the rights of both content creators and platforms. Due to the difficulty of protecting these rights, these infringements greatly dampen the creative enthusiasm of content creators. Therefore, various video watermarking technologies have emerged, such as digital video watermarking technology.
[0101] Video digital watermarking embeds a watermark into a video image (video digital watermark encoding), and after infringement is discovered, the watermark information can be extracted from the infringed content (video digital watermark decoding), thereby achieving the purpose of protecting rights.
[0102] However, due to the massive volume of videos uploaded daily to video platforms, the encoding and decoding efficiency of video watermarks is low, failing to meet the needs of users and platforms. Furthermore, video watermarking technology struggles to maintain image quality after watermark encoding, resulting in poor image quality and low robustness in decoding after various image quality attacks. The video digital watermarking technology known to the inventors has the following specific shortcomings:
[0103] (1) The encoding speed and computational power consumption of digital watermarking are related to the image resolution input into the encoding algorithm. The higher the image resolution, the slower the encoding speed and the greater the computational power consumption. For high-resolution videos, if digital watermarks are to be embedded, the high video resolution results in low encoding efficiency, affecting the video release speed. In addition, embedding digital watermarks in high-resolution videos requires significant computational power, leading to higher hardware costs.
[0104] (2) The inventors have learned of a video digital watermarking technology that can improve encoding speed and reduce computing power consumption. Specifically, a high-resolution video can be scaled down to a smaller size before watermarking. The video can then be scaled back to its original resolution during or after encoding. This method sacrifices image quality for encoding speed and computing power consumption. While it can improve encoding speed and reduce computing power consumption, it cannot guarantee the image quality after watermarking, resulting in poor image quality.
[0105] (3) Videos containing watermark information may undergo changes during the infringement process, such as scaling, cropping, rotating, or other geometric transformations. When the position of the watermark information on the screen changes, watermark decoding becomes more difficult and inefficient.
[0106] Therefore, this application provides a video watermark encoding and decoding technology solution. In this technology solution: (1) Watermark information and position information are simultaneously embedded in different channels of a local image of a video frame, which can improve the watermark encoding speed, reduce hardware computing power consumption, and does not require changing the video resolution, thereby ensuring the overall image quality of the video after adding the watermark. In addition, simultaneously embedding the watermark position information can also improve the robustness of watermark decoding against geometric transformation attacks. (2) Efficient encoding and decoding of digital watermarks are achieved without changing the video resolution. (3) The video after watermark encoding can still accurately identify the embedded watermark position and decode the watermark information under geometric transformation attacks such as scaling, cropping, and rotation. (4) The position information of the image to be processed is marked by four or more anchor points of different categories. Each image to be processed is embedded with such a set of anchor points. After a geometric transformation, the image to be processed can be restored to its original orientation and size by using the detected anchor point set. See below for details.
[0107] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0108] like Figure 1 As shown, the runtime environment diagram includes: Figure 1 As shown in the diagram, the environment includes a service platform 2, a network 4, and a client 6, wherein:
[0109] Service platform 2 can consist of one or more computing devices. These computing devices may include virtualized computing instances. Virtualized computing instances may include virtual machines, such as emulations of computer systems, operating systems, servers, etc. The computing devices can load virtual machines based on virtual images and / or other data that define specific software used for emulation (e.g., operating systems, dedicated applications, servers). As the demand for different types of processing services changes, different virtual machines can be loaded and / or terminated on one or more computing devices. A hypervisor can be implemented to manage the use of different virtual machines on the same computing device.
[0110] Service platform 2 can be configured to communicate with clients 6, etc., via network 4. Network 4 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or similar devices. Network 4 may include physical links, such as coaxial cable links, twisted pair cable links, fiber optic links, or combinations thereof, or wireless links, such as cellular links, satellite links, Wi-Fi links, etc.
[0111] Service platform 2 can provide services such as image / video watermark embedding, image / video watermark decoding, and location information decoding training. For example, it can add watermarks to videos uploaded by clients or decode watermarks from the client's previous videos.
[0112] Client 6 can run Windows or Android. TM Electronic devices running operating systems such as iOS, including smartphones, tablets, laptops, virtual reality devices, gaming devices, set-top boxes, in-vehicle terminals, and smart TVs. Based on these operating systems, various applications can run, such as uploading video images to be watermarked to the service platform 2. Of course, the client 6 can also provide local watermarking functionality.
[0113] Client 6 can provide / configure a user access page, which can be used to upload video images to be watermarked, video images to be decoded, etc.
[0114] It should be noted that the above-mentioned equipment is exemplary, and the number and type of equipment can be adjusted in different scenarios or according to different needs.
[0115] The technical solution of this application will be described below through multiple embodiments, using service platform 2 as the implementing entity. It should be understood that these embodiments can be implemented in many different forms and should not be construed as being limited to the embodiments described herein.
[0116] Example 1
[0117] Figure 2A flowchart illustrating the video watermark encoding method according to Embodiment 1 of this application is shown.
[0118] like Figure 2 As shown, the video watermark encoding method may include steps S200 to S212, wherein:
[0119] Step S200: Obtain the target frame image of the video.
[0120] Step S202: Extract an image to be processed from the target frame image, wherein the image to be processed is a local image block of the target frame image.
[0121] Step S204: Perform channel decomposition on the image to be processed to obtain multiple channels; wherein the multiple channels include a first channel and a second channel.
[0122] Step S206: Embed the watermark information into the first channel to obtain a first channel containing watermark information.
[0123] Step S208: Embed the location information into the second channel to obtain a second channel containing location information.
[0124] Step S210: Generate a target image corresponding to the image to be processed based on the first channel containing watermark information and the second channel containing location information.
[0125] Step S212: Embed the target image into the target frame image to obtain a watermarked video.
[0126] The video watermarking encoding method provided in this embodiment decomposes a local image block into channels, obtaining a first channel and a second channel. Watermark information is embedded into the first channel, resulting in a first channel containing watermark information. Simultaneously, position information is embedded into the second channel, resulting in a second channel containing position information. A target image is generated based on the first channel containing watermark information and the second channel containing position information. The target image is then embedded into a target frame image, thereby obtaining a watermarked video. It can be seen that this embodiment, without changing the video resolution, can simultaneously embed watermark information and position information into different channels of a local image in a target frame image, without needing to embed watermark information and position information into the entire target frame image, thereby improving the efficiency of adding watermarks to videos (video watermarking encoding) and reducing resource and computing power consumption. In other words, it can achieve efficient video watermarking encoding and low computing power consumption while ensuring the video quality after watermarking.
[0127] The following combination Figure 2 The steps in steps S200 to S212, as well as other optional steps, are described in detail.
[0128] Step S200To obtain the target frame image of the video.
[0129] The target frame image is used to add a watermark. Video watermarking encoding refers to the process of embedding watermark information into the video image, thereby ensuring the watermark's invisibility and extractability in the video, while minimizing its impact on video quality.
[0130] The video can be a user-created or uploaded video on various video sharing platforms. When a user uploads a video to a video sharing platform, the platform adds a watermark. This watermark can be a digital watermark. The digital watermark can be invisible. An invisible watermark is embedded in the video image in a form imperceptible to the naked eye, ensuring video quality and preventing the watermark from affecting the user's viewing experience. The video can be in various formats, such as MPEG-4 and AVI.
[0131] The target frame image can be any one or more frames from the video. When a watermark needs to be added to the video, it can be added to multiple frames.
[0132] Step S202 An image to be processed is extracted from the target frame image, wherein the image to be processed is a local image block of the target frame image.
[0133] The image to be processed is the region in the target frame image to which the watermark needs to be added. When cropping the image to be processed from the target frame image, one or more fixed-size local image blocks can be cropped from any position in the target frame image. If multiple local image blocks are cropped, their positions should not overlap. Furthermore, the number and size of the local image blocks can be determined based on hardware environment, encoding / decoding speed, and other requirements. With more powerful hardware, the number of local image blocks can be greater, and the size of the local image blocks can also be larger. By cropping multiple non-overlapping local image blocks from the target frame image and adding watermarks to these multiple local image blocks, the watermarked video can retain more effective watermark information after being subjected to geometric transformation attacks, thereby improving the robustness of watermark decoding.
[0134] In this embodiment, a local image block is extracted from the target frame image, so that when adding a watermark to the video, only the local image block of the target frame image needs to be watermarked, instead of the entire target frame image, thereby improving the efficiency of watermark addition.
[0135] Step S204 The image to be processed is decomposed into multiple channels. These multiple channels include a first channel and a second channel.
[0136] The channel refers to a single color component in the image to be processed. For a color image, an image can consist of multiple channels. Specifically, if the image to be processed is a color image, then the image has multiple color channels. The channel types of the image to be processed can include RGB channels (Red, Green, Blue Channels), YUV (Luminance, Chrominance-Blue Projection, Chrominance-Red Projection) channels, HVS channels, CMYK channels (Cyan, Magenta, Yellow, Key Channels), etc.
[0137] In an exemplary application, if the image to be processed is of YUV channel type, then the image has three channels, namely, the Y channel, U channel, and V channel. The Y channel represents luminance, while the U and V channels represent chrominance. In this embodiment, the Y channel can be designated as the first channel, and the U channel as the second channel. It should be noted that the first channel includes, but is not limited to, the Y channel, and the second channel includes, but is not limited to, the U channel.
[0138] In this embodiment, the image to be processed is decomposed into multiple channels so that watermark information and location information can be embedded in different channels of the image to be processed, thereby achieving decoupling of watermark information and location information.
[0139] Step S206 The watermark information is embedded into the first channel to obtain the first channel containing the watermark information.
[0140] The watermark information refers to a specific identifier embedded in digital media (such as video) to indicate the source, copyright ownership, or other relevant information of the digital media. The watermark information can be text, images, logos, numerical sequences, or other forms of identifiers.
[0141] In exemplary applications, such as Figure 8 As shown, when the image channel type is YUV, and the channel is decomposed into a Y channel (first channel), a U channel (second channel), and a V channel (third channel), watermark information can be embedded into the Y channel to obtain a Y channel containing watermark information. Specifically, the layer corresponding to the Y channel can be sent to the watermark encoder, and the watermark encoder outputs the Y channel containing watermark information.
[0142] Step S208 The location information is embedded into the second channel to obtain a second channel containing location information.
[0143] The location information refers to the relative position of the image to be processed within the target frame image. In this embodiment, the watermark is embedded in the image to be processed. Therefore, the location information can be used to indicate the position of the watermark.
[0144] In an exemplary application, when the image channel type to be processed is YUV, and the channel is decomposed into Y channel, U channel, and V channel, position information can be embedded into the U channel to obtain a U channel containing position information.
[0145] The location information can be identified by anchor point information. An optional embodiment is provided below.
[0146] In optional embodiments, such as Figure 3 As shown, the location information includes anchor point information, and step S208 may include:
[0147] S300, the position information of the image to be processed is determined by the original anchor point group.
[0148] The original anchor point group includes multiple original anchor points, which are used to indicate the relative position of the image to be processed in the target frame image.
[0149] The original anchor point refers to a specific point in the image to be processed, and can be used to mark the positional information of the image to be processed.
[0150] Each image to be processed can record location information through one or more sets of raw anchor points. A set of raw anchor points can include four or more raw anchor points of different categories.
[0151] In the above optional embodiments, the position information of the image to be processed in the target frame image can be calibrated by the original anchor point group, which can achieve the following effects: the original anchor point group can provide accurate position calibration, thereby enabling the position of the image to be processed in the target frame image to be determined more quickly and effectively, so that when the image is decoded in the subsequent process, the position of the watermark in the target frame image can be quickly identified, thus improving the decoding efficiency.
[0152] In optional embodiments, such as Figure 4 As shown, step S208 may further include:
[0153] S400 defines a circular area formed with the original anchor point as the center.
[0154] S402, the circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors.
[0155] S404, retain the value of the target sector and set the values of the other sectors to fixed values.
[0156] The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
[0157] The target sector is a part of the circular region. Specifically, the target sector can be one-third, one-quarter, or one-fifth of the circular region, without limitation.
[0158] It should be noted that each original anchor point group may include multiple original anchor points, each original anchor point corresponds to a target sector, and the shape of the target sector of each original anchor point may be different or the same. In an exemplary application, a set of original anchor points can be used to mark the position information of the image to be processed in the target frame image. The original anchor point group may include four different categories of original anchor points. Among them: (1) If the target sectors have the same shape, the shape of the four anchor points can be a quarter circle of a circular area. (2) If the target sectors have different shapes, the shapes of the four anchor points can be a third circle, a quarter circle, a fifth circle, and a sixth circle of a circular area, respectively. The shape of each target sector can be selected according to the actual situation and is not limited here. When the target sector shapes are different, the category of each original anchor point in the original anchor point group can be quickly identified according to the shape of each target sector, such as the arc corresponding to the sector surface.
[0159] In exemplary applications, such as Figure 10 As shown, while retaining the value of the target sector, the values of other sectors can be set to fixed values, such as 1.
[0160] In the above optional embodiments, each original anchor point is associated with a target sector, and the value of the target sector is retained. The values of other sectors are set to fixed values, so that the target sector can be divided from the circular region. This achieves the effect of separating the target sector from other sectors, so that the position of each original anchor point can be quickly identified from the target frame image based on the numerical characteristics of the target sector, thereby quickly determining the position of the watermark in the video.
[0161] In optional embodiments, such as Figure 5 As shown, step S208 may further include:
[0162] S500, determine the orientation of each of the original anchor points.
[0163] S502, select the corresponding target sector for each of the original anchor points according to their orientation.
[0164] In the exemplary application, before selecting the corresponding target sector for each original anchor point, the orientation of each original anchor point must first be determined. For example... Figure 9, 10 As shown, the image to be processed includes a group of anchor points, which includes four anchor points. When viewed clockwise, the positions of the four anchor points in the image to be processed are as follows: (1) Anchor point ① is located at the upper right corner of the image to be processed. (2) Anchor point ② is located at the lower right corner of the image to be processed. (3) Anchor point ③ is located at the lower left corner of the image to be processed. (4) Anchor point ④ is located at the upper left corner of the image to be processed.
[0165] The target sector can be determined based on the orientation of the original anchor point. In an exemplary application, a sector diagonally opposite to the orientation of the original anchor point can be selected, and the size of the sector can be 1 / 4 of a circle. The circular area corresponding to each anchor point is divided into four quadrants, with the horizontal direction being the x-axis and the vertical direction being the y-axis. The target sectors of the four anchor points are as follows: (1) The target sector of anchor point ① is located in the third quadrant. (2) The target sector of anchor point ② is located in the second quadrant. (3) The target sector of anchor point ③ is located in the first quadrant. (4) The target sector of anchor point ④ is located in the fourth quadrant.
[0166] In the optional embodiments described above, the corresponding target sector is selected based on the orientation of each original anchor point. When the orientations of the original anchor points are different, the orientation of each target sector relative to the (associated) original anchor point is also inconsistent. The advantage of this is that the category of each anchor point in the original anchor point group can be quickly determined by the orientation of each target sector relative to the original anchor point, thereby quickly and accurately identifying the location and placement of the watermark.
[0167] In exemplary applications, such as Figure 11 As shown, the specific embedding process for location information can be as follows: Define the original anchor point group information corresponding to the watermark to be embedded, such as quantity, position, shape, and value. Then, multiply the layer corresponding to the second channel pixel-by-pixel with the defined original anchor point group information to obtain the second channel containing location information. The original anchor points can be represented in various forms, such as using a Gaussian kernel or a circular mean kernel.
[0168] The original anchor point can be represented by a circular mean kernel. When represented by a circular mean kernel, a circular region is formed with the original anchor point as the center. Within this circular region, all values are the same fixed value, such as 0.4 or 0.5. When determining the target sector, a portion of the sector within this circular region can be selected as an anchor point for a category.
[0169] The original anchor point can be represented by a Gaussian kernel. In an alternative embodiment, such as Figure 6 As shown, the original anchor point is represented in the form of a Gaussian kernel.
[0170] In optional embodiments, such as Figure 7As shown, the original anchor points are of different categories, including Gaussian kernels with different numerical distributions and different sectors.
[0171] In exemplary applications, such as Figure 9 , 10 As shown in Figure 12, each original anchor point group contains four original anchor points, meaning each original anchor point group includes four Gaussian-like kernels with different numerical distributions. The original anchor point group uses these four Gaussian-like kernels to define the positional information of the target image. The values of the original anchor points are calculated using the following formula:
[0172]
[0173]
[0174] Formula (1) is the formula for the Gaussian kernel, and formula (2) is the formula for a Gaussian-like kernel. In the above formulas, u and v represent coordinates in different directions. G represents a two-dimensional Gaussian kernel, the shape of which is controlled by σ. i Let p represent the i-th anchor point in a set of anchor points. i The value distribution of the control anchor points is set to an open interval from 0 to 1. max(G) represents the maximum value in G. The original anchor point is located at the image pixel coordinates where the minimum value of that anchor point is located.
[0175] In the above optional embodiments: (1) The original anchor points are represented in the form of Gaussian kernels. The values in the Gaussian kernel are Gaussian values, which are presented in a gradient form. This makes the image quality of the image to be processed less affected when the position of the image to be processed is marked by the original anchor points, i.e., when the Gaussian kernel is embedded into the image to be processed, and better ensures the invisibility of the watermark in the image to be processed. In addition, since the values in the Gaussian kernel are presented in a gradient form, this numerical feature can be easily identified by the position information decoder, anchor point detector, etc. Therefore, in the subsequent watermark decoding process, the original anchor points represented in the form of Gaussian kernels can be quickly identified, so that the watermark corresponding to the original anchor point group can be quickly identified. (2) The categories of the original anchor points include Gaussian kernels with different numerical distributions and different sectors. When embedding the original anchor point group into the image to be processed, the numerical distribution of the Gaussian kernel and the sector shape orientation and other information can be changed to embed different anchor points into the image to be processed. It can be seen that by judging the value of the Gaussian kernel and the shape of the sector corresponding to the Gaussian kernel, the category of the original anchor point can be quickly determined.
[0176] Step S210 Based on the first channel containing watermark information and the second channel containing location information, a target image corresponding to the image to be processed is generated.
[0177] The generated target image is a watermarked target image.
[0178] When generating the target image corresponding to the image to be processed, all the decomposed channels need to be merged. For example, such as Figure 13 As shown, when the image channel type is YUV, and this channel is decomposed into Y, U, and V channels, watermark information can be embedded into the Y channel to obtain a Y channel containing watermark information. Position information can be embedded into the U channel to obtain a U channel containing position information. The Y channel containing watermark information, the U channel containing position information, and the original V channel are then merged to generate the watermarked target image.
[0179] Step S212 The target image is embedded into the target frame image to obtain a watermarked video.
[0180] To add a watermark to the target frame image, this embodiment embeds the watermark by cropping a portion of the target frame image. The advantage of this approach is that when embedding the watermark in the target frame image, there's no need to add watermark and location information to the entire target frame image; only a portion needs to be embedded, thus improving watermark encoding speed and reducing hardware computational consumption. After obtaining the watermarked target image, since it's cropped from the target frame image, the cropped target image needs to be reinserted into the target frame image to obtain the watermarked target frame image, and thus the video to be watermarked.
[0181] When users upload videos to the platform, the platform adds a watermark to the uploaded videos, resulting in watermarked videos. This watermark ensures the legal use of the videos, protects the legitimate rights and interests of creators and the platform, and provides reliable data traceability and evidence. It should be noted that users can also add watermarks on their own devices.
[0182] Example 2
[0183] It should be noted that the difference between this embodiment and Embodiment 1 lies in the order of channel decomposition and local image cropping. For specific implementation details and technical effects of this embodiment, please refer to Embodiment 1, which will not be repeated here.
[0184] A method for encoding video watermarks, the method comprising:
[0185] Obtain the target frame image from the video.
[0186] The target frame image is decomposed into multiple channels. These multiple channels include a first channel and a second channel.
[0187] Extract a first image block from the first channel. The first image block is a local image block in the layer corresponding to the first channel.
[0188] The watermark information is embedded into the first image block to obtain the first channel containing the watermark information.
[0189] A second image block is extracted from the second channel, and the second image block corresponds to the position of the first image block.
[0190] The location information is embedded into the second image block to obtain a second channel containing the location information.
[0191] A target frame image with a watermark is generated based on the first channel containing watermark information and the second channel containing location information.
[0192] In some embodiments, the target frame image can first be decomposed into multiple channels to obtain multiple channels. Then, an image to be processed is extracted from these multiple channels. Specifically: the target frame image is decomposed into multiple channels (including a first channel and a second channel). One or more fixed-size first image blocks are selected on the first channel, and watermark information is embedded into the first image blocks to obtain a first channel containing watermark information. Then, a second image block corresponding to the position of the image to be processed is extracted from the second channel, and position information is embedded into the second image block to obtain a second channel containing position information. Based on the first channel containing watermark information and the second channel containing position information, a watermarked image corresponding to the target frame image is generated.
[0193] The above embodiments describe the encoding method of the video watermark of this application. The decoding method of the video watermark of this application is described below.
[0194] Example 3
[0195] Figure 14 The flowchart illustrating the video watermark decoding method according to Embodiment 3 of this application is shown in the illustration.
[0196] like Figure 14 , 18 As shown, the video watermark encoding method may include steps S1400 to S1408, wherein:
[0197] S1400, acquire the target frame image of the video. The target frame image has watermark information loaded in the first channel and position information loaded in the second channel.
[0198] S1402, Perform channel decomposition on the target frame image to obtain the first channel and the second channel.
[0199] S1404, decode the second channel to obtain location information, the location information including anchor point group information.
[0200] S1406, Adjust the layer corresponding to the first channel according to the anchor point group information.
[0201] S1408, perform watermark decoding on the adjusted layer to obtain the watermark information of the video.
[0202] The video watermark decoding method provided in this embodiment, when decoding a video containing a watermark (the first channel contains watermark information and the second channel contains position information), first decomposes the target frame image into a first channel and a second channel. The position information of the anchor point group in the target frame image is parsed from the second channel. Then, the watermark in the first channel is adjusted according to the position information. Finally, the adjusted watermark is decoded to obtain the correct and valid watermark information. It can be seen that, based on the fact that the first channel of the video frame image contains watermark information and the second channel contains position information, the orientation and size of the watermark can be adjusted according to the position information parsed from the second channel. Therefore, even if the video undergoes geometric transformation, the technical solution of this application can still quickly and effectively extract accurate watermark information from the video, improving the robustness of watermark decoding.
[0203] The following combination Figure 14 The steps in steps S1400 to S1408, as well as other optional steps, are described in detail.
[0204] S1400 The target frame image of the video is obtained. The target frame image has watermark information loaded in the first channel and position information loaded in the second channel.
[0205] The video is a video to be decoded, and the video contains a watermark. Specifically, the target frame image in the video has watermark information loaded in the first channel and position information loaded in the second channel. For example, if both videos A and B contain watermark information, and video A is found to potentially infringe on video B, to determine whether video A infringes on video B, video A can be watermarked and the watermark information can be parsed from video A. The watermark parsed from video A is then compared with the watermark parsed from video B. If they match, video A is determined to infringe on video B. If they do not match, video A is determined not to infringe on video B.
[0206] The channel type of the target frame image may include RGB channels (Red, Green, Blue Channels), YUV channels, HVS channels, CMYK channels (Cyan, Magenta, Yellow, Key Channels), etc. In an exemplary application, if the target frame image channel type is YUV, with the Y channel as the first channel and the U channel as the second channel, then the Y channel in the target frame image contains watermark information, and the U channel contains position information.
[0207] In this embodiment, watermark information and position information are embedded in different channels of the target frame image respectively, thereby decoupling the watermark information and position information. This allows the watermark information in the first channel to be adjusted based on the position information parsed from the second channel.
[0208] S1402 The target frame image is decomposed into channels to obtain the first channel and the second channel.
[0209] For example, if the target frame image channel type is YUV, and the Y channel of the target frame image contains watermark information and the U channel contains position information, then channel decomposition of the target frame image can yield three channels: the Y channel, the U channel, and the V channel. The Y channel is the first channel, and the U channel is the second channel.
[0210] S1404 The second channel is decoded to obtain location information, which includes anchor point group information.
[0211] The location information refers to the location of the watermark in the target image frame. Decoding the second channel yields one or more sets of anchor point information, which are used to specify the location of the watermark.
[0212] Each group of anchor points may include four or more anchor points. The categories of each anchor point are different. When the anchor point is a Gaussian anchor point, the anchor point category includes Gaussian kernels with different numerical distributions and different sectors.
[0213] In this embodiment, the position information of the watermark in the first channel is determined by anchor point group information. After video geometric transformation, the image corresponding to the watermark can be quickly adjusted based on the anchor point group information detected from the second channel to restore it to its original orientation and size.
[0214] In some embodiments, if the second channel is decoded and no anchor group information is obtained, the target frame image is a watermark-free image.
[0215] In optional embodiments, such as Figure 15As shown, the anchor point group includes multiple anchor points, and each anchor point corresponds to a sector.
[0216] Correspondingly, step S1404 may include:
[0217] S1500, acquire the sector in the target frame image.
[0218] S1502, Based on the acquired sector, obtain the anchor point in the target frame image, the anchor point being used to indicate the relative position of the watermark in the target frame image.
[0219] Each anchor point corresponds to a circular region. When embedding a watermark into the target frame image, a sector is selected for each anchor point. A sector is a portion of the circular region, such as a quarter circle or a fifth circle. Therefore, when decoding the second channel of the target frame image, the anchor point information of the watermark can be obtained based on the sectors in the target frame image; one sector corresponds to one anchor point. For example, if the anchor point is represented by a Gaussian kernel, and the anchor point category is presented as a Gaussian kernel with different numerical distributions and different sectors, then the image pixel coordinates where the minimum value in the sector is located are the anchor point's position.
[0220] When decoding the second channel, anchor points are obtained based on the sectors. When multiple anchor points are detected, the category of the anchor points is determined to identify the position of the anchor points in the video frame image before geometric transformation. When identifying the category of anchor points, the following information can be used: (1) The angle of the sector, such as the radian of the sector's surface. For example, the radian of a one-third circular area is 120°, and the radian of a quarter circular area is 90°. (2) The value of each point in the sector, which can be determined based on the value (minimum value) of the anchor points in the sector. (3) The orientation of the sector, as described above. Figure 9 As shown, when taking a quarter circle in the target sector, the arc of the sector corresponding to anchor point ① is oriented towards the lower left corner relative to anchor point ①, and the arc of the sector corresponding to anchor point ② is oriented towards the upper left corner relative to anchor point ②.
[0221] In the above optional embodiments, anchor points are represented in the form of sectors. The position and category of anchor points can be quickly determined by the characteristics of the sectors (such as angle / radian, value, orientation, etc.), thereby quickly indicating the relative position of the watermark in the target frame image.
[0222] S1406 The layer corresponding to the first channel is adjusted based on the anchor point group information.
[0223] like Figure 17As shown, the video containing watermark information may undergo changes during the infringement process. For example, during the infringement process, the video containing watermark information may undergo the following geometric transformation operations: scaling, cropping, rotation, etc. After the above operations, the position of the target frame image containing watermark information will change. At this time, the difficulty of watermark decoding increases significantly. Therefore, in order to correctly and quickly decode the watermark information, the layer corresponding to the first channel can be adjusted according to the position information (anchor point group information) to restore the target frame image to its original orientation and size.
[0224] In optional embodiments, such as Figure 16 As shown, step S1406 may include:
[0225] S1600, Determine the geometric transformation matrix based on the original anchor point group and the anchor point group;
[0226] S1602, Perform a geometric transformation on the layer corresponding to the first channel according to the geometric transformation matrix to adjust the layer.
[0227] The original anchor point group refers to the anchor point group of the video before any geometric transformation operation. In an exemplary application, if both video A and video B embed watermarks, and video A is found to potentially infringe on video B, then the original anchor point group is theoretically consistent with the anchor point group of video B. In this case, the anchor point group of video A can be obtained through the second channel of video A. Based on the anchor point group of video A and the anchor point group of video B, the corresponding geometric transformation matrix can be determined. Based on this geometric transformation matrix, a geometric transformation is performed on the layer of the first channel in video A to adjust the layer.
[0228] In the above optional embodiments, a corresponding geometric transformation matrix is determined based on the position of the original anchor point group and the position of the anchor point group decoded from the second channel. This geometric transformation matrix is applied to the layer corresponding to the first channel to perform a geometric transformation on that layer, thereby quickly and accurately restoring the orientation and size of the layer corresponding to the second channel, i.e., quickly and accurately restoring the orientation and size of the watermark in the second channel for infringement identification.
[0229] S1408 The adjusted layer is then watermarked to obtain the watermark information of the video.
[0230] The adjusted layer is input into a watermark decoder for decoding, thereby obtaining the video's watermark information. Based on this watermark information, it can be determined whether the video infringes on copyright. If the video's watermark is the same as the watermark of the infringed video, then the video is considered to be infringing. If the video's watermark is different from the infringed video's watermark, then it is not infringing.
[0231] The above embodiments describe the video watermark decoding method of this application. The training process of the location information decoder in this embodiment is described below.
[0232] In optional embodiments, such as Figure 19 As shown, the anchor point is detected by the location information decoder. The location information decoder is trained through the following operations:
[0233] S1900, obtain a watermarked sample video.
[0234] S1902, input the layer corresponding to the second channel in the sample video into the location information decoder to obtain the predicted position of the anchor point in the sample video.
[0235] S1904: Obtain the loss value based on the predicted position of the anchor point in the sample video and the actual position of the anchor point in the sample video.
[0236] S1906, Adjust the network parameters of the location information decoder according to the loss value.
[0237] For example, if the image frame channel type in the sample video is YUV, and the U channel is the second channel, then the layer corresponding to the U channel is input into the position information decoder. The position information decoder will output one or more sets of anchor point position information, and each set of anchor point position information includes the pixel coordinates of each anchor point in that set.
[0238] In the above optional embodiments, by training the location information decoder, the trained location information decoder can more accurately predict the location information of the anchor group, so as to quickly and accurately decode the watermark information.
[0239] To make this application easier to understand, the following is combined with... Figure 20 as well as Figure 21 An example application is provided.
[0240] (1) Encoding method for video watermarking:
[0241] S11, acquire the target frame image of the video.
[0242] S12, extract the image to be processed from the target frame image. The image to be processed is a local image block of the target frame image.
[0243] S13, perform channel decomposition on the image to be processed.
[0244] S14, embed the watermark information into the first channel.
[0245] Specifically:
[0246] S141, the position information of the image to be processed is determined by the original anchor point group.
[0247] S142, Determine the circular region formed by the original anchor point, and divide the circular region into multiple sectors.
[0248] S143, select the corresponding target sector for each original anchor point based on the orientation of each original anchor point.
[0249] S144: Retain the value of the target sector and set the values of other sectors to fixed values.
[0250] The original anchor points are represented in the form of Gaussian kernels, and the categories of original anchor points include Gaussian kernels with different numerical distributions and different sectors.
[0251] S15 embeds location information into the second channel.
[0252] S16: Generate the target image based on the first channel and the second channel.
[0253] S17, embed the target image into the target frame image to obtain a watermarked video.
[0254] (2) Video watermark decoding method:
[0255] S21, acquire the target frame image of the video, which has watermark information and location information loaded in different channels.
[0256] S22, perform channel decomposition on the target frame image to obtain the first channel and the second channel.
[0257] S23, decode the second channel to obtain the location information (anchor group information).
[0258] Specifically:
[0259] S231, Obtain the sector in the target frame image.
[0260] S232, Based on the obtained sector, obtain the anchor point in the target frame image.
[0261] S24, adjust the layer corresponding to the first channel based on the anchor point group information.
[0262] Specifically:
[0263] S241, Determine the geometric transformation matrix based on the original anchor point group and the anchor point group.
[0264] S242, Perform a geometric transformation on the layer corresponding to the first channel according to the geometric transformation matrix.
[0265] S25, perform watermark decoding on the adjusted layer to obtain the watermark information of the video.
[0266] Example 4
[0267] Figure 22 A block diagram schematically illustrates a video watermarking encoding apparatus according to Embodiment 4 of this application. This video watermarking encoding apparatus can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of this application. The program module referred to in this embodiment is a series of computer program instruction segments capable of performing a specific function. The following description will specifically introduce the function of each program module in this embodiment. For example... Figure 22 As shown, the video watermark encoding device may include: an acquisition module 2210, a cropping module 2220, a decomposition module 2230, a first embedding module 2240, a second embedding module 2250, a generation module 2260, and a third embedding module 2270, wherein:
[0268] The acquisition module 2210 is used to acquire the target frame image of the video;
[0269] The cropping module 2220 is used to crop an image to be processed from the target frame image, wherein the image to be processed is a local image block of the target frame image;
[0270] The decomposition module 2230 is used to perform channel decomposition on the image to be processed to obtain multiple channels; wherein, the multiple channels include a first channel and a second channel;
[0271] The first embedding module 2240 is used to embed watermark information into the first channel to obtain a first channel containing watermark information.
[0272] The second embedding module 2250 embeds the location information into the second channel to obtain a second channel containing the location information;
[0273] The generation module 2260 is used to generate a target image corresponding to the image to be processed based on a first channel containing watermark information and a second channel containing location information.
[0274] The third embedding module 2270 embeds the target image into the target frame image to obtain a watermarked video.
[0275] In an optional embodiment, the location information includes anchor point information;
[0276] Correspondingly, the second embedding module 2250 is also used for:
[0277] The positional information of the image to be processed is determined by the original anchor point group;
[0278] The original anchor point group includes multiple original anchor points, which are used to indicate the relative position of the image to be processed in the target frame image.
[0279] In an optional embodiment, the second embedding module 2250 is further configured to:
[0280] Define the circular area formed with the original anchor point as the center;
[0281] The circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors;
[0282] The value of the target sector is retained, and the values of the other sectors are set to fixed values;
[0283] The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
[0284] In an optional embodiment, there are four original anchor points, and the second embedding module 2250 is further used for:
[0285] Determine the orientation of each of the original anchor points; and
[0286] Based on the location of each original anchor point, a corresponding target sector is selected for each original anchor point.
[0287] In an optional embodiment, the original anchor point is represented in the form of a Gaussian kernel.
[0288] In an optional embodiment, the original anchor points are of different categories, including Gaussian kernels with different numerical distributions and different sectors.
[0289] In an optional embodiment, the video watermark encoding device may further include:
[0290] The acquisition module is used to acquire the target frame image of the video;
[0291] The decomposition module is used to perform channel decomposition on the target frame image to obtain multiple channels; wherein the multiple channels include a first channel and a second channel;
[0292] The first cropping module is used to crop a first image block from the first channel, wherein the first image block is a local image block in the layer corresponding to the first channel;
[0293] The first embedding module is used to embed watermark information into the first image block to obtain a first channel containing watermark information;
[0294] The second cropping module is used to crop a second image block from the second channel, and the second image block corresponds to the position of the first image block;
[0295] The second embedding module is used to embed position information into the second image block to obtain a second channel containing position information;
[0296] The generation module is used to generate a watermarked target frame image based on the first channel containing watermark information and the second channel containing location information.
[0297] Example 5
[0298] Figure 23 A block diagram schematically illustrates a video watermark decoding apparatus according to Embodiment 5 of this application. This video watermark decoding apparatus can be divided into one or more program modules. One or more program modules are stored in a storage medium and executed by one or more processors to complete the embodiment of this application. The program module referred to in the embodiments of this application refers to a series of computer program instruction segments capable of performing a specific function. The following description will specifically introduce the function of each program module in this embodiment. For example... Figure 23 As shown, the video watermark decoding device may include: an acquisition module 2310, a decomposition module 2320, a decoding module 2330, an adjustment module 2340, and a watermark decoding module 2350, wherein:
[0299] The acquisition module 2310 is used to acquire the target frame image of the video, which has watermark information loaded in the first channel and position information loaded in the second channel;
[0300] The decomposition module 2320 is used to perform channel decomposition on the target frame image to obtain the first channel and the second channel;
[0301] Decoding module 2330 is used to decode the second channel to obtain position information, the position information including anchor point group information;
[0302] The adjustment module 2340 is used to adjust the layer corresponding to the first channel according to the anchor point group information;
[0303] The watermark decoding module 2350 is used to decode the watermark on the adjusted layer to obtain the watermark information of the video.
[0304] In an optional embodiment, the anchor point group includes multiple anchor points, each anchor point corresponding to a sector;
[0305] The video watermark decoding device further includes a second acquisition module (unidentified), used for:
[0306] Obtain sectors from the target frame image;
[0307] Based on the acquired sector, anchor points in the target frame image are obtained, and the anchor points are used to indicate the relative position of the watermark in the target frame image.
[0308] In an optional embodiment, the adjustment module is further configured to:
[0309] Determine the geometric transformation matrix based on the original anchor point group and the anchor point group;
[0310] Based on the geometric transformation matrix, a geometric transformation is performed on the layer corresponding to the first channel to adjust the layer.
[0311] In an optional embodiment, the anchor point is detected by a location information decoder;
[0312] The device further includes a training module (unidentified), which is used for:
[0313] Obtain watermarked sample videos;
[0314] The layer corresponding to the second channel in the sample video is input into the location information decoder to obtain the predicted position of the anchor point in the sample video;
[0315] The loss value is obtained based on the predicted position of the anchor point in the sample video and the actual position of the anchor point in the sample video;
[0316] The network parameters of the location information decoder are adjusted based on the loss value.
[0317] Example 6
[0318] Figure 24 This illustration schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing an encoding and decoding method for video watermarking according to Embodiment Six of this application. In some embodiments, the computer device 10000 may be a terminal device such as a smartphone, wearable device, tablet computer, personal computer, in-vehicle terminal, game console, virtual device, workbench, digital assistant, set-top box, robot, etc. In other embodiments, the computer device 10000 may be a rack server, blade server, tower server, or cabinet server (including independent servers or server clusters composed of multiple servers), etc. Figure 24 As shown, the computer device 10000 includes, but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate and be linked with each other via a system bus. Wherein:
[0319] The memory 10010 includes at least one type of computer-readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10010 may be an internal storage module of a computer device 10000, such as the hard disk or memory of the computer device 10000. In other embodiments, the memory 10010 may also be an external storage device of the computer device 10000, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 10000. Of course, the memory 10010 may also include both the internal storage module and the external storage device of the computer device 10000. In this embodiment, the memory 10010 is typically used to store the operating system and various application software installed on the computer device 10000, such as program code for video watermark encoding and decoding methods. In addition, the memory 10010 can also be used to temporarily store various types of data that have been output or will be output.
[0320] In some embodiments, processor 10020 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other chip. Processor 10020 is typically used to control the overall operation of computer device 10000, such as performing control and processing related to data interaction or communication with computer device 10000. In this embodiment, processor 10020 is used to run program code stored in memory 10010 or process data.
[0321] Network interface 10030 may include a wireless network interface or a wired network interface, which is typically used to establish a communication link between computer device 10000 and other computer devices. For example, network interface 10030 is used to connect computer device 10000 to an external terminal via a network, establishing a data transmission channel and communication link between computer device 10000 and the external terminal. The network may be an intranet, the Internet, Global System for Mobile Communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, or other wireless or wired networks.
[0322] It should be pointed out that, Figure 24 Only computer devices with components 10010-10030 are shown; however, it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0323] In this embodiment, the video watermark encoding and decoding method stored in memory 10010 can be further divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of this application.
[0324] Example 7
[0325] This application also provides a computer-readable storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of the video watermark encoding and decoding method in the embodiments.
[0326] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as the hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device. Of course, the computer-readable storage medium can also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer-readable storage medium is typically used to store the operating system and various application software installed on the computer device, such as the program code of the encoding and decoding method of video watermark in this embodiment. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or will be output.
[0327] It should be noted that the above are merely preferred embodiments of this application and do not limit the scope of patent protection of this application. Any equivalent structural or procedural changes made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of this application.
Claims
1. A video watermark encoding method, characterized in that, The method includes: Acquire the target frame image of the video; An image to be processed is extracted from the target frame image, wherein the image to be processed is a local image patch of the target frame image; The image to be processed is decomposed into multiple channels; wherein the multiple channels include a first channel and a second channel. The watermark information is embedded into the first channel to obtain a first channel containing the watermark information; The location information is embedded into the second channel to obtain a second channel containing location information; Based on the first channel containing watermark information and the second channel containing location information, a target image corresponding to the image to be processed is generated; The target image is embedded into the target frame image to obtain a watermarked video; The method further includes: A circular region is defined with the original anchor point as the center; wherein the original anchor point is used to indicate the relative position of the image to be processed in the target frame image; The circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors; The value of the target sector is retained, and the values of the remaining sectors are set to fixed values; The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
2. The method according to claim 1, characterized in that, The location information includes anchor point information; correspondingly, embedding the location information into the second channel to obtain a second channel containing location information includes: The positional information of the image to be processed is determined by the original anchor point group; The original anchor point group includes multiple original anchor points.
3. The method according to claim 1, characterized in that, The original anchor points are four, and the method further includes: Determine the orientation of each of the original anchor points; and Based on the location of each original anchor point, a corresponding target sector is selected for each original anchor point.
4. The method according to any one of claims 2 to 3, characterized in that: The original anchor point is represented in the form of a Gaussian kernel.
5. The method according to any one of claims 2 to 3, characterized in that: The original anchor points are of different categories, including Gaussian kernels with different numerical distributions and different sectors.
6. A video watermark encoding method, characterized in that, The method includes: Acquire the target frame image of the video; The target frame image is decomposed into multiple channels; wherein the multiple channels include a first channel and a second channel. Extract a first image block from the first channel, where the first image block is a local image block in the layer corresponding to the first channel; The watermark information is embedded into the first image block to obtain the first channel containing the watermark information; A second image block is extracted from the second channel, and the second image block corresponds to the position of the first image block; Position information is embedded into the second image block to obtain a second channel containing position information; Based on the first channel containing watermark information and the second channel containing location information, a target frame image with watermark is generated. The method further includes: Define a circular region with the original anchor point as the center; wherein the original anchor point is used to indicate the relative position of the image to be processed in the target frame image; The circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors; The value of the target sector is retained, and the values of the remaining sectors are set to fixed values; The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
7. A method for decoding video watermarks, characterized in that, The method includes: acquiring a target frame image of a video, wherein the target frame image has watermark information loaded in a first channel and position information loaded in a second channel; The target frame image is decomposed into channels to obtain the first channel and the second channel; The second channel is decoded to obtain position information, which includes anchor point group information; wherein the anchor point group information is used to specify the position information of the watermark in the target frame image. Adjust the layer corresponding to the first channel based on the anchor point group information; Watermark decoding is performed on the adjusted layer to obtain the watermark information of the video; The adjustment of the layer corresponding to the first channel based on the anchor point group information includes: Based on the original anchor point group and the anchor point group, a geometric transformation matrix is determined; wherein, the original anchor point group is the anchor point group of the video that has not undergone geometric transformation operation; According to the geometric transformation matrix, a geometric transformation is performed on the layer corresponding to the first channel to adjust the layer; The anchor point group includes multiple anchor points, and each anchor point corresponds to a sector; Correspondingly, the second channel is decoded to obtain location information, including: Obtain sectors from the target frame image; Based on the acquired sector, anchor points in the target frame image are obtained, and the anchor points are used to indicate the relative position of the watermark in the target frame image.
8. The method according to claim 7, characterized in that, Anchor points are detected using a location information decoder; The location information decoder is trained through the following operations: Obtain watermarked sample videos; The layer corresponding to the second channel in the sample video is input into the location information decoder to obtain the predicted position of the anchor point in the sample video; The loss value is obtained based on the predicted position of the anchor point in the sample video and the actual position of the anchor point in the sample video; The network parameters of the location information decoder are adjusted based on the loss value.
9. A video watermark encoding device, characterized in that, The device includes: The acquisition module is used to acquire the target frame image of the video; The cropping module is used to crop an image to be processed from the target frame image, wherein the image to be processed is a local image block of the target frame image; The decomposition module is used to perform channel decomposition on the image to be processed to obtain multiple channels; wherein the multiple channels include a first channel and a second channel; The first embedding module is used to embed watermark information into the first channel to obtain a first channel containing watermark information; The second embedding module is used to embed location information into the second channel to obtain a second channel containing location information; The generation module is used to generate a target image corresponding to the image to be processed based on the first channel containing watermark information and the second channel containing location information; The third embedding module is used to embed the target image into the target frame image to obtain a watermarked video; The second embedding module is further configured to: A circular region is defined with the original anchor point as the center; wherein the original anchor point is used to indicate the relative position of the image to be processed in the target frame image; The circular area is divided into multiple sectors, wherein the multiple sectors include the target sector and the remaining sectors; The value of the target sector is retained, and the values of the remaining sectors are set to fixed values; The value reserved in the target sector and the fixed values of the remaining sectors are both stored in the second channel.
10. A video watermark decoding device, characterized in that, The device includes: The acquisition module is used to acquire the target frame image of the video. The target frame image has watermark information loaded in the first channel and position information loaded in the second channel. The decomposition module is used to perform channel decomposition on the target frame image to obtain the first channel and the second channel; A decoding module is used to decode the second channel to obtain position information, the position information including anchor point group information; wherein, the anchor point group information is used to specify the position information of the watermark in the target frame image; The adjustment module is used to adjust the layer corresponding to the first channel according to the anchor point group information; The watermark decoding module is used to decode the watermark on the adjusted layer to obtain the watermark information of the video. The adjustment module is further configured to: determine a geometric transformation matrix based on the original anchor point group and the anchor point group; wherein the original anchor point group is the anchor point group of the video that has not undergone geometric transformation operation; and perform geometric transformation on the layer corresponding to the first channel based on the geometric transformation matrix to adjust the layer; The anchor point group includes multiple anchor points, each anchor point corresponding to a sector; correspondingly, the decoding module is also used to obtain sectors in the target frame image; based on the obtained sectors, the anchor points in the target frame image are obtained, and the anchor points are used to indicate the relative position of the watermark in the target frame image.
11. A computer device, characterized in that, include: At least one processor; and A memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method as described in any one of claims 1 to 8.
13. A computer program product comprising computer instructions, characterized in that, When executed by a processor, the computer instructions implement the method of any one of claims 1 to 8.
Citation Information
Patent Citations
Android photo position and time digital watermark embedding and extraction method
CN106373079A