Image processing method and system, storage medium, and computing device

By modifying the Fourier transform coefficients of the original image and embedding the watermarks using the characteristics of the two-dimensional Fourier transform, the watermark failure problem under various attacks during the propagation process is solved, and efficient copyright protection of the image is achieved.

CN113393358BActive Publication Date: 2025-06-13ALIBABA GROUP HOLDING LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202010172556.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-12
Publication Date
2025-06-13
Estimated Expiration
2040-03-12

AI Technical Summary

Technical Problem

The prior art is difficult to deal with the frequent attacks of rotation, scaling, translation, mirroring, cutting, collage, compression, etc. during the propagation of images, resulting in the invalidation of digital image watermarks and affecting the copyright protection of images.

Method used

By acquiring the original image and the binary sequence, modifying the Fourier transform coefficients of the original image based on the binary sequence to generate a target image containing a watermark. This method utilizes the characteristics of the two-dimensional Fourier transform, making the target image strongly robust and able to deal with multiple attacks.

Benefits of technology

It realizes effective embedding and detection of image watermarks, and can maintain the integrity and detectability of the watermark after the image undergoes rotation, scaling, translation, mirroring, cutting, collage, compression and other attacks, improving the copyright protection ability of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113393358B_ABST
    Figure CN113393358B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method and system, a storage medium, and a computing device. Among them, the method includes: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark. The present application solves the technical problem that the image processing method in the related art cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image watermarking, and in particular, to an image processing method and system, a storage medium, and a computing device. Background Art

[0002] With the rapid development of the Internet, the speed of information dissemination far exceeds that of any previous period. Digital images, as a common information carrier, are widely used today in the digital information age. However, digital images are easy to spread, copy, and tamper with, and there are still problems such as difficult-to-define image copyright ownership, anti-counterfeiting, and anti-tampering in practical applications. To solve the above problems, digital image watermarking technology has been proposed. Digital image watermarking technology embeds some identification information into digital images without affecting the use value of the original carrier. Through this information hidden in the images, purposes such as confirming the image creator, purchaser, transmitting secret information, or determining whether the image has been tampered with can be achieved. Digital image watermarking is an effective method for protecting the security of digital images, realizing anti-counterfeiting traceability, and copyright protection, and is an important branch and research direction in the field of information hiding technology research.

[0003] Now is a period when mobile Internet applications are very developed. When images are transmitted, they are often rotated, scaled, translated, collaged, compressed, etc. These attacks are very common, but they also seriously damage digital image watermarks. Under these attacks, digital image watermarks face the risk of failure. Due to the wide existence of this attack method, if the problems caused by this transmission method cannot be solved in time, it will bring great troubles to the copyright protection of images.

[0004] Regarding the problem that the image processing method in the related technology cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, collaging, and compression, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of the present application provide an image processing method and system, a storage medium, and a computing device to at least solve the technical problem that the image processing method in the related technology cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, collaging, and compression.

[0006] According to one aspect of the embodiments of the present application, an image processing method is provided, including: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0007] According to another aspect of the embodiments of the present application, there is also provided an image processing method, including: obtaining a detection image and a binary sequence, where the binary sequence is used to generate a watermark included in the detection image; generating a target amplitude image based on the Fourier transform coefficients of the detection image; filtering the target amplitude image with the binary sequence to obtain a first filtering result; determining a detection result of the detection image based on the first filtering result, where the detection result is used to indicate whether there is a watermark in the detection image.

[0008] According to another aspect of the embodiments of the present application, there is also provided a storage medium, where the storage medium includes a stored program, and when the program runs, it controls the device where the storage medium is located to execute the above-mentioned image processing method.

[0009] According to another aspect of the embodiments of the present application, there is also provided a computing device, including: a processor and a storage medium, where the processor is used to run the program stored in the storage medium, and when the program runs, it executes the above-mentioned image processing method.

[0010] According to another aspect of the embodiments of the present application, there is also provided an image processing system, including: a processor; and a memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0011] According to another aspect of the embodiments of the present application, there is also provided a data processing method, including: obtaining original data; modifying the first Fourier transform coefficients of the original data to generate target data with an embedded watermark.

[0012] In the embodiments of the present application, after obtaining the original image, a binary sequence for generating a watermark can be obtained, and the Fourier transform coefficients of the original image are modified based on the binary sequence to obtain a target image containing the watermark, achieving the purpose of watermark embedding. Compared with the prior art, by modifying the Fourier transform coefficients of the original image and using the characteristics of the two-dimensional Fourier transform, the target image has strong robustness and can cope with combined attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression, and has the technical effects of fast embedding speed, simple calculation, and broad application scenarios, thereby solving the technical problem that the image processing method in the related art cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression. Description of the Drawings

[0013] The accompanying drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation to the present application. In the drawings:

[0014] Figure 1 is a hardware structure block diagram of a computer terminal for implementing an image processing method according to an embodiment of the present application;

[0015] Figure 2 is a schematic diagram of a computer device as a receiving end according to an embodiment of the present application;

[0016] Figure 3 is a flowchart of an image processing method according to Embodiment 1 of the present application;

[0017] Figure 4 is a flowchart of template watermark embedding based on Fourier transform according to an embodiment of the present application;

[0018] Figure 5 is a schematic diagram of watermark embedding taking an image as an example according to an embodiment of the present application;

[0019] Figure 6 is a schematic diagram of a Fourier transform template taking an image as an example according to an embodiment of the present application;

[0020] Figure 7 is a flowchart of another template watermark embedding based on Fourier transform according to an embodiment of the present application;

[0021] Figure 8 is a flowchart of the correlation result of a polar coordinate diagram according to an embodiment of the present application;

[0022] Figure 9 is a schematic diagram of watermark detection taking an image as an example according to an embodiment of the present application;

[0023] Figure 10 is a flowchart of template watermark detection and image correction based on Fourier transform according to an embodiment of the present application;

[0024] Figure 11 is a flowchart of an image processing method according to Embodiment 2 of the present application;

[0025] Figure 12 is a schematic diagram of an image processing device according to Embodiment 3 of the present application;

[0026] Figure 13 is a schematic diagram of an image processing device according to Embodiment 4 of the present application;

[0027] Figure 14is a structural block diagram of a computer terminal according to an embodiment of the present application; and

[0028] Figure 15 is a flowchart of a data processing method according to Embodiment 8 of the present application. Detailed implementation manners

[0029] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0031] First, some nouns or terms that appear in the process of describing the embodiments of the present application are applicable to the following explanations:

[0032] DFT: Discrete Fourier Transform. The discrete Fourier transform can convert a discrete spatial domain signal into a discrete frequency domain signal, and the transformation basis is sine and cosine functions.

[0033] Binary sequence: It can be composed of a certain number of binary elements, and the binary elements can be 0 or 1.

[0034] Embodiment 1

[0035] In real life, common attacks on images include rotation, scaling, translation, mirroring, shearing, tiling, compression, etc. Related digital image watermarking schemes are often difficult to resist the combined attacks of the above-mentioned attacks, resulting in the failure of digital image watermarks, low security of digital images, and still existing problems such as image copyright attribution, anti-counterfeiting and anti-tampering.

[0036] To solve the above problems, an embodiment of the present application provides an image processing method. Utilizing the characteristics of Fourier transform, a watermark template method based on discrete Fourier transform is proposed, which has strong robustness and can cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression. Moreover, it can give the rotation and scaling coefficients of the image, and it is a watermark method for image correction. Furthermore, this method is a blind extraction watermark template scheme, with fast embedding and extraction times, and can be combined with other watermark methods for customizing embedded information, having a very broad application scenario.

[0037] The above solution can be divided into two parts, namely: embedding of the watermark and detection of the watermark. That is, the above image processing method includes: an embedding method of template watermark based on Fourier transform, and a detection method of template watermark based on Fourier transform.

[0038] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0039] The method embodiment provided by Embodiment 1 of the present application can be executed on a mobile terminal, a computer terminal, a server, or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal (or mobile device, or server) for implementing the image processing method is shown. As Figure 1 shown, the computer terminal 10 (or mobile device 10, or server 10) may include one or more (shown as 102a, 102b,..., 102n in the figure) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a field programmable gate array FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (BUS bus) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.

[0040] It should be noted that one or more of the above-mentioned processors 102 and / or other data processing circuits can generally be referred to as "data processing circuits" herein. The data processing circuit can be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit can be a single independent processing module, or be incorporated, in whole or in part, into any one of other elements in the computer terminal 10 (or mobile device, or server).

[0041] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage devices corresponding to the image processing method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the above-mentioned image processing method. The memory 104 can include high-speed random access memory, and can also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 can further include a memory remotely disposed relative to the processor 102, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, enterprise intranets, local area networks, mobile communication networks, and combinations thereof.

[0042] The transmission device 106 is used to receive or send data via a network. Specific examples of the above-mentioned network can include the wireless network provided by the communication provider of the computer terminal 10. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0043] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables a user to interact with the user interface of the computer terminal 10 (or mobile device, or server).

[0044] It should be noted here that in some alternative embodiments, the above-mentioned Figure 1 shown computer device (or mobile device, or server) can include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. It should be pointed out that Figure 1 is only an example of a specific specific instance, and is intended to illustrate the types of components that can exist in the above-mentioned computer device (or mobile device, or server).

[0045] Figure 1 The shown hardware structure block diagram can be used not only as an exemplary block diagram of the above computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above server. In an alternative embodiment, Figure 2 The block diagram shows the use of the above Figure 1 shown computer terminal 10 (or mobile device) as a receiving end in one embodiment. As Figure 2 shown, the computer terminal 10 (or mobile device) can be connected to one or more clients 20 via a data network connection or an electronic connection. In an alternative embodiment, the above computer terminal 10 (or mobile device) can be a server. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections. The computer terminal 10 (or mobile device) can provide network services to the clients. The network services are network-based user services, such as social networks, cloud resources, email, online payment, or other online applications.

[0046] Under the above operating environment, the present application provides an image processing method as Figure 3 shown. Figure 3 is a flowchart of an image processing method according to Embodiment 1 of the present application. As Figure 3 shown, the method includes the following steps:

[0047] Step S302, obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image.

[0048] The original image in the above step can be a single-channel grayscale image. In actual use, any single-channel image can be used, for example, a certain color channel separated from color spaces such as RGB and YUV. The binary sequence in the above step can be a one-dimensional binary sequence with a certain length, and its elements are composed of 0 and 1. Generally, the length L of the binary sequence can be between 20 and 40, but it is not limited thereto, and it can also be other suitable lengths. The binary sequence is a definite identifier actively constructed by the watermark adder, not randomly set information, used to determine whether a watermark is embedded in the image and to calculate the rotation and scaling coefficients of the image.

[0049] It should be noted that the construction of the binary sequence satisfies at least one of the following conditions: the traversal result obtained by traversing from the head of the binary sequence to the tail of the binary sequence is different from the traversal result obtained by traversing from the tail of the binary sequence to the head of the binary sequence; in the new binary sequence formed by connecting two binary sequences end to end, the starting position of the subsequence identical to the binary sequence is not located inside the binary sequence; the difference between the number of 0s and the number of 1s in the binary sequence is within a first preset range.

[0050] Specifically, taking the case where the binary sequence satisfies the above three conditions as an example for illustration. The three conditions are unidirectionality, weak periodicity, and balance of the number of binary elements. The binary sequence constructed by the above three conditions can significantly improve the detection effect.

[0051] Among them, unidirectionality can refer to the asymmetry of the binary sequence, that is, it is different from the head to the tail and from the tail to the head of the binary sequence. For example, the binary sequence {010010001} has unidirectionality. The sequence from the head to the tail is {010010001}, while the sequence from the tail to the head is {100010010}, and the two are different; the binary sequence {00100100} does not have unidirectionality because the sequence from the head to the tail is {00100100}, and the sequence from the tail to the head is {00100100}, and the two are the same.

[0052] Weak periodicity can refer to connecting two sequences head to tail, and there is no subsequence that is the same or similar to the sequence starting from the inside of the original sequence. For example, the binary sequence {010010001} has weak periodicity. Connecting two such sequences head to tail gives a new sequence {010010001010010001}. In the new sequence, the starting sequence positions of the subsequences that are the same as the original sequence are the 1st and 10th positions, both located at the 1st position of the original sequence, and there is no subsequence that is the same as the original sequence starting from the inside of the original sequence; the sequence {001001001} does not have weak periodicity. Connecting two such sequences head to tail gives a new sequence {001001001001001001}; in the new sequence, the starting sequence positions of the subsequences that are the same as the original sequence are the 1st, 4th, 7th, and 10th positions, where the 4th and 7th positions are inside the original sequence, that is, the subsequences {001{001001001}001001} and {001001{001001001}001} are the same as the original sequence, so it does not have weak periodicity.

[0053] The balance of the number of binary elements can refer to that the numbers of 0 and 1 in the binary sequence are within a first preset range and do not differ much. The first preset range can be set according to needs during actual use, and this application does not make any limitations on this. For example, in the binary sequence {01010011}, the number of 0 is 4 and the number of 1 is 4, that is, the numbers of 0 and 1 elements are balanced; while in the binary sequence {00000001}, the number of 0 is 7 and the number of 1 is 1, that is, the numbers of 0 and 1 elements are unbalanced. Therefore, the balance of the number of binary elements of the sequence {01010011} is better than that of the sequence {00000001}.

[0054] Step S304, modify the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains a watermark.

[0055] In an alternative embodiment, by utilizing the rotation and translation invariance of the two-dimensional Fourier transform and the influence of scaling on the Fourier spectrum, the Fourier transform coefficients of the original image can be modified based on the binary sequence actively constructed by the watermark adder, so that the Fourier transform coefficients of the original image have the characteristics of the binary sequence, achieving the purpose of embedding a watermark in the original image.

