Anti-counterfeiting watermark information embedding method, device, equipment and medium
By constructing a three-dimensional grid model of the carrier image and XOR operation of the feature matrix, the problem of poor robustness of digital watermarks is solved, the effectiveness and security of watermark embedding is improved, and better image protection is achieved.
Patent Information
- Application Number
- CN202311553940.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2024-10-18
AI Technical Summary
Among the existing image copyright protection methods, the robustness of digital watermarks is poor, which can easily lead to the loss of watermark signals, and the invisibility of anti-counterfeiting information embedded in the frequency domain is not ideal, making it difficult to effectively protect the security and copyright of digital information.
By constructing a three-dimensional grid model of the carrier image, the non-smoothness of the closed space is calculated based on the preset feature algorithm, and the areas with obvious features are screened out to construct the feature matrix and perform XOR operation with the watermark matrix to embed the watermark information and improve the robustness of the watermark. and invisibility.
The robustness of the watermark information is enhanced, making it better able to withstand image processing and attacks, improving the effectiveness and security of watermark embedding, and maintaining the quality and characteristics of the image.
Smart Images

Figure CN118799158A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network security technology, and in particular to a method, device, equipment and medium for embedding anti-counterfeiting watermark information. Background Art
[0002] At present, most methods of protecting image copyrights use digital watermarking technology. Digital watermarking technology has been widely studied and has achieved remarkable results. Watermark information contains owner confirmation information, such as logos and names, which can be embedded in the medium. When the carrier medium is attacked intentionally or unintentionally, the watermark can still be detected. Digital watermarking technology can be applied to audio, image, video and other types of media, which can not only play an anti-counterfeiting role, but also play an anti-theft role.
[0003] In the prior art, watermark images can be embedded in the spatial domain. However, the robustness of the method of embedding anti-counterfeiting information in the spatial domain of the image is poor, which can easily cause the loss of the watermark signal, resulting in low effectiveness of watermark embedding. Summary of the invention
[0004] The present application provides an anti-counterfeiting watermark information embedding method, device, equipment and medium, which can improve the effectiveness of the embedded watermark.
[0005] In a first aspect, an embodiment of the present application provides a method for embedding anti-counterfeiting watermark information, the method comprising:
[0006] Get the watermark matrix of the image to be embedded with the watermark;
[0007] Constructing a first three-dimensional grid model corresponding to the carrier image, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image;
[0008] Based on a preset feature algorithm, feature operations are performed on each closed space to obtain multiple degrees of roughness corresponding to the multiple closed spaces, where the degrees of roughness are used to indicate the degree of feature prominence of the closed space;
[0009] The target closed space corresponding to the roughness greater than the first preset threshold among the multiple roughnesses is constructed as a first feature matrix, where the first feature matrix corresponds to the carrier image;
[0010] The watermark matrix is XORed with the first characteristic matrix so that the image to be embedded with the watermark is embedded in the carrier image to obtain the target image.
[0011] In a second aspect, the present application provides an anti-counterfeiting watermark information embedding device, the device comprising:
[0012] An acquisition module, used for acquiring a watermark matrix to be embedded in the watermark image;
[0013] A first construction module is used to construct a first three-dimensional grid model corresponding to the carrier image, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image;
[0014] A first calculation module is used to perform feature calculation on each closed space based on a preset feature algorithm to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, where the roughnesses are used to indicate the degree of feature prominence of the closed space;
[0015] A second construction module is used to construct a target closed space corresponding to a roughness greater than a first preset threshold among a plurality of roughnesses into a first feature matrix, where the first feature matrix corresponds to the carrier image;
[0016] The second calculation module is used for performing an XOR operation on the watermark matrix and the first characteristic matrix so as to embed the image to be embedded with the watermark into the carrier image to obtain the target image.
[0017] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;
[0018] When the processor executes the computer program instructions, the anti-counterfeiting watermark information embedding method as in any one of the embodiments in the first aspect is implemented.
[0019] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, a method for embedding anti-counterfeiting watermark information as in any one of the embodiments in the first aspect is implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the anti-counterfeiting watermark information embedding method in any one of the embodiments in the first aspect above.
[0021] In an anti-counterfeiting watermark information embedding method, device, equipment and medium provided in an embodiment of the present application, a watermark matrix of a to-be-embedded watermark image is obtained; a first three-dimensional grid model corresponding to a carrier image is constructed, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image; based on a preset feature algorithm, a feature operation is performed on each closed space to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, the roughnesses are used to indicate the degree of feature prominence of the closed space; a target closed space corresponding to a roughness greater than a first preset threshold among the plurality of roughnesses is constructed as a first feature matrix, the first feature matrix corresponds to the carrier image; an XOR operation is performed on the watermark matrix and the first feature matrix, so that the to-be-embedded watermark image is embedded in the carrier image to obtain a target image. In the above manner, through a feature operation based on roughness, the degree of feature prominence of the carrier image can be better identified, thereby selectively embedding the watermark, which helps to improve the robustness of the watermark, so that the target image after the watermark image is embedded can better withstand various image processing and attacks, thereby improving the effectiveness of watermark embedding. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0023] Figure 1 It is a flowchart of an anti-counterfeiting watermark information embedding method provided by an embodiment of the present application;
[0024] Figure 2 This is a schematic diagram of a process of embedding a watermark image provided by an embodiment of the present application;
[0025] Figure 3 It is a schematic diagram of a process of extracting a watermark image provided by an embodiment of the present application;
[0026] Figure 4 It is a structural schematic diagram of an anti-counterfeiting watermark information embedding device provided in an embodiment of the present application;
[0027] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0029] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0030] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0031] At present, most methods of protecting image copyrights use digital watermarking technology. Digital watermarking technology has been widely studied and has achieved remarkable results. Watermark information contains owner confirmation information, such as logos and names, which can be embedded in the medium. When the carrier medium is attacked intentionally or unintentionally, the watermark can still be detected. Digital watermarking technology can be applied to audio, image, video and other types of media, which can not only play an anti-counterfeiting role, but also play an anti-theft role.
[0032] Nowadays, the phenomenon of illegal theft of digital information is increasing day by day, so how to maintain the security of digital information and prevent digital image counterfeiting has become a problem that we have to solve.
[0033] In recent years, digital watermarking has been recognized as a very effective solution technology. It embeds certain digital information in digital products to prevent counterfeiting. There are two ways to study digital watermarking technology, namely spatial domain and frequency domain. The robustness of the method of embedding anti-counterfeiting information in the spatial domain of the image is poor, which can easily cause the loss of the watermark signal. The invisibility of the method of embedding anti-counterfeiting information in the frequency domain of the image is not ideal. Therefore, the present invention adopts a new method of embedding anti-counterfeiting information in the frequency domain to enhance the robustness and invisibility of anti-counterfeiting information.
[0034] In order to solve the problems existing in the prior art, the embodiments of the present application provide a method, device, equipment and medium for embedding anti-counterfeiting watermark information.
[0035] The present application embodiment provides a method, device, equipment and medium for embedding anti-counterfeiting watermark information. The following first introduces the anti-counterfeiting watermark information embedding method provided by the present application embodiment. Figure 1 As shown, the method specifically comprises the following steps:
[0036] S100, obtaining a watermark matrix for an image to be embedded with a watermark.
[0037] Optionally, in a feasible implementation of the present application, first, determine the watermark information to be embedded in the image. This can be text, image, binary data or any other form of information. The watermark information is usually represented by numbers, and it needs to be represented in matrix form so that it can be embedded and extracted with the image data. It can then be encoded into a matrix form based on the selected watermark information. For example, if the watermark information is text, a coding scheme can be used to convert the text into binary data, which is then organized into a matrix. If the watermark information is already in digital form, the corresponding matrix can be directly constructed.
[0038] Specifically, if your watermark information is text, first select the text content to be embedded. For example, you can choose a copyright notice, author name, or other identifying information. Convert the selected text into a character encoding, which maps each character to a number. Then convert the character-encoded text into a sequence of numbers, where each character corresponds to a number. Once the watermark information is represented as a sequence of numbers, it needs to be organized into a matrix form so that it can be embedded with the image data.
[0039] First, the number of rows and columns of the watermark matrix needs to be determined, which depends on the length of the watermark and the size of the image. Then the digital sequence of the watermark information is filled into the matrix. Different filling methods can be selected, such as by row, by column, or other patterns, depending on the embedding algorithm. It should be noted that in some cases, error correction codes can be added to improve the robustness of the watermark. For example, the watermark information can be encoded as a matrix with redundant information.
[0040] S200, constructing a first three-dimensional grid model corresponding to the carrier image, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image.
[0041] Optionally, in an embodiment of the present application, first, a carrier image to be embedded with a watermark is selected. This can be any type of digital image, such as a photo, illustration, or graphic. The selected carrier image is then normalized to ensure that all pixel values are within a uniform range. For example, the pixel values can be scaled to a range of 0 to 255 to match the values of the watermark matrix.
[0042] A three-dimensional coordinate system is then applied to the carrier image, where the X and Y coordinates are related to the horizontal and vertical positions of the image, and the Z coordinate is related to the intensity or color of the pixel. The carrier image is then tiled onto the XY plane in the three-dimensional coordinate space, ensuring that the intensity value of each pixel corresponds to the Z coordinate. The three-dimensional mesh model is segmented into multiple smaller closed spaces. Specifically, the octree segmentation method can be used to gradually segment the entire model into smaller closed spaces until the desired segmentation level is reached.
[0043] S300, based on a preset feature algorithm, feature operation is performed on each closed space to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, where the roughnesses are used to indicate the degree of feature prominence of the closed space.
[0044] Optionally, in a possible implementation of the present application, first, features or feature vectors for describing the features of a closed space can be selected according to a preset feature algorithm. These features should be numerical values related to the degree of feature prominence of the closed space. For each closed space, the selected feature algorithm is applied to the space. Specifically, it may involve processing pixel values or other attributes to calculate the feature values of the closed space. Based on the calculated closed space feature values, the roughness of the closed space is calculated. Roughness can be defined according to the nature of the feature, and roughness is a numerical value used to indicate the degree of prominence of the feature in the closed space. A higher roughness indicates that the feature changes more obviously in the closed space, and vice versa. Repeat the above steps to perform feature operations and roughness calculations on each closed space to obtain multiple roughness values corresponding to multiple closed spaces.
[0045] S400, constructing a target closed space corresponding to a roughness greater than a first preset threshold among a plurality of roughnesses into a first feature matrix, wherein the first feature matrix corresponds to a carrier image.
[0046] Optionally, in a specific implementation of the present application, the roughness values corresponding to each previously calculated closed space are first traversed, and the values greater than the first preset threshold are recorded. These values will be used as the target roughness values after screening. These values indicate that the corresponding closed space has sufficiently obvious features.
[0047] For each screened target roughness value, determine its corresponding target closed space. The identifier or coordinates of the closed space can be used to associate the roughness value and the closed space. For each closed space considered to be a target, extract its eigenvalues, and combine these eigenvalues into a first feature matrix. The dimensions and content of this matrix will depend on the selected features and feature algorithms. It should be noted that in the embodiment of the present application, it is necessary to ensure that the dimensions of the first feature matrix match the dimensions of the carrier image so that the watermark information can be embedded in a specific area. Generally, the first feature matrix can be matched with the corresponding position of the carrier image to ensure that each eigenvalue is located in the correct position.
[0048] In these optional embodiments, the first feature matrix can be used in the subsequent watermark embedding step to embed the watermark information into the carrier image. This method can screen areas with obvious features according to the roughness, thereby improving the robustness and invisibility of the watermark.
[0049] S500, performing an XOR operation on the watermark matrix and the first characteristic matrix, so that the image to be embedded with the watermark is embedded in the carrier image, and a target image is obtained.
[0050] Optionally, in an embodiment of the present application, first, it is necessary to ensure that the dimensions of the watermark matrix and the first feature matrix match. This is to ensure that an XOR operation can be performed element by element, so the dimensions between the watermark matrix and the first feature matrix need to be the same. For each corresponding element, an XOR operation is performed on the element in the watermark matrix with the corresponding element in the first feature matrix. The XOR operation is a bitwise operation, and its result is 1 if the two bits are different and 0 if they are the same. This will embed the watermark information in the target image. Through the element-by-element XOR operation, the target image embedded with the watermark information is obtained. This target image will retain the characteristics of the original carrier image while embedding the watermark information. This target image can now be used for transmission or distribution for subsequent watermark extraction.
[0051] In these optional embodiments, the embedded watermark information will be present in the target image in an imperceptible manner while maintaining the quality and characteristics of the image. This method makes it possible to hide watermark information in an image for authentication, copyright protection or other applications.
[0052] In an anti-counterfeiting watermark information embedding method provided in an embodiment of the present application, a watermark matrix of a to-be-embedded watermark image is obtained; a first three-dimensional grid model corresponding to the carrier image is constructed, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image; based on a preset feature algorithm, a feature operation is performed on each closed space to obtain a plurality of non-smoothnesses corresponding to the plurality of closed spaces, the non-smoothnesses are used to indicate the degree of feature prominence of the closed space; the target closed space corresponding to the non-smoothnesses greater than a first preset threshold among the plurality of non-smoothnesses is constructed as a first feature matrix, the first feature matrix corresponds to the carrier image; the watermark matrix and the first feature matrix are XOR-operated to embed the to-be-embedded watermark image into the carrier image to obtain the target image. In the above manner, the degree of feature prominence of the carrier image can be better identified through feature operations based on non-smoothness, thereby selectively embedding the watermark, which helps to improve the robustness of the watermark, so that the target image after the watermark image is embedded can better withstand various image processing and attacks, thereby improving the effectiveness of watermark embedding.
[0053] In one embodiment, the above step 100 may specifically perform the following steps:
[0054] S110, selecting a binary image of a first matrix size as an image to be embedded with a watermark;
[0055] S120, performing a scrambling operation on the image to be embedded with a watermark, so that the image to be embedded with a watermark is converted into a first sequence;
[0056] S130, performing an iterative operation on the image to be embedded with a watermark based on preset parameters and preset initial values to obtain a chaotic sequence corresponding to the image to be embedded with a watermark;
[0057] S140, performing an XOR operation on the first sequence and the chaotic sequence to obtain a target sequence;
[0058] S150, performing spread spectrum modulation on the target sequence to obtain a watermark matrix of a second matrix size, where the second matrix size is larger than the first matrix size.
[0059] Optionally, in a specific implementation of the present application, as Figure 2 As shown, first, the watermark image is preprocessed as follows:
[0060] (1) Select a 32×32 pixel binary image as the image to be embedded with the watermark;
[0061] (2) Perform Arnold scrambling on the image to be embedded with watermark, and then convert the matrix into a sequence;
[0062] (3) Select appropriate parameters and initial values to generate a chaotic sequence and convert its elements into 0 or 1;
[0063] (4) XOR the sequence generated by (2) with the chaotic sequence generated by (3) to generate a new sequence;
[0064] (5) Perform spread spectrum modulation on the result of (4) and convert it into a 64×64 matrix.
[0065] Optionally, in another feasible implementation of the present application, a binary image of a first matrix size is selected as the image to be embedded with a watermark. This image may contain the watermark information to be embedded, which may be text, an image, or other forms of information. Subsequently, a scrambling operation is performed on the image to be embedded with a watermark, usually using Arnold scrambling or other suitable methods. Arnold scrambling is an image scrambling method based on chaos theory. It can rearrange the pixels of an image to increase the security of the watermark. After the scrambling is performed, the image is converted into a first sequence.
[0066] The image to be watermarked is then iterated based on the preset parameters and initial values. This step specifically involves performing multiple iterations of chaotic operations on the image pixels according to certain rules to generate a chaotic sequence for subsequent processing. The first sequence and the generated chaotic sequence are then XORed element by element. This will produce a target sequence that contains part of the watermark information. XOR is a bitwise operation that is used to combine two binary sequences to produce a new sequence. The target sequence is then spread spectrum modulated to generate a watermark matrix of the size of the second matrix. Spread spectrum is a technique for spreading information over a larger range, usually using methods such as discrete cosine transform. Ensure that the size of the second matrix is larger than the first matrix size to accommodate the watermark information. This watermark matrix will be used in the subsequent embedding process. These steps allow the watermark information to be embedded in the target image, while increasing the security and invisibility of the watermark through scrambling and spread spectrum operations.
[0067] In the embodiment of the present application, when processing the anti-counterfeiting information to be embedded, the Arnold scrambling technology and the spread spectrum technology are used, which can effectively reduce the possibility of human brute force cracking of the anti-counterfeiting information and effectively protect the anti-counterfeiting information. Even if the anti-counterfeiting information is taken out, it is difficult to understand the specific content of the anti-counterfeiting information. The anti-counterfeiting information image of this scheme is a 32×32 binary image. When implementing the scheme, the watermark image is first scrambled by Arnold, and then reasonable parameters and initial values are selected to spread it into a 64×64 matrix.
[0068] In these optional embodiments, the image to be embedded with the watermark is subjected to scrambling and iterative operations to generate a chaotic sequence and a first sequence. These operations increase the complexity and difficulty of cracking the watermark information, thereby improving the security of watermark embedding. The watermark information is not easily recognized or extracted by unauthorized users. Since the watermark embedding process is mainly carried out in the encoding and generation stages of the watermark information, the original image data is not directly modified. This means that watermark embedding will not have a significant negative impact on the visibility of the image, thereby maintaining the visual quality of the image. By performing an XOR operation, the watermark information has been embedded in the target sequence, which makes the watermark more robust. The characteristics of the chaotic sequence make the watermark more difficult to be affected by common attacks (such as compression, noise addition, cropping, etc.). The target sequence is spread spectrum modulated, which increases the distribution of the watermark information, making it more difficult to detect and resist various attacks in the target image.
[0069] In one embodiment, the first three-dimensional grid model further includes an X coordinate axis, a Y coordinate axis, and a Z coordinate axis; the above step 200 may specifically perform the following steps:
[0070] S210, selecting a grayscale image of a preset pixel size as a carrier image;
[0071] S220, tiling the carrier image on the XY plane, and expressing the pixels of the carrier image on the Z coordinate axis to obtain a first three-dimensional grid model;
[0072] S230, segmenting the first three-dimensional grid model based on an octree segmentation method and preset recursive parameters to obtain a plurality of closed spaces.
[0073] Optionally, in a specific implementation of the present application. Figure 2 As shown in the figure, after the watermark image is preprocessed, the host image (i.e., the carrier image) also needs to be preprocessed. First, a 512×512 pixel grayscale image is selected as the carrier image, and the carrier image is normalized; then a three-dimensional grid model is established, and the carrier image is tiled on the XY plane, and the intervals of x and y are both [0,512]. The pixels of the carrier image are expressed on the Z axis, and the interval of z is [0,255]; then the octree segmentation method is used to segment the three-dimensional grid model, and the recursive parameter r is set. The grid model is segmented from the whole to the local, until the local information of the grid model is segmented into several closed spaces, and the large closed space contains several small closed spaces, and so on until the entire model is segmented.
[0074] Optionally, in another implementation of the present application, the three-dimensional mesh model can be segmented into multiple closed spaces using an octree segmentation method. An octree is a data structure that segments a three-dimensional space into eight subspaces, and then recursively segments these subspaces until the required depth is reached or certain conditions are met. This depth or condition is usually determined by a preset recursive parameter. As the recursion proceeds, the original three-dimensional mesh model will be segmented into multiple closed spaces, each of which represents a different part of the carrier image. These closed spaces will be used for feature operations and watermark embedding in subsequent steps.
[0075] In these optional embodiments, by using the octree segmentation method, the three-dimensional space of the carrier image can be effectively divided into multiple closed spaces. These closed spaces can be processed separately, thereby improving the efficiency of watermark embedding. Dividing the carrier image into multiple closed spaces can increase the robustness of the watermark, because the watermark information can be dispersed and stored in multiple areas, reducing the degree of damage to the entire watermark by attacks.
[0076] In one embodiment, the first three-dimensional mesh model further includes a plurality of vertices and a plurality of edges connecting the plurality of vertices; the above step 300 may specifically perform the following steps:
[0077] S310, for any first vertex among the plurality of vertices, obtaining the number of edges directly connected to the first vertex;
[0078] S320, when the number is less than a second preset threshold, remove the closed space including the first vertex to obtain a plurality of target spaces;
[0079] S330, for any first space among the multiple target spaces, based on a first formula, perform a feature operation on the first space to obtain a degree of roughness corresponding to the first space, wherein the first formula is:
[0080] f=(x1+x2+...+xn) / (n*y)
[0081] Wherein, f is the roughness, xn is the distance from the nth vertex in the first space to the center of the first space, n is the number of vertices in the first space, and y is the average distance from each vertex in the first space to the center of the first space.
[0082] Optionally, in a specific implementation of the present application, as Figure 2As shown, the model features of the first three-dimensional mesh model are extracted, vertices with less than 3 connected vertices are removed, the smooth part outside the model is removed (the smooth part is the position where the original image features are not obvious), the sharp part is retained, and the roughness f of each closed space is calculated. The roughness is to calculate the distance x from the vertex in each closed space to the center of the closed space. If the distance from a vertex to the center is greater than the average distance y, all distances x greater than y are added and divided by n to calculate the quadratic average distance. Specifically, the roughness of the closed space part can be set to f = (x1+x2+...xn) / (n*y).
[0083] Optionally, in another implementation of the present application, first, the first vertex is analyzed to obtain the number of edges directly connected to the vertex. This can be achieved by traversing the number of connected vertices. If the number of connected edges is less than the second preset threshold, it means that the closed space is not suitable for watermark embedding, so it will be eliminated. Then, for each target space, the first formula is used to perform feature operations and calculate the roughness. First, calculate the distance (xn) from each vertex in the space to the center of the space. Then, calculate the average of these distances (y). Finally, according to the first formula, calculate the roughness (f). This will provide a roughness value for each target space to indicate the degree of feature obviousness. This helps to select areas with obvious features in the image and improve the invisibility of the watermark.
[0084] In these optional embodiments, target spaces suitable for watermark embedding are screened out, and unsuitable closed spaces are eliminated, which is beneficial to select only those spaces whose shapes and structures are suitable for embedding watermarks. These eliminated spaces not only improve the effectiveness of watermark embedding, but also help ensure that the watermark is not easily detected by attackers. By calculating the roughness of each target space, the complexity and obviousness of its features can be determined. The roughness value (f) represents the distribution of the distance from the vertex to the center of the space in the space. Larger roughness values generally indicate that the features of the space are more obvious and suitable for watermark embedding. This helps to further improve the invisibility and robustness of the watermark.
[0085] In one embodiment, the above step 400 may specifically perform the following steps:
[0086] S410, forming each target closed space into a feature sequence;
[0087] S420, converting the feature sequence into an initial matrix;
[0088] S430, performing secondary wavelet transform processing on the initial matrix to obtain a target matrix;
[0089] S440, extracting eigenvalues of preset high and low frequency systems in the target matrix;
[0090] S450: construct the eigenvalues into a first eigenmatrix.
[0091] Optionally, in a specific implementation of the present application, as Figure 2 As shown, construct characteristic information (i.e., the first characteristic matrix), obtain parameter h through multiple experiments, retain those with unsmoothness greater than h, form sequence L, convert the sequence of length L into matrix M, and perform secondary wavelet transform on M, and select high and low frequency system HL2 as characteristic information through multiple experiments. Then, perform XOR operation on watermark matrix and first characteristic matrix to generate zero watermark. And register the watermark in the intellectual property rights (IPR) information database.
[0092] Specifically, wavelet transform is a mathematical transform used to decompose a signal or image into components of different scales and frequencies. In this step, a secondary wavelet transform is performed, which means that the initial matrix will be subjected to two consecutive wavelet transforms. In each wavelet transform, the initial matrix will be decomposed into subbands of different scales and frequencies. The first wavelet transform will decompose the signal or image into low-frequency and high-frequency components. These components can then be further decomposed. After each decomposition step, you can choose to retain the frequency components of interest and ignore other components, or process them. Ultimately, by merging these components, the target matrix will be obtained. A key feature of wavelet transform is the ability to extract different frequencies and detail information in a signal or image. In an embodiment of the present application, performing a secondary wavelet transform may help to further emphasize specific image features in order to better embed watermark information.
[0093] Optionally, in an embodiment of the present application, when processing a host image (i.e., a carrier image), a three-dimensional modeling method is cleverly used, and the roughness of the three-dimensional model is used to construct a feature matrix. A secondary wavelet transform is then used on the feature information, and high and low frequency information is selected as feature information, which can map the characteristic parts of the original image angle.
[0094] In these optional embodiments, the frequency domain characteristics of the image can be enhanced by performing a secondary wavelet transform. Wavelet transform helps to highlight the frequency information and detail features of the target image, which will be used when embedding the watermark. The eigenvalues of the preset high and low frequency systems are extracted from the target matrix. These eigenvalues are crucial for the embedding and extraction of watermarks. High-frequency features contain detailed information of the image, while low-frequency features contain more overall image features. By extracting these eigenvalues, the first feature matrix for watermark embedding can be better constructed. In short, these steps can ensure the effective embedding and extraction of watermarks while retaining important information of the image, thereby helping to enhance the robustness and invisibility of the watermark and improve the anti-counterfeiting of the image.
[0095] In one embodiment, after the above step 500, the method may further specifically perform the following steps:
[0096] S510, constructing a second three-dimensional grid model corresponding to the target image, where the second three-dimensional grid model includes a plurality of second spaces;
[0097] S520, performing feature operation on each second space based on a preset feature algorithm to obtain multiple target roughness corresponding to the multiple second spaces;
[0098] S530, constructing a third space corresponding to a target roughness greater than a first preset threshold among a plurality of target roughnesses into a second characteristic matrix, where the second characteristic matrix corresponds to the target image;
[0099] S540, extracting a target watermark image from the target image based on the second feature matrix;
[0100] S550, verifying the image to be embedded with watermark and the target watermark image to obtain a verification result, where the verification result is used to indicate whether the image to be embedded with watermark and the target watermark image are consistent.
[0101] Optionally, in a specific implementation of the present application, as Figure 3 As shown in Figure 1, the watermark extraction process is actually the inverse process of the watermark embedding process. First, the target image is preprocessed as follows:
[0102] (1) Normalize the target image;
[0103] (2) establishing a second three-dimensional mesh model;
[0104] (3) Octree segmentation model, segmentation according to the recursive parameters set during embedding;
[0105] (4) Extract model features and remove vertices with less than 3 connected vertices, remove the smooth part outside the model (the smooth part is the position where the original image features are not obvious), retain the sharp part, and calculate the roughness f of each closed space. The roughness is calculated by calculating the distance x from each vertex in the closed space to the center of the closed space. If the distance from a vertex to the center is greater than the average distance y, then add all distances x greater than y and divide by n to calculate the quadratic average distance. Then, let the roughness of the closed space be f = (x1+x2+...xn) / (n*y).
[0106] (5) Construct feature information. After multiple experiments, obtain the parameter h. The ones with a degree of unsmoothness greater than h are retained to form a sequence L. The sequence of length L is converted into a matrix M, and M is processed by a secondary wavelet transform. The high-low frequency coefficient HL2 is taken as the feature information of the target image.
[0107] Optionally, in an embodiment of the present application, spread spectrum technology, image scrambling technology and frequency domain processing technology of images are applied to the research of digital watermark technology, and a zero watermark solution based on image normalization technology, spread spectrum technology and three-dimensional modeling is proposed. The present application combines spread spectrum technology and image scrambling technology to process image information for anti-counterfeiting. The prepared anti-counterfeiting information image (i.e., the watermark matrix) is embedded into a host image (i.e., the carrier image) that has been normalized, three-dimensionally modeled, segmented and extracted of roughness. The watermark is then extracted through the reversibility of the algorithm. The present application provides a new image anti-counterfeiting method, which can be used in the anti-counterfeiting technology of daily image products because it is easy to implement.
[0108] Optionally, in a possible implementation of the present application, the verification step may specifically first obtain the original image to be embedded with watermark, which is the original watermark information used when embedding the watermark, and obtain the extracted target watermark image, which is the watermark image extracted from the target image containing the watermark. Before the comparison, some preprocessing is required for the original watermark and the extracted watermark to ensure that they are under the same conditions. This includes resizing the images to the same size, color space conversion, etc.
[0109] The core part of verification is to compare the original watermark and the extracted watermark. The comparison method may vary depending on the specific application. For example, similarity comparison can be used: calculating similarity indicators between the two watermark images, such as structural similarity, mean square error, peak signal-to-noise ratio, etc. A higher similarity score indicates that the two are more similar.
[0110] You can also use hash function comparison: use hash function to hash the watermark image and the original watermark, and then compare the hash values. If the hash values match, the watermarks are considered consistent.
[0111] Or use a deep learning model: Use deep learning technology to train a neural network to verify the consistency of the watermark. A large amount of labeled data is required for training. Depending on the specific application, a comparison threshold can be set. If the comparison result is higher than the threshold, the watermark is considered consistent; if it is lower than the threshold, it is considered inconsistent. Based on the comparison results, a verification report is generated. This report usually includes information such as the comparison results, similarity scores, and decisions on whether they are consistent. Based on the comparison results and the threshold, a final decision is made to determine whether the extracted watermark is consistent with the original watermark. If they are consistent, the watermark verification can be considered successful.
[0112] In these optional embodiments, by verifying the target watermark image extracted from the target image and the initial watermark image, it helps to ensure the data integrity of the image. If the image is damaged during transmission or storage, the verification process can detect any damage or modification of the data, thereby preventing data loss or data tampering. Verification can also be used for reverse purposes, that is, to identify whether the image is authentic and legal. This is useful in the anti-counterfeiting identification of goods to confirm the authenticity of the product. For news, evidence or other important media, verification can ensure that its content has not been tampered with, thereby maintaining the integrity and reliability of the media.
[0113] In one embodiment, the above step 540 may specifically perform the following steps:
[0114] S541, performing an XOR operation on the target image and the second characteristic matrix to obtain an intermediate matrix, and converting the intermediate matrix into a second sequence;
[0115] S542, performing an XOR operation on the second sequence and the chaotic sequence to obtain a watermark sequence;
[0116] S543, performing inverse transformation on the watermark sequence to obtain a target watermark image.
[0117] Optionally, in a specific implementation of the present application, as Figure 3 As shown, after preprocessing the target image, watermark extraction is required, as follows:
[0118] (1) XOR the zero watermark with the second feature matrix obtained by preprocessing the target image to obtain a new matrix, which is then converted into a sequence;
[0119] (2) XOR the converted sequence with the chaotic sequence to generate a watermark sequence;
[0120] (3) The watermark sequence is processed by Arnold inverse transform to obtain the watermark.
[0121] In these optional embodiments, watermark information is accurately extracted from the target image for verification and identification, which can be used to ensure intellectual property rights, anti-counterfeiting identification, and maintain the integrity and authenticity of data.
[0122] Optionally, in the embodiment of the present application, the digital zero watermark method is used to achieve the purpose of image anti-counterfeiting authentication. The position where the image features are more obvious is the critical point between high pixels and low pixels. The feature information of the critical point position is expressed by the non-smoothness of the three-dimensional model, and the feature information is more targeted when extracting the feature information. Therefore, the non-smoothness of the three-dimensional model can well reflect the position where the image features are more obvious. And the host image is modeled into a three-dimensional space, and the watermark embedding point selects the non-smooth position of the model, which can directly map the most obvious feature position of the original image. The Arnold scrambling technology and spread spectrum technology used in this application can generate a lot of multiplication combination sequences of ciphertexts. The correct combination sequence can use an effective key to enhance the difficulty of unauthorized decryption, so as to encrypt the watermark image, and the original watermark image cannot be obtained even if it is attacked by violence. Through a variety of attack experiments to verify the good robustness and effectiveness of this application, the experiment shows that the algorithm in this application has good robustness for common processing such as noise interference, filtering, shearing, etc., and the extracted watermark also has good recognition in human subjective vision.
[0123] Figure 4 A schematic structural diagram of an anti-counterfeiting watermark information embedding device provided in another embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0124] Reference Figure 4 , the anti-counterfeiting watermark information embedding device may include:
[0125] An acquisition module 401 is used to acquire a watermark matrix to be embedded in the watermark image;
[0126] A first construction module 402 is used to construct a first three-dimensional grid model corresponding to the carrier image, the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image;
[0127] A first calculation module 403 is used to perform feature calculation on each closed space based on a preset feature algorithm to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, where the roughnesses are used to indicate the degree of feature prominence of the closed space;
[0128] A second construction module 404 is used to construct a target closed space corresponding to a roughness greater than a first preset threshold among a plurality of roughnesses into a first feature matrix, where the first feature matrix corresponds to the carrier image;
[0129] The second calculation module 405 is used to perform an XOR operation on the watermark matrix and the first characteristic matrix, so as to embed the image to be embedded with the watermark into the carrier image, thereby obtaining a target image.
[0130] In one embodiment, the acquisition module 401 may include:
[0131] A first selection submodule is used to select a binary image of a first matrix size as an image to be embedded with a watermark;
[0132] The first processing submodule is used to perform a scrambling operation on the image to be embedded with a watermark, so as to convert the image to be embedded with a watermark into a first sequence;
[0133] The second processing submodule is used to perform an iterative operation on the image to be embedded with a watermark based on preset parameters and preset initial values to obtain a chaotic sequence corresponding to the image to be embedded with a watermark;
[0134] The first calculation submodule is used to perform an XOR operation on the first sequence and the chaotic sequence to obtain a target sequence;
[0135] The third processing submodule is used to perform spread spectrum modulation on the target sequence to obtain a watermark matrix of a second matrix size, where the second matrix size is larger than the first matrix size.
[0136] In one embodiment, the first three-dimensional grid model further includes an X-coordinate axis, a Y-coordinate axis, and a Z-coordinate axis; the first construction module 402 may include:
[0137] A second selection submodule is used to select a grayscale image of a preset pixel size as a carrier image;
[0138] A first construction submodule is used to flatten the carrier image on the XY plane and express the pixels of the carrier image on the Z coordinate axis to obtain a first three-dimensional grid model;
[0139] The segmentation submodule is used to segment the first three-dimensional grid model based on the octree segmentation method and preset recursive parameters to obtain multiple closed spaces.
[0140] In one embodiment, the first three-dimensional mesh model further includes a plurality of vertices and a plurality of edges connecting the plurality of vertices; the first calculation module 403 may include:
[0141] A first acquisition submodule, used for acquiring, for any first vertex among the plurality of vertices, the number of edges directly connected to the first vertex;
[0142] A culling submodule, configured to cull the closed space including the first vertex when the number is less than a second preset threshold, to obtain a plurality of target spaces;
[0143] The second calculation submodule is used to perform feature operation on any first space among the multiple target spaces based on the first formula to obtain the roughness corresponding to the first space, wherein the first formula is:
[0144] f=(x1+x2+...+xn) / (n*y)
[0145] Wherein, f is the roughness, xn is the distance from the nth vertex in the first space to the center of the first space, n is the number of vertices in the first space, and y is the average distance from each vertex in the first space to the center of the first space.
[0146] In one embodiment, the second building module 404 may include:
[0147] The first combination submodule is used to combine each target closed space into a feature sequence;
[0148] The first conversion submodule is used to convert the feature sequence into an initial matrix;
[0149] The fourth processing submodule is used to perform secondary wavelet transform processing on the initial matrix to obtain a target matrix;
[0150] The first extraction submodule is used to extract the eigenvalues of the preset high and low frequency systems in the target matrix;
[0151] The second construction submodule is used to construct the eigenvalues into a first eigenmatrix.
[0152] In one embodiment, the anti-counterfeiting watermark information embedding device may further include:
[0153] A third construction module is used to construct a second three-dimensional grid model corresponding to the target image, where the second three-dimensional grid model includes a plurality of second spaces;
[0154] A third calculation module is used to perform feature operation on each second space based on a preset feature algorithm to obtain multiple target roughness corresponding to the multiple second spaces;
[0155] A fourth construction module is used to construct a third space corresponding to a target roughness greater than a first preset threshold among a plurality of target roughnesses into a second feature matrix, where the second feature matrix corresponds to the target image;
[0156] An extraction module, used for extracting a target watermark image from a target image based on a second characteristic matrix;
[0157] The verification module is used to verify the image to be embedded with watermark and the target watermark image to obtain a verification result, and the verification result is used to indicate whether the image to be embedded with watermark and the target watermark image are consistent.
[0158] In one embodiment, the extraction module may include:
[0159] A third calculation submodule is used to perform an XOR operation on the target image and the second feature matrix to obtain an intermediate matrix, and convert the intermediate matrix into a second sequence;
[0160] The fourth calculation submodule is used to perform an XOR operation on the second sequence and the chaotic sequence to obtain a watermark sequence;
[0161] The transformation submodule is used to perform inverse transformation on the watermark sequence to obtain the target watermark image.
[0162] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application, and are devices corresponding to the above-mentioned battery thermal runaway warning method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiments of the device. Its specific functions and technical effects can be found in the method embodiment part, which will not be repeated here.
[0163] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0164] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0165] The device may include a processor 501 and a memory 502 storing program instructions.
[0166] When the processor 501 executes the program, the steps in any of the above method embodiments are implemented.
[0167] Exemplarily, the program may be divided into one or more modules / units, one or more modules / units are stored in the memory 502, and executed by the processor 501 to complete the present application. One or more modules / units may be a series of program instruction segments capable of completing a specific function, and the instruction segments are used to describe the execution process of the program in the device.
[0168] Specifically, the processor 501 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0169] The memory 502 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 502 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 502 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 502 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 502 is a non-volatile solid-state memory.
[0170] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) readable storage media (e.g., memory devices) encoded with software including computer executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0171] The processor 501 implements any one of the methods in the above embodiments by reading and executing program instructions stored in the memory 502 .
[0172] In one example, the electronic device may further include a communication interface 503 and a bus 510. The processor 501, the memory 502, and the communication interface 503 are connected via the bus 510 and communicate with each other.
[0173] The communication interface 503 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0174] Bus 510 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 510 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0175] In addition, in combination with the method in the above embodiment, the embodiment of the present application can provide a storage medium for implementation. The storage medium stores program instructions; when the program instructions are executed by a processor, any one of the methods in the above embodiment is implemented.
[0176] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0177] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0178] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0179] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0180] The functional modules shown in the above block diagram can be implemented as hardware, software, firmware or their combination. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), suitable firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer grids such as the Internet, intranets, etc.
[0181] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0182] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0183] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. A method for embedding anti-counterfeiting watermark information, It is characterized in that The method comprises: Get the watermark matrix of the image to be embedded with the watermark; Constructing a first three-dimensional grid model corresponding to the carrier image, wherein the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image; Based on a preset feature algorithm, feature operations are performed on each closed space to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, wherein the roughnesses are used to indicate the degree of feature prominence of the closed space; constructing a target closed space corresponding to a degree of roughness greater than a first preset threshold among the plurality of degrees of roughness as a first feature matrix, wherein the first feature matrix corresponds to the carrier image; An XOR operation is performed on the watermark matrix and the first feature matrix so that the image to be embedded with the watermark is embedded in the carrier image to obtain a target image.
2. The method according to claim 1, It is characterized in that The step of obtaining a watermark matrix to be embedded in the watermark image comprises: Selecting a binary image of a first matrix size as the image to be embedded with a watermark; Performing a scrambling operation on the image to be embedded with a watermark, so that the image to be embedded with a watermark is converted into a first sequence; Based on preset parameters and preset initial values, an iterative operation is performed on the image to be embedded with a watermark to obtain a chaotic sequence corresponding to the image to be embedded with a watermark; Performing an XOR operation on the first sequence and the chaotic sequence to obtain a target sequence; The target sequence is spread spectrum modulated to obtain the watermark matrix of a second matrix size, where the second matrix size is larger than the first matrix size.
3. The method according to claim 1, It is characterized in that The first three-dimensional grid model also includes an X-coordinate axis, a Y-coordinate axis and a Z-coordinate axis; The step of constructing a first three-dimensional mesh model corresponding to the carrier image includes: Selecting a grayscale image of a preset pixel size as the carrier image; The carrier image is flattened on the XY plane, and pixels of the carrier image are expressed on the Z coordinate axis to obtain the first three-dimensional mesh model; Based on the octree segmentation method and preset recursive parameters, the first three-dimensional grid model is segmented to obtain the multiple closed spaces.
4. The method according to claim 1, It is characterized in that The first three-dimensional mesh model further includes a plurality of vertices and a plurality of edges connecting the plurality of vertices; Based on a preset feature algorithm, feature operations are performed on each closed space to obtain multiple degrees of roughness corresponding to the multiple closed spaces, including: For any first vertex among the multiple vertices, obtaining the number of edges directly connected to the first vertex; When the number is less than a second preset threshold, the closed space including the first vertex is eliminated to obtain a plurality of target spaces; For any first space among the multiple target spaces, a feature operation is performed on the first space based on a first formula to obtain the roughness corresponding to the first space, wherein the first formula is: f=(x1+x2+...+xn) / (n*y) Wherein, f is the roughness, xn is the distance from the nth vertex in the first space to the center of the first space, n is the number of vertices in the first space, and y is the average distance from each vertex in the first space to the center of the first space.
5. The method according to claim 1, It is characterized in that The step of constructing the target closed space corresponding to the roughness greater than the first preset threshold among the plurality of roughnesses into a first feature matrix includes: Combining the target closed spaces into a feature sequence; Converting the feature sequence into an initial matrix; Performing secondary wavelet transform processing on the initial matrix to obtain a target matrix; Extracting eigenvalues of preset high and low frequency systems in the target matrix; The eigenvalues are constructed as the first eigenmatrix.
6. The method according to claim 2, It is characterized in that After performing an XOR operation on the watermark matrix and the feature matrix so that the image to be embedded with the watermark is embedded in the carrier image to obtain the target image, the method further includes: Constructing a second three-dimensional grid model corresponding to the target image, wherein the second three-dimensional grid model includes a plurality of second spaces; Based on the preset feature algorithm, feature operation is performed on each second space to obtain multiple target roughness corresponding to the multiple second spaces; constructing a third space corresponding to a target roughness greater than the first preset threshold among the multiple target roughnesses as a second feature matrix, wherein the second feature matrix corresponds to the target image; extracting a target watermark image from the target image based on the second feature matrix; The image to be embedded with watermark and the target watermark image are verified to obtain a verification result, wherein the verification result is used to indicate whether the image to be embedded with watermark and the target watermark image are consistent.
7. The method according to claim 6, It is characterized in that The step of extracting a target watermark image from the target image based on the second feature matrix includes: Performing an XOR operation on the target image and the second feature matrix to obtain an intermediate matrix, and converting the intermediate matrix into a second sequence; Performing an XOR operation on the second sequence and the chaotic sequence to obtain a watermark sequence; The watermark sequence is subjected to inverse transformation to obtain the target watermark image. 8.An anti-counterfeiting watermark information embedding device, It is characterized in that The device comprises: An acquisition module, used for acquiring a watermark matrix to be embedded in the watermark image; A first construction module is used to construct a first three-dimensional grid model corresponding to the carrier image, wherein the first three-dimensional grid model includes a plurality of closed spaces, and the watermark matrix is used to embed the carrier image; A first calculation module is used to perform feature calculation on each closed space based on a preset feature algorithm to obtain a plurality of roughnesses corresponding to the plurality of closed spaces, wherein the roughnesses are used to indicate the degree of feature prominence of the closed space; A second construction module is used to construct a target closed space corresponding to a degree of roughness greater than a first preset threshold among the multiple degrees of roughness into a first feature matrix, wherein the first feature matrix corresponds to the carrier image; The second calculation module is used to perform an XOR operation on the watermark matrix and the first feature matrix so as to embed the image to be embedded with the watermark into the carrier image to obtain a target image.
9. An electronic device, It is characterized in that The device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the anti-counterfeiting watermark information embedding method as described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the anti-counterfeiting watermark information embedding method as described in any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Robust watermarking method for three-dimensional deformable grid model
CN120355559A
Book page watermark anti-theft method driven by double verification
CN121435197A
A double-verification driven book page number watermark anti-theft method
CN121435197B
