Watermark information embedding and extracting method, device, equipment, program product and medium
By performing frequency domain conversion and frequency domain modification of video frames, and adjusting frequency domain coefficients to meet the preset mapping relationship, the problem of poor watermark information in the prior art is solved, and stronger anti-interference ability is achieved and better copyright protection.
Patent Information
- Application Number
- CN202311001168.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2025-02-18
AI Technical Summary
When the prior art embeds watermark information in video frames, it has poor robustness, weak anti-interference ability, and is easily lost in processing operations such as image compression, affecting video quality and copyright protection.
By performing frequency domain conversion of the target image frame, multiple frequency domain modification segments are determined, and each segment is divided according to preset parameters, the frequency domain coefficients of the area to be embedded, and by adjusting these coefficients, it is marked with the watermark The bits in the information bit stream satisfy the preset mapping relationship.
The anti-interference ability of watermark information is improved, so that it can still be successfully extracted after image compression, rotation, translation, etc., ensuring the copyright traceability and protection of video frames.
Smart Images

Figure CN119477651A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to watermark information processing technology, and in particular to a watermark information embedding and extraction method, device, electronic device, computer program product and storage medium. Background Art
[0002] Digital watermark information technology refers to the technology of embedding watermark information into data, which is an effective way to achieve anti-counterfeiting traceability and copyright protection. For example, before publishing a video, the publisher's watermark information is embedded in the video to indicate the publisher's identity, thereby preventing the video from being stolen.
[0003] In the related art, watermark information is usually embedded in the frequency domain of the video. The watermark information embedding technical solutions in the related art mainly focus on modifying the lowest bit of the image data to embed multi-bit watermark information. The least significant bit method (LSB) is a typical spatial domain watermark information algorithm, which modifies the lowest bit of the chrominance component to complete the embedding of the watermark information. The least significant bit method is simple to implement, but has poor robustness and may also affect the video quality. At the same time, this watermark information has poor anti-interference ability. For example, processing operations such as image compression will erase the embedded watermark information, resulting in the loss of watermark information. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a watermark information embedding and extraction method, device, electronic device, computer program product and storage medium. The technical solution of the embodiments of the present application is implemented as follows:
[0005] The present invention provides a method for embedding watermark information, the method comprising:
[0006] Performing domain conversion processing on the target image frame to obtain frequency domain data corresponding to the target image frame;
[0007] Obtaining a watermark information bit stream corresponding to the watermark information to be embedded;
[0008] Determine a plurality of frequency domain modification segments in the frequency domain data, and divide each of the frequency domain modification segments into regions according to preset parameters to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modification segment; the plurality of frequency domain modification segments have the same origin and different distances;
[0009] Obtaining frequency domain coefficients of a plurality of to-be-embedded regions corresponding to each frequency domain modification segment;
[0010] The frequency domain coefficient of each to-be-embedded area corresponding to each frequency domain modification segment is adjusted until the frequency domain coefficient of the to-be-embedded area between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship.
[0011] The present application also provides a method for extracting watermark information, including:
[0012] Performing domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected;
[0013] determining a frequency domain detection segment in the frequency domain data;
[0014] Segmenting the frequency domain detection segment according to a preset standard degree to obtain a plurality of regions to be extracted;
[0015] Calculating a mapping relationship between frequency domain coefficients of the plurality of regions to be extracted, and extracting different embedded bits according to the mapping relationship;
[0016] The different embedded bits are combined and decoded to obtain embedded watermark information, and the embedded watermark information is embedded according to the previous watermark information embedding method.
[0017] The present application also provides a watermark information embedding device, including:
[0018] An information conversion module, used to perform domain conversion processing on the target image frame to obtain frequency domain data corresponding to the target image frame;
[0019] The information conversion module is further used to obtain a watermark information bit stream corresponding to the watermark information to be embedded;
[0020] a watermark information embedding module, configured to determine a plurality of frequency domain modification segments in the frequency domain data, and divide each of the frequency domain modification segments into regions according to preset parameters, so as to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modification segment; the plurality of frequency domain modification segments have the same origin and different distances;
[0021] The watermark information embedding module is further used to obtain frequency domain coefficients of multiple to-be-embedded areas corresponding to each frequency domain modification segment;
[0022] The watermark information embedding module is further used to adjust the frequency domain coefficients of each to-be-embedded area corresponding to each frequency domain modification segment until the frequency domain coefficients of the to-be-embedded area between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship.
[0023] In some embodiments, the information conversion module is further used to obtain the target video to be processed and the watermark information embedded frame number information;
[0024] The information conversion module is further used to perform frame extraction processing on the target video to obtain at least two image frames;
[0025] The information conversion module is further used to screen the at least two image frames according to the frame number information embedded in the watermark information to obtain the target image frame.
[0026] In some embodiments, the information conversion module is further used to obtain watermark information to be embedded of a specific type, wherein the specific type includes any one of the following: a bit stream data type, a picture data type, and a text data type;
[0027] The information conversion module is further used to convert the specific type of watermark information to be embedded into an information exchange standard code;
[0028] The information conversion module is further used to perform standard bit conversion on the information exchange standard code to obtain an initial bit stream;
[0029] The information conversion module is further used to perform Hamming code encoding on the initial bit stream to obtain a watermark information bit stream corresponding to the watermark information to be embedded.
[0030] In some embodiments, the information conversion module is further used to determine the center point of the frequency domain data;
[0031] The information conversion module is further used to determine the origin of each frequency domain modification segment according to the center point of the frequency domain data, and the origin is the common origin of each frequency domain modification segment;
[0032] The information conversion module is further used to obtain a first preset distance corresponding to the first frequency domain modification segment, and determine the first frequency domain modification segment according to the origin and the first preset distance;
[0033] The information conversion module is further used to obtain a second preset distance corresponding to the second frequency domain modification segment, and determine the second frequency domain modification segment according to the origin and the second preset distance;
[0034] A third preset distance corresponding to the third frequency domain modification segment is acquired, and the third frequency domain modification segment is determined according to the origin and the third preset distance.
[0035] In some embodiments, the watermark information embedding module is further used to obtain a preset standard degree that matches the watermark information to be embedded;
[0036] The watermark information embedding module is further used to divide the first frequency domain modified segment into a preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded areas of the first frequency domain modified segment;
[0037] The watermark information embedding module is further used to divide the second frequency domain modified segment into the preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded areas of the second frequency domain modified segment;
[0038] The watermark information embedding module is further used to divide the third frequency domain modified segment into the preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded areas of the third frequency domain modified segment.
[0039] In some embodiments, the watermark information embedding module is further used to determine frequency domain coefficients of to-be-embedded regions having the same standard degree in the plurality of frequency domain modification segments;
[0040] The watermark information embedding module is further used to configure the frequency domain coefficients of the to-be-embedded area with the same standard degree into a frequency domain coefficient triplet, wherein the frequency domain coefficient triplet includes: a first frequency domain coefficient, a second frequency domain coefficient and a third frequency domain coefficient, and the first frequency domain coefficient, the second frequency domain coefficient and the third frequency domain coefficient have the same standard degree;
[0041] The watermark information embedding module is further used to determine the value of the bit to be embedded in the watermark information bit stream;
[0042] The watermark information embedding module is further used to determine a preset mapping relationship of frequency domain coefficients of a to-be-embedded area of each frequency domain modification segment according to the value of the to-be-embedded bit;
[0043] The watermark information embedding module is also used to dynamically adjust the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment based on the preset mapping relationship until the first frequency domain coefficient, the second frequency domain coefficient, the third frequency domain coefficient and the to-be-embedded bits in the watermark information bit stream satisfy the preset mapping relationship.
[0044] In some embodiments, the watermark information embedding module is further used for the preset mapping relationship to include the difference of the frequency domain coefficients of the area to be embedded;
[0045] The determining, according to the value of the bit to be embedded, a preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment comprises:
[0046] The watermark information embedding module is further used to obtain a first difference value of the frequency domain coefficients of the area to be embedded;
[0047] The watermark information embedding module is further used to, when the value of the bit to be embedded is 0, perform synchronous subtraction adjustment on the first frequency domain coefficient and the third frequency domain coefficient, and determine that the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: the difference between the second frequency domain coefficient and the third frequency domain coefficient is greater than the first difference, and the difference between the second frequency domain coefficient and the first frequency domain coefficient is greater than the first difference; or
[0048] The watermark information embedding module is also used to synchronously add and adjust the first frequency domain coefficient and the third frequency domain coefficient when the value of the bit to be embedded is 0, and determine that the preset mapping relationship of the frequency domain coefficients of the area to be embedded in each frequency domain modification fragment is: the difference between the first frequency domain coefficient and the second frequency domain coefficient is greater than the first difference, and the difference between the third frequency domain coefficient and the second frequency domain coefficient is greater than the first difference.
[0049] In some embodiments, the information conversion module is further used to detect the propagation link of the target image frame to obtain the number of propagation link levels of the target image frame;
[0050] The first difference is adjusted according to the number of propagation link levels of the target image frame to obtain a second difference in the frequency domain coefficients of the area to be embedded.
[0051] The embodiment of the present application also provides a watermark information extraction device, characterized in that the device comprises:
[0052] An image processing module is used to perform domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected;
[0053] The image processing module is further used to determine a frequency domain detection segment in the frequency domain data;
[0054] The image processing module is further used to segment the frequency domain detection segment according to a preset standard degree to obtain a plurality of regions to be extracted;
[0055] A watermark information extraction module, used to calculate the mapping relationship between the frequency domain coefficients of the multiple areas to be extracted, and extract different embedded bits according to the mapping relationship;
[0056] The watermark information extraction module is further used to combine and decode the different embedded bits to obtain embedded watermark information, and the embedded watermark information is embedded according to the preceding method.
[0057] In some embodiments, the watermark information extraction module is further used to, when the number of the to-be-extracted regions is 3, determine that the frequency domain coefficients of the to-be-extracted regions include: a fourth frequency domain coefficient, a fifth frequency domain coefficient, and a sixth frequency domain coefficient, wherein the fourth frequency domain coefficient, the fifth frequency domain coefficient, and the sixth frequency domain coefficient have the same standard degree;
[0058] The watermark information extraction module is further configured to determine that the extracted embedded bit is 0 when the fifth frequency domain coefficient is greater than the fourth frequency domain coefficient and the fifth frequency domain coefficient is greater than the sixth frequency domain coefficient;
[0059] The watermark information extraction module is further configured to determine that the extracted embedded bit is 1 when the fifth frequency domain coefficient is smaller than the fourth frequency domain coefficient and the fifth frequency domain coefficient is smaller than the sixth frequency domain coefficient.
[0060] The present application also provides an electronic device, the electronic device comprising:
[0061] A memory for storing executable instructions;
[0062] The processor is used to implement the preceding watermark information embedding method or the preceding watermark information extraction method when running the executable instructions stored in the memory.
[0063] The embodiment of the present application further provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the above-mentioned watermark information embedding method, or implement the previous watermark information extraction method.
[0064] The embodiment of the present application further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the above-mentioned watermark information embedding method, or implements the previous watermark information extraction method.
[0065] The embodiments of the present application have the following beneficial effects:
[0066] 1) The embodiment of the present application obtains frequency domain data corresponding to the target image frame by performing domain conversion processing on the target image frame; obtains a watermark information bit stream corresponding to the watermark information to be embedded; determines multiple frequency domain modification fragments in the frequency domain data, and divides each of the frequency domain modification fragments into regions according to preset parameters to obtain multiple to-be-embedded regions corresponding to each frequency domain modification fragment; the multiple frequency domain modification fragments have the same origin and different distances; thereby, the embedding region of the watermark information can be flexibly selected in the frequency domain data corresponding to different target image frames according to different watermark information embedding requirements, thereby ensuring the accuracy of the watermark information embedding position.
[0067] 2) The embodiment of the present application obtains the frequency domain coefficients of the multiple areas to be embedded corresponding to each frequency domain modification segment; adjusts the frequency domain coefficients of each area to be embedded corresponding to each frequency domain modification segment until the frequency domain coefficients of the areas to be embedded between the multiple frequency domain modification segments and the bits to be embedded in the watermark information bit stream satisfy the preset mapping relationship. Thus, the preset mapping relationship can be used to make the embedded watermark information more resistant to interference, and at the same time, the added watermark information will not affect the imaging of the image and has high robustness. Even if the image frame carrying the watermark information is compressed, rotated, translated, re-encoded, etc., due to the position invariance and linear transformation characteristics of the frequency domain signal, the computer device can still successfully extract the watermark information from the image frame carrying the watermark information. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of a usage scenario of the watermark information embedding method provided in an embodiment of the present application;
[0069] Figure 2 An optional flow chart of the watermark information embedding method provided in the embodiment of the present application;
[0070] Figure 3 A schematic diagram of a process of adjusting the frequency domain coefficients of each to-be-embedded region corresponding to each frequency domain modification segment in an embodiment of the present invention;
[0071] Figure 4 A schematic diagram of a process of extracting watermark information in an embodiment of the present invention;
[0072] Figure 5 Schematic diagram of an image frame to be detected in an embodiment of the present application;
[0073] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application for executing the watermark information embedding method provided in the present application. DETAILED DESCRIPTION
[0074] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0075] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0076] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0077] 1) Digital watermark information: refers to embedding specific information into a digital signal, which may be audio, image or video. If you want to copy a signal with digital watermark information, the embedded information will also be copied. Digital watermark information can be divided into two types: emergent and hidden. The former is visible watermark information, and the information contained in it can be seen at the same time when watching pictures or videos. Generally speaking, emergent watermark information usually contains the name or logo of the copyright owner. Hidden watermark information adds watermark information by changing part of the data in the digital signal. This kind of data change in the digital signal is usually not easy to detect.
[0078] 2) Terminals, including but not limited to: ordinary terminals and dedicated terminals, wherein the ordinary terminals maintain a long connection or a short connection with the sending channel, and the dedicated terminals maintain a long connection with the sending channel.
[0079] 3) Client, a carrier that implements specific functions in a terminal. For example, a mobile client (APP) is a carrier of specific functions in a mobile terminal, such as executing image frame processing functions or performing watermark information extraction functions.
[0080] 4) Cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing. It is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0081] 5) Discrete Cosine Transform (DCT): It is a transformation defined for real signals. After the transformation, a real signal is also obtained in the frequency domain. Compared with Discrete Fourier Transform (DFT), DCT can reduce more than half of the calculation. DCT also has a very important property (energy concentration characteristic): the energy of most natural signals (sound, image) is concentrated in the low-frequency part after discrete cosine transform, so DCT is widely used in (sound, image) data compression. Since DCT is another transform derived from DFT, many properties of DFT are still retained in DCT. For example, discrete cosine transform is a transform related to Fourier transform, similar to discrete Fourier transform, but only uses real numbers. Discrete cosine transform is equivalent to a discrete Fourier transform with a length of about twice that of discrete Fourier transform, which is performed on a real even function.
[0082] 6) Robustness: It means that after the original signal has been processed by a variety of unintentional or intentional signal processing, the digital watermark information can still be fully recognized or accurately identified. Common signal processing processes include channel noise, digital filtering, digital-to-analog and analog-to-digital conversion, signal sampling, shift transformation, scale change, and lossy or lossless compression. For example, with digital watermark information technology with good robustness, it is difficult for attackers to use common image processing (such as data compression, low-pass filtering, high-pass filtering, image enhancement, subsampling / sampling, secondary quantization), geometric transformation and geometric distortion (such as cropping, scale stretching, translation, rotation, distortion, etc.), noise interference (salt and pepper noise, Gaussian noise), overlapping of multiple watermark information, etc. to destroy, delete watermark information or forge copyright marks of data.
[0083] 7) Hamming Code: Hamming Code inserts a 0 (or 1) at a fixed position in the original data to perform odd (or even) check. Although it makes the original data longer, it can give it error correction capabilities.
[0084] Before explaining the watermark information embedding method provided by the present application, the defects in the related art are first explained. The inventors found in their research that the commonly used method for embedding watermark information in video frames in the related art is the least significant bit method. The least significant bit method (LSB) is a typical spatial domain watermark information algorithm, which completes the embedding of watermark information by modifying the lowest bit of the chrominance component, that is, using the modification of multiple pixel values to represent a bit of information. This algorithm is simple to implement, but has poor robustness and may also affect the video quality. At the same time, this watermark information has poor anti-interference ability. When the video frame undergoes more propagation chains (for example, multiple propagations in different instant messaging clients), image compression and other processing operations will erase the embedded watermark information, resulting in the loss of watermark information. The video frame cannot be traced, which is not conducive to the copyright protection of the video information.
[0085] In order to solve the above defects, the present application provides a watermark information embedding method, which can utilize a preset mapping relationship to make the embedded watermark information more resistant to interference, and at the same time ensure that the added watermark information will not affect the imaging of the image and has high robustness.
[0086] Figure 1 Schematic diagram of the application scenario of the watermark information embedding method provided in the embodiment of the present application, see Figure 1 , with the continuous development of computer technology, cloud servers can provide secure and reliable elastic computing services, and can also provide different instance types to meet the specific usage scenarios of the target object. The electronic device 100 may include two different types of terminals or electronic devices, namely terminal 10-1 and terminal 10-2, and the target object can be selected according to the usage requirements of different information transmission usage scenarios. The terminal (including terminal 10-1 and terminal 10-2) is provided with a corresponding client capable of executing a video frame viewing function. When executing the watermark information embedding method provided in the present application, the terminal (including terminal 10-1 and terminal 10-2) is required to embed watermark information in the video to be uploaded, thereby protecting the copyright of the uploaded video.
[0087] The video transmission path established by the terminal (including terminal 10-1 and terminal 10-2) can establish a connection with the cloud server 200 through the network 300. Terminal 10-1 and terminal 10-2 can respectively use the watermark information embedding method provided by the present application to embed watermark information in the video to be uploaded, and can also extract watermark information from the video to be played obtained through the video transmission path, so as to determine whether the copyright of the video to be played meets the playback requirements. In this process, the terminal connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two, and a wireless link is used to realize data transmission. Combined with Figure 1As shown, in the embodiments provided in the present application, the cloud server 200 may be written in a software code environment of different programming languages, and the code objects may be different types of code entities. For example, in a software code of the C language, a code object may be a function. In a software code of the JAVA language, a code object may be a class.
[0088] See also Figure 2 , Figure 2 A schematic diagram of an implementation flow of a watermark information embedding method provided in an embodiment of the present application, wherein the embodiment of the present application can be implemented in combination with cloud technology, which refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize data calculation, storage, processing, and sharing. It can also be understood as a general term for network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business model applications. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites, and more portal websites, so cloud technology needs to be supported by cloud computing.
[0089] It should be noted that cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use. As a basic capability provider of cloud computing, a cloud computing resource pool platform will be established, referred to as a cloud platform, generally referred to as Infrastructure as a Service (IaaS Infrastructure as a Service), and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (which can be virtualized machines, including operating systems), storage devices and network devices. Different operation permissions are given to the target objects for embedding watermark information through cloud servers.
[0090] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world. In the related art, the storage method of the storage system is: create a logical volume. When creating a logical volume, a physical storage space is allocated to each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, the data is stored on the file system. The file system divides the data into many parts, each of which is an object. The object not only contains data but also contains additional information such as data identification (ID IDentity). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object. Therefore, when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object. The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the capacity of the actual objects to be stored) and the grouping of independent redundant disk arrays (RAID Redundant Array of Independent Disks), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0091] Understandably, Figure 2 The execution subject of the steps shown can be implemented by a terminal running a watermark information embedding device alone, or by a server running a watermark information embedding device. Figure 2 The processing steps shown in the figure are explained by taking the server as the execution subject as an example. Figure 2 The steps shown are explained.
[0092] Step 201: performing domain conversion processing on a target image frame to obtain frequency domain data corresponding to the target image frame.
[0093] In some embodiments, before executing step 201, it is necessary to select a target image frame in the video according to the embedding requirements of different types of watermark information. The target image frame may be selected in the video in the following manner:
[0094] Obtain the target video to be processed and the number of frames in which the watermark information is embedded; perform frame extraction processing on the target video to obtain at least two image frames; and screen the at least two image frames according to the number of frames in which the watermark information is embedded to obtain the target image frame. The target video includes at least two frames of images (image frames). Exemplarily, the target image frame may be one image frame, or several consecutive image frames within a period of time, or a plurality of image frames extracted at fixed time intervals, or all image frames of the target video. The target image frame may be all image frames in the target video, or a portion of image frames selected from all image frames according to an extraction method. For example, the extraction method may be: extracting one image frame as the target image frame every other image frame. Exemplarily, the embodiment of the present application takes the target image frame as all image frames in the target video as an example, that is, watermark information is added to each image frame in the target video.
[0095] In some embodiments, when the device executing the watermark information embedding method provided by the present application is a terminal, the target video can be a captured video uploaded by a user, a locally stored target video, or a network video downloaded from the network. Exemplarily, when the device executing the method is a server, the target video can be a locally stored target video on the server, or a target video uploaded by the terminal to the server.
[0096] In some embodiments, taking the target video as a TV series video as an example, the watermark information that needs to be embedded is the copyright number of the TV series. At this time, the watermark information is embedded in the frame number information as 1, that is, the copyright number information of the TV series is embedded in the first frame of the TV series video. At this time, two image frames are obtained by extracting the frame of the TV series video; according to the watermark information embedded in the frame number information as 1, the two image frames are screened as the first frame of the TV series video as the target image frame, and the copyright number information of the TV series is embedded through the watermark information embedding method provided in this application.
[0097] In some embodiments, the target image frame is subjected to domain conversion processing through step 201, and the obtained data is the frequency domain data corresponding to the video frame data. Compared with the spatial domain or time domain data of the target video frame, the spatial domain or time domain data is unstable and easily lost when disturbed, while the frequency domain data has a strong anti-interference ability. Therefore, the target image frame is subjected to frequency domain transformation to obtain the frequency domain vector of the target image frame, so that the target image frame information is avoided from being lost in the subsequent process of adding the watermark information to the target image frame. Specifically, the embodiment of the present application adds watermark information to the target image frame in the frequency domain data. Compared with adding watermark information to the target image frame in the spatial domain or time domain of the video data, adding watermark information to the frequency domain data has less impact on the video picture. When adding watermark information in the spatial domain, only the pixel values of the pixels in the image are changed. With this method, the more transmission link levels of the target image frame, the more processing operations of the video data. If the video data is copied, encoded, and compressed multiple times, the pixel values of each pixel in the image will change, and this change is irregular. Users will not be able to extract the watermark information from the video data again, which is not conducive to the copyright traceability of video data and is easy to cause pirated video data abuse. When adding watermark information in the frequency domain, by changing the value of the image in the time domain, even if the video data is copied, offset, cropped, encoded, and compressed multiple times, the value of the image in the video in the frequency domain will not change much, and users can still extract the watermark information from the video data again, making the copyright traceability of video data more accurate.
[0098] In some embodiments, the method for frequency domain transformation of the target image frame can be selected according to the actual situation. For example, a discrete Fourier transform (DFT) method or a discrete cosine transform (DCT) method is used as the method for frequency domain transformation of the target image frame in the embodiment of the present application, and the embodiment of the present application does not impose specific restrictions on this. When a discrete cosine transform is used, the discrete cosine transform has the characteristics of position invariance and linear transformation. After the video image frame carrying the watermark information is compressed, the position of its frequency domain data remains unchanged and the change of the frequency domain data is linear, so the watermark information can be accurately extracted.
[0099] Step 202: Obtain a watermark information bit stream corresponding to the watermark information to be embedded.
[0100] In some embodiments, obtaining a watermark information bit stream corresponding to the watermark information to be embedded may include two methods: 1) obtaining a watermark information bit stream corresponding to the watermark information to be embedded from a cloud server (wherein, a watermark information processing terminal encodes the watermark information to be embedded, and stores the watermark information bit stream corresponding to the watermark information to be embedded in the cloud server); 2) a server that executes the watermark information embedding method provided in the present application encodes the watermark information to be embedded, and obtains a watermark information bit stream corresponding to the watermark information to be embedded. Since the security of obtaining the watermark information bit stream corresponding to the watermark information to be embedded in the above two methods is different, when the watermark information bit stream corresponding to the watermark information to be embedded is obtained from the cloud server, the watermark information bit stream is at risk of being tampered with. Therefore, before executing step 202, it is necessary to detect the security of the watermark information embedding environment according to the identification of the target image frame. When the security detection result of the watermark information embedding environment is greater than the security threshold, the watermark information bit stream corresponding to the watermark information to be embedded is obtained from the cloud server. When the security detection result of the watermark information embedding environment is less than or equal to the security threshold, the server that executes the watermark information embedding method provided by the present application encodes the watermark information to be embedded to obtain the watermark information bit stream corresponding to the watermark information to be embedded.
[0101] In some embodiments, obtaining the watermark information bit stream corresponding to the watermark information to be embedded may be achieved by:
[0102] Obtain watermark information to be embedded of a specific type, the specific type including any one of the following: a bitstream data type, a picture data type, and a text data type; convert the specific type of watermark information to be embedded into a standard code for information exchange; perform standard bit conversion on the standard code for information exchange to obtain an initial bit stream; perform Hamming code encoding on the initial bit stream to obtain a watermark information bit stream corresponding to the watermark information to be embedded. Among them, the watermark information embedded in the video frame in the embodiment of the present application is hidden watermark information. That is: after adding the watermark information, the user cannot intuitively see the watermark information from the video screen, and the watermark information can only be extracted from the video through the corresponding watermark information extraction method. At the same time, no matter in which instant messaging client the video frame is transmitted, the watermark information still maintains robustness, which is convenient for using the watermark information to detect the compliance of the video data.
[0103] In some embodiments, the watermark information to be embedded can be provided by the user, or can be automatically generated based on the user's username, or can be the default watermark information provided by the application. The watermark information can be any one of text, numbers, characters, and images. Exemplarily, for text and images, the text and images can be converted into numbers, and then the frequency domain coefficients in the target frequency domain data are modified according to the numbers of the watermark information. For example, an image can be converted into a matrix composed of pixel values; Chinese characters can be converted into digital numbers, or Chinese characters can be converted into English, and English can be converted into digital numbers. This application does not make specific restrictions on this.
[0104] In some embodiments, the watermark information bit stream refers to a data stream that may include multiple bits, where a bit may be 0 bit or 1 bit. The method for encoding the watermark information may be selected according to actual conditions. For example, the watermark information may be encoded into ASCII code (standard code for information interchange) using the base64 method, and then the ASCII code may be converted into a bit stream. For example, if the specific type of watermark information to be embedded is the English word "Copyright Movie 1", the watermark information is encoded into an ASCII code of "\u7248\u6743\u7535\u5f711" using the base64 method, and the corresponding bit stream is "0111010101101110 0110010001100101 01100110 01101001 01101110 01100101 01100100".
[0105] In some embodiments, since the target image frame may be disturbed during transmission when the number of propagation link levels exceeds 3, the embedded watermark information may be disturbed. In order to resist such disturbance and reduce the watermark information extraction errors, the initial bit stream after the initial encoding can be encoded with Hamming code to obtain the encoded watermark information bit stream, so that the watermark information bit stream can detect and correct multiple bit errors.
[0106] Step 203: Determine multiple frequency domain modification segments in the frequency domain data, and divide each frequency domain modification segment into regions according to preset parameters to obtain multiple to-be-embedded regions corresponding to each frequency domain modification segment, wherein the multiple frequency domain modification segments have the same origin and different distances.
[0107] In some embodiments, the number of frequency domain modification segments is a positive integer greater than or equal to 3 and less than or equal to 6. Taking the number of frequency domain modification segments as 3 as an example, the multiple frequency domain modification segments include a first frequency domain modification segment, a second frequency domain modification segment, and a third frequency domain modification segment. Determining multiple frequency domain modification segments in the frequency domain data can be implemented in the following manner:
[0108] First, determine the center point of the frequency domain data; determine the origin of each frequency domain modification segment according to the center point of the frequency domain data, and the origin is the common origin of each frequency domain modification segment; then, obtain the first preset distance corresponding to the first frequency domain modification segment, and determine the first frequency domain modification segment according to the origin and the first preset distance; obtain the second preset distance corresponding to the second frequency domain modification segment, and determine the second frequency domain modification segment according to the origin and the second preset distance; obtain the third preset distance corresponding to the third frequency domain modification segment, and determine the third frequency domain modification segment according to the origin and the third preset distance. Wherein, due to the different contents of the video frames, the position of the center point of the frequency domain data is also different. Optionally, the center point of the frequency domain data can be used as the origin of each frequency domain modification segment. Regardless of the number of frequency domain modification segments, all frequency domain modification segments can use the center point of the frequency domain data as the common origin of the frequency domain modification segment to ensure the integrity and continuity of the embedded watermark information. At the same time, the integrity of the watermark information extraction can be ensured when the watermark information is extracted, making the traceability of the video frame more accurate. At the same time, no matter how many frequency domain modification segments there are, when all frequency domain modification segments use the center point of the frequency domain data as the origin of the common frequency domain modification segment, the preset distances corresponding to each type of frequency domain modification segment are different. Taking the previous embodiment in which multiple frequency domain modification segments include a first frequency domain modification segment, a second frequency domain modification segment and a third frequency domain modification segment as an example, the first preset distance is smaller than the second preset distance, and the second preset distance is smaller than the third preset distance. This ensures that different types of frequency domain modification segments are obtained using different preset distances, thereby achieving the acquisition of frequency domain coefficient triplets (multiple groups) to implement the watermark information embedding method provided in the present application.
[0109] In some embodiments, the value range of the first preset distance, the second preset distance and the third preset distance is 5% to 50% (relative to the radius of the frequency domain data). In order to uniformly embed watermark information identifying copyright into different types of target videos, the values of the first preset distance, the second preset distance and the third preset distance can be fixed, that is, the first preset distance is 5%, the second preset distance is 15%, and the third preset distance is 25%. The use of fixed first preset distance, second preset distance and third preset distance can effectively save the time of embedding watermark information identifying copyright.
[0110] In some embodiments, since each bit in the watermark information bit stream needs to be embedded in a corresponding region, each frequency domain modification segment is divided into regions according to preset parameters to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modification segment, which can be achieved in the following manner:
[0111] Obtain a preset standard degree that matches the watermark information to be embedded; divide the first frequency domain modification segment into a preset number of equal proportions according to the preset standard degree to obtain a preset number of regions to be embedded in the first frequency domain modification segment; divide the second frequency domain modification segment into a preset number of equal proportions according to the preset standard degree to obtain a preset number of regions to be embedded in the second frequency domain modification segment; divide the third frequency domain modification segment into a preset number of equal proportions according to the preset standard degree to obtain a preset number of regions to be embedded in the third frequency domain modification segment. By dividing the corresponding frequency domain modification segment into a preset number of equal proportions according to the preset standard degree, each region to be embedded can have a portion of three frequency domain modification segments. Specifically, in combination with the above-mentioned embodiment, taking the preset standard degree of 6 degrees as an example, since the first preset distance is 5%, the second preset distance is 15%, and the third preset distance is 25%, the corresponding frequency domain modification segment is a circle, when embedding watermark information, only the upper half of the corresponding frequency domain modification segment (i.e., a half-circular frequency domain modification segment of 180 degrees) can be evenly divided into 30 regions according to the preset standard degree (6 degrees), and 1 bit of information is embedded in each region. Therefore, each frequency domain modification segment can obtain 3 frequency domain coefficients that can be configured as a 3-tuple.
[0112] Step 204: Obtain frequency domain coefficients of multiple to-be-embedded regions corresponding to each frequency domain modification segment.
[0113] Step 205: adjusting the frequency domain coefficients of each to-be-embedded region corresponding to each frequency domain modification segment until the frequency domain coefficients of the to-be-embedded region between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bitstream satisfy a preset mapping relationship.
[0114] refer to Figure 3 , Figure 3 Schematic diagram of a process of adjusting the frequency domain coefficients of each to-be-embedded region corresponding to each frequency domain modification segment in an embodiment of the present invention. Figure 3 The execution subject of the steps shown can be implemented by a terminal running a watermark information embedding device alone, or by a server running a watermark information embedding device. Figure 3 The processing steps shown in the figure are explained by taking the server as the execution subject as an example. Figure 3 The steps shown are explained.
[0115] Step 301: Determine frequency domain coefficients of to-be-embedded regions having the same standard degree in a plurality of frequency domain modification segments.
[0116] In some embodiments, combined with the above-mentioned embodiments, taking the preset standard degree of 6 degrees as an example, since the first preset distance is 5%, the second preset distance is 15%, and the third preset distance is 25%, the corresponding frequency domain modification segment is a circle. When embedding watermark information, only the upper half of the corresponding frequency domain modification segment (i.e., a half-circular frequency domain modification segment of 180 degrees) can be evenly divided into 30 regions according to the preset standard degree (6 degrees), and each region is embedded with 1 bit of information. Therefore, each frequency domain modification segment can obtain 3 frequency domain coefficients that can be configured as a 3-tuple. That is, each frequency domain modification segment can be a (corresponding to the first preset distance of 5%), b (corresponding to the second preset distance of 15%), and c (corresponding to the third preset distance of 25%) in sequence.
[0117] Step 302: The frequency domain coefficients of the to-be-embedded region having the same standard degree are configured as a frequency domain coefficient triplet.
[0118] In some embodiments, in combination with the previous embodiments, the frequency domain coefficient triplet includes: a first frequency domain coefficient, a second frequency domain coefficient and a third frequency domain coefficient, the standard degrees corresponding to the first frequency domain coefficient, the second frequency domain coefficient and the third frequency domain coefficient are the same (all 6 degrees), and the three frequency domain coefficients of each frequency domain modified segment can be configured as a 3-tuple, which can be expressed as (a, b, c).
[0119] Step 303: Determine the value of the bit to be embedded in the watermark information bit stream.
[0120] In some embodiments, taking the specific type of watermark information to be embedded as "Copyright Movie 1" as an example, the watermark information is encoded into an ASCII code of "\u7248\u6743\u7535\u5f711" using the base64 method, and the corresponding bit stream is "01110101 01101110 01100100 01100101 01100110 0110100101101110 011001010101100100". At this time, the value of the bit to be embedded determined by step 303 is each value in the bit stream.
[0121] Step 304: Determine a preset mapping relationship of frequency domain coefficients of the to-be-embedded region of each frequency domain modification segment according to the value of the to-be-embedded bit.
[0122] Step 305: Dynamically adjust the frequency domain coefficients of the to-be-embedded region of each frequency domain modification segment based on a preset mapping relationship until the first frequency domain coefficient, the second frequency domain coefficient, the third frequency domain coefficient and the to-be-embedded bits in the watermark information bitstream satisfy a preset mapping relationship.
[0123] In some embodiments, the preset mapping relationship includes the difference of the frequency domain coefficients of the region to be embedded;
[0124] Determining the preset mapping relationship of the frequency domain coefficients of the to-be-embedded region of each frequency domain modification segment according to the value of the to-be-embedded bit can be achieved in the following manner:
[0125] Obtaining a first difference value of the frequency domain coefficients of the area to be embedded;
[0126] When the value of the bit to be embedded is 0, the first frequency domain coefficient and the third frequency domain coefficient are synchronously subtracted and adjusted to determine that the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: the difference between the second frequency domain coefficient and the third frequency domain coefficient is greater than the first difference, and the difference between the second frequency domain coefficient and the first frequency domain coefficient is greater than the first difference; or when the value of the bit to be embedded is 1, the first frequency domain coefficient and the third frequency domain coefficient are synchronously added and adjusted to determine that the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: the difference between the first frequency domain coefficient and the second frequency domain coefficient is greater than the first difference, and the difference between the third frequency domain coefficient and the second frequency domain coefficient is greater than the first difference. In combination with the foregoing embodiment, the value of the bit to be embedded determined by step 303 is the bit stream "01110101 01101110 01100100 01100101 01100110 01101001 For each value in "011011100110010101100100", the frequency domain coefficient triplet is (a, b, c). Taking the first difference value of 18 as an example, if the embedded bit is 0, a and c can be synchronized by -1 until the number of abc3 satisfies: ba>18 and bc>18. If the embedded bit is 1, a and c can be synchronized by +1 until the number of abc3 satisfies: ab>18 and cb>18. In this process, ac is modified synchronously to maintain the relative size of ac, so that the modification of the image content by the watermark information is not easily perceived by the naked eye, so as to enhance the concealment of the watermark information and improve the anti-interference ability of the watermark information without affecting the content of the video frame.
[0127] In some embodiments, for videos of popular film and television works, there is often a problem of video piracy. At this time, the target image frame of the video has a large number of propagation link levels. For example, the pirated videos of popular film and television works are often spread through network disks, instant messaging clients, and video players. For this reason, it is necessary to adjust the first difference of the frequency domain coefficients of the area to be embedded so that the difference of the frequency domain coefficients of the area to be embedded is adapted to the number of propagation link levels of the target image frame. This can be achieved in the following way: the propagation link of the target image frame is detected to obtain the number of propagation link levels of the target image frame; according to the number of propagation link levels of the target image frame, the first difference is adjusted to obtain the second difference of the frequency domain coefficients of the area to be embedded. Among them, when the number of propagation link levels of the target image frame is greater than or equal to 3, the first difference can be increased, and when the number of propagation link levels of the target image frame is less than 3, the first difference can be reduced. By flexibly adjusting the first difference and using the preset mapping relationship, the anti-interference ability of the embedded watermark information is stronger, and at the same time, the added watermark information will not affect the imaging of the image and has high robustness. Even if the image frames carrying the watermark information are compressed, rotated, translated, re-encoded, etc., the computer equipment can still successfully extract the watermark information from the image frames carrying the watermark information due to the position invariance and linear transformation characteristics of the frequency domain signal.
[0128] In some embodiments, since the propagation link level of the target video frame is uncertain, in order to effectively save the time of embedding watermark information identifying copyright, the frequency domain coefficients of the area to be embedded can be configured to a default value of 18. When the propagation link level of the target video frame can be determined, the default value of the frequency domain coefficients of the area to be embedded can be adjusted to reduce the time users wait for the watermark information to be embedded.
[0129] Through the processing of step 201 to step 205, the frequency domain coefficients of the to-be-embedded areas between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream have satisfied the preset mapping relationship. Since the frequency domain coefficients are symmetrical about the origin, after modifying the frequency domain coefficients in the upper left corner of the frequency domain data, it is also necessary to synchronously modify the corresponding diagonal lines in the lower right corner to construct legal frequency domain coefficients, so as to ensure that the complete watermark information can be extracted when the watermark information is extracted.
[0130] In some embodiments, the frequency domain coefficients of the embedded watermark information may be subjected to corresponding inverse domain conversion operations to obtain the spatial domain of the target image frame, and then the target image frame may be re-encapsulated in the video information to complete embedding the watermark information in the video information.
[0131] refer to Figure 4 , Figure 4 Schematic diagram of the process of extracting watermark information in an embodiment of the present invention. Figure 4The execution subject of the steps shown can be implemented independently by a terminal running the watermark information extraction device, and can also be implemented by a server running the watermark information extraction device. Figure 4 The processing steps shown in the figure are explained by taking the server as the execution subject as an example. Figure 4 The steps shown are explained.
[0132] Step 401: performing domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected.
[0133] In some embodiments, reference Figure 5 , Figure 5 is a schematic diagram of an image frame to be detected in an embodiment of the present application, wherein: Figure 5 The image frame to be detected shown has a specific type of watermark information to be embedded, and the specific type includes any one of the following: a bit stream data type, a picture data type, and a text data type, such as Figure 5 As shown, the watermark information embedded in the video frames (1-3) of the film and television drama A is "XX video". No matter in which instant messaging client the video frames are transmitted, the watermark information embedding method provided by the present application can make the embedded watermark information still maintain robustness, making it easy to use the watermark information to detect the compliance of the video data.
[0134] Step 402: Determine a frequency domain detection segment in the frequency domain data.
[0135] Step 403: Segment the frequency domain detection segment according to a preset standard degree to obtain a plurality of regions to be extracted.
[0136] In combination with the above-mentioned embodiment, taking the preset standard degree of 6 degrees as an example, since the first preset distance is 5%, the second preset distance is 15%, and the third preset distance is 25%, the corresponding frequency domain detection segment is a circle, when embedding watermark information, only the upper half of the corresponding frequency domain detection segment (i.e., a half-circular frequency domain detection segment of 180 degrees) can be evenly divided into 30 regions according to the preset standard degree (6 degrees), and 1 bit of information is embedded in each region. Therefore, each frequency domain detection segment can obtain 3 frequency domain coefficients that can be configured as a 3-tuple.
[0137] Step 404: Determine a mapping relationship between frequency domain coefficients of a plurality of regions to be extracted, and extract different embedded bits according to the mapping relationship.
[0138] In some embodiments, when there are three regions to be extracted, determining the frequency domain coefficients of the regions to be extracted includes: a fourth frequency domain coefficient, a fifth frequency domain coefficient, and a sixth frequency domain coefficient, where the standard degrees corresponding to the fourth frequency domain coefficient, the fifth frequency domain coefficient, and the sixth frequency domain coefficient are the same; extracting different embedded bits according to the mapping relationship can be achieved in the following manner:
[0139] When the fifth frequency domain coefficient is greater than the fourth frequency domain coefficient and the fifth frequency domain coefficient is greater than the sixth frequency domain coefficient, it is determined that the extracted embedded bit is 0; when the fifth frequency domain coefficient is less than the fourth frequency domain coefficient and the fifth frequency domain coefficient is less than the sixth frequency domain coefficient, it is determined that the extracted embedded bit is 1.
[0140] In some embodiments, as shown in the previous embodiments, the fourth frequency domain coefficient takes the value of a1, the fifth frequency domain coefficient takes the value of b1, and the sixth frequency domain coefficient takes the value of c1. The frequency domain coefficient triple is (a1, b1, c1). Taking the difference value of the mapping relationship being 18 as an example, if b1 > a1 and b1 > c1, it means that a 0 bit is extracted from this frequency domain coefficient triple; if b1 < a1 and b1 < c1, it means that a 1 bit is extracted from the frequency domain coefficient triple.
[0141] Through the processing of steps 401 - 404, it is determined that Figure 5 the value of the embedded bit of the image frame to be detected shown is the bit stream "01110101 01101110 01100100 01100101 01100110 01101001 01101110 01100101 01100100".
[0142] Step 405: Combine and decode different embedded bits to obtain the embedded watermark information.
[0143] In some embodiments, according to the sequence of the bit stream, it can be converted to the characters represented by ASCII, and then the original watermark information form can be restored through the reverse decoding operation of base64, that is, the watermark information corresponding to the bit stream "01110101 01101110 01100100 01100101 01100110 01101001 01101110 01100101 01100100" is "Copyright Movie 1".
[0144] See Figure 6 , Figure 6 which is a schematic structural diagram of an electronic device provided in an embodiment of the present application for executing the watermark information embedding method provided in the present application. Figure 6The electronic device 100 shown includes: each processor 410, a memory 450, each network interface 420 and a target object interface 430. The various components in the electronic device 100 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 6 Various buses are labeled as bus system 440 .
[0145] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0146] The target object interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and one or more visual display screens. The target object interface 430 also includes one or more input devices 432, including target object interface components that facilitate target object input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0147] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0148] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0149] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0150] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0151] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0152] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with a target object interface 430 (e.g., a target object interface for operating peripheral devices and displaying content and information);
[0153] The input processing module 454 is used to detect one or more target object inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.
[0154] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 6 The watermark information embedding device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., and includes the following software modules: an information conversion module 4081, a watermark information embedding module 4082. These modules are logical, and therefore can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0155] The functions of the various software modules in the watermark information embedding device 455 are described below. The information conversion module is used to perform domain conversion processing on the target image frame to obtain frequency domain data corresponding to the target image frame.
[0156] The information conversion module 4081 is also used to obtain a watermark information bit stream corresponding to the watermark information to be embedded;
[0157] The watermark information embedding module 4082 is used to determine multiple frequency domain modification segments in the frequency domain data, and divide each frequency domain modification segment into regions according to preset parameters to obtain multiple to-be-embedded regions corresponding to each frequency domain modification segment; the multiple frequency domain modification segments have the same origin and different distances;
[0158] The watermark information embedding module 4082 is further used to obtain frequency domain coefficients of multiple to-be-embedded areas corresponding to each frequency domain modification segment;
[0159] The watermark information embedding module 4082 is further used to adjust the frequency domain coefficients of each to-be-embedded area corresponding to each frequency domain modification segment until the frequency domain coefficients of the to-be-embedded area between multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship.
[0160] In some embodiments, the information conversion module 4081 is further used to obtain the target video to be processed and the watermark information embedded frame number information;
[0161] The information conversion module 4081 is further used to perform frame extraction processing on the target video to obtain at least two image frames;
[0162] The information conversion module 4081 is further used to screen at least two image frames according to the frame number information embedded in the watermark information to obtain a target image frame.
[0163] In some embodiments, the information conversion module 4081 is further used to obtain watermark information to be embedded having a specific type, where the specific type includes any one of the following: a bit stream data type, a picture data type, and a text data type;
[0164] The information conversion module 4081 is also used to convert the specific type of watermark information to be embedded into the information exchange standard code;
[0165] The information conversion module 4081 is also used to perform standard bit conversion on the information exchange standard code to obtain an initial bit stream;
[0166] The information conversion module 4081 is further used to perform Hamming code encoding on the initial bit stream to obtain a watermark information bit stream corresponding to the watermark information to be embedded.
[0167] In some embodiments, the information conversion module 4081 is also used to determine the center point of the frequency domain data;
[0168] The information conversion module 4081 is further used to determine the origin of each frequency domain modification segment according to the center point of the frequency domain data, and the origin is the common origin of each frequency domain modification segment;
[0169] The information conversion module 4081 is further used to obtain a first preset distance corresponding to the first frequency domain modification segment, and determine the first frequency domain modification segment according to the origin and the first preset distance;
[0170] The information conversion module 4081 is further used to obtain a second preset distance corresponding to the second frequency domain modification segment, and determine the second frequency domain modification segment according to the origin and the second preset distance;
[0171] A third preset distance corresponding to the third frequency domain modification segment is obtained, and the third frequency domain modification segment is determined according to the origin and the third preset distance.
[0172] In some embodiments, the watermark information embedding module 4082 is further used to obtain a preset standard degree that matches the watermark information to be embedded;
[0173] The watermark information embedding module 4082 is further used to divide the first frequency domain modified segment into a preset number of equal proportions according to a preset standard degree, so as to obtain a preset number of to-be-embedded regions of the first frequency domain modified segment;
[0174] The watermark information embedding module 4082 is further used to divide the second frequency domain modified segment into a preset number of equal proportions according to a preset standard degree, so as to obtain a preset number of to-be-embedded regions of the second frequency domain modified segment;
[0175] The watermark information embedding module 4082 is further configured to divide the third frequency domain modified segment into a preset number of equal proportions according to a preset standard degree, so as to obtain a preset number of to-be-embedded regions of the third frequency domain modified segment.
[0176] In some embodiments, the watermark information embedding module 4082 is further used to determine frequency domain coefficients of to-be-embedded regions having the same standard degree in a plurality of frequency domain modification segments;
[0177] The watermark information embedding module 4082 is further used to configure the frequency domain coefficients of the to-be-embedded area with the same standard degree into a frequency domain coefficient triplet, the frequency domain coefficient triplet includes: a first frequency domain coefficient, a second frequency domain coefficient and a third frequency domain coefficient, and the first frequency domain coefficient, the second frequency domain coefficient and the third frequency domain coefficient have the same standard degree;
[0178] The watermark information embedding module 4082 is further used to determine the value of the bit to be embedded in the watermark information bit stream;
[0179] The watermark information embedding module 4082 is further used to determine a preset mapping relationship of frequency domain coefficients of a to-be-embedded region of each frequency domain modification segment according to the value of the to-be-embedded bit;
[0180] The watermark information embedding module 4082 is also used to dynamically adjust the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment based on a preset mapping relationship until the first frequency domain coefficient, the second frequency domain coefficient, the third frequency domain coefficient and the to-be-embedded bits in the watermark information bit stream satisfy the preset mapping relationship.
[0181] In some embodiments, the watermark information embedding module 4082 is further configured to preset a mapping relationship including a difference in frequency domain coefficients of the region to be embedded;
[0182] Determining a preset mapping relationship of frequency domain coefficients of a to-be-embedded region of each frequency domain modification segment according to a value of the to-be-embedded bit includes:
[0183] The watermark information embedding module 4082 is further used to obtain a first difference value of the frequency domain coefficients of the area to be embedded;
[0184] The watermark information embedding module 4082 is further used to determine, when the value of the to-be-embedded bit is 0, that the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: synchronously subtract and adjust the first frequency domain coefficient and the third frequency domain coefficient, and the difference between the second frequency domain coefficient and the third frequency domain coefficient is greater than the first difference, and the difference between the second frequency domain coefficient and the first frequency domain coefficient is greater than the first difference; or
[0185] The watermark information embedding module 4082 is also used to determine, when the value of the bit to be embedded is 0, the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: the first frequency domain coefficient and the third frequency domain coefficient are synchronously added and adjusted, and the difference between the first frequency domain coefficient and the second frequency domain coefficient is greater than the first difference, and the difference between the third frequency domain coefficient and the second frequency domain coefficient is greater than the first difference.
[0186] In some embodiments, the information conversion module 4081 is further used to detect the propagation link of the target image frame to obtain the number of propagation link levels of the target image frame;
[0187] The first difference is adjusted according to the number of propagation link levels of the target image frame to obtain a second difference of the frequency domain coefficients of the area to be embedded.
[0188] In some embodiments, Figure 6 The electronic device shown may also include a watermark information extraction device (not shown in the figure), including:
[0189] An image processing module is used to perform domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected;
[0190] The image processing module is further used to determine the frequency domain detection segment in the frequency domain data;
[0191] The image processing module is also used to segment the frequency domain detection segment according to a preset standard degree to obtain multiple areas to be extracted;
[0192] A watermark information extraction module, used to determine a mapping relationship between frequency domain coefficients of a plurality of areas to be extracted, and extract different embedded bits according to the mapping relationship;
[0193] The watermark information extraction module is also used to combine and decode different embedded bits to obtain embedded watermark information. The embedded watermark information is embedded according to the previous method.
[0194] In some embodiments, the watermark information extraction module is further used to, when there are three regions to be extracted, determine that the frequency domain coefficients of the regions to be extracted include: a fourth frequency domain coefficient, a fifth frequency domain coefficient, and a sixth frequency domain coefficient, and the fourth frequency domain coefficient, the fifth frequency domain coefficient, and the sixth frequency domain coefficient have the same standard degree;
[0195] The watermark information extraction module is further used to determine that the extracted embedded bit is 0 when the fifth frequency domain coefficient is greater than the fourth frequency domain coefficient and the fifth frequency domain coefficient is greater than the sixth frequency domain coefficient;
[0196] The watermark information extraction module is further used to determine that the extracted embedded bit is 1 when the fifth frequency domain coefficient is smaller than the fourth frequency domain coefficient and the fifth frequency domain coefficient is smaller than the sixth frequency domain coefficient.
[0197] The above are merely embodiments of the present application and are not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.
Claims
1. A watermark information embedding method, characterized in that: The method comprises: Performing domain conversion processing on the target image frame to obtain frequency domain data corresponding to the target image frame; Obtaining a watermark information bit stream corresponding to the watermark information to be embedded; Determine a plurality of frequency domain modification segments in the frequency domain data, and divide each of the frequency domain modification segments into regions according to preset parameters to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modification segment, wherein the plurality of frequency domain modification segments have the same origin and different distances; Obtaining frequency domain coefficients of a plurality of to-be-embedded regions corresponding to each frequency domain modification segment; The frequency domain coefficient of each to-be-embedded area corresponding to each frequency domain modification segment is adjusted until the frequency domain coefficient of the to-be-embedded area between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship.
2. The method according to claim 1, characterized in that The step of obtaining a watermark information bit stream corresponding to the watermark information to be embedded includes: Acquire watermark information to be embedded of a specific type, wherein the specific type includes any one of the following: a bit stream data type, a picture data type, and a text data type; Converting the specific type of watermark information to be embedded into an information exchange standard code; Performing standard bit conversion on the information exchange standard code to obtain an initial bit stream; The initial bit stream is encoded by Hamming code to obtain a watermark information bit stream corresponding to the watermark information to be embedded.
3. The method according to claim 1, characterized in that The multiple frequency domain modification segments include a first frequency domain modification segment, a second frequency domain modification segment, and a third frequency domain modification segment; The determining of a plurality of frequency domain modification segments in the frequency domain data comprises: Determining a center point of the frequency domain data; Determine the origin of each frequency domain modification segment according to the center point of the frequency domain data, wherein the origin is the common origin of each frequency domain modification segment; Acquire a first preset distance corresponding to the first frequency domain modification segment, and determine the first frequency domain modification segment according to the origin and the first preset distance; Acquire a second preset distance corresponding to the second frequency domain modification segment, and determine the second frequency domain modification segment according to the origin and the second preset distance; A third preset distance corresponding to the third frequency domain modification segment is obtained, and the third frequency domain modification segment is determined according to the origin and the third preset distance, wherein the first preset distance is smaller than the second preset distance, and the second preset distance is smaller than the third preset distance.
4. The method according to claim 3, characterized in that The preset parameters include preset standard degrees; The step of dividing each frequency domain modified segment into regions according to preset parameters to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modified segment includes: Acquire a preset standard degree matching the watermark information to be embedded; Divide the first frequency domain modified segment into a preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded regions of the first frequency domain modified segment; Divide the second frequency domain modified segment into the preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded regions of the second frequency domain modified segment; The third frequency domain modification segment is divided into the preset number of equal proportions according to the preset standard degree to obtain the preset number of to-be-embedded regions of the third frequency domain modification segment.
5. The method according to claim 4, characterized in that The step of adjusting the frequency domain coefficient of each to-be-embedded region corresponding to each frequency domain modification segment until the frequency domain coefficient of the to-be-embedded region between the plurality of frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship includes: Determining frequency domain coefficients of the to-be-embedded regions having the same standard degree in the plurality of frequency domain modification segments; The frequency domain coefficients of the to-be-embedded area with the same standard degree are configured as a frequency domain coefficient triplet, wherein the frequency domain coefficient triplet includes: a first frequency domain coefficient, a second frequency domain coefficient and a third frequency domain coefficient, and the first frequency domain coefficient, the second frequency domain coefficient and the third frequency domain coefficient have the same standard degree; Determining the value of the bit to be embedded in the watermark information bit stream; Determining, according to the value of the bit to be embedded, a preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment; Based on the preset mapping relationship, the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment are dynamically adjusted until the first frequency domain coefficients, the second frequency domain coefficients, the third frequency domain coefficients and the to-be-embedded bits in the watermark information bit stream satisfy the preset mapping relationship.
6. The method according to claim 5, characterized in that The preset mapping relationship includes the difference of the frequency domain coefficients of the area to be embedded; The determining, according to the value of the bit to be embedded, a preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment comprises: Obtaining a first difference value of the frequency domain coefficients of the area to be embedded; When the value of the bit to be embedded is 0, the first frequency domain coefficient and the third frequency domain coefficient are synchronously subtracted and adjusted to determine that the preset mapping relationship of the frequency domain coefficients of the to-be-embedded area of each frequency domain modification segment is: the difference between the second frequency domain coefficient and the third frequency domain coefficient is greater than the first difference, and the difference between the second frequency domain coefficient and the first frequency domain coefficient is greater than the first difference; or When the value of the bit to be embedded is 1, the first frequency domain coefficient and the third frequency domain coefficient are synchronously added and adjusted to determine that the preset mapping relationship of the frequency domain coefficients of the area to be embedded in each frequency domain modification fragment is: the difference between the first frequency domain coefficient and the second frequency domain coefficient is greater than the first difference, and the difference between the third frequency domain coefficient and the second frequency domain coefficient is greater than the first difference.
7. The method according to claim 6, characterized in that After obtaining the first difference value of the frequency domain coefficients of the to-be-embedded area, the method further includes: Detecting the propagation link of the target image frame to obtain the number of propagation link levels of the target image frame; The first difference is adjusted according to the number of propagation link levels of the target image frame to obtain a second difference in the frequency domain coefficients of the area to be embedded, and the second difference in the frequency domain coefficients of the area to be embedded is used to characterize the preset mapping relationship.
8. The method according to claim 1, characterized in that Before performing domain conversion processing on the target image frame, the method further includes: Obtain the target video to be processed and the number of frames in which the watermark information is embedded; Performing frame extraction processing on the target video to obtain at least two image frames; The at least two image frames are screened according to the watermark information embedded frame number information to obtain the target image frame.
9. A watermark information extraction method, characterized in that: The method comprises: Performing domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected; determining a frequency domain detection segment in the frequency domain data; Segmenting the frequency domain detection segment according to a preset standard degree to obtain a plurality of regions to be extracted; Calculating a mapping relationship between frequency domain coefficients of the plurality of regions to be extracted, and extracting different embedded bits according to the mapping relationship; The different embedded bits are combined and decoded to obtain embedded watermark information, wherein the embedded watermark information is embedded according to any one of claims 1-8.
10. The method according to claim 9, characterized in that When there are three regions to be extracted, determining the frequency domain coefficients of the regions to be extracted includes: a fourth frequency domain coefficient, a fifth frequency domain coefficient, and a sixth frequency domain coefficient, and the fourth frequency domain coefficient, the fifth frequency domain coefficient, and the sixth frequency domain coefficient have the same standard degree; The extracting different embedded bits according to the mapping relationship includes: When the fifth frequency domain coefficient is greater than the fourth frequency domain coefficient, and the fifth frequency domain coefficient is greater than the sixth frequency domain coefficient, determining that the extracted embedded bit is 0; When the fifth frequency domain coefficient is smaller than the fourth frequency domain coefficient, and the fifth frequency domain coefficient is smaller than the sixth frequency domain coefficient, it is determined that the extracted embedded bit is 1.
11. A watermark information embedding device, characterized in that: The device comprises: An information conversion module, used to perform domain conversion processing on the target image frame to obtain frequency domain data corresponding to the target image frame; The information conversion module is further used to obtain a watermark information bit stream corresponding to the watermark information to be embedded; A watermark information embedding module, used to determine a plurality of frequency domain modification segments in the frequency domain data, and divide each of the frequency domain modification segments into regions according to preset parameters to obtain a plurality of to-be-embedded regions corresponding to each frequency domain modification segment; the plurality of frequency domain modification segments have the same origin and different distances; The watermark information embedding module is further used to obtain frequency domain coefficients of multiple to-be-embedded areas corresponding to each frequency domain modification segment; The watermark information embedding module is further used to adjust the frequency domain coefficients of each to-be-embedded area corresponding to each frequency domain modification segment until the frequency domain coefficients of the to-be-embedded area between the multiple frequency domain modification segments and the to-be-embedded bits in the watermark information bit stream satisfy a preset mapping relationship.
12. A watermark information extraction device, characterized in that: The device comprises: An image processing module is used to perform domain conversion processing on the image frame to be detected to obtain frequency domain data corresponding to the image frame to be detected; The image processing module is further used to determine a frequency domain detection segment in the frequency domain data; The image processing module is further used to segment the frequency domain detection segment according to a preset standard degree to obtain a plurality of regions to be extracted; A watermark information extraction module, used to calculate the mapping relationship between the frequency domain coefficients of the multiple areas to be extracted, and extract different embedded bits according to the mapping relationship; The watermark information extraction module is further used to combine and decode the different embedded bits to obtain embedded watermark information, and the embedded watermark information is embedded according to any one of claims 1-8.
13. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable instructions; The processor is used to implement the watermark information embedding method described in any one of claims 1 to 8, or the watermark information extraction method described in claim 9 or 10 when running the executable instructions stored in the memory.
14. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the watermark information embedding method described in any one of claims 1 to 8 is implemented, or the watermark information extraction method described in claim 9 or 10 is implemented.
15. A computer-readable storage medium storing executable instructions, characterized in that: When the executable instructions are executed by the processor, the watermark information embedding method described in any one of claims 1 to 8 is implemented, or the watermark information extraction method described in claim 9 or 10 is implemented.