[0056] Based on the solution provided in the above embodiments of the present application, after obtaining the original image, a binary sequence for generating a watermark can be obtained, and the Fourier transform coefficients of the original image can be modified based on the binary sequence to obtain an image containing the watermark, achieving the purpose of watermark embedding. Compared with the prior art, by modifying the Fourier transform coefficients of the original image and utilizing the characteristics of the two-dimensional Fourier transform, the target image has strong robustness and can cope with combined attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression, and has the technical effects of fast embedding speed, simple calculation, and broad application scenarios, thereby solving the technical problem that the image processing method in the related art cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression.

[0057] In the above embodiments of the present application, modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image includes: performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients; obtaining a set of coefficients to be modified and the modification intensity in the first Fourier transform coefficients, where the set of coefficients to be modified contains a plurality of coefficients to be modified that correspond one-to-one to the plurality of elements contained in the binary sequence; modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity, where the modification intensity is used to represent the degree of amplification of the amplitude; and performing an inverse transform on the modified Fourier transform coefficients to obtain the target image.

[0058] Specifically, the above set of coefficients to be modified can be the coefficients selected from all the Fourier transform coefficients, and the number is the same as the length of the binary sequence. The corresponding coefficients can be modified based on the element value of each element in the binary sequence. The modification intensity can refer to the degree of amplification of the amplitude of the Fourier transform coefficients that meet the modification conditions, which can be obtained by setting an adaptive calculation method according to the characteristics of the original image itself, or can be set in advance. The present application does not limit this.

[0059] In an alternative embodiment, a two-dimensional discrete Fourier transform may be performed on the original image to obtain the Fourier transform coefficients of the original image. The coefficients to be modified are selected from all the Fourier transform coefficients. Based on the element values and modification intensity of the corresponding elements in the binary sequence, the amplitude of the corresponding coefficients is enlarged, so as to embed the binary sequence into the Fourier transform coefficients. Further, by performing an inverse transform on the Fourier transform coefficients containing the embedded information, the final watermarked image can be obtained.

[0060] In the above embodiments of the present application, obtaining the set of coefficients to be modified in the first Fourier transform coefficients includes: determining the center of the first Fourier transform coefficients as the center of the circle; determining the unit angle of the circle based on the length of the binary sequence; determining the radius of the circle based on the obtained preset coefficient and the size of the original image; and determining each coefficient to be modified in the set of coefficients to be modified based on the center, unit angle, and radius.

[0061] In the embodiments of the present application, the binary sequence may be embedded into the Fourier transform coefficients in a circular ring manner. Among them, determining the unit angle of the circle based on the length of the binary sequence includes: obtaining the ratio of the preset angle to the length to obtain the unit angle; determining the radius of the circle based on the obtained preset coefficient includes: determining the target length based on the size of the original image; obtaining the product of the preset coefficient and the target length; and obtaining the ratio of the product to the first preset value to obtain the radius.

[0062] Specifically, the preset coefficient in the above steps may be a coefficient for controlling the radius of the embedded circle, denoted as p, which is a decimal between 0 and 1, for example, a decimal between 0.2 and 0.8. Since the two-dimensional Fourier transform coefficients are centrosymmetric, the above preset angle may be 180°. After the coefficient is modified, the coefficient symmetric about the center of the circle can be modified in the same way. Thus, the angle covered by the binary sequence is 180°, and after central symmetry, the entire 360° will be covered. Since the size of the original image is not fixed, in order to conveniently embed the binary sequence into the original image in a circular ring manner, the original image may be filled into a square image. Therefore, when the original image is a square image, the target length may be the length of the original image; when the original image is not a square image, the target length may be the side length of the filled square image, denoted as d.

[0063] In an alternative embodiment, first, the unit angle θ may be calculated according to the length L of the binary sequence. For example, Then, taking the center of the two-dimensional Fourier transform coefficient matrix as the center of the circle, with the positive x-axis direction as 0°, the counterclockwise direction as the angle increasing direction, and the unit angle θ as the angle value increased each time, and calculating the radius length r according to the preset coefficient p and the target length d, the radius (That is, the above first preset value is 2). Based on the center of the circle, the unit angle, and the radius, the position of the coefficient to be modified can be found, thereby determining the coefficient to be modified.

[0064] In the above embodiments of the present application, modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity includes: determining whether the value of the element corresponding to each coefficient to be modified is 1; if the value of the element corresponding to any one of the coefficients to be modified is 1, then expand the amplitude of any one of the coefficients to be modified according to the modification intensity.

[0065] In an alternative embodiment, the modification rule for modifying the coefficient to be modified based on the binary sequence is as follows: if the value of the element in the binary sequence is 0, then there is no need to modify the corresponding coefficient; if the value of the element in the binary sequence is 1, then the corresponding coefficient needs to be modified, and the amplitude of the coefficient is expanded according to the modification intensity.

[0066] In the above embodiments of the present application, expanding the amplitude of any one of the coefficients to be modified according to the modification intensity includes one of the following: expanding the amplitude of any one of the coefficients to be modified to the modification intensity; obtaining the product of the amplitude of any one of the coefficients to be modified and the modification intensity.

[0067] In an alternative solution, the method of expanding the amplitude of the Fourier transform coefficient can be set according to the actual situation. For example, the modification intensity can be used as the modification target, or the modification intensity can be used as the expansion multiple. For example, assume that the preset modification intensity E = 100 is used as the modification target, and the modified Fourier transform coefficient is 10 + 5i, and the amplitude of this coefficient is If the amplitude is expanded to the modification intensity E = 100, then it needs to be expanded times, so the expanded coefficient is (10 + 5i) * 8.94 = 89.4 + 44.7i; if the modification intensity is used as the expansion multiple, then directly multiply the coefficient by the modification intensity, so the expanded coefficient is (10 + 5i) * 100 = 100 + 500i.

[0068] In the above embodiments of the present application, before obtaining the modification intensity, the method further includes: performing an offset operation on the first Fourier transform coefficient to obtain an offset Fourier transform coefficient; obtaining the maximum amplitude among the amplitudes of the offset Fourier transform coefficients; obtaining the modification intensity based on the maximum amplitude.

[0069] In an alternative embodiment, after obtaining the Fourier transform coefficients, a shift operation can be performed on the Fourier transform coefficients, and the magnitude of the Fourier transform coefficients after the shift operation can be calculated. The maximum magnitude of all magnitudes is obtained, and based on the maximum magnitude, it is obtained according to a ratio. For example, if the maximum magnitude is 100 and the ratio is 0.1, the modified intensity can be 100 * 0.1 = 10.

[0070] In the above embodiments of the present application, before performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients, the method further includes: performing size completion on the original image to obtain a completed image; performing a two-dimensional Fourier transform on the completed image to obtain the first Fourier transform coefficients.

[0071] In order to improve the speed of the Fourier transform and facilitate the embedding and extraction of the ring, the original image can be completed, and the original image can be completed to a suitable size so that the completed image becomes a square image. Then, a two-dimensional Fourier transform is performed on the completed image to obtain the Fourier transform coefficients, and the above Fourier transform coefficients are modified based on the binary sequence to achieve the purpose of embedding a watermark in the original image.

[0072] In the above embodiments of the present application, performing size completion on the original image to obtain a completed image includes: obtaining the longest side length of the original image; based on the longest side length, determining the target side length, where the target side length is greater than the longest side length and the target side length is a multiple of a second preset value; performing size completion on the original image according to the target side length to obtain a completed image, where the completed image is a square image, and the pixel values of all pixels other than the original image part in the completed image are a third preset value.

[0073] Specifically, the above second preset value can be 2 or 3 or 5, but is not limited thereto. To avoid the influence of the completed image on the original image, the above third preset value can be 0.

[0074] In an alternative solution, the method of image completion is as follows: Select the longer side length in the original image, that is, l = max(w, h), and then calculate the smallest number greater than or equal to l that can be divisible by 2 or 3 or 5, and let it be d. Then, the image size is completed to d * d, and the pixel value used for completion is 0. For example: The size of the image is 19 * 23, and the longer side length is 23. Then, the smallest number greater than or equal to 23 that can be divisible by 2 or 3 or 5 is 24. Therefore, the image needs to be completed to a size of 24 * 24.

[0075] It should be noted that when the image is completed, the original image can be located in the upper left corner, and the pixel values of the lower right completed part are 0.

[0076] In the above embodiments of the present application, before performing the inverse transform on the modified Fourier transform coefficients to obtain the target image, the method further includes: cropping the target image based on the size of the original image.

[0077] In an alternative solution, since the binary sequence is embedded into the completed square image, in order to ensure that the finally obtained target image has the same size as the original image, after obtaining the image with the completed size containing the watermark, the image with the completed size can be cropped to the original size according to the size of the original image to obtain the final image containing the watermark.

[0078] The following combines Figure 4 and Figure 5 to elaborate in detail on a preferred embodiment of the present application. As Figure 4 shown, the method includes the following steps:

[0079] Step S41, input a carrier image and preset parameters, where the preset parameters include: a preset template sequence and a calibrated frequency position;

[0080] Optionally, the carrier image in the above step may be the original image to which the watermark needs to be embedded, the preset template sequence in the above step may be a binary sequence with a certain length, and the calibrated frequency position may be a coefficient for controlling the radius of the embedded ring.

[0081] Step S42, perform size completion on the carrier image, and perform a DFT transform on the completed image to obtain DFT coefficients;

[0082] Optionally, the size of the carrier image can be completed to a square image, and then a two-dimensional Fourier transform is performed on the completed image to obtain two-dimensional Fourier transform coefficients.

[0083] Step S43, perform a shift operation on the DFT coefficients, and then calculate the amplitude of the coefficients;

[0084] Optionally, a shift operation can be performed on the Fourier transform coefficients, and the amplitude of the two-dimensional Fourier transform coefficients after the shift is calculated;

[0085] Step S44, calculate the embedding strength according to the maximum value in the amplitude;

[0086] Optionally, the above embedding strength may refer to the degree of expanding the amplitude of the coefficients that meet the modification conditions. The maximum value in the amplitude of the two-dimensional Fourier transform coefficients can be obtained, and the embedding strength is calculated according to the maximum value or other rules.

[0087] Step S45, embed a circular template sequence in the DFT coefficients according to the template sequence, the calibrated frequency position, and the embedding strength;

[0088] Optionally, the Fourier transform coefficients can be modified according to the template sequence, the calibrated frequency position, and the embedding strength, and the template sequence can be circularly embedded into the Fourier transform coefficients, where the radius of the circle is determined by the calibrated frequency position.

[0089] Step S46: Inverse-transform the DFT coefficients embedded with the template sequence to obtain an image with a complete size.

[0090] Optionally, the Fourier transform coefficients containing the embedded information can be inverse-transformed to obtain a complete-size image containing the template watermark information.

[0091] Step S47: Crop the image with the complete size to the original size to obtain an image containing the template watermark.

[0092] Optionally, the image with the complete size can be cropped to the original size according to the size of the carrier image.

[0093] As Figure 5 shown, the set template sequence is {0100101100010111110010001010100000}, the calibrated frequency position is 0.5, the size of the original carrier image is 512*430, the size of the completed image is 512*512, perform a two-dimensional Fourier transform on the completed image, and move the low-frequency coefficients to the center of the image. After obtaining the absolute value of the coefficients, the frequency spectrum image is obtained. The length of the template sequence L = 34, the unit angle Set the embedding strength to 100, modify the coefficients corresponding to the circle with a radius of 128 to the specified size, and the coefficient frequency spectrum image after modification can be as Figure 5 shown in the "watermark-containing frequency spectrum image" in. Further, the modified coefficients are inverse-transformed into a spatial domain image using the inverse Fourier transform. Since the size of this image is the completed size, the completed part of the watermark-containing completed image needs to be cut off to obtain the watermark-containing image.

[0094] In the above embodiments of the present application, modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image includes: modifying the second Fourier transform coefficients of the preset image based on the binary sequence to generate a watermark image, where all pixel values in the preset image are the fourth preset value; obtaining the difference between the watermark image and the preset image to obtain the mother spatial domain template; cropping the mother spatial domain template according to the size of the original image to obtain the spatial domain template; and superimposing the spatial domain template and the original image to obtain the target image.

[0095] Specifically, the fourth preset value in the above steps can be 128, but is not limited thereto. The preset image in the above steps can be a square graph, the size of the preset image is larger than the original image, and the side length of the preset image is a multiple of the second preset value.

[0096] In the embodiments of the present application, as Figure 6 shown, the method for generating the mother airspace template is as follows: The binary sequence is {0100101100010111110010001010100000}, and the calibrated frequency position is 0.5. First, construct a square grayscale image with the pixel value of all pixels being 128. The size of this image is greater than or equal to the size of the original image, and the side length is a multiple of 2 or 3 or 5; perform a two-dimensional Fourier transform on the square grayscale image to obtain Fourier transform coefficients; set the modification intensity, and modify the Fourier transform coefficients according to the binary sequence, a preset coefficient, and the modification intensity, and embed the binary sequence into the Fourier transform coefficients in a circular ring shape (as shown in the "watermarked frequency spectrum image" in Figure 6 ); perform an inverse transform on the modified coefficients to obtain a watermark image (as shown in the "watermarked image" in Figure 6 ); subtract the square grayscale image from the watermark image to obtain a residual, and this residual is the generated mother airspace template (as shown in the "difference template image" in Figure 6 ).

[0097] It should be noted that the method for cropping the mother airspace template can be to obtain the central part of the mother airspace template, and the size of this part is the same as the size of the original image.

[0098] Through the above steps, an airspace template can be generated according to the binary sequence, thereby significantly reducing the time consumed in the embedding process and improving the imperceptibility of the watermark.

[0099] In the above embodiments of the present application, superimposing the airspace template on the original image to obtain the target image includes: obtaining the weight value of the original image; obtaining the product of the weight value, a preset proportional coefficient, and the airspace template to obtain a product image; obtaining the sum of the original image and the product image to obtain the target image.

