Watermark embedding method, watermark de-embedding method, watermark de-embedding device, watermark de-embedding equipment and storage medium
By performing grayscale and frequency domain transformations on the carrier image and the watermark image, and embedding the watermark based on the frequency and amplitude values of the frequency points, an invisible synthetic image is generated. This solves the problem of watermark information being easily discovered and improves the reliability of application software copyright protection.
Patent Information
- Application Number
- CN202511178055.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-21
- Publication Date
- 2025-12-12
AI Technical Summary
Watermark information added to application software program code in existing technologies is easily detected, resulting in low reliability of copyright protection.
By performing grayscale and frequency domain transformations on the carrier image and the watermark image, and embedding the watermark based on the frequency and amplitude values of the frequency points, an invisible composite image is generated, thereby achieving copyright protection.
It improves the reliability of application software copyright protection, making watermark information invisible in composite images, thus enhancing the concealment and security of copyright protection.
Smart Images

Figure CN121120351A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to a watermark embedding method and device, a watermark removing method and device, an apparatus, and a storage medium. BACKGROUND
[0002] With the development of technology, various application software emerges in an endless stream. In order to protect the legal rights and interests of the application software, it is necessary to protect the copyright of the application software.
[0003] One way of protecting the copyright of the application software is to add watermark information in the program code of the application software. The watermark information can be information for identifying the owner or user of the application software. Through the watermark information, it can be identified whether the application software is tampered with, thereby protecting the legal rights and interests of the application software.
[0004] However, in the above method, the watermark information added in the program code of the application software is explicit, so that the watermark information is easy to be found, resulting in low reliability when protecting the copyright of the application software. SUMMARY
[0005] The present application provides a watermark embedding method, a watermark removing method, a device, an apparatus, and a storage medium, which improves the reliability of protecting the copyright of the first application.
[0006] In a first aspect, the present application provides a watermark embedding method, which comprises:
[0007] performing grayscale transformation processing and frequency domain transformation processing on a carrier image of a first application in sequence to obtain first frequency domain information corresponding to the carrier image;
[0008] performing grayscale transformation processing and frequency domain transformation processing on a watermark image in sequence to obtain second frequency domain information corresponding to the watermark image;
[0009] performing watermark embedding processing on the first frequency domain information according to the frequency values of the frequency points in the first frequency domain information and the second frequency domain information to obtain third frequency domain information;
[0010] performing time domain transformation processing on the third frequency domain information to obtain a composite image corresponding to the carrier image.
[0011] In one possible implementation, the watermark embedding processing on the first frequency domain information according to the frequency values of the frequency points in the first frequency domain information and the second frequency domain information to obtain the third frequency domain information comprises:
[0012] determining, according to the frequency values of the frequency points in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value in the first frequency domain information;
[0013] For each first frequency point, a target amplitude value of the first frequency point is obtained according to a frequency value of the first frequency point, an amplitude value of the first frequency point in the first frequency domain information, and an amplitude value of the first frequency point in the second frequency domain information;
[0014] The third frequency domain information is obtained according to the target amplitude value of each first frequency point and the amplitude value of each second frequency point in the first frequency domain information.
[0015] In a possible implementation, the target amplitude value of the first frequency point is obtained according to the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information, including:
[0016] The amplitude processing mode corresponding to the first frequency point is determined according to the frequency value of the first frequency point.
[0017] The amplitude value of the first frequency point in the second frequency domain information is updated according to the amplitude processing mode corresponding to the first frequency point, to obtain an updated amplitude value of the first frequency point.
[0018] The sum of the amplitude value of the first frequency point in the first frequency domain information and the updated amplitude value of the first frequency point is determined as the target amplitude value of the first frequency point.
[0019] In a possible implementation, the amplitude processing mode corresponding to the first frequency point is determined according to the frequency value of the first frequency point, including:
[0020] If the frequency value of the first frequency point is greater than or equal to a second preset frequency value, the amplitude processing mode is determined as amplitude amplification processing.
[0021] If the frequency value of the first frequency point is less than the second preset frequency value, the amplitude processing mode is determined as amplitude reduction processing.
[0022] The second preset frequency value is greater than the first preset frequency value.
[0023] In a possible implementation, the amplitude value of the first frequency point in the second frequency domain information is updated according to the amplitude processing mode corresponding to the first frequency point, to obtain the updated amplitude value of the first frequency point, including:
[0024] The energy coefficient is obtained according to the amplitude processing mode corresponding to the first frequency point.
[0025] The amplitude value of the first frequency point in the second frequency domain information is updated according to the energy coefficient, to obtain the updated amplitude value of the first frequency point.
[0026] In a second aspect, the present application provides a watermarking method, including:
[0027] The synthesized image from the first application is subjected to frequency domain transformation to obtain third frequency domain information;
[0028] The carrier image of the first application is subjected to grayscale transformation and frequency domain transformation in sequence to obtain the first frequency domain information corresponding to the carrier image;
[0029] Based on the frequency values of each frequency point in the first frequency domain information, the third frequency domain information is dewatermarked to obtain the second frequency domain information;
[0030] The second frequency domain information is subjected to time domain transformation to obtain the watermark image.
[0031] In one possible implementation, the third frequency domain information is dewatermarked based on the frequency values of each frequency point in the first frequency domain information to obtain the second frequency domain information, including:
[0032] Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information.
[0033] For each first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information.
[0034] The second frequency domain information is obtained based on the amplitude values of multiple first frequency points in the second frequency domain information, and the amplitude values of multiple frequency points in the first frequency domain information.
[0035] In one possible implementation, determining the amplitude value of the first frequency point in the second frequency domain information based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information includes:
[0036] The difference between the target amplitude value at the first frequency point and the amplitude value at the first frequency point in the first frequency domain information is determined as the updated amplitude value at the first frequency point.
[0037] Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point;
[0038] Based on the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined.
[0039] Thirdly, this application provides a watermark embedding device, which includes:
[0040] The first processing module is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image.
[0041] The second processing module is used to sequentially perform grayscale transformation and frequency domain transformation on the watermark image to obtain the second frequency domain information corresponding to the watermark image.
[0042] The watermark embedding module is used to perform watermark embedding processing on the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information to obtain the third frequency domain information.
[0043] The time-domain processing module is used to perform time-domain transformation processing on the third frequency domain information to obtain the synthetic image corresponding to the carrier image.
[0044] In one possible implementation, the watermark embedding module is specifically used for:
[0045] Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information.
[0046] For each first frequency point, the target amplitude value of the first frequency point is obtained based on the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information.
[0047] The third frequency domain information is obtained based on the target amplitude values of multiple first frequency points and the amplitude values of multiple second frequency points in the first frequency domain information.
[0048] In one possible implementation, the watermark embedding module is specifically used for:
[0049] Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point;
[0050] Based on the amplitude processing method corresponding to the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point.
[0051] The sum of the amplitude value of the first frequency point in the first frequency domain information and the updated amplitude value of the first frequency point is determined as the target amplitude value of the first frequency point.
[0052] In one possible implementation, the watermark embedding module is specifically used for:
[0053] If the frequency value of the first frequency point is greater than or equal to the second preset frequency value, the amplitude processing method is determined to be amplitude amplification processing.
[0054] If the frequency value of the first frequency point is less than the second preset frequency value, the amplitude processing method is determined to be amplitude reduction processing.
[0055] The second preset frequency value is greater than the first preset frequency value.
[0056] In one possible implementation, the watermark embedding module is specifically used for:
[0057] The energy coefficient is obtained based on the amplitude processing method corresponding to the first frequency point;
[0058] Based on the energy coefficient, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point.
[0059] Fourthly, this application provides a watermark removal device, which includes:
[0060] The first transformation module is used to perform frequency domain transformation processing on the synthesized image of the first application to obtain the third frequency domain information;
[0061] The second transformation module is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image;
[0062] The watermark removal module is used to perform watermark removal processing on the third frequency domain information based on the frequency values of each frequency point in the first frequency domain information to obtain the second frequency domain information.
[0063] The time-domain transformation module is used to perform time-domain transformation processing on the second frequency domain information to obtain the watermark image.
[0064] In one possible implementation, the watermark removal module is specifically used for:
[0065] Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information.
[0066] For each first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information.
[0067] The second frequency domain information is obtained based on the amplitude values of multiple first frequency points in the second frequency domain information, and the amplitude values of multiple frequency points in the first frequency domain information.
[0068] In one possible implementation, the watermark removal module is specifically used for:
[0069] The difference between the target amplitude value at the first frequency point and the amplitude value at the first frequency point in the first frequency domain information is determined as the updated amplitude value at the first frequency point.
[0070] Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point;
[0071] Based on the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined.
[0072] Fifthly, this application provides a watermark embedding device, comprising:
[0073] At least one processor; and
[0074] A memory that is communicatively connected to at least one processor; wherein,
[0075] The memory stores instructions that can be executed by at least one processor to cause the at least one processor to perform the watermark embedding method involved in the first aspect and any possible implementation.
[0076] Sixthly, this application provides a watermark removal device, comprising:
[0077] At least one processor; and
[0078] A memory that is communicatively connected to at least one processor; wherein,
[0079] The memory stores instructions that can be executed by at least one processor to cause the at least one processor to perform the watermark removal method involved in the second aspect and any possible implementation.
[0080] In a seventh aspect, this application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the watermark embedding method involved in the first aspect and any possible implementation, and the watermark removal method involved in the second aspect and any possible implementation.
[0081] Eighthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the watermark embedding method involved in the first aspect and any possible implementation, and the watermark removal method involved in the second aspect and any possible implementation.
[0082] The watermark embedding method, dewatermarking method, apparatus, device, and storage medium provided in this application first perform grayscale transformation and frequency domain transformation on the carrier image of the first application to obtain first frequency domain information. Then, the watermark image is subjected to grayscale transformation and frequency domain transformation to obtain second frequency domain information. Next, based on the frequency values of each frequency point in the first frequency domain information, the second frequency domain information is embedded into the first frequency domain information, thereby completing the watermark embedding process of the first frequency domain information to obtain third frequency domain information. Finally, the third frequency domain information is subjected to time domain transformation to obtain a composite image. Since the watermark embedding process of the first frequency domain information is performed by embedding the second frequency domain information into the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information, the watermark image is invisible in the composite image, thereby improving the reliability of copyright protection for the first application. Attached Figure Description
[0083] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0084] Figure 1 This is a schematic diagram illustrating an application scenario provided in the embodiments of this application;
[0085] Figure 2 A flowchart illustrating a watermark embedding method provided in an embodiment of this application;
[0086] Figure 3 This application provides a schematic diagram of a process for watermarking the first frequency domain information in an embodiment of the present application.
[0087] Figure 4 A flowchart illustrating the watermark embedding method provided in this application embodiment;
[0088] Figure 5 A flowchart illustrating a watermark removal method provided in an embodiment of this application;
[0089] Figure 6 This is a schematic diagram of the structure of a watermark embedding device provided in an embodiment of this application;
[0090] Figure 7 This is a schematic diagram of the structure of a watermark removal device provided in an embodiment of this application;
[0091] Figure 8 This is a schematic diagram of the structure of a watermark embedding device provided in an embodiment of this application;
[0092] Figure 9This is a schematic diagram of a watermark removal device provided in an embodiment of this application. Detailed Implementation
[0093] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0094] It should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of data and other information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals. It should also be noted that certain software, components, models, and other existing industry solutions may be mentioned in the embodiments of this application. These should be considered exemplary, and their purpose is merely to illustrate the feasibility of implementing the technical solution of this application, but does not imply that the applicant has already used or necessarily used such solutions.
[0095] In this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0096] With the development of technology, copyright protection is receiving increasing attention. Protecting the copyright of the first application can help safeguard the rights and interests of the first application.
[0097] In this technology, each primary application corresponds to a unique hash value. For any given primary application's hash value, a public and private key pair is generated by a certificate authority. The hash value is then encrypted using the private key to obtain a digital signature. The rights and interests of the primary application can be protected through digital signatures and public keys.
[0098] When protecting the copyright of the first application using the above methods, the first application needs to be compatible with the technology for generating digital signatures. Furthermore, if the first application supports this technology, the above methods rely on the trustworthiness of the certificate authority and the management of public and private keys. Secondly, generating digital signatures is inefficient, and digital signatures are only valid for a certain period. The digital signature of the first application needs to be updated promptly; otherwise, it may lead to service interruption or security vulnerabilities in the first application.
[0099] The method of adding watermark information to the program code of the first application can be specifically divided into static watermarking methods and dynamic watermarking methods. Static watermarking methods refer to adding watermark information to the executable code of the first application. For example, watermark information can be added to the installation module, instruction code, debugging code, or class files (constant pool table, method table, line number table, etc.) of the first application. Based on the form in which the watermark information is added, static watermarking methods can be further divided into static data watermarking and static code watermarking.
[0100] Dynamic watermarking refers to adding watermark information to the execution state of a first application. For example, preset input information can be entered into the running program of the first application, and the program will run to a certain state based on the preset input information. This state is the watermark information added to the execution state of the first application. Examples of dynamic watermarks include Easter Egg watermarks, data structure watermarks, and execution state watermarks.
[0101] When adding watermark information to the first application using the method described above, the added watermark information is explicit, meaning it is easily detectable, which leads to low reliability in protecting the copyright of the first application.
[0102] To facilitate understanding, the following will be combined with... Figure 1 The application scenarios used in the embodiments of this application will be briefly described below.
[0103] Figure 1 This is a schematic diagram illustrating an application scenario provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 The first application can run on the terminal device 11, and when the first application runs on the terminal device 11, the images of the first application on the front-end page are displayed through the terminal device 11. The terminal device 11 can be a mobile phone, computer, tablet, or other device. Since video is a series of rapidly playing images, the images of the first application on the front-end page can be pictures, videos, etc., of the first application on the front-end page.
[0104] When the first application runs on terminal device 11, the image displayed on terminal device 11 serves as the carrier image. An image carrying specific identification information of the first application is used as a watermark image. The carrier image is then watermarked by embedding the watermark image, resulting in an image containing the specific identification information of the first application. This replaces the carrier image on terminal device 11 with the image carrying the specific identification information of the first application. This allows for timely detection of any tampering or imitation of the first application, thus achieving copyright protection for the first application.
[0105] For example, suppose that terminal device 11 includes a first application A. When the first application A runs on terminal device 11, images 1, 2 and 3 of the first application A on the front-end page are displayed through terminal device 11.
[0106] Using images 1, 2, and 3 as carrier images and image X as the watermark image, the carrier images of the first application A are processed by watermark embedding based on image X. That is, image 4 is obtained by embedding watermark image X in image 1, image 5 is obtained by embedding watermark image X in image 2, and image 6 is obtained by embedding watermark image X in image 3. Images 1, 2, and 3 are replaced with images 4, 5, and 6 respectively. At this time, the images displayed in the terminal device 11 are images 4, 5, and 6 respectively.
[0107] It should be noted that, Figure 1 This is merely an example to illustrate one application scenario, and is not intended to limit the application scenario.
[0108] Based on this, embodiments of this application provide a watermark embedding method. This method processes a carrier image of a first application to obtain first time-domain information, processes the watermark image of the first application to obtain second time-domain information, and embeds second frequency-domain information into the first time-domain information based on the frequency values of each frequency point, resulting in third frequency-domain information. Finally, a time-domain transform is performed on the third frequency-domain information to obtain a composite image. Because the above method embeds second frequency-domain information into the first time-domain information based on the frequency values of each frequency point, the final watermark image is invisible in the composite image, thereby improving the reliability of copyright protection for the first application.
[0109] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes will not be repeated in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0110] Figure 2 This is a flowchart illustrating a watermark embedding method provided in an embodiment of this application. Please refer to... Figure 2 Watermark embedding methods may include:
[0111] S21. Perform grayscale transformation and frequency domain transformation on the carrier image of the first application in sequence to obtain the first frequency domain information corresponding to the carrier image.
[0112] The first application can be the application software to be protected by copyright, and the carrier image of the first application can be images such as pictures and videos on the front-end page of the first application. It is understood that a video is composed of multiple consecutive frames of images. In the embodiments of this application, "video as carrier image" means that multiple frames of images in the video serve as carrier images.
[0113] For example, assuming that the images on the front-end page of the first application are image 1, image 2 and image 3, then the carrier images of the first application can be image 1, image 2 and image 3.
[0114] A pixel is the basic unit of an image, and an image is composed of multiple pixels. For any given pixel, its pixel value represents its color or grayscale information. For example, in a color image, the pixel value is usually composed of multiple components, representing the color of each pixel in the image. Taking a Red Green Blue (RGB) image as an example, the pixel value of each pixel consists of three components: red, green, and blue. The value of each component typically ranges from 0 to 255.
[0115] In a grayscale image, the values of the red, green, and blue components of each pixel are the same. That is, the pixel value of each pixel is a single scalar, representing the grayscale value of each pixel in the image. The range of pixel values is usually between 0 and 255, where 0 represents black and 255 represents white. In other words, the larger the grayscale value of each pixel in the first grayscale image, the lighter the grayscale of the first grayscale image at that pixel.
[0116] For any one of the carrier images in the first application, let the carrier image be N. × Taking an RGB image of size M as an example, the pixel value of each pixel in the carrier image can be composed of three components: red, green, and blue. Grayscale transformation of the carrier image can be performed as follows: The red, green, and blue components of the pixel value at the i-th row and j-th column of the carrier image are processed to obtain the pixel value at the i-th row and j-th column of the first grayscale image. The pixel value at the i-th row and j-th column of the first grayscale image represents the grayscale value at that pixel. Here, i ranges from 1 to N, and j ranges from 1 to M.
[0117] After performing grayscale transformation on the carrier image, the resulting grayscale image of the carrier image can be represented as an N... × A two-dimensional matrix M, where N × The two-dimensional matrix M includes N × M elements, and N × Each of the M elements corresponds to a pixel in the grayscale image of the carrier image, and N × The value of each of the M elements corresponds to the pixel value of a pixel in the grayscale image of the carrier image.
[0118] Based on the pixels and their positions in the grayscale image of the carrier image, a frequency domain transformation is performed on the grayscale image of the carrier image to obtain the first frequency domain information corresponding to the carrier image.
[0119] Pixel position can be the location of each pixel in the first grayscale image; for example, for an N... × In the first grayscale image of M, the pixel position of each pixel can be represented by (x, y), where the value of x ranges from 1 to N, and the value of y ranges from 1 to M.
[0120] Frequency domain transformation of the carrier image can be performed by either Fast Fourier Transform (FFT) or Fourier Transform. Specifically, in the process of converting the carrier image's grayscale image from the time domain to the frequency domain using FFT, pixels in the grayscale image can be sampled, and the pixel values at the sampled pixels can be subjected to FFT. Alternatively, in the process of converting the carrier image's grayscale image from the time domain to the frequency domain using Fourier Transform, pixels in the grayscale image can be sampled, and the pixel values at the sampled pixels can be subjected to Fourier Transform. Using FFT in the frequency domain transformation of the carrier image reduces the computational load and improves computational efficiency.
[0121] Assume the grayscale image of the carrier image is an N × The formula for performing a fast Fourier transform on the grayscale image of the carrier image, given by the two-dimensional matrix M, is shown in formula (1):
[0122]
[0123] Where f(x,y) represents the pixel value of the pixel at position (x,y) in the grayscale image of the carrier image, u represents the horizontal coordinate of the pixel at position (x,y) in the frequency domain, v represents the vertical coordinate of the pixel at position (x,y) in the frequency domain, F(u,v) is the amplitude value of the grayscale image of the carrier image at different frequency components in the frequency domain, representing the distribution of the grayscale image of the carrier image at various frequencies, and j is the imaginary unit.
[0124] The first frequency domain information can be the frequency domain information obtained after performing grayscale transformation and frequency domain transformation on the carrier image. The first frequency domain information includes the frequency value and amplitude value of each of the multiple frequency points of the grayscale image of the carrier image in the frequency domain.
[0125] S22. Perform grayscale transformation and frequency domain transformation on the watermark image in sequence to obtain the second frequency domain information corresponding to the watermark image.
[0126] A watermarked image can be an image that carries copyright information for the first application.
[0127] With watermark image as N × Taking an RGB image of size M as an example, the pixel value of each pixel in the watermark image can be composed of three components: red, green, and blue. Grayscale transformation of the watermark image can be performed as follows: The red, green, and blue individual component values of the pixel value at row i and column j in the watermark image are processed to obtain the pixel value at row i and column j in the grayscale image of the watermark image. The pixel value at row i and column j in the grayscale image of the watermark image represents the grayscale value at that row i and column j in the grayscale image of the watermark image. Here, i ranges from 1 to N, and j ranges from 1 to M.
[0128] After performing grayscale transformation on the watermark image, the resulting grayscale image of the watermark image can be represented as an N... × A two-dimensional matrix M, where N × The two-dimensional matrix M includes N × M elements, and N × Each of the M elements corresponds to a pixel in the grayscale image of the watermark image, and N × The value of each of the M elements corresponds to the pixel value of a pixel in the grayscale image of the watermark image.
[0129] Based on the pixel value and pixel position of each pixel in the grayscale image of the watermark image, a frequency domain transformation is performed on the grayscale image of the watermark image to obtain the second frequency domain information.
[0130] Pixel position can be the location of each pixel in the grayscale image of the watermark image. For example, for an N... × The grayscale image of the watermark image M can be represented by (x, y), where x ranges from 1 to N and y ranges from 1 to M.
[0131] Frequency domain transformation of the grayscale image of the watermark image can be used to perform random transformations on the grayscale image, such as random rotation, random scaling, random noise addition, and random filtering. Random transformations increase the randomness of the grayscale image, improving its security and concealment when embedded in the carrier image, and reducing the likelihood of detection or removal.
[0132] The second frequency domain information can be obtained by performing random transformation processing on the grayscale image of the watermark image, converting the grayscale image of the watermark image from the time domain to the frequency domain. The second frequency domain information includes the frequency value and amplitude value of each of the multiple frequency points of the grayscale image of the watermark image in the frequency domain.
[0133] S23. Based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information, perform watermark embedding processing on the first frequency domain information to obtain the third frequency domain information.
[0134] The third frequency domain information can be the frequency domain information obtained after watermarking the first frequency domain information. The third frequency domain information can include the first frequency domain information and the second frequency domain information.
[0135] Based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information, watermark embedding processing is performed on the first frequency domain information. This allows the copyright mark information of the first application to be embedded in the carrier image without affecting the carrier image, thereby achieving the purpose of copyright protection.
[0136] S24. Perform time-domain transformation on the third frequency domain information to obtain the composite image corresponding to the carrier image.
[0137] Performing a time-domain transformation on the third frequency domain information can be achieved by performing an inverse fast Fourier transform (IFFT) on the third frequency domain information, converting it from frequency domain information to time domain information, thus obtaining a composite image corresponding to the carrier image. The composite image corresponding to the carrier image can be an image obtained by embedding the watermark image into the carrier image; that is, the composite image includes both the carrier image and the watermark image. Therefore, the composite image can be an image carrying the copyright information of the first application.
[0138] exist Figure 2In the illustrated embodiment, the carrier image of the first application is first subjected to grayscale transformation and frequency domain transformation to obtain first frequency domain information. Then, the watermark image is subjected to grayscale transformation and frequency domain transformation to obtain second frequency domain information. Next, based on the frequency values of each frequency point in the first frequency domain information, the second frequency domain information is embedded into the first frequency domain information, thus completing the watermark embedding process and obtaining third frequency domain information. Finally, the third frequency domain information is subjected to time domain transformation to obtain a composite image. Because the watermark embedding process of the first frequency domain information involves embedding the second frequency domain information into the first frequency domain information based on the frequency values of each frequency point, the watermark image is invisible in the composite image, thereby improving the reliability of copyright protection for the first application.
[0139] exist Figure 2 Based on the illustrated embodiment, the following, in conjunction with Figure 3 The process of embedding watermarks into the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information is described in detail.
[0140] Figure 3 This is a schematic diagram illustrating a process for watermarking the first frequency domain information, provided as an embodiment of this application. Please refer to... Figure 3 The watermark embedding process for the first frequency domain information may include the following steps:
[0141] S31. Based on the frequency values of each frequency point in the first frequency domain information, determine a plurality of first frequency points whose frequency values are greater than the first preset frequency value, and a plurality of second frequency points whose frequency values are less than or equal to the first preset frequency value in the first frequency domain information.
[0142] Frequency domain information includes low-frequency, mid-frequency, and high-frequency information. Low-frequency information corresponds to the overall outline or background of an image. Under normal circumstances, the human eye can only see the content corresponding to low-frequency information in an image. Mid-frequency and high-frequency information correspond to the detailed features and edge or texture details of an image, respectively. Under normal circumstances, the human eye cannot perceive the content corresponding to mid-frequency or high-frequency information in an image.
[0143] Based on this, when performing watermark embedding processing on the first frequency domain information, the intermediate frequency information and high frequency information in the first frequency domain information are modified. In this way, after watermark embedding processing on the carrier image, the watermarked image appears exactly the same as the original carrier image to the human eye, and the presence of the watermark image is imperceptible. This increases the reliability of copyright protection for the first application while not affecting the user's viewing experience of the carrier image.
[0144] The first preset frequency value can be a pre-set frequency value. If there is a frequency point in the first frequency domain information with a frequency value greater than the first preset frequency value, then the frequency domain information corresponding to that frequency point is intermediate frequency information or high frequency information. That is, the frequency domain information corresponding to multiple first frequency points is intermediate frequency information or high frequency information in the first frequency domain information. If there is a frequency point in the first frequency domain information with a frequency value less than or equal to the first preset frequency value, then the amplitude value corresponding to that frequency point is low frequency information. That is, the frequency domain information corresponding to multiple second frequency points is low frequency information in the first frequency domain information.
[0145] Similarly, in the second frequency domain information, the frequency domain information corresponding to multiple first frequency points is the intermediate frequency information or high frequency information in the second frequency domain information, and the frequency domain information corresponding to multiple second frequency points is the low frequency information in the second frequency domain information; in the third frequency domain information, the frequency domain information corresponding to multiple first frequency points is the intermediate frequency information and high frequency information in the third frequency domain information, and the frequency domain information corresponding to multiple second frequencies is the low frequency information in the third frequency domain information.
[0146] S32. For each first frequency point, based on the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information, the target amplitude value of the first frequency point is obtained.
[0147] The first frequency domain information includes the frequency values of multiple first frequency points and the amplitude values of multiple first frequency points in the first frequency domain information; the second frequency domain information includes the frequency values of multiple first frequency points and the amplitude values of multiple first frequency points in the second frequency domain information.
[0148] For each first frequency point, the amplitude value of the first frequency point can be obtained in the following way: Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point; based on the amplitude processing method corresponding to the first frequency point, update the amplitude value of the first frequency point in the second frequency domain information to obtain the updated amplitude value of the first frequency point; the sum of the amplitude value of the first frequency point in the first frequency domain information and the updated amplitude value of the first frequency point is determined as the target amplitude value of the first frequency point.
[0149] The amplitude processing method corresponding to the first frequency point is determined based on the frequency value of the first frequency point as follows: if the frequency value of the first frequency point is greater than or equal to the second preset frequency value, the amplitude processing method is determined to be amplitude amplification processing; if the frequency value of the first frequency point is less than the second preset frequency value, the amplitude processing method is determined to be amplitude reduction processing; wherein, the second preset frequency value is greater than the first preset frequency value.
[0150] The second preset frequency value can be a pre-set frequency value. For the first frequency point whose frequency value is greater than or equal to the second preset frequency value, the amplitude processing method is amplitude amplification processing, which means amplifying the amplitude value corresponding to the first frequency point in the second frequency domain information whose frequency value is greater than or equal to the second preset frequency value, that is, multiplying the amplitude value corresponding to the first frequency point in the second frequency domain information whose frequency value is greater than or equal to the second preset frequency value by a number greater than 1. For the first frequency point whose frequency value is less than the second preset frequency value, the amplitude processing method is amplitude reduction processing, which means reducing the amplitude value corresponding to the first frequency point in the second frequency domain information whose frequency value is less than the second preset frequency value, that is, multiplying the amplitude value corresponding to the first frequency point in the second frequency domain information whose frequency value is less than the second preset frequency value by a number greater than 0 and less than 1.
[0151] The updated amplitude value of the first frequency point is obtained as follows: the energy coefficient is obtained according to the amplitude processing method corresponding to the first frequency point; the amplitude value of the first frequency point in the second frequency domain information is updated according to the energy coefficient to obtain the updated amplitude value of the first frequency point.
[0152] When the amplitude processing method corresponding to the first frequency point is amplitude amplification, the obtained energy coefficient is a random number greater than 1. When the amplitude processing method corresponding to the first frequency point is amplitude reduction, the obtained energy coefficient is a random number greater than 0 and less than 1. It should be noted that for multiple first frequency points with amplitude amplification, the energy coefficients corresponding to the multiple first frequency points are the same; for multiple first frequency points with amplitude reduction, the energy coefficients corresponding to the multiple first frequency points are the same.
[0153] The updated amplitude value of the first frequency point can be obtained as follows: For each first frequency point, multiply the amplitude value corresponding to the first frequency point by the energy coefficient corresponding to the first frequency point to obtain the updated amplitude value of the first frequency point.
[0154] For example, for a first frequency point A, the frequency value of the first frequency point A is greater than a second preset frequency value, and the amplitude value corresponding to the first frequency point A is F1. The amplitude processing method for the first frequency point A is determined to be amplitude amplification, and the energy coefficient a is obtained, where a is greater than 1. The amplitude value F1 corresponding to the first frequency point A is multiplied by the energy coefficient a to obtain the updated amplitude value a of the first frequency point. × F1.
[0155] Finally, the updated amplitude value of the first frequency point is added to the amplitude value of the first frequency point in the first frequency domain information to obtain the target amplitude value of the first frequency point.
[0156] For example, suppose the amplitude value after the first frequency point is updated is a. ×F1, the amplitude value of the first frequency point in the first frequency domain information is F2, then the formula for obtaining the target amplitude value F3 of the first frequency point can be shown in formula (2):
[0157] F3=F2+a×F1 (2) S33. Based on the target amplitude values of multiple first frequency points and the amplitude values of multiple second frequency points in the first frequency domain information, obtain the third frequency domain information.
[0158] The method for obtaining the third frequency domain information based on the target amplitude values of multiple first frequency points and the amplitude values of multiple second frequency points in the first frequency domain information can be as follows: the target amplitude values of multiple first frequency points are respectively determined as the amplitude values of multiple first frequency points in the third frequency domain information; the amplitude values of multiple second frequency points in the first frequency domain information are respectively determined as the amplitude values of multiple second frequency points in the third frequency domain information, thereby obtaining the second frequency domain information.
[0159] exist Figure 3 In the illustrated embodiment, multiple first frequency points and multiple second frequency points are determined based on a first preset frequency value. For any given first frequency point, the amplitude processing method corresponding to that first frequency point is determined based on the second preset frequency value. An energy coefficient is obtained based on the amplitude processing method, and the amplitude value of that first frequency point in the second frequency domain information is updated based on the energy coefficient to obtain the updated amplitude value of the first frequency point. Then, the updated amplitude value of the first frequency point is added to the amplitude value of the first frequency point in the first frequency domain information to obtain the target amplitude value of the first frequency point. Finally, third frequency domain information is determined based on the target amplitude values of the multiple first frequency points and the amplitude values of the multiple second frequency points in the first frequency domain information. First, watermark embedding processing is performed on the mid-to-high frequency information in the first frequency domain information, so that, to the human eye, the synthesized image and the carrier image are indistinguishable in appearance. In some cases, the watermark image embedded in the synthesized image cannot be detected, thus increasing the security of the watermark image. Secondly, by introducing an energy coefficient during the watermark embedding process in the first frequency domain, the complexity of watermark embedding in the first frequency domain information is increased. This makes it impossible to easily derive the second frequency domain information from the first and third frequency domain information even if the first and third frequency domain information are obtained, further improving the reliability of copyright protection for the first application. Finally, for users of the first application, it will not affect their viewing experience of the synthesized image.
[0160] Based on any of the above embodiments, the following, in conjunction with Figure 4 The watermark embedding method is illustrated through specific embodiments.
[0161] Figure 4This is a flowchart illustrating the watermark embedding method provided in an embodiment of this application. Please refer to... Figure 4 The watermark embedding method may include the following steps:
[0162] S41. Perform grayscale transformation and frequency domain transformation on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image.
[0163] Taking the RGB image as the carrier image in the first application as an example, for any pixel value in the carrier image, the red, green and blue component values of the pixel value are processed to obtain the gray value of each pixel in the grayscale image of the carrier image. Based on the gray value of each pixel in the grayscale image of the carrier image, the grayscale image of the carrier image is represented in the form of a two-dimensional matrix.
[0164] For the grayscale image of the carrier image, the pixels in the grayscale image of the carrier image are sampled, and the pixel values of the sampled pixels are processed by Fast Fourier Transform, thereby transforming the grayscale image of the carrier image from the time domain to the frequency domain, and obtaining the first frequency domain information corresponding to the carrier image.
[0165] S42. Perform grayscale transformation and frequency domain transformation on the watermark image of the first application to obtain the second frequency domain information corresponding to the watermark image.
[0166] Taking the watermark image of the first application as an RGB image as an example, for any pixel value in the watermark image, the red, green and blue component values of the pixel value are processed to obtain the gray value of each pixel in the grayscale image of the watermark image. Based on the gray value of each pixel in the grayscale image of the watermark image, the grayscale image of the watermark image is represented in the form of a two-dimensional matrix.
[0167] Frequency domain transformation of the grayscale image of the watermark can be performed by randomly transforming the grayscale image, such as by random rotation, random scaling, random noise addition, or random filtering. By performing this random transformation, the grayscale image is converted from the time domain to the frequency domain, yielding the second frequency domain information corresponding to the watermark image.
[0168] S43. Determine multiple first frequency points and multiple second frequency points, and for each first frequency point, determine the target amplitude value of the first frequency point.
[0169] Based on the first preset frequency value, a frequency point with a frequency value greater than the first preset frequency value is determined in the first frequency domain information as the first frequency point, and a frequency point with a frequency value less than or equal to the first preset frequency value is determined in the first frequency domain information as the second frequency point.
[0170] For each first frequency point, if the frequency value of the first frequency point is greater than or equal to the second preset frequency point, the amplitude processing method corresponding to the first frequency point is determined to be amplitude amplification processing, and the energy coefficient is obtained. At this time, the energy coefficient is a random number greater than 1. The amplitude value of the first frequency point in the second frequency domain information is multiplied by the energy coefficient to obtain the updated amplitude value of the first frequency point. The updated amplitude value of the first frequency point is added to the amplitude value of the first frequency point in the first frequency domain information to obtain the target amplitude value of the first frequency point.
[0171] If the frequency value of the first frequency point is less than the second preset frequency point, the amplitude processing method corresponding to the first frequency point is determined to be amplitude reduction processing. The energy coefficient is obtained. At this time, the energy coefficient is a random number greater than 0 and less than 1. The amplitude value of the first frequency point in the second frequency domain information is multiplied by the energy coefficient to obtain the updated amplitude value of the first frequency point. The updated amplitude value of the first frequency point is added to the amplitude value of the first frequency point in the first frequency domain information to obtain the target amplitude value of the first frequency point.
[0172] S44. Determine the third frequency domain information based on the target amplitude values of each of the multiple first frequency points and the amplitude values of the multiple second frequency points in the first frequency domain information.
[0173] The multiple frequency points in the third frequency domain information consist of multiple first frequency points and multiple second frequency points. The third frequency domain information includes the amplitude values corresponding to the multiple first frequency points, which are the target amplitude values of the multiple first frequency points respectively. The amplitude values corresponding to the multiple second frequency points included in the third frequency domain information are the amplitude values of the multiple second frequency points in the first frequency domain information.
[0174] S45. Perform time-domain transformation on the third frequency domain information to obtain the synthesized image.
[0175] The time-domain transformation of the third frequency domain information can be performed by performing an inverse fast Fourier transform on the third frequency domain information, converting the third frequency domain information from the frequency domain to the time domain information, and obtaining the synthetic image corresponding to the carrier image.
[0176] exist Figure 4In the illustrated embodiment, the image of the first application on the front-end page is used as the carrier image. The carrier image is processed to obtain the first frequency domain information corresponding to the carrier image. The image carrying the copyright mark information of the first application is used as the watermark image. The watermark image is processed to obtain the second frequency domain information corresponding to the watermark image. For multiple first frequency points in the first frequency domain information, the amplitude processing method for each of the multiple first frequency points is determined, and the energy coefficients corresponding to the multiple first frequency points are obtained according to the amplitude processing method. Based on the energy coefficients corresponding to the multiple first frequency points, the amplitude values of the multiple first frequency points in the first frequency domain information, and the amplitude values of the multiple first frequency points in the second frequency domain information, the target amplitude values of the multiple first frequency points are determined. Finally, based on the target amplitude values of the multiple first frequency points and the amplitude values of the multiple second frequency points in the first frequency domain information, the third frequency domain information is determined. Therefore, in the third frequency domain information, the amplitude values of each of the multiple second frequency points are the same as those of each of the multiple second frequency points in the first frequency domain information. That is, the low-frequency information in the synthesized image is the same as the low-frequency information in the carrier image. To the human eye, there is no difference between the synthesized image and the carrier image, and it is impossible to detect that a watermark image is embedded in the synthesized image, which increases the security of the watermark image. At the same time, for the user of the first application, it will not affect the user's viewing experience when viewing the synthesized image.
[0177] The above embodiments mainly describe how to perform watermark embedding processing on the carrier image to obtain a composite image. To facilitate the identification of counterfeit software, this application also provides a method for removing watermarks, which will be described below. Figure 5 The watermark removal method provided in the embodiments of this application will be described in detail.
[0178] Figure 5 This is a flowchart illustrating a watermark removal method provided in an embodiment of this application. Figure 5 As shown, the watermark removal method may include the following steps:
[0179] S51. Perform frequency domain transformation on the synthesized image of the first application to obtain the third frequency domain information.
[0180] The first application can be the application software to be protected by copyright, and the synthesized image of the first application can be the image obtained after watermarking the carrier image of the first application using a watermark embedding method. Performing frequency domain transformation on the synthesized image of the first application can be performed by performing a Fast Fourier Transform (FFT) on the synthesized image of the first application. The method for performing the FFT on the synthesized image of the first application can be as follows: sample each pixel of the synthesized image of the first application, and perform a FFT on the pixel values at the sampled pixels, thereby transforming the synthesized image of the first application from the time domain to the frequency domain, obtaining the third frequency domain information.
[0181] The third frequency domain information includes the amplitude value of the synthesized image at at least one frequency point in the frequency domain.
[0182] S52. Perform grayscale transformation and frequency domain transformation on the carrier image of the first application in sequence to obtain the first frequency domain information corresponding to the carrier image.
[0183] The process of sequentially performing grayscale transformation and frequency domain transformation on the carrier image for the first application can be found in [reference needed]. Figure 2 S21 in the illustrated embodiment will not be described in detail here.
[0184] S53. Based on the frequency values of each frequency point in the first frequency domain information, perform watermark removal processing on the third frequency domain information to obtain the second frequency domain information.
[0185] The method for dewatermarking the third frequency domain information corresponds to the method for watermark embedding the first frequency domain information. The method for dewatermarking the third frequency domain information is as follows: Based on the frequency values of each frequency point in the first frequency domain information, determine multiple first frequency points with frequency values greater than a first preset frequency value, and multiple second frequency points with frequency values less than or equal to the first preset frequency value; for each first frequency point, determine the amplitude value of the first frequency point in the second frequency domain information based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information; based on the amplitude values of the multiple first frequency points in the second frequency domain information, and the amplitude values of the multiple frequency points in the first frequency domain information, obtain the second frequency domain information.
[0186] The method for determining multiple first frequency points with frequency values greater than a first preset frequency value and multiple second frequency points with frequency values less than or equal to the first preset frequency value in the first frequency domain information can be found in [reference needed]. Figure 3 S31 in the illustrated embodiment will not be described in detail here.
[0187] The amplitude value of the first frequency point in the second frequency domain information can be determined as follows: the difference between the target amplitude value of the first frequency point and the amplitude value of the first frequency point in the first frequency domain information is determined as the updated amplitude value of the first frequency point; the amplitude processing method corresponding to the first frequency point is determined according to the frequency value of the first frequency point; the amplitude value of the first frequency point in the second frequency domain information is determined according to the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point.
[0188] The method for determining the updated amplitude value of the first frequency point as the difference between the target amplitude value at the first frequency point and the amplitude value of the first frequency point in the first frequency domain information can be found in [reference needed]. Figure 3 S32 in the illustrated embodiment will not be described in detail here.
[0189] The method for determining the amplitude value of the first frequency point in the second frequency domain information based on the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point can be as follows: according to the amplitude processing method corresponding to the first frequency point, obtain the energy coefficient corresponding to the first frequency point, divide the updated amplitude value of the first frequency point by the energy coefficient, and obtain the amplitude value of the first frequency point in the second frequency domain information, thereby obtaining the second frequency domain information.
[0190] The energy coefficient corresponding to the first frequency point can be the energy coefficient obtained during the watermark embedding process of the first frequency domain information. For example, assuming that the amplitude processing method corresponding to the first frequency point is amplitude amplification, the energy coefficient corresponding to the first frequency point is a random number greater than 1; assuming that the amplitude processing method corresponding to the first frequency point is amplitude reduction, the energy coefficient corresponding to the first frequency point is a random number greater than 0 and less than 1.
[0191] For example, for a first frequency point A, the amplitude value of the first frequency point A in the first frequency domain information is F2, the amplitude value of the first frequency point A in the third frequency domain information is F3, and the frequency value of the first frequency point A is greater than the second preset frequency value. The energy coefficient corresponding to the first frequency point A is obtained as a, where a is greater than 1. The amplitude value of the first frequency point A in the third frequency domain information is F3, and the amplitude value of the first frequency point A in the first frequency domain information is F2, to obtain the updated amplitude value of the first frequency point A as F3-F2. The updated amplitude value of the first frequency point A is divided by the energy coefficient to obtain the amplitude value F1 of the first frequency point A in the second frequency domain information. That is, the formula for obtaining the amplitude value F1 of the first frequency point A in the second frequency domain information can be shown as formula (3):
[0192]
[0193] S54. Perform time-domain transformation on the second frequency domain information to obtain the watermark image.
[0194] Performing a time-domain transformation on the second frequency domain information can be considered the inverse of a random transformation of the second frequency domain information. For example, if a random rotation transformation is used when performing a random transformation on the watermark image, then the inverse of a random transformation on the second frequency domain information can be the inverse of a random rotation transformation on the second frequency domain information; similarly, if a random filtering transformation is used when performing a random transformation on the watermark image, then the inverse of a random transformation on the second frequency domain information can be the inverse of a random filtering transformation on the second frequency domain information.
[0195] exist Figure 5In the illustrated embodiment, the synthesized image and the carrier image are processed separately to obtain third frequency domain information and first frequency domain information. For each first frequency point, the amplitude value of the first frequency point in the third frequency domain information is subtracted from the amplitude value of the first frequency point in the first frequency domain information to obtain the updated amplitude value of the first frequency point. Then, based on the frequency value of the first frequency point, the energy coefficient of the first frequency point is determined. The updated amplitude value of the first frequency point is divided by the energy coefficient of the first frequency point to obtain the second frequency domain information. Finally, the second frequency domain information is subjected to time domain transformation processing to obtain the watermark image. This application embodiment provides a method for dewatermarking a synthesized image based on a carrier image. Furthermore, in the process of dewatermarking the third frequency domain information of the synthesized image, it is necessary to consider the synthesized image, the carrier image, the energy coefficient, and a random transformation processing method for the watermark image to obtain the watermark image embedded in the synthesized image. This further demonstrates that after the watermark image is embedded in the carrier image by the watermark embedding method provided in this application, the watermark image will not be easily discovered or obtained, thus improving the reliability of copyright protection for the first application.
[0196] Figure 6 This is a schematic diagram of a watermark embedding device provided in an embodiment of this application. Please refer to... Figure 6 The watermark embedding device 60 may include a first processing module 61, a second processing module 62, a watermark embedding module 63, and a time domain processing module 64.
[0197] The first processing module 61 is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image.
[0198] The second processing module 62 is used to sequentially perform grayscale transformation and frequency domain transformation on the watermark image to obtain the second frequency domain information corresponding to the watermark image.
[0199] The watermark embedding module 63 is used to perform watermark embedding processing on the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information to obtain the third frequency domain information.
[0200] In one possible implementation, the watermark embedding module 63 is specifically used for:
[0201] Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information.
[0202] For each first frequency point, the target amplitude value of the first frequency point is obtained based on the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information.
[0203] The third frequency domain information is obtained based on the target amplitude values of multiple first frequency points and the amplitude values of multiple second frequency points in the first frequency domain information.
[0204] In one possible implementation, the watermark embedding module 63 is specifically used for:
[0205] Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point;
[0206] Based on the amplitude processing method corresponding to the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point.
[0207] The sum of the amplitude value of the first frequency point in the first frequency domain information and the updated amplitude value of the first frequency point is determined as the target amplitude value of the first frequency point.
[0208] In one possible implementation, the watermark embedding module 63 is specifically used for:
[0209] If the frequency value of the first frequency point is greater than or equal to the second preset frequency value, the amplitude processing method is determined to be amplitude amplification processing.
[0210] If the frequency value of the first frequency point is less than the second preset frequency value, the amplitude processing method is determined to be amplitude reduction processing.
[0211] The second preset frequency value is greater than the first preset frequency value.
[0212] In one possible implementation, the watermark embedding module 63 is specifically used for:
[0213] The energy coefficient is obtained based on the amplitude processing method corresponding to the first frequency point;
[0214] Based on the energy coefficient, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point.
[0215] The time-domain processing module 64 is used to perform time-domain transformation processing on the third frequency domain information to obtain the synthetic image corresponding to the carrier image.
[0216] The watermark embedding device 60 provided in this application embodiment can execute the watermark embedding method in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0217] Figure 7 This is a schematic diagram of a watermark removal device provided in an embodiment of this application. Please refer to... Figure 7The watermark removal device 70 may include a first transformation module 71, a second transformation module 72, a watermark removal module 73, and a time-domain transformation module 74.
[0218] The first transformation module 71 is used to perform frequency domain transformation processing on the synthesized image of the first application to obtain third frequency domain information.
[0219] The second transformation module 72 is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image.
[0220] The watermark removal module 73 is used to perform watermark removal processing on the third frequency domain information based on the frequency values of each frequency point in the first frequency domain information to obtain the second frequency domain information.
[0221] In one possible implementation, the watermark removal module 73 is specifically used for:
[0222] Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information.
[0223] For each first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information.
[0224] The second frequency domain information is obtained based on the amplitude values of multiple first frequency points in the second frequency domain information, and the amplitude values of multiple frequency points in the first frequency domain information.
[0225] In one possible implementation, the watermark removal module 73 is specifically used for:
[0226] The difference between the target amplitude value at the first frequency point and the amplitude value at the first frequency point in the first frequency domain information is determined as the updated amplitude value at the first frequency point.
[0227] Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point;
[0228] Based on the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined.
[0229] The time-domain transformation module 74 is used to perform time-domain transformation processing on the second frequency domain information to obtain the watermark image.
[0230] The watermark removal device 70 provided in this application embodiment can execute the technical solution of the watermark removal method in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0231] Figure 8 This is a schematic diagram of a watermark embedding device provided in an embodiment of this application. Figure 8 As shown, the watermark embedding device 80 may include a memory 81 and at least one processor 82. Exemplarily, the memory 81 and the at least one processor 82 are interconnected via a bus 83.
[0232] Memory 81 is used to store program instructions.
[0233] At least one processor 82 is used to execute program instructions stored in the memory to cause the watermark embedding device 80 to perform the watermark embedding method in the above method embodiment.
[0234] Optionally, the aforementioned processor can be a central processing unit (CPU), a graphics processing unit (GPU), other general-purpose processors, a digital signal processor (DSP), or an application-specific integrated circuit (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0235] The watermark embedding device 80 provided in this application embodiment can execute the watermark embedding method in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0236] Figure 9 This is a schematic diagram of a watermark removal device provided in an embodiment of this application. Figure 9 As shown, the watermark removal device 90 may include a memory 91 and at least one processor 92. Exemplarily, the memory 91 and the at least one processor 92 are interconnected via a bus 93.
[0237] Memory 91 is used to store program instructions.
[0238] At least one processor 92 is used to execute program instructions stored in the memory to cause the watermark removal device 90 to perform the watermark removal method in the above method embodiment.
[0239] Optionally, the processor mentioned above can be a CPU, or it can be a GPU, other general-purpose processors, DSPs, or ASICs, etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or being executed by a combination of hardware and software modules in the processor.
[0240] The watermark removal device 90 provided in this application embodiment can execute the watermark removal method in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.
[0241] This application provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the watermark embedding method and the watermark removal method involved in the above method embodiments.
[0242] This application provides a computer program product, including a computer program that, when executed by a processor, implements the watermark embedding method and the watermark removal method involved in the above method embodiments.
[0243] This application provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the watermark embedding method and the watermark removal method involved in the above method embodiments.
[0244] This application provides a chip module on which a computer program is stored. When the computer program is executed by the chip module, it implements the watermark embedding method and the watermark removal method involved in the above method embodiments.
[0245] All or part of the steps in the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disk, and any combination thereof.
[0246] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable terminal device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable terminal device, generate instructions for implementing the flowchart. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0247] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable terminal device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0248] These computer program instructions can also be loaded onto a computer or other programmable terminal device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 Figure 1 The steps of the function specified in one or more boxes.
[0249] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
[0250] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0251] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A watermark embedding method, characterized in that, The method includes: The carrier image of the first application is subjected to grayscale transformation and frequency domain transformation processing in sequence to obtain the first frequency domain information corresponding to the carrier image; The watermark image is subjected to grayscale transformation and frequency domain transformation in sequence to obtain the second frequency domain information corresponding to the watermark image; Based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information, watermark embedding processing is performed on the first frequency domain information to obtain the third frequency domain information. The third frequency domain information is subjected to time domain transformation processing to obtain the synthetic image corresponding to the carrier image.
2. The method according to claim 1, characterized in that, The step of performing watermark embedding processing on the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information to obtain the third frequency domain information includes: Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information. For each first frequency point, the target amplitude value of the first frequency point is obtained based on the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information. The third frequency domain information is obtained based on the target amplitude values of the plurality of first frequency points and the amplitude values of the plurality of second frequency points in the first frequency domain information.
3. The method according to claim 2, characterized in that, The step of obtaining the target amplitude value of the first frequency point based on the frequency value of the first frequency point, the amplitude value of the first frequency point in the first frequency domain information, and the amplitude value of the first frequency point in the second frequency domain information includes: Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point; Based on the amplitude processing method corresponding to the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point. The sum of the amplitude value of the first frequency point in the first frequency domain information and the updated amplitude value of the first frequency point is determined as the target amplitude value of the first frequency point.
4. The method according to claim 3, characterized in that, The step of determining the amplitude processing method corresponding to the first frequency point based on the frequency value of the first frequency point includes: If the frequency value of the first frequency point is greater than or equal to the second preset frequency value, the amplitude processing method is determined to be amplitude amplification processing. If the frequency value of the first frequency point is less than the second preset frequency value, the amplitude processing method is determined to be amplitude reduction processing; The second preset frequency value is greater than the first preset frequency value.
5. The method according to claim 3 or 4, characterized in that, The step of updating the amplitude value of the first frequency point in the second frequency domain information according to the amplitude processing method corresponding to the first frequency point to obtain the updated amplitude value of the first frequency point includes: The energy coefficient is obtained based on the amplitude processing method corresponding to the first frequency point; Based on the energy coefficient, the amplitude value of the first frequency point in the second frequency domain information is updated to obtain the updated amplitude value of the first frequency point.
6. A method for removing watermarks, characterized in that, The method includes: The synthesized image from the first application is subjected to frequency domain transformation to obtain third frequency domain information; The carrier image of the first application is subjected to grayscale transformation and frequency domain transformation in sequence to obtain the first frequency domain information corresponding to the carrier image; Based on the frequency values of each frequency point in the first frequency domain information, the third frequency domain information is dewatermarked to obtain the second frequency domain information. The second frequency domain information is subjected to time domain transformation to obtain the watermark image.
7. The method according to claim 6, characterized in that, The step of performing watermark removal processing on the third frequency domain information based on the frequency values of each frequency point in the first frequency domain information to obtain the second frequency domain information includes: Based on the frequency values of each frequency point in the first frequency domain information, a plurality of first frequency points with frequency values greater than a first preset frequency value and a plurality of second frequency points with frequency values less than or equal to the first preset frequency value are determined in the first frequency domain information. For each first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information. The second frequency domain information is obtained based on the amplitude values of the plurality of first frequency points in the second frequency domain information and the amplitude values of the plurality of frequency points in the first frequency domain information.
8. The method according to claim 7, characterized in that, Determining the amplitude value of the first frequency point in the second frequency domain information based on the frequency value of the first frequency point and the target amplitude value of the first frequency point in the third frequency domain information includes: The difference between the target amplitude value of the first frequency point and the amplitude value of the first frequency point in the first frequency domain information is determined as the updated amplitude value of the first frequency point. Based on the frequency value of the first frequency point, determine the amplitude processing method corresponding to the first frequency point; Based on the amplitude processing method corresponding to the first frequency point and the updated amplitude value of the first frequency point, the amplitude value of the first frequency point in the second frequency domain information is determined.
9. A watermark embedding device, characterized in that, The device includes: The first processing module is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image; The second processing module is used to sequentially perform grayscale transformation and frequency domain transformation on the watermark image to obtain the second frequency domain information corresponding to the watermark image. The watermark embedding module is used to perform watermark embedding processing on the first frequency domain information based on the frequency values of each frequency point in the first frequency domain information and the second frequency domain information to obtain the third frequency domain information. The time-domain processing module is used to perform time-domain transformation processing on the third frequency domain information to obtain the synthetic image corresponding to the carrier image.
10. A watermark removal device, characterized in that, The device includes: The first transformation module is used to perform frequency domain transformation processing on the synthesized image of the first application to obtain the third frequency domain information; The second transformation module is used to sequentially perform grayscale transformation processing and frequency domain transformation processing on the carrier image of the first application to obtain the first frequency domain information corresponding to the carrier image; The watermark removal module is used to perform watermark removal processing on the third frequency domain information based on the frequency values of each frequency point in the first frequency domain information to obtain the second frequency domain information. The time-domain transformation module is used to perform time-domain transformation processing on the second frequency domain information to obtain the watermark image.
11. A watermark embedding device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to cause the at least one processor to perform the watermark embedding method according to any one of claims 1 to 5.
12. A watermark removal device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to cause the at least one processor to perform the watermark removal method according to any one of claims 6 to 8.
13. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 8.