Watermarking Image Protection Method and Computer Equipment Based on Implicit Encoding
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HIGH-TECH ZONE (BINJIANG) INSTITUTE OF BLOCKCHAIN & DATA SECURITY
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-26
Smart Images

Figure CN122089548A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image watermarking technology, and in particular to a watermarking image protection method and computer device based on implicit coding. Background Technology
[0002] In today's world of highly circulating digital content, images, as crucial information carriers, are directly related to the legitimate rights and information security of creators through their authenticity and integrity. Preventing images from being altered, cropped, or misappropriated without authorization has become an important issue in the field of digital copyright protection.
[0003] Currently, the most mature image watermarking technologies in the industry mostly employ visible watermarking, which involves overlaying visually perceptible markings, such as text or logos, onto an image. While these watermarks can serve a certain degree of identification, they are still easily counterfeited by attackers through methods such as smearing or partial modification or cropping of watermarked images. It is often difficult to discern with the naked eye whether the original content has been damaged, making it challenging to verify its authenticity and integrity.
[0004] There is currently no effective solution to the problem of low security in image protection in related technologies. Summary of the Invention
[0005] This embodiment provides a watermarking image protection method and computer device based on implicit coding to solve the problem of low security in image protection in related technologies.
[0006] Firstly, this embodiment provides a watermark image protection method based on implicit coding, the method comprising:
[0007] Get the original image;
[0008] The pixel values at multiple preset positions on the original image are modified to preset values to obtain the first image;
[0009] Based on a preset watermarking strategy, a watermark is added to the first image to obtain a second image;
[0010] The first encoding information is calculated based on the overall pixel information of the second image;
[0011] Based on the first encoding information, the pixel values at the preset positions are adjusted so that the encoding pattern formed by the pixel values at the preset positions in a preset order is the same as the pattern of the first encoding information, thereby obtaining the protected target image.
[0012] In some embodiments, a watermark is added to the first image based on a preset watermarking strategy to obtain a second image, including:
[0013] Based on a preset watermarking strategy, an initial watermark is added to the first image. A target selection area is determined according to the position of the initial watermark. Second encoding information is generated based on the pixel information of the target selection area. The number of pixels at the corresponding position of the initial watermark is adjusted based on the second encoding information to obtain the second image after watermarking.
[0014] In some embodiments, based on a preset watermarking strategy, an initial watermark is added to the first image; a target selection area is determined according to the position of the initial watermark; second encoding information is generated based on the pixel information of the target selection area; and the number of pixels at the corresponding position of the initial watermark is adjusted based on the second encoding information to obtain a second image with the watermark added, including:
[0015] When the preset watermarking strategy is the first strategy, after adding the first initial watermark to the first image, the first watermarked image is obtained.
[0016] Based on the position of the first initial watermark, a target selection area is determined in the first watermark image;
[0017] Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the first initial watermark in the first watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, thereby obtaining the second watermark image;
[0018] Continue adding and modifying the second initial watermark on the second watermark image to update the second watermark image, until all the initial watermarks have been added and modified, to obtain the second image after watermarking; wherein, the new initial watermark is added at a position outside the target selection area corresponding to the existing watermark.
[0019] In some embodiments, determining a target selection area in the first watermark image based on the position of the first initial watermark includes:
[0020] In the first watermark image, the column boundary is determined based on the column where the leftmost pixel of the first initial watermark is located, and the row boundary is determined based on the row where the topmost pixel is located.
[0021] The target selection area is determined based on the position above the row boundary and to the left of the column boundary.
[0022] In some embodiments, second encoded information is generated based on the pixel information of the target selection area; based on the second encoded information, the number of pixels at the corresponding position of the first initial watermark in the first watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoded information, thereby obtaining a second watermark image, including:
[0023] The pixel information within the target selection area is encrypted to obtain the encryption result;
[0024] The encryption result is converted into a binary encoding sequence of the target number of bits to obtain the second encoded information;
[0025] In the first watermark image, the number of pixels in the target row and column of the current single initial watermark is counted and modified so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of the target row and column is equal to the number of target bits.
[0026] In some embodiments, based on a preset watermarking strategy, an initial watermark is added to the first image; a target selection area is determined according to the position of the initial watermark; second encoding information is generated based on the pixel information of the target selection area; and the number of pixels at the corresponding position of the initial watermark is adjusted based on the second encoding information to obtain a second image with the watermark added, including:
[0027] When the preset watermarking strategy is the second strategy, all the initial watermarks are added to the first image at once to obtain a combined watermark image.
[0028] In the combined watermarked image, the target selection area is determined based on the watermark-free area;
[0029] Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the initial watermark in the combined watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, thus obtaining the second image after adding the watermark.
[0030] In some embodiments, determining the target selection area based on the watermark-free region in the combined watermark image includes:
[0031] The combined watermark in the combined watermark image includes four initial watermarks located at the top, bottom, left, and right positions respectively;
[0032] The upper boundary row is determined based on the bottommost pixel of the initial watermark described above, the lower boundary row is determined based on the topmost pixel of the initial watermark described below, the left boundary column is determined based on the rightmost pixel of the initial watermark described on the left, and the right boundary column is determined based on the leftmost pixel of the initial watermark described on the right.
[0033] In the combined watermark image, the target selection area is determined based on the region below the upper boundary row, above the lower boundary row, to the right of the left boundary column, and to the left of the right boundary column.
[0034] In some embodiments, second encoded information is generated based on the pixel information of the target selection area; based on the second encoded information, the number of pixels at corresponding positions of the initial watermark in the combined watermark image is modified so that the odd / even pattern of the number of pixels at the corresponding positions is the same as the pattern of the second encoded information, resulting in a second image with the added watermark, including:
[0035] The pixel information within the target selection area is encrypted to obtain the encryption result;
[0036] The encryption result is converted into a binary encoding sequence of the target number of bits to obtain the second encoded information;
[0037] In the combined watermark image, the number of pixels in the target row and column of the combined watermark is counted and modified so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of the target row and column is equal to the number of target bits.
[0038] In some embodiments, the preset positions on the original image include the four vertices of the original image;
[0039] The step of adjusting the pixel value at the preset position based on the first encoded information includes:
[0040] The first encoding information is a four-bit binary encoding sequence. Based on the position of 1 in the first encoding information, the position to be changed is determined in the preset position starting from the top left and proceeding clockwise.
[0041] Change the pixel value of the position to be changed from the preset value to another pixel value.
[0042] In some embodiments, the method further includes:
[0043] During the verification phase, the image to be verified is obtained;
[0044] The authenticity of the image to be verified is determined based on the pixel value at the preset position in the image to be verified, or the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at the preset position.
[0045] In some embodiments, determining the authenticity of the image to be verified based on the pixel value at the preset position in the image to be verified includes:
[0046] Extract pixel values at preset positions from the image to be verified; if the pixel value is not equal to the preset value, record it as 1, and if the pixel value is equal to the preset value, record it as 0; convert the pixel values at multiple preset positions into a first verification code according to the preset order.
[0047] Modify the pixel values at preset positions on the image to be verified to the preset values, and calculate the first inference code based on the modified image to be verified;
[0048] If the first verification code is the same as the first calculated code, then the image to be verified is real.
[0049] In some embodiments, the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at a preset position, including:
[0050] For the first strategy, after the pixel value at the preset position is verified to be real, a single watermark pattern and its corresponding addition order are identified in the image to be verified.
[0051] According to the order in which the watermarks were added, the verification selection area corresponding to each of the individual watermark patterns is determined sequentially in the image to be verified.
[0052] A second inference code is generated based on the pixel information within each of the test selection areas;
[0053] If the second calculated code matches the number of pixels at the corresponding position on the single watermark pattern, then the image to be verified is authentic.
[0054] In some embodiments, the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at a preset position, including:
[0055] For the second strategy, after the pixel value at the preset position is verified as real, a combined watermark pattern is identified in the image to be verified.
[0056] Determine the inspection selection area corresponding to the combined watermark pattern in the image to be verified;
[0057] Based on the pixel information within the selected inspection area, a third inference code is generated;
[0058] If the third calculated code matches the number of pixels at the corresponding position on the combined watermark pattern, then the image to be verified is authentic.
[0059] Secondly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the implicit encoding-based watermark image protection method described in the first aspect.
[0060] Thirdly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the implicit encoding-based watermark image protection method described in the first aspect.
[0061] Compared with related technologies, the watermark image protection method and computer device based on implicit coding provided in this embodiment obtains an original image; modifies the pixel values at multiple preset positions on the original image to preset values to obtain a first image; adds a watermark to the first image based on a preset watermark addition strategy to obtain a second image; calculates first encoding information based on the overall pixel information of the second image; and adjusts the pixel values at the preset positions based on the first encoding information so that the encoding rule formed by the pixel values at the preset positions according to a preset order is the same as the rule of the first encoding information to obtain a protected target image. This solves the problem of low security in image protection in existing technologies; it achieves the effect that tampering at any pixel level in the image can be detected, thus improving the protection performance of watermarked images.
[0062] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0063] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0064] Figure 1 This is a hardware structure block diagram of the terminal for the watermarking image protection method based on implicit coding in the embodiments of this application;
[0065] Figure 2 This is a flowchart illustrating the watermarking image protection method based on implicit coding in the embodiments of this application;
[0066] Figure 3 This is a schematic diagram of the original image in one embodiment of this application;
[0067] Figure 4 This is a schematic diagram illustrating the desired watermarking effect in one embodiment of this application;
[0068] Figure 5 This is a schematic diagram of a target selection area defined in one embodiment of this application;
[0069] Figure 6 This is a sub-map obtained based on the target selection area in one embodiment of this application;
[0070] Figure 7 This is a schematic diagram illustrating the determination of the position to be modified for the first watermark in one embodiment of this application;
[0071] Figure 8 This is a schematic diagram of the modified first watermark in one embodiment of this application;
[0072] Figure 9 This is a schematic diagram illustrating the desired watermarking effect in another embodiment of this application;
[0073] Figure 10 This is a schematic diagram of the target selection area determined in another embodiment of this application;
[0074] Figure 11 This is a sub-graph obtained based on the target selection area in another embodiment of this application;
[0075] Figure 12 This is a schematic diagram showing the number of bottommost pixels of the watermark in another embodiment of this application;
[0076] Figure 13 This is a schematic diagram showing the number of pixels in the leftmost column of the watermark on the right side in another embodiment of this application;
[0077] Figure 14 This is a schematic diagram showing the number of pixels at the top of the bottom watermark in another embodiment of this application;
[0078] Figure 15 This is a schematic diagram showing the number of pixels in the rightmost column of the watermark on the left side in another embodiment of this application;
[0079] Figure 16 This is a schematic diagram showing the modified watermark in another embodiment of this application.
[0080] Reference numerals: 102, processor; 104, memory; 106, transmission device; 108, input / output device. Detailed Implementation
[0081] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0082] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.
[0083] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of the terminal for the watermarking image protection method based on implicit encoding in this embodiment. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.
[0084] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the implicit encoding-based watermark image protection method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0085] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0086] This embodiment provides a watermarking image protection method based on implicit coding. Figure 2 This is a flowchart of the watermarking image protection method based on implicit coding in this embodiment, as follows: Figure 2 As shown, the process includes the following steps:
[0087] Step S210, obtain the original image, such as Figure 3 As shown.
[0088] Step S220: Modify the pixel values at multiple preset positions on the original image to preset values to obtain the first image.
[0089] Specifically, the original image is the image to be protected. The preset position can be set in the edge area of the image, such as a single pixel at the four vertices, or multiple pixels that are easy to locate. The preset value can be set to a value that is close to the original color tone or a color effect such as gray, for example, RGB=(80,80,80).
[0090] Step S230: Based on a preset watermarking strategy, a watermark is added to the first image to obtain the second image.
[0091] Specifically, the acquired initial watermark can be directly added to the first image to form the second image; alternatively, the acquired initial watermark can be modified into a target watermark and then combined with the first image to form the second image. The target watermark can hide anti-counterfeiting information to further enhance protection. For example, content information from the original image can be hidden within the target watermark.
[0092] Step S240: Calculate the first encoding information based on the overall pixel information of the second image.
[0093] Specifically, the first encoded information includes information about the original image and watermark information. The first encoded information is an encoded sequence, including but not limited to numeric or character codes, which corresponds to pixel values at preset positions. This correspondence can be predefined. By modifying the pixel values at the preset positions based on the first encoded information and the correspondence, the first encoded information is hidden within the image. When generating the first encoded information, feature extraction or encryption calculations can be performed on the pixel information to obtain an encoded value. This encoded value is then converted into an encoded sequence in binary or ternary form. The specific calculation method is selected based on the required precision and is not limited in this embodiment.
[0094] Step S250: Based on the first encoding information, adjust the pixel values at the preset positions so that the encoding pattern formed by the pixel values at the preset positions according to the preset order is the same as the pattern of the first encoding information, thereby obtaining the protected target image.
[0095] Specifically, based on the encoding rules of the first encoding information, some positions that need to be modified are determined sequentially from the preset positions in a preset order. For the positions that need to be modified, their pixel values are changed to color values different from the preset values, such as RGB=(160,160,160). As a result, the pixel values at each preset position change, forming a certain pattern of change, and this pattern is consistent with the pattern of change of the first encoding information.
[0096] For example, the preset positions are defined as individual pixels at the four vertices of the image. After processing in step S220, all four pixels are RGB=(80,80,80). If the first encoding information is 1101, where 1 indicates modification and 0 indicates no change, then the pixels that need modification are the first, second, and fourth pixels. If the preset order is clockwise starting from the top left pixel, then the first pixel is top left, the second pixel is top right, and the fourth pixel is bottom left. Therefore, the RGB=(80,80,80) of the top left, top right, and bottom left pixels are modified to RGB=(160,160,160), while the top right pixel remains RGB=(80,80,80).
[0097] Since the modifications are all at the pixel level, the impact on the overall image is negligible and does not affect the visual effect.
[0098] During the verification phase, it can be determined whether the image to be verified has been modified by checking at least the pixel values at preset locations. Modifications at any pixel level can be detected. The encryption detection method can be kept confidential, making it very difficult for others to replicate the original image.
[0099] Correspondingly, during the verification phase, an image to be verified is obtained; the pixel values at preset positions on the image to be verified are all modified to preset values, and a first estimated code is calculated and output based on the pixel information of the modified image to be verified; by comparing the encoding pattern of the first estimated code with the pattern of the pixel values at the preset positions on the image to be verified before modification, it can be determined whether the image to be verified is the first image without modification, thereby determining the authenticity of the image to be verified.
[0100] In this embodiment, an original image is acquired; pixel values at multiple preset positions on the original image are modified to preset values to obtain a first image; a watermark is added to the first image based on a preset watermarking strategy to obtain a second image; first encoding information is calculated based on the overall pixel information of the second image; based on the first encoding information, pixel values at preset positions are adjusted so that the encoding pattern formed by the pixel values at preset positions according to a preset order is the same as the pattern of the first encoding information, thus obtaining a protected target image. This solves the problem of low security for image protection in existing technologies; it achieves the effect that tampering at any pixel level in the image can be detected, improving the protection performance of watermarked images.
[0101] In some embodiments, step S230, based on a preset watermarking strategy, adds a watermark to the first image to obtain a second image, including:
[0102] Step S231: Based on the preset watermarking strategy, an initial watermark is added to the first image. The target selection area is determined according to the position of the initial watermark. Based on the pixel information of the target selection area, second encoding information is generated. Based on the second encoding information, the number of pixels at the corresponding position of the initial watermark is adjusted to obtain the second image after watermarking.
[0103] In this embodiment, the image information of the target selection area is hidden in the watermark through implicit encoding, thereby modifying the acquired initial watermark into the target watermark and further enhancing the protection capability. For example, the second encoding information is a four-bit binary "1011", where 1 corresponds to an odd number and 0 corresponds to an even number, and the encoding pattern of the second encoding information is "odd-even-odd-odd". The parity of the number of pixels in the corresponding four rows or columns of the initial watermark is modified accordingly, making the number of pixels consistent with the "odd-even-odd-odd" pattern. When multiple watermarks are involved, each watermark can be modified after adding one, or all watermarks can be added and then modified uniformly; this embodiment does not limit this approach. This embodiment is not limited to binary second encoding information and parity matching; under other encoding methods, as long as the number of pixels at the corresponding position of the initial watermark maintains the same variation pattern as the second encoding information, it is acceptable.
[0104] Correspondingly, in the verification phase, the watermark in the image to be verified is identified, and the inspection selection area is determined based on the position of the watermark (the inspection selection area theoretically corresponds to the target selection area). The pixel information of the inspection selection area is calculated into encoding information in the same way, and the number of pixels at the corresponding position of the watermark in the image to be verified is judged to be consistent with the encoding information corresponding to the inspection selection area. This determines whether the image has been modified.
[0105] In some embodiments, step S231 above, which involves adding an initial watermark to a first image based on a preset watermarking strategy, determining a target selection area based on the position of the initial watermark, generating second encoding information based on the pixel information of the target selection area, and adjusting the number of pixels at the corresponding positions of the initial watermark based on the second encoding information to obtain a second image with the watermark added, includes:
[0106] Step S310: When the preset watermarking strategy is the first strategy, after adding the first initial watermark to the first image, the first watermark image is obtained.
[0107] Step S320: Based on the position of the first initial watermark, determine the target selection area in the first watermark image.
[0108] Step S330: Generate second encoding information based on the pixel information of the target selection area; based on the second encoding information, modify the number of pixels at the corresponding position of the first initial watermark in the first watermark image so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, and obtain the second watermark image.
[0109] Step S340: Continue to add and modify the second initial watermark on the second watermark image to update the second watermark image until all initial watermarks have been added and modified, resulting in the second image with added watermarks; wherein, the new initial watermark is added at a position outside the target selection area corresponding to the existing watermark.
[0110] Specifically, the first strategy is a layered approach, where the currently modified single watermark not only contains information from the original image but also includes information from watermarks that were added and modified earlier.
[0111] For example, Figure 4 This illustrates the desired watermarking effect in the first strategy. During the process of layering watermarks, for the position where the current initial watermark is to be added, the column number *m* (i.e., column boundary) of the leftmost pixel of the initial watermark and the row number *n* (i.e., row boundary) of the topmost pixel of the initial watermark are calculated. Based on the position above the row boundary and to the left of the column boundary, the target selection area is determined, such as... Figure 5 As described above. Extract a sub-image from the top left corner to row n and column m from the image, as shown below. Figure 6 As shown, the sub-image is calculated as a 4-bit binary number 1011. Each bit in 1011 corresponds to the top, right, bottom, and left positions of the initial watermark in a clockwise direction. Then, the number of pixels in the top row (A), right column (B), bottom row (C), and left column (D) of the initial watermark are found, as follows: Figure 7 As shown, the parity of ABCD must be consistent with the parity of each bit of the calculated binary value. If the parity of the number of pixels at a certain detection position is inconsistent, add one pixel in a clockwise direction to change the parity until they are consistent. The effect of the modified initial watermark is as follows. Figure 8 As shown, since the modifications are all at the pixel level, the impact on the overall image is negligible. Add all initial watermarks from left to right and top to bottom using the same method, ensuring that when adding a watermark, all watermarks above and to the left of it are also added, and the sub-image within the target selection area includes the sub-image with the modified watermarks.
[0112] In this embodiment, by using a strategy of adding watermarks one by one, the image and watermark information are hidden in each watermark, thereby improving the ability to protect images.
[0113] In some embodiments, step S330 above, which generates second encoding information based on the pixel information of the target selection area; and modifies the number of pixels at corresponding positions of the first initial watermark in the first watermark image based on the second encoding information, so that the odd-even pattern of the number of pixels at the corresponding positions is the same as the pattern of the second encoding information, to obtain the second watermark image, includes:
[0114] Step S331: Encrypt the pixel information within the target selection area to obtain the encryption result.
[0115] Step S332: Convert the encryption result into a binary encoding sequence of the target number of bits to obtain the second encoded information.
[0116] Specifically, the encryption calculation will produce a value between 0 and 15 (i.e., the encryption result). The result is then modulo 16, and the remainder is converted into 4 bits of binary. Assuming the remainder is 11, converting 11 to 4 bits of binary gives 1011.
[0117] The encryption calculation can use the MD5 (Message-Digest Algorithm 5) hash function. Regardless of the length of the input data, the output length of MD5 is always a fixed 128 bits (16 bytes). The original data cannot be deduced from the MD5 output, meaning that even knowing the MD5 value, it is impossible to reconstruct the original data. Even changing just one bit in the input data will result in a completely different MD5 value. The probability of two different data points producing the same MD5 value is extremely low.
[0118] Step S333: In the first watermark image, count and modify the number of pixels in the target row and column in the current single initial watermark so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of target rows and columns is equal to the number of target bits.
[0119] Specifically, the target rows and columns can be set to rows and columns that are easy to locate, such as the pixel rows and columns of the watermark edge. The number of bits in the second encoding information, i.e., the target number of bits, needs to be consistent with the number of rows and columns set. Therefore, when the pixel rows and columns of the watermark edge are selected based on the four directions of "up, down, left, and right", at least 4 bits of binary encoding sequence are required. For example, the first initial watermark has 2 pixels in the top row, 1 pixel in the rightmost column, 3 pixels in the bottom row, and 2 pixels in the leftmost column, with a parity of "even-odd-odd-even", which is inconsistent with the parity of "odd-even-odd-odd" in the second encoding information 1011. Therefore, one pixel is added to each of the top, right, and left sides to make the parity consistent. After step S330, other initial watermarks are added using the same method.
[0120] In this embodiment, the security of the second encoded information is improved by using encrypted computation.
[0121] In some embodiments, step S231 above, which involves adding an initial watermark to a first image based on a preset watermarking strategy, determining a target selection area based on the position of the initial watermark, generating second encoding information based on the pixel information of the target selection area, and adjusting the number of pixels at the corresponding positions of the initial watermark based on the second encoding information to obtain a second image with the watermark added, includes:
[0122] Step S410: When the preset watermarking strategy is the second strategy, all the initial watermarks are added to the first image at once to obtain a combined watermark image.
[0123] Step S420: In the combined watermarked image, determine the target selection area based on the watermark-free area.
[0124] Step S430: Based on the pixel information of the target selection area, generate second encoding information; based on the second encoding information, modify the number of pixels at the corresponding position of the initial watermark in the combined watermark image so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, and obtain the second image after adding the watermark.
[0125] Specifically, the second strategy is a combined encoding strategy. Figure 9 The desired watermarking effect in the second strategy is shown. Multiple watermarks are treated as a whole, with the information of both the watermark and the image hidden within this combined watermark. Each individual watermark carries only a portion of the information, simplifying computation while maintaining high security and making the encoding method difficult for others to crack.
[0126] For example, using a pre-defined algorithm, the second encoding information, such as 1011, is calculated based on the pixel information of the target selection area. Each bit corresponds to a specific position in the combined watermark, such as the top, right, bottom, and left positions in a clockwise direction. Then, the number of pixels at each position in the combined watermark is determined: A for the bottom row of the top watermark, B for the leftmost column of the right watermark, C for the top row of the bottom watermark, and D for the rightmost column of the left watermark. The parity of A, B, C, and D must match the parity of each bit in the calculated second encoding information. If the parity of the number of pixels at a certain detection position is inconsistent, one pixel is added clockwise to change the parity until it matches.
[0127] In some embodiments, step S420 above, determining the target selection area based on the watermark-free area in the combined watermark image, includes:
[0128] Step S421: Combine the combined watermark in the combined watermark image, including four initial watermarks located at the top, bottom, left, and right positions respectively.
[0129] Step S422: Determine the upper boundary row based on the bottommost pixel of the upper initial watermark, determine the lower boundary row based on the topmost pixel of the lower initial watermark, determine the left boundary column based on the rightmost pixel of the left initial watermark, and determine the right boundary column based on the leftmost pixel of the right initial watermark.
[0130] Step S423: In the combined watermark image, determine the target selection area based on the region below the upper boundary row, above the lower boundary row, to the right of the left boundary column, and to the left of the right boundary column.
[0131] Specifically, such as Figure 10As shown, determine the row number n1 (top boundary row) of the bottommost pixel of the top watermark, the row number n2 (bottom boundary row) of the topmost pixel of the bottom watermark, the column number m1 (left boundary column) of the rightmost pixel of the left watermark, and the column number m2 (right boundary column) of the leftmost pixel of the right watermark. The area from row n1+1 to row n2-1 and column m1+1 to column m2-1 is taken as the target area, and the corresponding sub-image is extracted (e.g., ...). Figure 11 (As shown) is used for subsequent calculations.
[0132] In this embodiment, the four watermarks can basically cover the entire original image, and the central area of the image is often the area with the highest information density, containing the core information of the image. Using the central area of the four watermarks as the target selection area can focus on the main content of the original image, thereby improving the protection of the core information of the image while reducing the amount of computation.
[0133] In some embodiments, step S430 above, which generates second encoding information based on the pixel information of the target selection area; and modifies the number of pixels at corresponding positions of the initial watermark in the combined watermark image based on the second encoding information, so that the odd-even pattern of the number of pixels at the corresponding positions is the same as the pattern of the second encoding information, to obtain the second image after adding the watermark, includes:
[0134] Step S431: Encrypt the pixel information within the target selection area to obtain the encryption result.
[0135] Step S432: Convert the encryption result into a binary encoding sequence of the target number of bits to obtain the second encoded information.
[0136] Specifically, the encryption calculation yields a value between 0 and 15 (the encryption result). This result is then modulo 16, and the remainder is converted to 4 bits. For example, if the remainder is 11, converting 11 to 4 bits gives 1011. The encryption calculation can use the MD5 (Message-Digest Algorithm 5) hash function.
[0137] Step S433: In the combined watermark image, count and modify the number of pixels in the target row and column of the combined watermark so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of target rows and columns is equal to the number of target bits.
[0138] Specifically, the target rows and columns can be set to rows and columns that are easy to locate, such as the pixel rows and columns of the combined watermark edge. The number of bits in the second encoding information, i.e., the target number of bits, needs to be consistent with the number of rows and columns set. Therefore, when the pixel rows and columns of the watermark edge are in the four directions of "top, bottom, left, and right", a 4-bit binary encoding sequence is required. For example, taking the top, right, bottom, and left positions of the combined watermark in a clockwise direction, such as... Figure 12 As shown, the number of pixels at the bottom of the watermark is 3; Figure 13 As shown, the leftmost column of the watermark on the right has 2 pixels; Figure 14 As shown, the top row of the watermark below contains 2 pixels; Figure 15 As shown, the rightmost column of the left watermark has 5 pixels. The parity of this pixel count is "odd-even-even-odd," which is inconsistent with the parity of the calculated second encoding information 1011, which is "odd-even-odd-odd." Therefore, a point is added to the top row of the bottom watermark, as shown below. Figure 16 As shown, this ensures that parity is consistent.
[0139] In this embodiment, the security of the second encoded information is improved by using encrypted computation.
[0140] In some embodiments, the preset positions on the original image include the four vertices of the original image. Step S250 above, based on the first encoding information, adjusts the pixel values at the preset positions, specifically including the following steps:
[0141] Step S251: The first encoding information is a four-bit binary encoding sequence. Based on the position of 1 in the first encoding information, the position to be changed is determined in the preset position starting from the top left and proceeding clockwise.
[0142] Step S252: Change the pixel value of the position to be changed from the preset value to another pixel value.
[0143] Among them, other pixel values can be another preset pixel value that is different from the preset value, or they can be random pixel values that are different from the preset value. For example, the preset value is RGB=(80,80,80), and the other pixel values are the preset RGB=(160,160,160), or the randomly generated RGB=(161,185,221).
[0144] Based on this, the pixel value corresponding to 0 in the first encoding information is a preset value, and the pixel value corresponding to 1 in the first encoding information is another pixel value, thereby achieving the purpose of unifying the encoding rules: making the encoding rules formed by the pixel values at the preset positions in a preset order the same as the rules of the first encoding information.
[0145] For example, using a pre-defined encryption algorithm, such as calculating the MD5 value of the entire image, and then taking the remainder after dividing by 16 (assuming the calculated value is 13, or binary 1101), the pixel values at the top left, top right, bottom right, and bottom left (clockwise) points are represented. If the position is 1, the pixel value is changed to RGB=(160,160,160); if it is 0, RGB=(80,80,80) is maintained. In this example, the top left, top right, and bottom left pixels should be changed to (160, 160, 160), while the bottom right pixel should remain at (80,80,80).
[0146] In some embodiments, the method further includes:
[0147] Step S260: In the verification phase, obtain the image to be verified.
[0148] Step S270: Determine the authenticity of the image to be verified based on the pixel value at a preset position in the image to be verified, or determine the authenticity of the image to be verified based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at the preset position.
[0149] Specifically, since the pixel values at preset positions and key information of the entire original image are hidden after image protection processing, the authenticity can be verified at least by checking the pixel values at preset positions. If image information is also hidden in the watermark, the number of pixels at the corresponding positions of the watermark can be further checked, strengthening the verification and increasing the difficulty of cracking the protection measures.
[0150] In some embodiments, the authenticity of the image to be verified is determined based on the pixel values at preset locations in the image to be verified, including:
[0151] Step S510: Extract pixel values at preset positions from the image to be verified; if the pixel value is not equal to the preset value, record it as 1; if the pixel value is equal to the preset value, record it as 0; convert the pixel values at multiple preset positions into the first verification code according to the preset order.
[0152] Step S520: Modify the pixel values at preset positions on the image to be verified to preset values, and calculate the first estimated code based on the modified image to be verified.
[0153] Step S530: If the first verification code is the same as the first calculated code, then the image to be verified is real.
[0154] Specifically, if the pixel values extracted from the four preset positions in a preset order are RGB=(160,160,160), RGB=(160,160,160), RBG=(80,80,80), and RGB=(160,160,160), where RBG=(80,80,80) is the preset value and RGB=(160,160,160) represents other pixel values, then the corresponding first verification code is 1101. In step S520, the calculation method for generating the first code information is used to calculate the image to be verified (note that in this step, the pixel values at the four preset positions need to be changed to the preset value RBG=(80,80,80) before calculation), resulting in a first deduced code of 1001. Since the calculation results of the first verification code and the first deduced code are inconsistent, it can be concluded that the image to be verified has been tampered with and is different from the first image. If the first verification code is the same as the first calculated code, then the image to be verified has not been tampered with and is the same as the first image.
[0155] In some embodiments, the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at a preset position, including:
[0156] Step S610: For the first strategy, after verifying that the pixel value at the preset position is real, identify a single watermark pattern and its corresponding addition order in the image to be verified.
[0157] Specifically, through steps S510 to S530, it can be determined that the pixel value at the preset position is verified as real (i.e., the first verification code is the same as the first calculated code). After the pixel value verification is passed, the number of watermark pixels is further verified.
[0158] Step S620: In accordance with the order in which the watermarks were added, determine the inspection selection area corresponding to each individual watermark pattern in the image to be verified.
[0159] Specifically, the method for determining the inspection area is the same as the method for determining the target selection, based on the position where a single watermark is added, such as the upper left of the current single watermark.
[0160] Step S630: Generate a second inference code based on the pixel information in each inspection selection area.
[0161] Specifically, the calculation method used when generating the second encoding information is adopted to calculate the pixel information within each test area. For example, the MD5 value of the pixel information within the test area is calculated, and the remainder of the MD5 value divided by 16 is taken, converting the remainder result into a four-bit binary number. Each test area can obtain a second calculated code.
[0162] Step S640: If the second calculated code matches the number of pixels at the corresponding position on the corresponding single watermark pattern, then the image to be verified is authentic.
[0163] Specifically, each second-calculated code is used to detect the number of pixels in the corresponding single watermark. For example, it checks the number of pixels in the top row (A), the rightmost column (B), the bottom row (C), and the leftmost column (D) of the watermark. If the parity of A, B, C, and D matches the parity of each bit in the calculated second-calculated code, then the pixel count check of the watermark passes. Combined with the pixel value at the preset position, this confirms the conclusion that the image to be verified is genuine, and the image to be verified is authentic.
[0164] In this embodiment, by using a verification method in conjunction with the first strategy when adding watermarks, modifications to the image at any pixel level can be identified, effectively improving the security of image information.
[0165] In some embodiments, the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at a preset position, including:
[0166] Step S650: For the second strategy, after verifying that the pixel value at the preset position is real, identify the combined watermark pattern in the image to be verified.
[0167] Specifically, through steps S510 to S530, it can be determined that the pixel value at the preset position is verified as real (i.e., the first verification code is the same as the first calculated code). After the pixel value verification is passed, the number of watermark pixels is further verified.
[0168] Step S670: Determine the inspection selection area corresponding to the combined watermark pattern in the image to be verified.
[0169] Specifically, the method for determining the inspection area is the same as the method for determining the target selection, based on the location where the combined watermark is added, such as the watermark-free area in the center of the combined watermark.
[0170] Step S680: Based on the pixel information within the selected area, generate a third calculated code.
[0171] Step S690: If the third calculated code matches the number of pixels at the corresponding position on the combined watermark pattern, then the image to be verified is authentic.
[0172] Specifically, the calculation method used when generating the second encoding information is applied to calculate the pixel information within the inspection selection area. For example, the MD5 value of the pixel information within the inspection selection area is calculated, and the remainder of the MD5 value divided by 16 is taken. The remainder result is converted into a four-bit binary number to obtain the third deduced code. The third deduced code is used to detect the number of pixels in the corresponding combined watermark. For example, the number of pixels in the top row (A), right column (B), bottom row (C), and left column (D) of the combined watermark is checked. If the parity of ABCD matches the parity of each bit in the calculated third deduced code, it means that the pixel count check of the watermark has passed. Combined with the pixel value at the preset position, the conclusion is that it is genuine, and the image to be verified is genuine.
[0173] In this embodiment, by using a verification method in conjunction with the second strategy when adding watermarks, modifications to the image at any pixel level can be identified, effectively improving the security of image information.
[0174] The present embodiment will now be described and illustrated through preferred embodiments.
[0175] See Figures 3 to 8 The implementation process of the first preferred embodiment is as follows:
[0176] 1) Obtain the original image to which you want to add a watermark, and change the four pixels at the preset positions (top left, top right, bottom right, bottom left) of the original image to the preset value RGB=(80,80,80), so that these four pixel values will be used in the calculations regardless of whether encryption or decryption is performed.
[0177] 2) Obtain the watermark addition strategy, which is to add individual watermarks sequentially from left to right and from top to bottom, and hide a portion of the image information in the watermark for each watermark added.
[0178] 3) Based on the watermarking strategy, obtain the initial watermark (watermark text in this preferred embodiment). For each watermark text to be added, calculate the column number m of the leftmost pixel and the row number n of the topmost pixel. Extract the sub-image from the top left corner to row n and column m, calculate the MD5 value of the sub-image, then take the remainder after dividing by 16, and convert the remainder value to 4 bits to obtain the second encoding information (1011 in this preferred embodiment). Each bit in 1011 corresponds to the top, right, bottom, and left positions of a single watermark text, clockwise. Count the number of pixels A in the top row, B in the rightmost column, C in the bottom row, and D in the leftmost column of the current single watermark text, requiring that the parity of ABCD is consistent with the parity of each bit of the calculated second encoding information. If the parity of the number of pixels at a certain detection position of ABCD is inconsistent, add one pixel in a clockwise direction to change the parity to make it consistent. For example, the top row has 2 pixels, the rightmost column has 1 pixel, the bottom row has 3 pixels, and the leftmost column has 2 pixels. The parity is "even-odd-odd-even", which is inconsistent with the parity "odd-even-odd-odd" of the second encoding information 1011. Therefore, one pixel is added to the top, right, and left to make the parity consistent.
[0179] 4) Add all individual watermark text from left to right and from top to bottom using the same method, ensuring that when adding a certain watermark, the watermarks in the upper left corner are all added. Select the sub-image that includes the modified watermark.
[0180] 5) Finally, calculate the MD5 value for the entire watermarked image, then take the remainder after dividing by 16. The calculated value is 13, which is binary 1101. 1101 is the first encoded information. 1101 corresponds to the pixel values of the top-left, top-right, bottom-right, and bottom-left pixels clockwise in the entire image. If the value at a given position is 1, the pixel value is changed to RGB=(160, 160, 160); if it is 0, RGB=(80, 80, 80) is maintained. In this example, the top-left, top-right, and bottom-left pixels should be changed to (160, 160, 160), while the bottom-right pixel should remain at (80, 80, 80).
[0181] In this preferred embodiment, the problem of low security in image protection of existing technologies is solved; the effect of detecting tampering at any pixel level in the image is achieved, thus improving the protection performance of watermarked images.
[0182] See Figures 9 to 16 The implementation process of the second preferred embodiment is as follows:
[0183] 1) Obtain the original image to which you want to add a watermark, and change the four pixels at the preset positions (top left, top right, bottom right, bottom left) of the original image to the preset value RGB=(80,80,80), so that these four pixel values will be used in the calculations regardless of whether encryption or decryption is performed.
[0184] 2) Obtain the watermarking strategy, which is to add watermarks sequentially from left to right and from top to bottom on the original image, and hide the information of the original image in each watermark in a combination.
[0185] 3) Based on the watermarking strategy, obtain the initial watermark (watermark text in this preferred embodiment). For the four positions where watermarks are to be added (top, bottom, left, and right), calculate the row number n1 of the bottom pixel of the top watermark text, the row number n2 of the top pixel of the bottom watermark text, the column number m1 of the rightmost pixel of the left watermark, and the column number m2 of the leftmost pixel of the right watermark. Take out the sub-image from row n1+1 to row n2-1 and column m1+1 to column m2-1, calculate the MD5 value of the sub-image, and then take the remainder after dividing by 16. Convert the calculation result into 4 bits of binary to obtain the second encoding information 1011, where each bit corresponds to the top, right, bottom, and left positions of a single watermark text in a clockwise direction. Then find the number of pixels A in the bottom row of the top watermark text, the number of pixels B in the leftmost column of the right watermark, the number of pixels C in the top row of the bottom watermark, and the number of pixels D in the rightmost column of the left watermark. The parity of ABCD must be consistent with the parity of each bit of the calculated binary value. If the parity of the number of pixels at a certain detection location is inconsistent, one pixel is added clockwise to change the parity and make it consistent. In this preferred embodiment, A has 3 pixels, B has 2 pixels, C has 2 pixels, and D has 5 pixels, with a parity of "odd-even-even-odd". This is inconsistent with the parity of "odd-even-odd-odd" in the second encoding information 1011. Therefore, a dot needs to be added above the watermark below to make the parity consistent.
[0186] 4) Finally, calculate the MD5 value for the entire watermarked image, then take the remainder after dividing by 16. The calculated value is 13, which is binary 1101, obtaining the first encoded information. 1101 corresponds to the pixel values of the top-left, top-right, bottom-right, and bottom-left pixels clockwise. If the position is 1, the pixel value is changed to RGB=(160, 160, 160); if it is 0, RGB=(80, 80, 80) is maintained. In this example, the top-left, top-right, and bottom-left pixels should be changed to (160, 160, 160), while the bottom-right pixel should remain (80, 80, 80).
[0187] In this preferred embodiment, the problem of low security in image protection of existing technologies is solved; the effect of detecting tampering at any pixel level in the image is achieved, thus improving the protection performance of watermarked images.
[0188] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0189] This embodiment also provides a watermark image protection device based on implicit encoding, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. The terms "module," "unit," "subunit," etc., used below can refer to combinations of software and / or hardware that perform a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0190] The watermark image protection device based on implicit encoding includes: an image acquisition module, a pixel value modification module, a watermark addition module, an overall encoding module, and an encoding hiding module.
[0191] The image acquisition module is used to acquire the original image.
[0192] The pixel value modification module is used to modify the pixel values at multiple preset positions on the original image to preset values to obtain the first image.
[0193] The watermarking module is used to add a watermark to the first image based on a preset watermarking strategy to obtain a second image.
[0194] The overall encoding module is used to calculate the first encoding information based on the overall pixel information of the second image.
[0195] The encoding and hiding module is used to adjust the pixel values at the preset positions based on the first encoding information, so that the encoding pattern formed by the pixel values at the preset positions in a preset order is the same as the pattern of the first encoding information, thereby obtaining a protected target image.
[0196] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0197] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0198] This embodiment also provides a computer device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0199] Furthermore, in conjunction with the implicit encoding-based watermarking image protection method provided in the above embodiments, this embodiment can also provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the implicit encoding-based watermarking image protection methods described in the above embodiments.
[0200] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0201] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0202] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0203] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. A watermarking image protection method based on implicit coding, characterized in that, The method includes: Get the original image; The pixel values at multiple preset positions on the original image are modified to preset values to obtain the first image; Based on a preset watermarking strategy, a watermark is added to the first image to obtain a second image; The first encoding information is calculated based on the overall pixel information of the second image; Based on the first encoding information, the pixel values at the preset positions are adjusted so that the encoding pattern formed by the pixel values at the preset positions in a preset order is the same as the pattern of the first encoding information, thereby obtaining the protected target image.
2. The watermarking image protection method based on implicit coding according to claim 1, characterized in that, Based on a preset watermarking strategy, a watermark is added to the first image to obtain a second image, including: Based on a preset watermarking strategy, an initial watermark is added to the first image. A target selection area is determined according to the position of the initial watermark. Second encoding information is generated based on the pixel information of the target selection area. The number of pixels at the corresponding position of the initial watermark is adjusted based on the second encoding information to obtain the second image after watermarking.
3. The watermarking image protection method based on implicit coding according to claim 2, characterized in that, Based on a preset watermarking strategy, an initial watermark is added to the first image. A target selection area is determined according to the position of the initial watermark. Second encoding information is generated based on the pixel information of the target selection area. The number of pixels at the corresponding positions of the initial watermark is adjusted based on the second encoding information to obtain a second image with the watermark added. When the preset watermarking strategy is the first strategy, after adding the first initial watermark to the first image, the first watermarked image is obtained. Based on the position of the first initial watermark, a target selection area is determined in the first watermark image; Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the first initial watermark in the first watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, thereby obtaining the second watermark image; Continue adding and modifying the second initial watermark on the second watermark image to update the second watermark image, until all the initial watermarks have been added and modified, to obtain the second image after watermarking; wherein, the new initial watermark is added at a position outside the target selection area corresponding to the existing watermark.
4. The watermarking image protection method based on implicit coding according to claim 3, characterized in that, Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the first initial watermark in the first watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, thereby obtaining the second watermark image, including: The pixel information within the target selection area is encrypted to obtain the encryption result; The encryption result is converted into a binary encoding sequence of the target number of bits to obtain the second encoded information; In the first watermark image, the number of pixels in the target row and column of the current single initial watermark is counted and modified so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of the target row and column is equal to the number of target bits.
5. The watermarking image protection method based on implicit coding according to claim 2, characterized in that, Based on a preset watermarking strategy, an initial watermark is added to the first image. A target selection area is determined according to the position of the initial watermark. Second encoding information is generated based on the pixel information of the target selection area. The number of pixels at the corresponding positions of the initial watermark is adjusted based on the second encoding information to obtain a second image with the watermark added. When the preset watermarking strategy is the second strategy, all the initial watermarks are added to the first image at once to obtain a combined watermark image. In the combined watermarked image, the target selection area is determined based on the watermark-free area; Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the initial watermark in the combined watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, thus obtaining the second image after adding the watermark.
6. The watermarking image protection method based on implicit coding according to claim 5, characterized in that, In the combined watermarked image, determining the target selection area based on the watermark-free region includes: The combined watermark in the combined watermark image includes four initial watermarks located at the top, bottom, left, and right positions respectively; The upper boundary row is determined based on the bottommost pixel of the initial watermark described above, the lower boundary row is determined based on the topmost pixel of the initial watermark described below, the left boundary column is determined based on the rightmost pixel of the initial watermark described on the left, and the right boundary column is determined based on the leftmost pixel of the initial watermark described on the right. In the combined watermark image, the target selection area is determined based on the region below the upper boundary row, above the lower boundary row, to the right of the left boundary column, and to the left of the right boundary column.
7. The watermarking image protection method based on implicit coding according to claim 5, characterized in that, Based on the pixel information of the target selection area, second encoding information is generated; based on the second encoding information, the number of pixels at the corresponding position of the initial watermark in the combined watermark image is modified so that the odd-even pattern of the number of pixels at the corresponding position is the same as the pattern of the second encoding information, resulting in a second image with the added watermark, including: The pixel information within the target selection area is encrypted to obtain the encryption result; The encryption result is converted into a binary encoding sequence of the target number of bits to obtain the second encoded information; In the combined watermark image, the number of pixels in the target row and column of the combined watermark is counted and modified so that the parity of the number of pixels matches the second encoding information to obtain the second watermark image; the number of the target row and column is equal to the number of target bits.
8. The watermarking image protection method based on implicit coding according to any one of claims 1 to 7, characterized in that, The preset positions on the original image include the four vertices of the original image; The step of adjusting the pixel value at the preset position based on the first encoded information includes: The first encoding information is a four-bit binary encoding sequence. Based on the position of 1 in the first encoding information, the position to be changed is determined in the preset position starting from the top left and proceeding clockwise. Change the pixel value of the position to be changed from the preset value to another pixel value.
9. The watermarking image protection method based on implicit coding according to claim 1, characterized in that, The method further includes: During the verification phase, the image to be verified is obtained; The authenticity of the image to be verified is determined based on the pixel value at the preset position in the image to be verified, or the authenticity of the image to be verified is determined based on the number of pixels at the corresponding position of the watermark in the image to be verified and the pixel value at the preset position.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.