[0100] Specifically, the weight value in the above steps can refer to the local weight used during template superposition. Through the weight value, the local modification intensity of the watermark can be adjusted, that is, the modification intensity in the smooth area can be reduced, and the modification intensity in the non-smooth area can be increased, thereby reducing the attention of the human eye to the airspace template and enhancing the effect during watermark extraction. The above preset proportional coefficient can be set during actual use, and the present application does not make specific limitations on this.

[0101] In an alternative embodiment, the original image is denoted by I, the weight value is denoted by g, the airspace template is denoted by w, the preset proportional coefficient is denoted by α, and the watermarked image is denoted by I w can be obtained through the following formula: I w (x,y) = I(x,y) + α * g(x,y) * w(x,y).

[0102] In the above embodiments of the present application, obtaining the weight value of the original image includes: obtaining a two-dimensional filtering matrix; filtering the original image with the two-dimensional filtering matrix to obtain the weight value.

[0103] Specifically, the two-dimensional filtering matrix in the above steps can be shown by the following formula, but is not limited thereto:

[0104]

[0105] In an alternative embodiment, a pre-constructed two-dimensional filtering matrix can be used to filter the original image, and the filtering result is the weight value.

[0106] Next, in combination with Figure 7 a preferred embodiment of the present application will be described in detail. As Figure 7 shown, the method includes the following steps:

[0107] Step S71, input a carrier image and preset parameters, where the preset parameters include: a preset template sequence and a calibration frequency position;

[0108] Optionally, the carrier image in the above step can be the original image to which the watermark needs to be embedded, the preset template sequence in the above step can be a binary sequence with a certain length, and the calibration frequency position can be a coefficient for controlling the embedding ring radius.

[0109] Step S72, calculate an adaptive gain according to the image content;

[0110] Optionally, the adaptive gain in the above step can refer to the local weight used when templates are superimposed, and is used to adjust the local strength of the watermark.

[0111] Step S73, generate a spatial domain template;

[0112] Optionally, a spatial domain template can be generated according to the template sequence and the calibration frequency position.

[0113] Step S74, superimpose the spatial domain template on the carrier image according to the adaptive gain.

[0114] In the above embodiments of the present application, after obtaining the target image, the method further includes: obtaining a detection image; generating a target amplitude image based on the third Fourier transform coefficient of the detection image; filtering the target amplitude image with a binary sequence to obtain a first filtering result; determining the detection result of the detection image based on the first filtering result, where the detection result is used to characterize whether there is a watermark in the detection image.

[0115] Specifically, the detected image in the above steps can be an image that needs to be detected for the presence of a watermark, which can be the above-mentioned target image or other images. Since the watermark embedded in the original image is in a circular ring shape, the target amplitude image can be a polar coordinate amplitude image.

[0116] In the embodiments of the present application, based on the above method of embedding a watermark, in an image containing a watermark, the Fourier transform coefficients have the characteristics of a binary sequence actively constructed by the watermark adder. Relevant methods can be used, for example, using the correlation of signals to detect this characteristic to achieve the purpose of watermark detection. As Figure 8 shown, in the correlation result of the polar coordinate amplitude image, there are two white boxes, indicating that these two positions are prone to peaks when the image has not been rotated and scaled. Therefore, by filtering the polar coordinate amplitude image, it can be determined whether the detected image has a watermark.

[0117] In an alternative embodiment, the rotation and translation invariance of the two-dimensional Fourier transform is utilized, and the influence of scaling on the Fourier spectrum is also utilized. After obtaining the detected image that needs to be detected for a watermark, a two-dimensional Fourier transform can be performed on the detected image to obtain two-dimensional Fourier transform coefficients, map the two-dimensional Fourier transform coefficients to the polar coordinate system to generate a polar coordinate amplitude image, and filter the polar coordinate amplitude image using a binary sequence, thereby determining whether there is a watermark in the detected image.

[0118] Through the above steps, by filtering the target amplitude image using a binary sequence, the detection effect and accuracy can be significantly improved.

[0119] In the above embodiments of the present application, generating a target amplitude image based on the third Fourier transform coefficients of the detected image includes: performing a two-dimensional Fourier transform on the detected image to obtain third Fourier transform coefficients; removing the amplitudes in the magnitudes of the third Fourier transform coefficients that meet a preset condition; mapping the processed magnitudes to the polar coordinate system to obtain a first amplitude image; and obtaining the difference between the first amplitude image and the mean value of the first amplitude image to obtain the target amplitude image.

[0120] Specifically, the peaks that meet the preset condition in the above steps can be irrelevant peaks, that is, the peaks that meet the preset condition can be the amplitudes in the second amplitude image corresponding to the third Fourier transform coefficients and within a second preset range. The second amplitude image can be the amplitude image of the Fourier transform coefficients, and the second preset range can refer to the positions where no watermark is embedded. For example, for Figure 5 the "watermark-containing frequency spectrum image" shown in, the irrelevant peaks are the white parts in the center. These peaks will affect subsequent watermark extraction, so an algorithm is used to remove them. The effects before and after removal are as Figure 9as shown in the "spectrum image" and the "spectrum image with irrelevant peaks removed".

[0121] In an alternative embodiment, a two-dimensional Fourier transform can be performed on the detection image to obtain two-dimensional Fourier transform coefficients, the amplitude of the two-dimensional Fourier transform coefficients can be calculated, and then the irrelevant peaks in the amplitude can be removed. The processed amplitude is mapped into the polar coordinate system to obtain a first amplitude image, and the mean value of the first amplitude image is subtracted from the first amplitude image to obtain a polar coordinate amplitude image for filtering.

[0122] In the above embodiments of the present application, removing the amplitudes that meet the preset conditions in the amplitude of the third Fourier transform coefficients includes: obtaining a preset filtering matrix; filtering the second amplitude image using the preset filtering matrix to obtain a second filtering result; and obtaining the processed amplitude based on the second amplitude image, the second filtering result, and a first preset threshold.

[0123] Specifically, the first preset threshold in the above steps can be a threshold for irrelevant peaks to be removed determined according to the watermark detection accuracy, and the present application does not make specific limitations thereto. The preset filtering matrix is shown in the following formula, but is not limited thereto:

[0124]

[0125] In an alternative embodiment, an amplitude image of Fourier transform coefficients can be input, which can be a two-dimensional matrix A, and a preset threshold Th can be input; the amplitude image is filtered using the above formula to obtain a filtering result F; and the result R after removing irrelevant peaks is obtained according to the following formula:

[0126]

[0127] In the above embodiments of the present application, before filtering the second amplitude image using the preset filtering matrix, the method further includes: performing Gaussian filtering on the two amplitude images to obtain a third filtering result; and filtering the third filtering result using the preset filtering matrix to obtain a second filtering result.

[0128] In an alternative embodiment, an amplitude image of Fourier transform coefficients can be input, which can be a two-dimensional matrix A, and a preset threshold Th can be input; Gaussian filtering is performed on the amplitude image to obtain a low-frequency result L; the low-frequency result L is filtered using the above formula to obtain a filtering result F; and the result R after removing irrelevant peaks is obtained according to the above formula.

[0129] In the above embodiments of the present application, filtering the target amplitude image using a binary sequence to obtain a first filtering result includes: generating a two-dimensional detection matrix based on the binary sequence; and filtering the target amplitude image using the two-dimensional detection matrix to obtain a first filtering result.

[0130] Specifically, the two-dimensional detection matrix can be a two-dimensional matrix with the same size as the polar coordinate amplitude image.

[0131] In an alternative embodiment, the generation of the two-dimensional detection matrix can be a process of converting a binary sequence into a two-dimensional matrix. There is more than one such generation process, and the generation principle is to convert the template sequence into a corresponding matrix with sequence characteristics.

[0132] In the above embodiments of the present application, generating a two-dimensional detection matrix based on a binary sequence includes: constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; obtaining an average segmentation distance based on the length of the binary sequence; modifying the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding elements are determined by each element and the average segmentation distance; and obtaining the difference between the modified target matrix and the mean of the modified target matrix to obtain the two-dimensional detection matrix.

[0133] Specifically, the target matrix in the above steps can be a two-dimensional all-zero matrix K, that is, the above fifth preset value is 0. The height of this matrix is H / 2, and the width is w, where H is the height of the polar coordinate system amplitude image, and w can be customized according to actual use. For example, the value of w can be 2 or 3.

[0134] It should be noted that assuming the bit position where each element in the binary sequence is located is x, the corresponding elements can be all the elements in the D*x-th row of the two-dimensional all-zero matrix K, or all the elements in the D*x-th, (D*x - 1)-th, and (D*x + 1)-th rows.

[0135] In an alternative embodiment, a two-dimensional all-zero matrix K can be constructed according to the height H of the polar coordinate system amplitude image; assuming the length of the binary sequence is L, the average segmentation distance of the sequence is obtained. For the element value of each element in the binary sequence, it can be determined whether to modify the elements in certain rows of the two-dimensional all-zero matrix; after the modification is completed, the modified matrix K is subtracted by the mean of L to obtain the two-dimensional detection matrix.

[0136] In the above embodiments of the present application, modifying the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence includes: determining whether the value of each first element is 1; if the value of any one first element is 1, then modifying the value of the corresponding second element of any one first element to a sixth preset value.

[0137] Specifically, the above sixth preset value can be 255, but is not limited thereto.

[0138] In an alternative embodiment, if the element value is 1, the two-dimensional all-zero matrix is modified by setting all elements in the corresponding row of the two-dimensional matrix to 255; if the element value is 0, the two-dimensional all-zero matrix is not modified.

[0139] In the above embodiments of the present application, determining the detection result of the detection image based on the first filtering result includes: obtaining the maximum value in the first filtering result; determining whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, it is determined that there is a watermark in the detection image; if the maximum value is less than or equal to the second preset threshold, it is determined that there is no watermark in the detection image.

[0140] Specifically, the second preset threshold in the above steps can be a value set in advance for determining whether the detection image contains a watermark, and the present application does not make specific limitations on this.

[0141] In an alternative embodiment, after obtaining the maximum value of the elements in the filtering result, if the maximum value in the filtering result is greater than the second preset threshold, it can be considered that the detection image contains a watermark, otherwise it can be considered that the detection image does not contain a watermark.

[0142] In the above embodiments of the present application, after determining that the detection result is that there is a watermark in the detection image, the method further includes: obtaining the radius and angle corresponding to the maximum value in the polar coordinate system; determining a scaling coefficient based on the radius and the side length of the complemented image; determining a rotation coefficient based on the angle.

[0143] In an alternative embodiment, after obtaining the maximum value of the elements in the filtering result, the radius and angle corresponding to the maximum value in the polar coordinate can be obtained, and the rotation and scaling coefficients can be further calculated based on the radius and angle. Among them, the rotation angle can be the angle θ corresponding to the maximum value, or θ + 180°; the scaling coefficient can be obtained through the following formula:

[0144] D = 0.5 / r / size / 2, where size refers to the side length of the image obtained by complementing the detection image into a square, and r is the radius.

[0145] In the above embodiments of the present application, the method further includes: obtaining the reverse sequence of the binary sequence; filtering the target amplitude image using the reverse sequence to obtain a third filtering result; determining the detection result based on the third filtering result; in the case where the detection result is that there is a watermark in the detection image, correcting the detection image based on the scaling coefficient and the rotation coefficient; performing a mirror flip on the corrected image to obtain the original image.

[0146] In an alternative embodiment, the solution provided by the embodiments of the present application can not only achieve the existence detection of the watermark, but also perform image correction. When it is necessary to confirm whether the detected image is a pirated image, the mirror attack detection can be performed. The specific method can be to generate a reverse template sequence according to the binary sequence. For example, if the binary sequence is {0101001}, then its reverse template sequence is {1001010}, and then the normal detection process is carried out. If the conclusion that the image contains a watermark can also be obtained using the reverse template sequence, the correction can be performed according to the calculated reversal and scaling coefficients, and the corrected image can be further mirror-flipped to obtain the original image.

[0147] In the above embodiments of the present application, after obtaining the detected image, the method further includes: determining whether the size of the detected image exceeds a preset size; if the size of the detected image exceeds the preset size, based on a third preset threshold, obtaining a sub-image of the detected image, and obtaining a target amplitude image in the polar coordinate system corresponding to the sub-image; if the size of the detected image does not exceed the preset size, obtaining a target amplitude image in the polar coordinate system corresponding to the detected image.

[0148] Specifically, the above preset size can be the size for determining that the detected image is a large image. For example, it can be an image of 1000*1000. When the size of the image is large, the detection time will increase. In order to reduce the detection time and not affect the detection result, a partial image of a certain size can be intercepted from the detected image for detection.

[0149] In an alternative embodiment, after obtaining the detected image, it is determined whether the detected image is a large image, that is, whether the size of the detected image exceeds the preset size. If it exceeds, a sub-image of a certain size can be intercepted, and the Fourier transform coefficients of the sub-image are mapped to the polar coordinate system to obtain a polar coordinate amplitude image; if it does not exceed, the Fourier transform coefficients of the detected image can be directly mapped to the polar coordinate system to obtain a polar coordinate amplitude image.

[0150] It should be noted that the size of the intercepted sub-image needs to match the preset threshold. For example, if the threshold is 200, the size of the sub-image is 256*256; if the threshold is 300, the size of the sub-image is 512*512, and the preset threshold can be set according to actual use.

[0151] It should also be noted that in order to avoid the size of the intercepted sub-image being too small and affecting the detection effect, the size of the sub-image is greater than or equal to 200*200.

[0152] In the above embodiments of the present application, before obtaining the target amplitude image in the polar coordinate system corresponding to the detection image, the method further includes: performing size completion on the detection image to obtain a completed image; and obtaining the target amplitude image in the polar coordinate system corresponding to the completed image.

[0153] In an alternative embodiment, similar to the watermark embedding method, the detection image or the intercepted sub-image can be subjected to size completion, and then the completed image is subjected to two-dimensional Fourier transform to obtain Fourier transform coefficients, and a shift operation is performed on the Fourier transform coefficients, and further the amplitude of the two-dimensional Fourier transform coefficients after the shift operation is calculated.

[0154] In the above embodiments of the present application, before modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image, the method further includes: receiving a processing request sent by the client; determining whether the processing request is a preset processing request; if the processing request is a preset processing request, then modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image.

[0155] The client in the above steps may be a user's smart phone (including Android phones and IOS phones), tablet computer, notebook computer, IPAD, personal digital assistant, personal computer and other devices with watermark embedding requirements, and the present application does not make specific limitations thereon.

[0156] In an alternative embodiment, when the user needs to embed a watermark in the original image, the user can upload the original image to the server through the client. At this time, the original image is carried in the processing request. After receiving the processing request, the server embeds the watermark in the original image by using the watermark embedding method provided in the above embodiment, specifically, the first Fourier transform coefficients of the original image can be modified based on the binary sequence to obtain a target image containing the watermark.

[0157] The watermark embedding method provided in the above embodiment has the advantage of high security. However, the cost is high and the processing time is long. For different users, some users need watermarks with higher security, while some users do not. Therefore, in order to meet the different needs of users, a selection interface can be provided for users to select the watermark embedding method to be used. On this basis, corresponding identification information can be preset for the watermark embedding method provided in the above embodiment, and the preset processing request in the above steps can be a processing request carrying the preset identification information.

[0158] In an alternative embodiment, before uploading the original image, the user can select a watermark embedding method. By default, it can be a traditional watermark embedding method. The client generates a corresponding processing request according to the user's selection result. When the user needs to embed a watermark in the original image using the watermark embedding method provided in the above embodiment, the generated processing request carries not only the original image but also the preset identification information. When the user embeds a watermark in the original image using the traditional watermark embedding method, the generated processing request carries only the original image.

[0159] In the above embodiments of the present application, before modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image, the method further includes: detecting the current state of a preset function switch; and when the current state is a preset state, modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image.

[0160] To meet the different needs of users, a preset function switch can also be set in advance. The user can trigger the preset function switch to switch to different states, and different states correspond to different watermark embedding methods. Among them, the preset state in the above steps can be the state corresponding to the watermark embedding method provided in the above embodiment. For example, the preset function switch is default in the on state, corresponding to the watermark embedding method provided in the above embodiment.

[0161] In an alternative embodiment, when the user needs to embed a watermark in the original image using the watermark embedding method provided in the above embodiment, the user does not need to trigger the preset function switch, and at this time, the current state of the preset function switch is the preset state. When the user embeds a watermark in the original image using the traditional watermark embedding method, the user triggers the preset function switch to switch the current state to a non-preset state.

[0162] The following combines Figure 9 and Figure 10 to elaborate in detail on a preferred embodiment of the present application. As Figure 10 shown, the method includes:

[0163] Step S101, input the image to be detected, and obtain preset parameters including: a preset template sequence and a calibrated frequency position;

[0164] Optionally, the carrier image in the above steps can be the original image to which a watermark needs to be embedded. The preset template sequence in the above steps can be a binary sequence of a certain length, and the calibrated frequency position can be a coefficient for controlling the radius of the embedding ring. If the size of the image to be detected is large, a part of the image can be intercepted for detection, which can speed up the detection time.

[0165] Step S102: Complement the size of the image to be detected, perform DFT transformation on the complemented image, and obtain DFT coefficients;

[0166] Optionally, a two-dimensional Fourier transform can be performed on the complemented image to obtain two-dimensional Fourier transform coefficients; perform a shift operation on the two-dimensional Fourier transform coefficients; calculate the magnitude of the two-dimensional Fourier transform coefficients after the shift.

[0167] Step S103: Calculate the magnitude of the DFT coefficients, and then reduce the irrelevant peaks in the magnitude;

[0168] Optionally, the magnitude of the two-dimensional Fourier transform coefficients can be calculated, and the largest and continuous points in the magnitude can be removed.

[0169] Step S104: Perform polar coordinate transformation on the above magnitude result;

[0170] Optionally, the processed magnitude can be mapped into the polar coordinate system to obtain a polar coordinate magnitude map, and the mean value of the polar coordinate magnitude map can be subtracted from the polar coordinate magnitude map to obtain a polar coordinate magnitude map for filtering.

[0171] Step S105: Generate a two-dimensional detection kernel according to the template sequence;

[0172] Optionally, the two-dimensional detection kernel in the above steps can be the above two-dimensional detection matrix.

[0173] Step S106: Calculate the correlation between the magnitude in the polar coordinate system and the two-dimensional detection kernel;

[0174] Optionally, the two-dimensional detection kernel can be used to filter the polar coordinate magnitude map to obtain a filtering result.

[0175] Step S107: Find the maximum value in the correlation result, and find the corresponding angle and radius of this value;

[0176] Optionally, the maximum value of the elements in the filtering result can be found, and the corresponding radius and angle of this maximum value in the polar coordinates can be obtained.

[0177] Step S108: Determine whether the maximum value exceeds the threshold;

[0178] Optionally, if so, go to step S109, if not, go to step S110.

[0179] Step S109: Calculate the rotation and scaling coefficients according to the radius and angle;

[0180] Optionally, if the maximum value in the filtering result exceeds the threshold, it is considered that the image contains a watermark, and the rotation and scaling coefficients are calculated according to the radius and angle.

[0181] Step S110, the watermark cannot be detected.

[0182] Optionally, if the maximum value in the filtering result does not exceed the threshold, it is considered that the image does not contain a watermark.

[0183] As Figure 9 shown, first, the image to be detected is completed, then the amplitude spectrum image of the coefficients is obtained through Fourier transform and shift, then the irrelevant peaks are removed to obtain the spectrum image with irrelevant peaks removed, and it is transformed into polar coordinates. After subtracting the mean value, a polar coordinate map for filtering is obtained. Then, a two-dimensional detection kernel is constructed according to a preset template sequence, and the above polar coordinate map is filtered to obtain a filtering result. The maximum value in the filtering result and the corresponding radius and angle of the position are obtained. If the maximum value is greater than the preset threshold, it can be determined that there is a watermark in the image, and the rotation and scaling coefficients can be calculated according to the radius and angle for subsequent correction. Otherwise, it is determined that the image does not contain a watermark.

[0184] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0185] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to enable a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

[0186] Embodiment 2

[0187] According to an embodiment of the present application, there is also provided an image processing method. Figure 11 is a flowchart of an image processing method according to Embodiment 2 of the present application. As Figure 11 shown, the method includes the following steps:

[0188] Step S112, obtain a detection image and a binary sequence, where the binary sequence is used to generate the watermark included in the detection image.

[0189] Specifically, the detected image in the above steps may be an image to be detected for the presence of a watermark, which may be the above-mentioned target image or other images. Since the watermark embedded in the original image is in a circular ring shape, the target amplitude image may be a polar coordinate amplitude image.

[0190] It should be noted that the construction of the binary sequence satisfies at least one of the following conditions: the traversal result obtained by traversing from the head of the binary sequence to the tail is different from the traversal result obtained by traversing from the tail of the binary sequence to the head; in the new binary sequence formed by connecting two binary sequences head to tail, the starting position of the subsequence identical to the binary sequence is not located inside the binary sequence; the difference between the number of 0s and the number of 1s in the binary sequence is within a first preset range.

[0191] Specifically, taking the binary sequence satisfying the above three conditions as an example for illustration. The three conditions are unidirectionality, weak periodicity, and binary element quantity balance. The binary sequence constructed by the above three conditions can significantly improve the detection effect.

[0192] Among them, unidirectionality may refer to the asymmetry of the binary sequence, that is, it is different from the head to the tail and from the tail to the head of the binary sequence. Weak periodicity may refer to connecting two sequences head to tail, and there is no subsequence identical or similar to the sequence starting from inside the original sequence. Binary element quantity balance may refer to that the number of 0s and 1s in the binary sequence is within a first preset range and the difference is not large. The first preset range can be set as needed during actual use, and the present application does not limit this.

[0193] Step S114: Generate a target amplitude image based on the Fourier transform coefficients of the detected image.

[0194] In the embodiment of the present application, as Figure 8 shown, in the correlation result of the polar coordinate amplitude image, there are two white squares, indicating that peaks are likely to appear at these two positions when the image has not been rotated and scaled. Therefore, by filtering the polar coordinate amplitude image, it can be determined whether the detected image has a watermark.

[0195] Step S116: Filter the target amplitude image with the binary sequence to obtain a first filtering result.

[0196] In the embodiment of the present application, based on the above watermark embedding method, it can be known that in an image containing a watermark, the Fourier transform coefficients have the characteristics of the binary sequence actively constructed by the watermark adder. Relevant methods can be used, for example, using the correlation of signals to detect this characteristic to achieve the purpose of watermark detection.

[0197] Step S118, determining a detection result of the detection image based on the first filtering result, where the detection result is used to characterize whether there is a watermark in the detection image.

[0198] In an alternative embodiment, the rotation and translation invariance of the two-dimensional Fourier transform is utilized, and the influence of scaling on the Fourier spectrum is also utilized. After obtaining the detection image that needs to be detected for watermark, the detection image can be subjected to two-dimensional Fourier transform to obtain two-dimensional Fourier transform coefficients, map the two-dimensional Fourier transform coefficients into the polar coordinate system to generate a polar coordinate amplitude image, and filter the polar coordinate amplitude image with a binary sequence, so as to determine whether there is a watermark in the detection image.

[0199] Based on the solution provided in the above embodiments of the present application, after obtaining the detection image, a target amplitude image can be generated based on the Fourier transform coefficients of the detection image, and a binary sequence used to generate the watermark can be obtained. Further, the binary sequence is used to filter the target amplitude image to obtain a first filtering result, so as to determine whether there is a watermark in the detection image based on the first filtering result, achieving the purpose of watermark detection. Compared with the prior art, by utilizing the characteristics of the two-dimensional Fourier transform, the detection image has strong robustness and can cope with the combined attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression. And by filtering the target amplitude image with a binary sequence, the detection effect and accuracy can be significantly improved, thus solving the technical problem that the image processing method in the related art cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression.

[0200] In the above embodiments of the present application, generating a target amplitude image based on the third Fourier transform coefficients of the detection image includes: performing two-dimensional Fourier transform on the detection image to obtain third Fourier transform coefficients; removing the amplitudes in the amplitudes of the third Fourier transform coefficients that meet a preset condition; mapping the processed amplitudes into the polar coordinate system to obtain a first amplitude image; obtaining the difference between the first amplitude image and the mean value of the first amplitude image to obtain the target amplitude image.

[0201] In the above embodiments of the present application, removing the amplitudes in the amplitudes of the third Fourier transform coefficients that meet a preset condition includes: obtaining a preset filtering matrix; filtering the second amplitude image with the preset filtering matrix to obtain a second filtering result; obtaining the processed amplitudes based on the second amplitude image, the second filtering result, and a first preset threshold.

[0202] In the above embodiments of the present application, before filtering the second amplitude image with the preset filtering matrix, the method further includes: performing Gaussian filtering on the two amplitude images to obtain a third filtering result; filtering the third filtering result with the preset filtering matrix to obtain a second filtering result.

[0203] In the above embodiments of the present application, filtering the target amplitude image using a binary sequence to obtain a first filtering result includes: generating a two-dimensional detection matrix based on the binary sequence; filtering the target amplitude image using the two-dimensional detection matrix to obtain a first filtering result.

[0204] In the above embodiments of the present application, generating a two-dimensional detection matrix based on the binary sequence includes: constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; obtaining an average segmentation distance based on the length of the binary sequence; modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding element is determined by each element and the average segmentation distance; obtaining the difference between the modified target matrix and the mean of the modified target matrix to obtain a two-dimensional detection matrix.

[0205] In the above embodiments of the present application, modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence includes: determining whether the value of each first element is 1; if the value of any one first element is 1, then modifying the value of the corresponding second element of any one first element to a sixth preset value.

[0206] In the above embodiments of the present application, determining the detection result of the detection image based on the first filtering result includes: obtaining the maximum value in the first filtering result; determining whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, then determining that the detection result is that there is a watermark in the detection image; if the maximum value is less than or equal to the second preset threshold, then determining that the detection result is that there is no watermark in the detection image.

[0207] In the above embodiments of the present application, after determining that the detection result is that there is a watermark in the detection image, the method further includes: obtaining the radius and angle corresponding to the maximum value in the polar coordinate system; determining a scaling factor based on the radius and the side length of the complemented image; determining a rotation factor based on the angle.

[0208] In the above embodiments of the present application, the method further includes: obtaining the reverse sequence of the binary sequence; filtering the target amplitude image using the reverse sequence to obtain a third filtering result; determining the detection result based on the third filtering result; in the case where the detection result is that there is a watermark in the detection image, correcting the detection image based on the scaling factor and the rotation factor; performing a mirror flip on the corrected image to obtain the original image.

[0209] In the above embodiments of the present application, after obtaining the detection image, the method further includes: determining whether the size of the detection image exceeds a preset size; if the size of the detection image exceeds the preset size, obtaining a sub-image of the detection image based on a third preset threshold, and obtaining a target amplitude image in the polar coordinate system corresponding to the sub-image; if the size of the detection image does not exceed the preset size, obtaining a target amplitude image in the polar coordinate system corresponding to the detection image.

[0210] In the above embodiments of the present application, before obtaining the target amplitude image in the polar coordinate system corresponding to the detection image, the method further includes: performing size completion on the detection image to obtain a completed image; obtaining a target amplitude image in the polar coordinate system corresponding to the completed image.

[0211] It should be noted that the preferred implementation schemes involved in the above embodiments of the present application are the same as the schemes, application scenarios, and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.

[0212] Embodiment 3

[0213] According to an embodiment of the present application, there is also provided an image processing apparatus for implementing the above image processing method, as Figure 12 shown, the apparatus 1200 includes: an acquisition module 1202 and a modification module 1204.

[0214] Among them, the acquisition module 1202 is used to acquire an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; the modification module 1204 is used to modify the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0215] It should be noted here that the above acquisition module 1202 and modification module 1204 correspond to steps S302 to S304 in Embodiment 1. The examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules, as part of the apparatus, can run in the computer terminal 10 provided in Embodiment 1.

[0216] In the above embodiments of the present application, the modification module includes: a transformation sub-module for performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients; a first acquisition sub-module for acquiring a set of coefficients to be modified and a modification intensity in the first Fourier transform coefficients, wherein the set of coefficients to be modified contains a plurality of coefficients to be modified that are in one-to-one correspondence with the plurality of elements in the binary sequence; a first modification sub-module for modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity, wherein the modification intensity is used to characterize the degree of amplification of the amplitude; and an inverse transformation sub-module for performing an inverse transformation on the modified Fourier transform coefficients to obtain the target image.

[0217] In the above embodiments of the present application, the first acquisition sub-module includes: a first determination unit for determining the center of the first Fourier transform coefficients as the center of the circle of the ring; a second determination unit for determining the unit angle of the ring based on the length of the binary sequence; a third determination unit for determining the radius of the ring based on the acquired preset coefficient and the size of the original image; and a fourth determination unit for determining each coefficient to be modified in the set of coefficients to be modified based on the center of the circle, the unit angle, and the radius.

[0218] In the above embodiments of the present application, the first modification sub-module includes: a judgment unit for judging whether the value of the element corresponding to each coefficient to be modified is 1; and an amplification unit for, if the value of the element corresponding to any one of the coefficients to be modified is 1, amplifying the amplitude of any one of the coefficients to be modified according to the modification intensity.

[0219] In the above embodiments of the present application, the amplification unit is used to amplify the amplitude of any one of the coefficients to be modified to the modification intensity; or to obtain the product of the amplitude of any one of the coefficients to be modified and the modification intensity.

[0220] In the above embodiments of the present application, the device further includes: an offset module for performing an offset operation on the first Fourier transform coefficients to obtain the offset Fourier transform coefficients; the acquisition module is further used to acquire the maximum amplitude in the amplitudes of the offset Fourier transform coefficients; and a processing module for obtaining the modification intensity based on the maximum amplitude.

[0221] In the above embodiments of the present application, the device further includes: a completion module for completing the size of the original image to obtain the completed image; and the transformation sub-module is further used to perform a two-dimensional Fourier transform on the completed image to obtain the first Fourier transform coefficients.

[0222] In the above embodiments of the present application, the completion module includes: a second acquisition sub-module, configured to acquire the longest side length of the original image; a first determination sub-module, configured to determine a target side length based on the longest side length, where the target side length is greater than the longest side length and is a multiple of a second preset value; a completion sub-module, configured to perform size completion on the original image according to the target side length to obtain a completed image, where the completed image is a square image, and the pixel values of all pixels in the completed image except the original image part are a third preset value.

[0223] In the above embodiments of the present application, the device further includes: a cropping module, configured to crop the target image based on the size of the original image.

[0224] In the above embodiments of the present application, the modification module further includes: a second modification sub-module, configured to modify the second Fourier transform coefficients of a preset image based on a binary sequence to generate a watermark image, where the pixel values of all pixels in the preset image are a fourth preset value; a third acquisition sub-module, configured to acquire the difference between the watermark image and the preset image to obtain a mother spatial domain template; a cropping sub-module, configured to crop the mother spatial domain template based on the size of the original image to obtain a spatial domain template; a superposition sub-module, configured to superpose the spatial domain template and the original image to obtain a target image.

[0225] In the above embodiments of the present application, the superposition sub-module includes: a first acquisition unit, configured to acquire the weight value of the original image; a second acquisition unit, configured to acquire the product of the weight value, a preset proportional coefficient, and the spatial domain template to obtain a product image; a third acquisition unit, configured to acquire the sum of the original image and the product image to obtain a target image.

[0226] In the above embodiments of the present application, the first acquisition unit includes: an acquisition subunit, configured to acquire a two-dimensional filtering matrix; a filtering subunit, configured to filter the original image using the two-dimensional filtering matrix to obtain a weight value.

[0227] In the above embodiments of the present application, the device further includes: the acquisition module is further configured to acquire a detection image; a generation module, configured to generate a target amplitude image based on the third Fourier transform coefficients of the detection image; a first filtering module, configured to filter the target amplitude image using a binary sequence to obtain a first filtering result; a first determination module, configured to determine the detection result of the detection image based on the first filtering result, where the detection result is used to indicate whether there is a watermark in the detection image.

[0228] In the above embodiments of the present application, the generation module includes: a transformation sub-module for performing a two-dimensional Fourier transform on the detected image to obtain third Fourier transform coefficients; a rejection sub-module for rejecting the amplitudes that meet the preset conditions in the amplitudes of the third Fourier transform coefficients; a mapping sub-module for mapping the processed amplitudes into a polar coordinate system to obtain a first amplitude image; and a fourth acquisition sub-module for obtaining the difference between the first amplitude image and the mean value of the first amplitude image to obtain a target amplitude image.

[0229] In the above embodiments of the present application, the rejection sub-module includes: a fourth acquisition unit for obtaining a preset filtering matrix; a filtering unit for filtering the second amplitude image by using the preset filtering matrix to obtain a second filtering result; and a first processing unit for obtaining the processed amplitudes based on the second amplitude image, the second filtering result, and a first preset threshold.

[0230] In the above embodiments of the present application, the device further includes: a second filtering module for performing Gaussian filtering on the two-amplitude image to obtain a third filtering result; and a third filtering module for filtering the third filtering result by using the preset filtering matrix to obtain a second filtering result.

[0231] In the above embodiments of the present application, the first filtering module includes: a generation sub-module for generating a two-dimensional detection matrix based on a binary sequence; and a filtering sub-module for filtering the target amplitude image by using the two-dimensional detection matrix to obtain a first filtering result.

[0232] In the above embodiments of the present application, the generation sub-module includes: a construction unit for constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; a second processing unit for obtaining an average segmentation distance based on the length of the binary sequence; a modification unit for modifying the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding elements are determined by each element and the average segmentation distance; and a fifth acquisition unit for obtaining the difference between the modified target matrix and the mean value of the modified target matrix to obtain a two-dimensional detection matrix.

[0233] In the above embodiments of the present application, the modification unit includes: a judgment sub-unit for judging whether the value of each first element is 1; and a modification sub-unit for, if the value of any one of the first elements is 1, modifying the value of the corresponding second element of any one of the first elements to a sixth preset value.

[0234] In the above embodiments of the present application, the first determination module includes: a fifth acquisition sub-module, configured to acquire the maximum value in the first filtering result; a judgment sub-module, configured to judge whether the maximum value is greater than a second preset threshold; a second determination sub-module, configured to, if the maximum value is greater than the second preset threshold, determine that there is a watermark in the detected image, and if the maximum value is less than or equal to the second preset threshold, determine that there is no watermark in the detected image.

[0235] In the above embodiments of the present application, the apparatus further includes: the acquisition module is further configured to acquire the radius and angle corresponding to the maximum value in the polar coordinate system; a second determination module, configured to determine a scaling factor based on the radius and the side length of the complemented image; a third determination module, configured to determine a rotation factor based on the angle.

[0236] In the above embodiments of the present application, the acquisition module is further configured to acquire the reverse sequence of the binary sequence; the first filtering module is further configured to filter the target amplitude image with the reverse sequence to obtain a third filtering result; the first determination module is further configured to determine a detection result based on the third filtering result; the apparatus further includes: a correction module, configured to correct the detected image based on the scaling factor and the rotation factor when the detection result is that there is a watermark in the detected image; a flipping module, configured to perform a mirror flip on the corrected image to obtain the original image.

[0237] In the above embodiments of the present application, the apparatus further includes: a judgment module, configured to judge whether the size of the detected image exceeds a preset size; the acquisition module is further configured to, if the size of the detected image exceeds the preset size, acquire a sub-image of the detected image based on a third preset threshold, and acquire the target amplitude image in the polar coordinate system corresponding to the sub-image; the acquisition module is further configured to, if the size of the detected image does not exceed the preset size, acquire the target amplitude image in the polar coordinate system corresponding to the detected image.

[0238] In the above embodiments of the present application, the complementing module is further configured to perform size complementation on the detected image to obtain a complemented image; the acquisition module is further configured to acquire the target amplitude image in the polar coordinate system corresponding to the complemented image.

[0239] It should be noted that the preferred implementation schemes involved in the above embodiments of the present application are the same as the schemes, application scenarios, and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.

[0240] Embodiment 4

[0241] According to an embodiment of the present application, there is also provided an image processing apparatus for implementing the above image processing method, as Figure 13 shown. The apparatus 1300 includes: an acquisition module 1302, a generation module 1304, a filtering module 1306, and a determination module 1308.

[0242] Among them, the acquisition module 1302 is used to acquire a detection image and a binary sequence, where the binary sequence is used to generate a watermark included in the detection image; the generation module 1304 is used to generate a target amplitude image based on the Fourier transform coefficients of the detection image; the filtering module 1306 is used to filter the target amplitude image with the binary sequence to obtain a first filtering result; the determination module 1308 is used to determine the detection result of the detection image based on the first filtering result, where the detection result is used to characterize whether there is a watermark in the detection image.

[0243] It should be noted here that the above acquisition module 1302, generation module 1304, filtering module 1306, and determination module 1308 correspond to steps S112 to S118 in Embodiment 2. The examples and application scenarios implemented by the four modules and the corresponding steps are the same, but are not limited to the content disclosed in the above Embodiment 1. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.

[0244] In the above embodiments of the present application, the generation module includes: a transformation sub-module, which is used to perform a two-dimensional Fourier transform on the detection image to obtain third Fourier transform coefficients; a rejection sub-module, which is used to reject the amplitudes that meet the preset conditions in the amplitudes of the third Fourier transform coefficients; a mapping sub-module, which is used to map the processed amplitudes to the polar coordinate system to obtain a first amplitude image; a first acquisition sub-module, which is used to obtain the difference between the first amplitude image and the mean value of the first amplitude image to obtain a target amplitude image.

[0245] In the above embodiments of the present application, the rejection sub-module includes: a first acquisition unit, which is used to acquire a preset filtering matrix; a filtering unit, which is used to filter the second amplitude image with the preset filtering matrix to obtain a second filtering result; a first processing unit, which is used to obtain the processed amplitudes based on the second amplitude image, the second filtering result, and a first preset threshold.

[0246] In the above embodiments of the present application, the filtering module is further used to perform Gaussian filtering on the two-amplitude image to obtain a third filtering result, and filter the third filtering result with the preset filtering matrix to obtain a second filtering result.

[0247] In the above embodiments of the present application, the filtering module includes: a generation sub-module, which is used to generate a two-dimensional detection matrix based on the binary sequence; a filtering sub-module, which is used to filter the target amplitude image with the two-dimensional detection matrix to obtain a first filtering result.

[0248] In the above embodiments of the present application, the generation sub-module includes: a construction unit for constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; a second processing unit for obtaining an average segmentation distance based on the length of the binary sequence; a modification unit for modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding elements are determined by each element and the average segmentation distance; a second acquisition unit for obtaining the difference between the modified target matrix and the mean value of the modified target matrix to obtain a two-dimensional detection matrix.

[0249] In the above embodiments of the present application, the modification unit includes: a judgment sub-unit for judging whether the value of each first element is 1; a modification sub-unit for, if the value of any one first element is 1, modifying the value of the second element corresponding to any one first element to a sixth preset value.

[0250] In the above embodiments of the present application, the determination module includes: a second acquisition sub-module for obtaining the maximum value in the first filtering result; a judgment sub-module for judging whether the maximum value is greater than a second preset threshold; a determination sub-module for, if the maximum value is greater than the second preset threshold, determining that the detection result is that there is a watermark in the detection image, and if the maximum value is less than or equal to the second preset threshold, determining that the detection result is that there is no watermark in the detection image.

[0251] In the above embodiments of the present application, the acquisition module is further configured to obtain the radius and angle corresponding to the maximum value in the polar coordinate system; the determination module is further configured to determine a scaling factor based on the radius and the side length of the complemented image, and determine a rotation factor based on the angle.

[0252] In the above embodiments of the present application, the acquisition module is further configured to obtain the reverse sequence of the binary sequence; the filtering module is further configured to filter the target amplitude image using the reverse sequence to obtain a third filtering result; the determination module is further configured to determine the detection result based on the third filtering result; the apparatus further includes: a correction module for, when the detection result is that there is a watermark in the detection image, correcting the detection image based on the scaling factor and the rotation factor; a flipping module for performing a mirror flip on the corrected image to obtain the original image.

[0253] In the above embodiments of the present application, the apparatus further includes: a judgment module for judging whether the size of the detection image exceeds a preset size; the acquisition module is further configured to, if the size of the detection image exceeds the preset size, obtain a sub-image of the detection image based on a third preset threshold, and obtain the target amplitude image in the polar coordinate system corresponding to the sub-image; the acquisition module is further configured to, if the size of the detection image does not exceed the preset size, obtain the target amplitude image in the polar coordinate system corresponding to the detection image.

[0254] In the above embodiments of the present application, the complementing module is further configured to complement the size of the detected image to obtain a complemented image; the obtaining module is further configured to obtain a target amplitude image in the polar coordinate system corresponding to the complemented image.

[0255] It should be noted that the preferred implementation schemes involved in the above embodiments of the present application are the same as the schemes, application scenarios, and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.

[0256] Embodiment 5

[0257] According to an embodiment of the present application, there is also provided an image processing system, including:

[0258] A processor; and

[0259] A memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0260] It should be noted that the preferred implementation schemes involved in the above embodiments of the present application are the same as the schemes, application scenarios, and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.

[0261] Embodiment 6

[0262] An embodiment of the present application can provide a computer terminal, which can be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the above computer terminal can also be replaced with a terminal device such as a mobile terminal.

[0263] Optionally, in this embodiment, the above computer terminal can be located in at least one of multiple network devices in a computer network.

[0264] In this embodiment, the above computer terminal can execute program codes for the following steps in the image processing method: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0265] Optionally, Figure 14 is a structural block diagram of a computer terminal according to an embodiment of the present application. As Figure 14 shown, the computer terminal A may include: one or more (only one is shown in the figure) processors 1402, and a memory 1404.

[0266] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the security vulnerability detection method and device in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned system vulnerability attack detection method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely set relative to the processor, and these remote memories can be connected to terminal A through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and their combinations.

[0267] The processor can call the information and application programs stored in the memory through the transmission device to execute the following steps: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark embedded in the original image; modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0268] Optionally, the above processor can also execute the program code of the following steps: performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients; obtaining a set of coefficients to be modified and a modification intensity in the first Fourier transform coefficients, where the set of coefficients to be modified contains multiple coefficients to be modified that correspond one-to-one with the multiple elements in the binary sequence; modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity, where the modification intensity is used to characterize the degree of amplification of the amplitude; performing an inverse transform on the modified Fourier transform coefficients to obtain the target image.

[0269] Optionally, the above processor can also execute the program code of the following steps: determining the center of the first Fourier transform coefficients as the center of a circle; determining the unit angle of the circle based on the length of the binary sequence; determining the radius of the circle based on the obtained preset coefficient and the size of the original image; determining each coefficient to be modified in the set of coefficients to be modified based on the center, unit angle, and radius.

[0270] Optionally, the above processor can also execute the program code of the following steps: determining whether the value of the element corresponding to each coefficient to be modified is 1; if the value of the element corresponding to any one of the coefficients to be modified is 1, then amplifying the amplitude of any one of the coefficients to be modified according to the modification intensity.

[0271] Optionally, the above-mentioned processor can also execute the program code of the following steps: expanding the amplitude of any coefficient to be modified to the modification intensity; or obtaining the product of the amplitude of any coefficient to be modified and the modification intensity.

[0272] Optionally, the above-mentioned processor can also execute the program code of the following steps: before obtaining the modification intensity, performing an offset operation on the first Fourier transform coefficient to obtain an offset Fourier transform coefficient; obtaining the maximum amplitude among the amplitudes of the offset Fourier transform coefficients; and obtaining the modification intensity based on the maximum amplitude.

[0273] Optionally, the above-mentioned processor can also execute the program code of the following steps: before performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficient, performing size completion on the original image to obtain a completed image; and performing a two-dimensional Fourier transform on the completed image to obtain the first Fourier transform coefficient.

[0274] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtaining the longest side length of the original image; determining a target side length based on the longest side length, where the target side length is greater than the longest side length and is a multiple of a second preset value; and performing size completion on the original image according to the target side length to obtain a completed image, where the completed image is a square image and the pixel values of all pixels other than the original image part in the completed image are a third preset value.

[0275] Optionally, the above-mentioned processor can also execute the program code of the following steps: before performing an inverse transform on the modified Fourier transform coefficient to obtain the target image, cropping the target image based on the size of the original image.

[0276] Optionally, the above-mentioned processor can also execute the program code of the following steps: modifying the second Fourier transform coefficient of a preset image based on a binary sequence to generate a watermark image, where the pixel values of all pixels in the preset image are a fourth preset value; obtaining the difference between the watermark image and the preset image to obtain a mother spatial domain template; cropping the mother spatial domain template based on the size of the original image to obtain a spatial domain template; and superimposing the spatial domain template and the original image to obtain the target image.

[0277] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtaining the weight value of the original image; obtaining the product of the weight value, a preset proportional coefficient, and the spatial domain template to obtain a product image; and obtaining the sum of the original image and the product image to obtain the target image.

[0278] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtaining a two-dimensional filtering matrix; and filtering the original image using the two-dimensional filtering matrix to obtain the weight value.

[0279] Optionally, the above-mentioned processor may also execute the program code of the following steps: after obtaining the target image, acquire the detection image; generate a target amplitude image based on the third Fourier transform coefficients of the detection image; filter the target amplitude image with a binary sequence to obtain a first filtering result; determine the detection result of the detection image based on the first filtering result, where the detection result is used to indicate whether there is a watermark in the detection image.

[0280] Optionally, the above-mentioned processor may also execute the program code of the following steps: perform a two-dimensional Fourier transform on the detection image to obtain third Fourier transform coefficients; eliminate the amplitudes in the amplitudes of the third Fourier transform coefficients that satisfy a preset condition; map the processed amplitudes to the polar coordinate system to obtain a first amplitude image; obtain the difference between the first amplitude image and the mean value of the first amplitude image to obtain a target amplitude image.

[0281] Optionally, the above-mentioned processor may also execute the program code of the following steps: obtain a preset filtering matrix; filter the second amplitude image with the preset filtering matrix to obtain a second filtering result; obtain the processed amplitude based on the second amplitude image, the second filtering result, and a first preset threshold.

[0282] Optionally, the above-mentioned processor may also execute the program code of the following steps: before filtering the second amplitude image with the preset filtering matrix, perform Gaussian filtering on the binary amplitude image to obtain a third filtering result; filter the third filtering result with the preset filtering matrix to obtain a second filtering result.

[0283] Optionally, the above-mentioned processor may also execute the program code of the following steps: generate a two-dimensional detection matrix based on the binary sequence; filter the target amplitude image with the two-dimensional detection matrix to obtain a first filtering result.

[0284] Optionally, the above-mentioned processor may also execute the program code of the following steps: construct a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; obtain an average segmentation distance based on the length of the binary sequence; modify the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding element is determined by each element and the average segmentation distance; obtain the difference between the modified target matrix and the mean value of the modified target matrix to obtain a two-dimensional detection matrix.

[0285] Optionally, the above-mentioned processor may also execute the program code of the following steps: determine whether the value of each first element is 1; if the value of any one first element is 1, then modify the value of the second element corresponding to any one first element to a sixth preset value.

[0286] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtain the maximum value in the first filtering result; determine whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, determine that the detection result is that there is a watermark in the detected image; if the maximum value is less than or equal to the second preset threshold, determine that the detection result is that there is no watermark in the detected image.

[0287] Optionally, the above-mentioned processor can also execute the program code of the following steps: after determining that the detection result is that there is a watermark in the detected image, obtain the radius and angle corresponding to the maximum value in the polar coordinate system; determine a scaling factor based on the radius and the side length of the complemented image; determine a rotation factor based on the angle.

[0288] Optionally, the above-mentioned processor can also execute the program code of the following steps: obtain the reverse sequence of the binary sequence; filter the target amplitude image with the reverse sequence to obtain a third filtering result; determine the detection result based on the third filtering result; in the case where the detection result is that there is a watermark in the detected image, correct the detected image based on the scaling factor and the rotation factor; perform a mirror flip on the corrected image to obtain the original image.

[0289] Optionally, the above-mentioned processor can also execute the program code of the following steps: after obtaining the detected image, determine whether the size of the detected image exceeds a preset size; if the size of the detected image exceeds the preset size, obtain a sub-image of the detected image based on a third preset threshold, and obtain the target amplitude image in the polar coordinate system corresponding to the sub-image; if the size of the detected image does not exceed the preset size, obtain the target amplitude image in the polar coordinate system corresponding to the detected image.

[0290] Optionally, the above-mentioned processor can also execute the program code of the following steps: before obtaining the target amplitude image in the polar coordinate system corresponding to the detected image, perform size complementation on the detected image to obtain a complemented image; obtain the target amplitude image in the polar coordinate system corresponding to the complemented image.

[0291] Optionally, the above-mentioned processor can also execute the program code of the following steps: before modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, receive a processing request sent by the client; determine whether the processing request is a preset processing request; if the processing request is a preset processing request, modify the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image.

[0292] Optionally, the above-mentioned processor may also execute program code of the following steps: Before modifying the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image, detect the current state of a preset function switch; in the case where the current state is the preset state, modify the first Fourier transform coefficients of the original image based on the binary sequence to obtain the target image.

[0293] By adopting the embodiment of the present application, a scheme for image processing is provided. By modifying the Fourier transform coefficients of the original image and utilizing the characteristics of the two-dimensional Fourier transform, the target image has strong robustness and can cope with combined attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression. Moreover, it has the technical effects of fast embedding speed, simple calculation, and broad application scenarios. Filtering the target amplitude image with the binary sequence can significantly improve the detection effect and accuracy, thereby solving the technical problem that the image processing method in the related art cannot cope with attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression.

[0294] Those of ordinary skill in the art can understand that Figure 14 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 14 It does not limit the structure of the above-mentioned electronic device. For example, computer terminal A may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 14 or have a different configuration from that shown in Figure 14 shown.

[0295] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and this program can be stored in a computer-readable storage medium. The storage medium may include: a flash drive, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disc, etc.

[0296] Embodiment 7

[0297] The embodiment of the present application also provides a storage medium. Optionally, in this embodiment, the above storage medium can be used to save the program code executed by the image processing method provided in the first embodiment above.

[0298] Optionally, in this embodiment, the above storage medium may be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0299] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: obtaining an original image and a binary sequence, where the binary sequence is used to generate a watermark to be embedded in the original image; modifying first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, where the target image contains the watermark.

[0300] Optionally, the above storage medium is further configured to store program code for performing the following steps: performing a two-dimensional Fourier transform on the original image to obtain first Fourier transform coefficients; obtaining a set of coefficients to be modified and a modification intensity in the first Fourier transform coefficients, where the set of coefficients to be modified contains a plurality of coefficients to be modified that correspond one-to-one with a plurality of elements contained in the binary sequence; modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity, where the modification intensity is used to represent the degree of amplification of the amplitude; performing an inverse transform on the modified Fourier transform coefficients to obtain a target image.

[0301] Optionally, the above storage medium is further configured to store program code for performing the following steps: determining the center of the first Fourier transform coefficients as the center of a circle; determining the unit angle of the circle based on the length of the binary sequence; determining the radius of the circle based on the obtained preset coefficient and the size of the original image; determining each coefficient to be modified in the set of coefficients to be modified based on the center, the unit angle, and the radius.

[0302] Optionally, the above storage medium is further configured to store program code for performing the following steps: determining whether the value of the element corresponding to each coefficient to be modified is 1; if the value of the element corresponding to any one of the coefficients to be modified is 1, then amplifying the amplitude of any one of the coefficients to be modified according to the modification intensity.

[0303] Optionally, the above storage medium is further configured to store program code for performing the following steps: amplifying the amplitude of any one of the coefficients to be modified to the modification intensity; or obtaining the product of the amplitude of any one of the coefficients to be modified and the modification intensity.

[0304] Optionally, the above storage medium is further configured to store program code for performing the following steps: performing an offset operation on the first Fourier transform coefficients before obtaining the modification intensity to obtain offset Fourier transform coefficients; obtaining the maximum amplitude in the amplitudes of the offset Fourier transform coefficients; obtaining the modification intensity based on the maximum amplitude.

[0305] Optionally, the above storage medium is further configured to store program code for performing the following steps: before performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients, perform size completion on the original image to obtain a completed image; perform a two-dimensional Fourier transform on the completed image to obtain the first Fourier transform coefficients.

[0306] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtain the longest side length of the original image; based on the longest side length, determine the target side length, where the target side length is greater than the longest side length and is a multiple of a second preset value; perform size completion on the original image according to the target side length to obtain a completed image, where the completed image is a square image, and the pixel values of all pixels in the completed image except the original image part are a third preset value.

[0307] Optionally, the above storage medium is further configured to store program code for performing the following steps: before performing an inverse transform on the modified Fourier transform coefficients to obtain the target image, crop the target image based on the size of the original image.

[0308] Optionally, the above storage medium is further configured to store program code for performing the following steps: modify the second Fourier transform coefficients of a preset image based on a binary sequence to generate a watermark image, where the pixel values of all pixels in the preset image are a fourth preset value; obtain the difference between the watermark image and the preset image to obtain a mother spatial domain template; crop the mother spatial domain template based on the size of the original image to obtain a spatial domain template; superimpose the spatial domain template and the original image to obtain the target image.

[0309] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtain the weight value of the original image; obtain the product of the weight value, a preset proportional coefficient, and the spatial domain template to obtain a product image; obtain the sum of the original image and the product image to obtain the target image.

[0310] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtain a two-dimensional filtering matrix; use the two-dimensional filtering matrix to filter the original image to obtain the weight value.

[0311] Optionally, the above storage medium is further configured to store program code for performing the following steps: after obtaining the target image, obtain a detection image; generate a target amplitude image based on the third Fourier transform coefficients of the detection image; filter the target amplitude image using a binary sequence to obtain a first filtering result; determine the detection result of the detection image based on the first filtering result, where the detection result is used to indicate whether there is a watermark in the detection image.

[0312] Optionally, the above storage medium is further configured to store program code for performing the following steps: performing a two-dimensional Fourier transform on the detected image to obtain third Fourier transform coefficients; removing the amplitudes in the amplitudes of the third Fourier transform coefficients that meet a preset condition; mapping the processed amplitudes to a polar coordinate system to obtain a first amplitude image; obtaining a difference between the first amplitude image and the mean value of the first amplitude image to obtain a target amplitude image.

[0313] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtaining a preset filtering matrix; filtering the second amplitude image by using the preset filtering matrix to obtain a second filtering result; obtaining processed amplitudes based on the second amplitude image, the second filtering result, and a first preset threshold.

[0314] Optionally, the above storage medium is further configured to store program code for performing the following steps: before filtering the second amplitude image by using the preset filtering matrix, performing Gaussian filtering on the second amplitude image to obtain a third filtering result; filtering the third filtering result by using the preset filtering matrix to obtain a second filtering result.

[0315] Optionally, the above storage medium is further configured to store program code for performing the following steps: generating a two-dimensional detection matrix based on a binary sequence; filtering the target amplitude image by using the two-dimensional detection matrix to obtain a first filtering result.

[0316] Optionally, the above storage medium is further configured to store program code for performing the following steps: constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; obtaining an average segmentation distance based on the length of the binary sequence; modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding elements are determined by each element and the average segmentation distance; obtaining a difference between the modified target matrix and the mean value of the modified target matrix to obtain a two-dimensional detection matrix.

[0317] Optionally, the above storage medium is further configured to store program code for performing the following steps: determining whether the value of each first element is 1; if the value of any one of the first elements is 1, modifying the value of the corresponding second element of any one of the first elements to a sixth preset value.

[0318] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtaining the maximum value in the first filtering result; determining whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, determining that the detection result is that there is a watermark in the detected image; if the maximum value is less than or equal to the second preset threshold, determining that the detection result is that there is no watermark in the detected image.

[0319] Optionally, the above storage medium is further configured to store program code for performing the following steps: after determining that a watermark exists in the detected image, obtaining the radius and angle corresponding to the maximum value in the polar coordinate system; determining a scaling factor based on the radius and the side length of the complemented image; and determining a rotation factor based on the angle.

[0320] Optionally, the above storage medium is further configured to store program code for performing the following steps: obtaining the reverse sequence of the binary sequence; filtering the target amplitude image with the reverse sequence to obtain a third filtering result; determining a detection result based on the third filtering result; when the detection result is that a watermark exists in the detected image, correcting the detected image based on the scaling factor and the rotation factor; and performing a mirror flip on the corrected image to obtain the original image.

[0321] Optionally, the above storage medium is further configured to store program code for performing the following steps: after obtaining the detected image, determining whether the size of the detected image exceeds a preset size; if the size of the detected image exceeds the preset size, obtaining a sub-image of the detected image based on a third preset threshold, and obtaining the target amplitude image in the polar coordinate system corresponding to the sub-image; if the size of the detected image does not exceed the preset size, obtaining the target amplitude image in the polar coordinate system corresponding to the detected image.

[0322] Optionally, the above storage medium is further configured to store program code for performing the following steps: before obtaining the target amplitude image in the polar coordinate system corresponding to the detected image, performing size complementation on the detected image to obtain a complemented image; and obtaining the target amplitude image in the polar coordinate system corresponding to the complemented image.

[0323] Optionally, the above processor may further execute program code for performing the following steps: before modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, receiving a processing request sent by a client; determining whether the processing request is a preset processing request; if the processing request is a preset processing request, modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image.

[0324] Optionally, the above processor may further execute program code for performing the following steps: before modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, detecting the current state of a preset function switch; and when the current state is a preset state, modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image.

[0325] Embodiment 8

[0326] According to an embodiment of the present application, a data processing method is further provided. Figure 15It is a flowchart of a data processing method according to Embodiment 8 of the present application. As Figure 15 shown, the method includes the following steps:

[0327] Step S152, obtain the original data;

[0328] The original data in the above steps can be the data to which watermark needs to be added. For example, it can be data such as video, image, audio, text, etc., but not limited thereto. In the embodiments of the present application, an image is taken as an example for illustration. When the original data is an image, a single-channel grayscale image can be used, or any other single-channel image.

[0329] Step S154, modify the first Fourier transform coefficients of the original data to generate the target data with the watermark embedded.

[0330] In an optional embodiment, by utilizing the rotation and translation invariance of the two-dimensional Fourier transform and the influence of scaling on the Fourier spectrum, the Fourier transform coefficients of the original data can be modified so that the Fourier transform coefficients of the original data have the characteristics of the watermark, achieving the purpose of embedding the watermark in the original data.

[0331] Based on the solution provided in the above embodiments of the present application, after obtaining the original data, the Fourier transform coefficients of the original data can be modified to obtain the target data containing the watermark, achieving the purpose of watermark embedding. Compared with the prior art, by modifying the Fourier transform coefficients of the original data and utilizing the characteristics of the two-dimensional Fourier transform, the target data has strong robustness and can cope with the combined attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression, and has the technical effects of fast embedding speed, simple calculation, and wide application scenarios. Furthermore, it solves the technical problem that the image processing method in the related art cannot cope with the attacks such as rotation, scaling, translation, mirroring, shearing, tiling, and compression.

[0332] In the above embodiments of the present application, modifying the first Fourier transform coefficients of the original data to generate the target data with the watermark embedded includes: obtaining a binary sequence, where the binary sequence is used to generate the watermark to be embedded; modifying the first Fourier transform coefficients based on the binary sequence to obtain the target data.

[0333] The above binary sequence can be a one-dimensional binary sequence with a certain length, and its elements are composed of 0 and 1. Generally, the length L of the binary sequence can be between 20 and 40, but not limited thereto, and it can also be other appropriate lengths. The binary sequence is a definite identifier actively constructed by the watermark adder, not randomly set information, which is used to judge whether the watermark is embedded in the data and to calculate the rotation and scaling coefficients of the data.

[0334] It should be noted that the construction of the binary sequence satisfies at least one of the following conditions: the traversal result obtained by traversing from the head of the binary sequence to the tail of the binary sequence is different from the traversal result obtained by traversing from the tail of the binary sequence to the head of the binary sequence; in the new binary sequence formed by connecting two binary sequences end to end, the starting position of the subsequence identical to the binary sequence is not located inside the binary sequence; the difference between the number of 0s and the number of 1s in the binary sequence is within a first preset range.

[0335] In the above embodiments of the present application, modifying the first Fourier transform coefficients based on the binary sequence to obtain target data includes: performing a two-dimensional Fourier transform on the original data to obtain the first Fourier transform coefficients; obtaining a set of coefficients to be modified and a modification intensity in the first Fourier transform coefficients, where the set of coefficients to be modified contains a plurality of coefficients to be modified that correspond one-to-one to the plurality of elements included in the binary sequence; based on the value of the element corresponding to each coefficient to be modified and the modification intensity, modifying the amplitude of each coefficient to be modified to obtain the modified Fourier transform coefficients, where the modification intensity is used to characterize the degree of amplification of the amplitude; performing an inverse transform on the modified Fourier transform coefficients to obtain the target data.

[0336] In the above embodiments of the present application, obtaining the set of coefficients to be modified in the first Fourier transform coefficients includes: determining the center of the first Fourier transform coefficients as the center of the circle of the ring; determining the unit angle of the ring based on the length of the binary sequence; determining the radius of the ring based on the obtained preset coefficient and the size of the original data; determining each coefficient to be modified in the set of coefficients to be modified based on the center, unit angle, and radius.

[0337] In the above embodiments of the present application, modifying the amplitude of each coefficient to be modified based on the value of the element corresponding to each coefficient to be modified and the modification intensity includes: determining whether the value of the element corresponding to each coefficient to be modified is 1; if the value of the element corresponding to any one of the coefficients to be modified is 1, then amplifying the amplitude of any one of the coefficients to be modified according to the modification intensity.

[0338] In the above embodiments of the present application, amplifying the amplitude of any one of the coefficients to be modified according to the modification intensity includes one of the following: amplifying the amplitude of any one of the coefficients to be modified to the modification intensity; obtaining the product of the amplitude of any one of the coefficients to be modified and the modification intensity.

[0339] In the above embodiments of the present application, before obtaining the modification intensity, the method further includes: performing an offset operation on the first Fourier transform coefficients to obtain the offset Fourier transform coefficients; obtaining the maximum amplitude among the amplitudes of the offset Fourier transform coefficients; obtaining the modification intensity based on the maximum amplitude.

[0340] In the above embodiments of the present application, before performing a two-dimensional Fourier transform on the original data to obtain the first Fourier transform coefficients, the method further includes: performing size completion on the original data to obtain the completed data; performing a two-dimensional Fourier transform on the completed data to obtain the first Fourier transform coefficients.

[0341] In the above embodiments of the present application, before performing an inverse transform on the modified Fourier transform coefficients to obtain the target data, the method further includes: cropping the target data based on the size of the original data.

[0342] In the above embodiments of the present application, modifying the first Fourier transform coefficients of the original data based on the binary sequence to obtain the target data includes: modifying the third Fourier transform coefficients of the preset data based on the binary sequence to generate the watermark data, where all the values in the preset data are the fourth preset value; obtaining the difference between the watermark data and the preset data to obtain the mother spatial domain template; cropping the mother spatial domain template based on the size of the original data to obtain the spatial domain template; and superimposing the spatial domain template and the original data to obtain the target data.

[0343] In the above embodiments of the present application, superimposing the spatial domain template and the original data to obtain the target data includes: obtaining the weight value of the original data; obtaining the product data by multiplying the weight value, the preset proportional coefficient, and the spatial domain template; and obtaining the sum of the original data and the product data to obtain the target data.

[0344] In the above embodiments of the present application, obtaining the weight value of the original data includes: obtaining the two-dimensional filtering matrix; and filtering the original data using the two-dimensional filtering matrix to obtain the weight value.

[0345] In the above embodiments of the present application, the method further includes: obtaining the detection data; processing the second Fourier transform coefficients of the detection data to obtain the processing result; and determining the detection result of the detection data based on the processing result, where the detection result is used to indicate whether there is a watermark in the detection data.

[0346] The detection data in the above steps may be the data that needs to be detected for the presence of a watermark. For example, it may be data such as video, image, audio, text, etc., but is not limited thereto. In the embodiments of the present application, an image is used as an example for illustration.

[0347] In an alternative embodiment, the rotation and translation invariance of the two-dimensional Fourier transform is utilized, and the influence of scaling on the Fourier spectrum is also utilized. After obtaining the detection data that needs to be detected for the watermark, a two-dimensional Fourier transform can be performed on the detection data to obtain the two-dimensional Fourier transform coefficients, and the two-dimensional Fourier transform coefficients can be processed to determine whether there is a watermark in the detection data.

[0348] In the above embodiments of the present application, processing the second Fourier transform coefficients of the detection data to obtain a processing result includes: generating target amplitude data based on the second Fourier transform system; filtering the target amplitude data using a binary sequence to obtain a processing result.

[0349] Based on the above method for embedding watermarks, it can be known that in the data containing watermarks, the Fourier transform coefficients have the characteristics of a binary sequence actively constructed by the watermark adder. Relevant methods can be used, for example, using the correlation of signals to detect this characteristic to achieve the purpose of watermark detection. Optionally, when the detection data is an image, since the watermark embedded in the image is in a circular ring shape, the target amplitude image can be a polar coordinate amplitude image.

[0350] Through the above steps, by filtering the target amplitude data using a binary sequence, the detection effect and accuracy can be significantly improved.

[0351] In the above embodiments of the present application, generating target amplitude data based on the second Fourier transform coefficients includes: performing a two-dimensional Fourier transform on the detection data to obtain the second Fourier transform coefficients; removing the amplitudes in the amplitudes of the second Fourier transform coefficients that meet a preset condition; mapping the processed amplitudes to the polar coordinate system to obtain first amplitude data; obtaining the difference between the first amplitude data and the mean of the first amplitude data to obtain the target amplitude data.

[0352] Optionally, the second amplitude data can be the amplitude data of the Fourier transform coefficients.

[0353] In the above embodiments of the present application, removing the amplitudes in the amplitudes of the second Fourier transform coefficients that meet a preset condition includes: obtaining a preset filtering matrix; filtering the second amplitude data using the preset filtering matrix to obtain a second filtering result; obtaining the processed amplitudes based on the second amplitude data, the second filtering result, and a first preset threshold.

[0354] In the above embodiments of the present application, before filtering the second amplitude data using the preset filtering matrix, the method further includes: performing Gaussian filtering on the two amplitude data to obtain a third filtering result; filtering the third filtering result using the preset filtering matrix to obtain a second filtering result.

[0355] In the above embodiments of the present application, filtering the target amplitude data using a binary sequence to obtain a first filtering result includes: generating a two-dimensional detection matrix based on the binary sequence; filtering the target amplitude data using the two-dimensional detection matrix to obtain a first filtering result.

[0356] In the above embodiments of the present application, generating a two-dimensional detection matrix based on a binary sequence includes: constructing a target matrix, where the value of each element in the target matrix is a fifth preset value, and the size of the target matrix is determined based on the size of the target amplitude data; obtaining an average segmentation distance based on the length of the binary sequence; modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence, where the corresponding elements are determined by each element and the average segmentation distance; and obtaining the difference between the modified target matrix and the mean value of the modified target matrix to obtain the two-dimensional detection matrix.

[0357] In the above embodiments of the present application, modifying the value of a corresponding second element in the target matrix based on the value of each first element in the binary sequence includes: determining whether the value of each first element is 1; if the value of any one of the first elements is 1, then modifying the value of the corresponding second element of any one of the first elements to a sixth preset value.

[0358] In the above embodiments of the present application, determining the detection result of the detection data based on the first filtering result includes: obtaining the maximum value in the first filtering result; determining whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, then determining that the detection result is that there is a watermark in the detection data; if the maximum value is less than or equal to the second preset threshold, then determining that the detection result is that there is no watermark in the detection data.

[0359] In the above embodiments of the present application, after determining that the detection result is that there is a watermark in the detection data, the method further includes: obtaining the radius and angle corresponding to the maximum value in the polar coordinate system; determining a scaling coefficient based on the radius and the size of the complemented data; and determining a rotation coefficient based on the angle.

[0360] In the above embodiments of the present application, the method further includes: obtaining the reverse sequence of the binary sequence; filtering the target amplitude data using the reverse sequence to obtain a third filtering result; determining the detection result based on the third filtering result; in the case where the detection result is that there is a watermark in the detection data, correcting the detection data based on the scaling coefficient and the rotation coefficient; and performing a mirror flip on the corrected data to obtain the original data.

[0361] In the above embodiments of the present application, after obtaining the detection data, the method further includes: determining whether the size of the detection data exceeds a preset size; if the size of the detection data exceeds the preset size, then obtaining a sub-data of the detection data based on a third preset threshold, and obtaining the target amplitude data in the polar coordinate system corresponding to the sub-data; if the size of the detection data does not exceed the preset size, then obtaining the target amplitude data in the polar coordinate system corresponding to the detection data.

[0362] In the above embodiments of the present application, before obtaining the target amplitude data in the polar coordinate system corresponding to the detection data, the method further includes: performing size completion on the detection data to obtain the completed data; and obtaining the target amplitude data in the polar coordinate system corresponding to the completed data.

[0363] The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.

[0364] In the above embodiments of the present application, the descriptions of the respective embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0365] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.

[0366] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0367] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0368] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0369] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. An image processing method, comprising: obtaining an original image and a binary sequence, wherein the binary sequence is used to generate a watermark embedded in the original image, the binary sequence is a determined identifier actively constructed by a watermark adder, and the binary sequence satisfies at least one of the following conditions: unidirectionality, weak periodicity, and balance of the number of binary elements; modifying first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image, wherein the target image contains the watermark, the target image is obtained by superimposing an airspace template and the original image, and the airspace template is determined based on a difference between a watermark image and a preset image, and the watermark image is obtained by modifying the preset image based on the binary sequence.

2. The method according to claim 1, wherein, modifying first Fourier transform coefficients of the original image based on the binary sequence to obtain a target image comprises: performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficients; obtaining a set of coefficients to be modified and a modification intensity in the first Fourier transform coefficients, wherein a plurality of coefficients to be modified included in the set of coefficients to be modified correspond one by one to a plurality of elements included in the binary sequence; modifying amplitudes of each of the coefficients to be modified based on a value of an element corresponding to each of the coefficients to be modified and the modification intensity, wherein the modification intensity is used to represent an extent of enlarging the amplitude; performing an inverse transform on the modified Fourier transform coefficients to obtain the target image.

3. The method according to claim 2, wherein, obtaining a set of coefficients to be modified in the first Fourier transform coefficients comprises: determining a center of the first Fourier transform coefficients as a center of a circle; determining a unit angle of the circle based on a length of the binary sequence; determining a radius of the circle based on a preset coefficient obtained and a size of the original image; determining each coefficient to be modified in the set of coefficients to be modified based on the center, the unit angle, and the radius.

4. The method according to claim 3, wherein, determining a unit angle of the circle based on a length of the binary sequence comprises: obtaining a ratio of a preset angle to the length to obtain the unit angle; determining a radius of the circle based on a preset coefficient obtained comprises: determining a target length based on a size of the original image; obtaining a product of the preset coefficient and the target length; obtaining a ratio of the product to a first preset value to obtain the radius.

5. The method according to claim 2, wherein, modifying amplitudes of each of the coefficients to be modified based on a value of an element corresponding to each of the coefficients to be modified and the modification intensity comprises: judging whether a value of an element corresponding to each of the coefficients to be modified is 1; if a value of an element corresponding to any one of the coefficients to be modified is 1, then enlarging an amplitude of the any one of the coefficients to be modified according to the modification intensity.

6. The method according to claim 5, wherein, Expanding the amplitude of any coefficient to be modified according to the modification intensity includes one of the following: Expanding the amplitude of any coefficient to be modified to the modification intensity; Obtaining the product of the amplitude of any coefficient to be modified and the modification intensity.

7. The method according to claim 2, wherein, Before obtaining the modification intensity, the method further includes: Performing an offset operation on the first Fourier transform coefficient to obtain an offset Fourier transform coefficient; Obtaining the maximum amplitude among the amplitudes of the offset Fourier transform coefficients; Based on the maximum amplitude, obtaining the modification intensity.

8. The method according to claim 2, wherein, Before performing a two-dimensional Fourier transform on the original image to obtain the first Fourier transform coefficient, the method further includes: Performing size completion on the original image to obtain a completed image; Performing a two-dimensional Fourier transform on the completed image to obtain the first Fourier transform coefficient.

9. The method according to claim 8, wherein, Performing size completion on the original image to obtain a completed image includes: Obtaining the longest side length of the original image; Based on the longest side length, determining a target side length, wherein the target side length is greater than the longest side length and is a multiple of a second preset value; Performing size completion on the original image according to the target side length to obtain the completed image, wherein the completed image is a square image, and the pixel values of all pixels in the completed image except the original image part are a third preset value.

10. The method according to claim 8, wherein, Before performing an inverse transform on the modified Fourier transform coefficient to obtain the target image, the method further includes: Cropping the target image based on the size of the original image.

11. The method according to claim 1, wherein, Modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image includes: Modifying the second Fourier transform coefficient of a preset image based on the binary sequence to generate a watermark image, wherein all pixel values in the preset image are a fourth preset value; Obtaining the difference between the watermark image and the preset image to obtain a mother spatial domain template; Cropping the mother spatial domain template based on the size of the original image to obtain a spatial domain template; Superimposing the spatial domain template and the original image to obtain the target image.

12. The method according to claim 11, wherein, The preset image is a square graph, the size of the preset image is larger than the original image, and the side length of the preset image is a multiple of the second preset value.

13. The method according to claim 11, wherein, Superimposing the spatial domain template and the original image to obtain the target image includes: Obtaining the weight value of the original image; Obtaining the product of the weight value, a preset proportional coefficient, and the spatial domain template to obtain a product image; Obtaining the sum of the original image and the product image to obtain the target image.

14. The method according to claim 13, wherein, obtaining the weight value of the original image includes: obtaining a two-dimensional filtering matrix; filtering the original image by using the two-dimensional filtering matrix to obtain the weight value.

15. The method according to claim 1, wherein, the binary sequence satisfies at least one of the following conditions: the traversal result obtained by traversing from the head of the binary sequence to the tail of the binary sequence is different from the traversal result obtained by traversing from the tail of the binary sequence to the head of the binary sequence; in the new binary sequence formed by connecting two binary sequences head to tail, the starting position of the subsequence identical to the binary sequence is not located inside the binary sequence; the difference between the number of 0s and the number of 1s in the binary sequence is within a first preset range.

16. The method according to claim 1, wherein, after obtaining the target image, the method further includes: obtaining a detection image; generating a target amplitude image based on the third Fourier transform coefficient of the detection image; filtering the target amplitude image by using the binary sequence to obtain a first filtering result; determining a detection result of the detection image based on the first filtering result, wherein the detection result is used to characterize whether there is a watermark in the detection image.

17. The method according to claim 16, wherein, generating a target amplitude image based on the third Fourier transform coefficient of the detection image includes: performing a two-dimensional Fourier transform on the detection image to obtain the third Fourier transform coefficient; eliminating the amplitudes in the amplitude of the third Fourier transform coefficient that satisfy a preset condition; mapping the processed amplitudes to a polar coordinate system to obtain a first amplitude image; obtaining the difference between the first amplitude image and the mean value of the first amplitude image to obtain the target amplitude image.

18. The method according to claim 17, wherein, the peak value that satisfies the preset condition is the amplitude within a second preset range in the second amplitude image corresponding to the third Fourier transform coefficient.

19. The method according to claim 18, wherein, eliminating the amplitudes in the amplitude of the third Fourier transform coefficient that satisfy a preset condition includes: obtaining a preset filtering matrix; filtering the second amplitude image by using the preset filtering matrix to obtain a second filtering result; obtaining the processed amplitudes based on the second amplitude image, the second filtering result, and a first preset threshold.

20. The method according to claim 19, wherein, before filtering the second amplitude image by using the preset filtering matrix, the method further includes: performing Gaussian filtering on the two-amplitude image to obtain a third filtering result; filtering the third filtering result by using the preset filtering matrix to obtain a second filtering result.

21. The method according to claim 16, wherein, filtering the target amplitude image by using the binary sequence to obtain a first filtering result includes: generating a two-dimensional detection matrix based on the binary sequence; filtering the target amplitude image by using the two-dimensional detection matrix to obtain the first filtering result.

22. The method according to claim 21, wherein, generating a two-dimensional detection matrix based on the binary sequence includes: constructing a target matrix, wherein the value of each element in the target matrix is a fifth preset value, and the height of the target matrix is determined based on the height of the target amplitude image; obtaining an average segmentation distance based on the length of the binary sequence; modifying the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence, wherein the corresponding element is determined by each element and the average segmentation distance; obtaining the difference between the modified target matrix and the mean value of the modified target matrix to obtain the two-dimensional detection matrix.

23. The method according to claim 22, wherein, modifying the value of the corresponding second element in the target matrix based on the value of each first element in the binary sequence includes: judging whether the value of each first element is 1; if the value of any one of the first elements is 1, modifying the value of the corresponding second element of the any one of the first elements to a sixth preset value.

24. The method according to claim 16, wherein, determining the detection result of the detection image based on the first filtering result includes: obtaining the maximum value in the first filtering result; judging whether the maximum value is greater than a second preset threshold; if the maximum value is greater than the second preset threshold, determining that there is a watermark in the detection image; if the maximum value is less than or equal to the second preset threshold, determining that there is no watermark in the detection image.

25. The method according to claim 24, wherein, after determining that the detection result is that there is a watermark in the detection image, the method further includes: obtaining the radius and angle corresponding to the maximum value in the polar coordinate system; determining a scaling factor based on the radius and the side length of the complemented image; determining a rotation factor based on the angle.

26. The method according to claim 25, wherein, the method further includes: obtaining the reverse sequence of the binary sequence; filtering the target amplitude image with the reverse sequence to obtain a third filtering result; determining the detection result based on the third filtering result; when the detection result is that there is a watermark in the detection image, correcting the detection image based on the scaling factor and the rotation factor; performing a mirror flip on the corrected image to obtain the original image.

27. The method according to claim 16, wherein, after obtaining the detection image, the method further includes: judging whether the size of the detection image exceeds a preset size; if the size of the detection image exceeds the preset size, obtaining a sub-image of the detection image based on a third preset threshold, and obtaining the target amplitude image in the polar coordinate system corresponding to the sub-image; if the size of the detection image does not exceed the preset size, obtaining the target amplitude image in the polar coordinate system corresponding to the detection image.

28. The method according to claim 16, wherein, Before obtaining the target amplitude image in the polar coordinate system corresponding to the detected image, the method further includes: Completing the size of the detected image to obtain a completed image; Obtaining the target amplitude image in the polar coordinate system corresponding to the completed image.

29. The method according to claim 1, wherein, Before modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, the method further includes: Receiving a processing request sent by a client; Determining whether the processing request is a preset processing request; If the processing request is the preset processing request, modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image.

30. The method according to claim 1, wherein, Before modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, the method further includes: Detecting the current state of a preset function switch; When the current state is a preset state, modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image.

31. An image processing method, including: Obtaining a detected image and a binary sequence, wherein the binary sequence is used to generate a watermark included in the detected image; Generating a target amplitude image based on the Fourier transform coefficient of the detected image; Filtering the target amplitude image by using the binary sequence to obtain a first filtering result; Determining a detection result of the detected image based on the first filtering result, wherein the detection result is used to represent whether there is a watermark in the detected image.

32. A storage medium, the storage medium includes a stored program, wherein, When the program runs, controlling the device where the storage medium is located to execute the image processing method according to any one of claims 1 to 31.

33. A computing device, including: A processor and a storage medium, the processor is used to run the program stored in the storage medium, wherein when the program runs, it executes the image processing method according to any one of claims 1 to 31.

34. An image processing system, including: A processor; and A memory, connected to the processor, for providing instructions for the processor to perform the following processing steps: obtaining an original image and a binary sequence, wherein the binary sequence is used to generate a watermark embedded in the original image, the binary sequence is a determined identifier actively constructed by a watermark adder, and the binary sequence satisfies at least one of the following conditions: unidirectionality, weak periodicity, and balance of the number of binary elements; modifying the first Fourier transform coefficient of the original image based on the binary sequence to obtain a target image, wherein the target image contains the watermark, the target image is obtained by superimposing an airspace template on the original image, the airspace template is determined based on the difference between a watermark image and a preset image, and the watermark image is obtained by modifying the preset image based on the binary sequence.

35. A data processing method, including: Obtain the original data and the binary sequence, wherein the binary sequence is used to generate the watermark to be embedded, the binary sequence is a determined identifier actively constructed by the watermark adder, and the binary sequence satisfies at least one of the following conditions: unidirectionality, weak periodicity, and balance of the number of binary elements; Modify the first Fourier transform coefficients of the original data based on the binary sequence to generate the target data with the embedded watermark, wherein the target data is obtained by superimposing the spatial domain template and the original data, and the spatial domain template is determined based on the difference between the watermark data and the preset data, and the watermark data is obtained by modifying the preset data based on the binary sequence.

36. The method according to claim 35, wherein, the method further includes: Obtain the detection data; Process the second Fourier transform coefficients of the detection data to obtain a processing result; Determine the detection result of the detection data based on the processing result, wherein the detection result is used to characterize whether there is a watermark in the detection data.

37. The method according to claim 36, wherein, Processing the second Fourier transform coefficients of the detection data to obtain a processing result includes: Generate target amplitude data based on the second Fourier transform coefficients; Filter the target amplitude data using the binary sequence to obtain the processing result.

Citation Information

Patent Citations

  • Video digital watermarking method based on characteristic scale variation invariant points and microscene detection

    CN103974144A

  • Image processing method and apparatus, and printed matter

    JP2003143388A

  • Electronic information embedding method and extraction method thereof, electronic information embedding apparatus and extraction apparatus thereof, and program thereof

    JP2007189724A

  • Method for inserting a watermark into an image

    US7058979B1