Hidden watermark writing method and readable storage medium

By selecting the appropriate hidden watermark encoding algorithm and the number of repeated encodings, an output image with high accuracy in watermark extraction under high and low resolution images is generated, which solves the problem of poor application of watermark algorithms in the prior art.

CN115695825BActive Publication Date: 2025-09-02HOWAY TECH (WUHAN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211369644.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2025-09-02
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

The accuracy of watermark extraction under high and low resolution images in the prior art cannot be taken into account, and the hidden watermark algorithm is poor in application.

Method used

By obtaining the input image of the hidden watermark to be added, at least two preset hidden watermark encoding algorithms are selected based on the maximum number of repeated encodings, the maximum number of repeated encodings is calculated, and the corresponding maximum number of repeated encodings is written to the input image without an error, to generate an output image with the hidden watermark added.

Benefits of technology

The accuracy of watermark extraction can be improved under high and low resolution images, taking into account the encoding effect at different resolutions, and solving the problems existing in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695825B_ABST
    Figure CN115695825B_ABST
Patent Text Reader

Abstract

The present invention provides a hidden watermark writing method and a readable storage medium. The hidden watermark writing method calculates the maximum number of repetitions using at least two preset hidden watermark encoding algorithms, and uses this to determine whether to select the appropriate hidden watermark encoding algorithm or report an error. If no error is reported, the method writes the maximum number of repetitions corresponding to the selected hidden watermark encoding algorithm into the input image to generate an output image with the hidden watermark. This configuration, by selecting the appropriate encoding algorithm and repeating the algorithm the appropriate number of times, takes into account both high-resolution and low-resolution input images, combining the advantages of repetition encoding and error correction encoding, resulting in a high accuracy watermark extraction result for both high-resolution and low-resolution images, thus resolving the problems existing in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to information coding technology, and in particular to a hidden watermark writing method and a readable storage medium. Background Art

[0002] Hidden watermarking is a technique that embeds specific information in a hidden form within a file (such as an image). While the image is invisible to the naked eye before and after the hidden watermark is added, it can be decoded using specialized decoding methods. This can be used for applications such as copyright verification and tracking.

[0003] Image resolution is a key metric for watermarking, determining the information capacity of the underlying image. Typical watermarking algorithms perform channel coding within the image payload to improve accuracy, but this accuracy decreases significantly as resolution decreases.

[0004] Please refer to Figure 1 , Figure 1 The relationship between image resolution and the error rate of a hidden watermark algorithm is shown. BER stands for Bit Error Rate, and the lower the better. Figure 1 Where L1 represents the BER of an image with a resolution of 1280*720, and L2 represents the BER of an image with a resolution of 2560*1440. Figure 1 The horizontal axis is used to distinguish different cases and does not mean that there is a necessary order relationship between the cases.

[0005] That is to say, the existing technology has the problem that the accuracy of watermark extraction under high-resolution and low-resolution images cannot be taken into account at the same time, and the hidden watermark algorithm has poor applicability. Summary of the Invention

[0006] The purpose of the present invention is to provide a hidden watermark writing method and a readable storage medium to solve the problems in the prior art of the inability to balance the accuracy of watermark extraction from high- and low-resolution images and the poor applicability of hidden watermark algorithms.

[0007] In order to solve the above technical problems, the present invention provides a hidden watermark writing method, which includes the following steps: obtaining an input image to which a hidden watermark is to be added; based on a maximum number of repeated encoding times, selecting one of at least two preset hidden watermark encoding algorithms or reporting an error; if no error is reported, writing the maximum number of repeated encoding times corresponding to the selected hidden watermark encoding algorithm into the input image to generate an output image with the hidden watermark added; wherein, the ratios of data length to check code length in at least two preset hidden watermark encoding algorithms are different.

[0008] Optionally, based on the maximum number of repeated encodings, the step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error includes: simultaneously calculating the maximum number of repeated encodings of the input image corresponding to each of at least two preset hidden watermark encoding algorithms; and selecting the hidden watermark encoding algorithm corresponding to the maximum number of repeated encodings that best meets the first preset condition.

[0009] Optionally, based on the maximum number of repeated encodings, the step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error includes: sequentially calculating the maximum number of repeated encodings corresponding to each of the at least two preset hidden watermark encoding algorithms for the input image; if the maximum number of repeated encodings calculated once meets the second preset condition, stopping subsequent calculations and selecting the current hidden watermark encoding algorithm; if the maximum number of repeated encodings calculated each time does not meet the second preset condition, reporting an error or selecting the hidden watermark encoding algorithm corresponding to the maximum number of repeated encodings that best meets the third preset condition.

[0010] Optionally, the at least two preset hidden watermark encoding algorithms include a BCH algorithm, a Hamming algorithm, and a No Coding algorithm, wherein the No Coding algorithm refers to an algorithm that adds the watermark data to be added into the input image in plain text.

[0011] Optionally, at least two preset hidden watermark coding algorithms are the BCH algorithm, the Hamming algorithm, and the No Coding algorithm, wherein the No Coding algorithm refers to an algorithm that adds the watermark data to be added to the input image in plain text. The step of selecting one of the at least two preset hidden watermark coding algorithms or reporting an error based on the maximum number of repeated codings includes: calculating the maximum number of repeated codings corresponding to the BCH algorithm for the input image; if the maximum number of repeated codings corresponding to the BCH algorithm is greater than a first threshold, stopping subsequent calculations and selecting the BCH algorithm; if the maximum number of repeated codings corresponding to the BCH algorithm is less than or equal to the first threshold, calculating the maximum number of repeated codings corresponding to the Hamming algorithm for the input image; if the maximum number of repeated codings corresponding to the Hamming algorithm is greater than a second threshold, stopping subsequent calculations and selecting the Hamming algorithm; if the maximum number of repeated codings corresponding to the Hamming algorithm is less than or equal to the second threshold, calculating the maximum number of repeated codings corresponding to the No Coding algorithm for the input image; if the maximum number of repeated codings corresponding to the No Coding algorithm is greater than a third threshold, selecting the No Coding algorithm.

[0012] Optionally, based on the maximum number of repeated encodings, the step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error also includes: reporting an error if the maximum number of repeated encodings corresponding to the No Coding algorithm is less than or equal to the third threshold.

[0013] Optionally, a first functional relationship is established between the accuracy of the BCH algorithm and the number of repeated encodings, and the first threshold is determined based on the slope of the first functional relationship; a second functional relationship is established between the accuracy of the Hamming algorithm and the number of repeated encodings, and the second threshold is determined based on the slope of the second functional relationship.

[0014] Optionally, the third threshold is 0.

[0015] Optionally, the step of calculating the maximum number of repeated encoding times includes: calculating the maximum number of repeated encoding times based on the resolution of the input image.

[0016] In order to solve the above technical problem, the present invention further provides a readable storage medium, on which a program is stored. When the program is run, the above hidden watermark writing method is executed.

[0017] Compared to the prior art, the present invention provides a hidden watermark writing method and readable storage medium. The method calculates the maximum number of repetitions using at least two preset hidden watermark encoding algorithms, using this to determine whether to select the appropriate hidden watermark encoding algorithm or report an error. If no error is reported, the method writes the maximum number of repetitions corresponding to the selected hidden watermark encoding algorithm into the input image to generate an output image with the hidden watermark. This configuration, by selecting the appropriate encoding algorithm and repeating the algorithm the appropriate number of times, balances high- and low-resolution input images, combining the advantages of repetition encoding and error correction coding to achieve a high accuracy watermark extraction for both high- and low-resolution images, thus resolving the problems of the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Those skilled in the art will appreciate that the accompanying drawings are provided for a better understanding of the present invention and do not constitute any limitation on the scope of the present invention.

[0019] Figure 1 It is the relationship between image resolution and the error rate of hidden watermark algorithm;

[0020] Figure 2 1 is a flow chart of a hidden watermark writing method according to an embodiment of the present invention;

[0021] Figure 31 is a schematic diagram of redundant space occupation of a preset hidden watermark encoding algorithm according to an embodiment of the present invention;

[0022] Figure 4 It is the relationship between the number of repeated encoding times and the error rate of the hidden watermark algorithm;

[0023] Figure 5 This is another flowchart of a hidden watermark writing method according to an embodiment of the present invention;

[0024] Figure 6 is a comparison table of the error rates of the hidden watermark writing method according to an embodiment of the present invention and the error rates of the hidden watermark writing method in the prior art;

[0025] Figure 7 yes Figure 6 Bar graph of the comparison table shown;

[0026] Figure 8 This is a comparison diagram of the output images of the hidden watermark writing method according to an embodiment of the present invention and the hidden watermark writing method in the prior art. DETAILED DESCRIPTION

[0027] To make the objects, advantages, and features of the present invention more clearly apparent, the present invention is further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the drawings are all in a very simplified form and are not drawn to scale. They are only used to conveniently and clearly assist in illustrating the purposes of the embodiments of the present invention. In addition, the structures shown in the drawings are often part of the actual structure. In particular, different drawings may need to illustrate different focuses and sometimes use different scales.

[0028] As used in the present invention, the singular forms "a", "an", and "the" include plural referents, the term "or" is generally used to include "and / or", the term "several" is generally used to include "at least one", and the term "at least two" is generally used to include "two or more". In addition, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features specified as "first", "second", and "third" may explicitly or implicitly include one or at least two of the features, "one end" and "the other end" and "proximal end" and "distal end" generally refer to two corresponding parts, which not only include endpoints, and the terms "mounted", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be a communication between two elements or an interaction relationship between two elements. In addition, as used in the present invention, "one element is disposed on another element" generally only indicates that there is a connection, coupling, cooperation, or transmission relationship between the two elements, and the connection, coupling, cooperation, or transmission between the two elements may be direct or indirect through an intermediate element. It should not be understood as indicating or implying a spatial positional relationship between the two elements. That is, one element can be in any orientation, such as inside, outside, above, below, or to one side of another element, unless the content clearly indicates otherwise. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0029] The core idea of ​​the present invention is to provide a hidden watermark writing method and a readable storage medium to solve the problems in the prior art of the inability to balance the accuracy of watermark extraction from high- and low-resolution images and the poor applicability of hidden watermark algorithms.

[0030] In different contexts, the related methods of hiding watermarks will have different names. In order to clearly refer to the objects, it is agreed in this specification that: "Encoding algorithm / method" refers to the encoding method of watermark data, whose input is a string and output is a string or binary data. For example, the watermark data is "a", and the output result after encoding based on a certain algorithm is "1001". "Writing algorithm / method" refers to the method of outputting a picture with a watermark, whose input is a picture and a string, and the output is a picture. During the operation of the "writing algorithm / method", a specific "encoding algorithm / method" needs to be called. In this specification, the concept is understood according to the above definition. Of course, there are similar different concepts for the corresponding decoding methods, but since the understanding here does not affect the explanation of this specification, they are collectively referred to as "decoding algorithms / methods". Those skilled in the art can understand it as "algorithm for obtaining watermark data through string / binary data" or "algorithm for obtaining watermark data through pictures" according to the context.

[0031] The following description is given with reference to the accompanying drawings.

[0032] Please refer to Figure 2 This embodiment provides a hidden watermark writing method, which includes the following steps:

[0033] S10: Obtain an input image to which a hidden watermark is to be added.

[0034] S20: Based on the maximum number of repeated encoding times, select one of at least two preset hidden watermark encoding algorithms or report an error, wherein the maximum number of repeated encoding times is calculated based on the resolution of the input image.

[0035] S30: If no error is reported, writing the corresponding maximum number of repeated encoding times into the input image based on the selected hidden watermark encoding algorithm to generate an output image with the hidden watermark added thereto.

[0036] The ratios of data length to check code length in at least two preset hidden watermark encoding algorithms are different.

[0037] In step S20, the "maximum" constraint in the maximum number of repetitions can be simply a spatial constraint, for example, maximum number of repetitions = resolution / number of spatial pixels that a single watermark data must occupy. Alternatively, the spatial constraint can be combined with other constraints.

[0038] In one embodiment, at least two preset hidden watermark encoding algorithms are the BCH algorithm, the Hamming algorithm, and the No Coding algorithm, wherein the BCH algorithm and the Hamming algorithm can be understood according to common knowledge in the art, and the No Coding algorithm refers to an algorithm that adds the watermark data to be added to the input image in plain text, that is, an algorithm that directly writes the watermark data to be added into the input image. It can be understood that in other embodiments, other hidden watermark encoding algorithms can also be used, and the number is not limited to three. However, for ease of understanding, the above three encoding algorithms are used as examples in the following text. When this method is implemented, it can be applied to algorithms based on frequency domain writing, or algorithms written in accordance with an agreed data format (such as parity relationship, size relationship, etc.).

[0039] In step S30, the writing process is divided into: dividing the input image into several sub-regions (denoted as totalN), selecting several of the sub-regions (denoted as BN) to write the same bit watermark data, this process is called repeated encoding. Therefore, the maximum number of repeated encodings BNmax is BNmax = totalN / totalBit, where totalBit is the total number of watermark bits. Therefore, the input image needs to meet the condition of being divisible. The purpose of being divisible is to meet the condition of repeated independent writing of watermarks, that is, the repeated encoding in this method, where independence means that the watermarks written into the image will not overlap and will not interfere with each other. However, in general scenarios, the input image meets the condition of being divisible.

[0040] During the invention process of this embodiment, the inventors first analyzed the effects of “error correction coding” and “repetition coding” on BER.

[0041] Error correction coding adds check bits to the original watermark information before embedding it, which can correct errors in the extracted watermark to a certain extent. The longer the check bits in the error correction code, the stronger the error correction capability, but the lower the data payload, the greater the space occupied. Table 1 shows the performance analysis of the three coding algorithms used in this embodiment.

[0042] Table 1 Performance analysis of three encoding algorithms

[0043] Data bits Check digit Data payload Error correction capability BCH 5 10 1 / 3 5 / 15 Hamming 4 3 4 / 7 1 / 7 No Coding - - 1 0

[0044] Combined with Table 1 and Figure 3As can be seen, each encoding algorithm has different data payloads, error correction capabilities, and spatial redundancy ratios, resulting in different performance in different usage scenarios. Due to resolution limitations, the amount of redundancy available for hiding image information is limited. Therefore, at low resolutions, algorithms with less redundancy have a greater advantage. At high resolutions, algorithms with greater redundancy have greater stability due to their error correction capabilities and are less susceptible to information loss caused by image duplication, blurring, or attacks.

[0045] Repeated encoding refers to embedding the same watermark multiple times in non-overlapping areas of the image. This effectively solves the problem of frequent watermark extraction errors in certain special areas. BN (block number) is defined as the number of repeated encodings performed by the watermark algorithm at the current image resolution and encoding method.

[0046] Please refer to Figure 4 , Figure 4 The relationship between the error rate of the repeated coding BN and the hidden watermark algorithm is shown. Figure 4 In the figure, the curves from top to bottom represent the BER when BN=1, 2, 4, 6, 8, 10, 12, and 14 respectively. Figure 4 The horizontal axis is used to distinguish different cases and does not mean that there is a necessary order relationship between the cases.

[0047] Depend on Figure 4 It can be seen that when the image space allows, the more times the coding is repeated, the smaller the BER is. Therefore, in general, BN takes the maximum number of possible coding times to minimize the error.

[0048] Both repetition coding and error correction coding can improve the accuracy of watermark extraction, but the two inhibit each other. The stronger the error correction capability of error correction coding, the smaller the number of repetition coding. Based on the above understanding, we designed Figure 2 The embodiment shown.

[0049] Specifically, in one embodiment, based on the maximum number of repeated encodings, the step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error includes: simultaneously calculating the maximum number of repeated encodings of the input image corresponding to each of the at least two preset hidden watermark encoding algorithms; and selecting the hidden watermark encoding algorithm corresponding to the maximum number of repeated encodings that best meets the first preset condition.

[0050] The first preset condition can be set according to actual needs. For example, a weight is set for each preset hidden watermark coding algorithm based on error correction capability, and then the coding algorithm with the largest weighted maximum number of repeated coding times is selected.

[0051] In another embodiment, it is also possible to Figure 5The calculation process shown includes: first obtaining the resolution of the input image. Calculating the maximum number of repetition codes BN1 for the input image corresponding to the BCH algorithm; if the maximum number of repetition codes BN1 for the BCH algorithm is greater than a first threshold value T1, stopping subsequent calculations and selecting the BCH algorithm (subsequently executed according to step S30). If the maximum number of repetition codes BN1 for the BCH algorithm is less than or equal to the first threshold value T1, calculating the maximum number of repetition codes BN2 for the input image corresponding to the Hamming algorithm; if the maximum number of repetition codes BN2 for the Hamming algorithm is greater than a second threshold value T2, stopping subsequent calculations and selecting the Hamming algorithm (subsequently executed according to step S30). If the maximum number of repetition codes BN2 for the Hamming algorithm is less than or equal to the second threshold value T2, calculating the maximum number of repetition codes BN3 for the input image corresponding to the No Coding algorithm; if the maximum number of repetition codes BN3 for the No Coding algorithm is greater than a third threshold value, selecting the No Coding algorithm (subsequently executed according to step S30). If the maximum number of repeated codes BN3 corresponding to the No Coding algorithm is less than or equal to the third threshold, an error is reported and a prompt "watermark cannot be embedded" is output; or, the hidden watermark coding algorithm is selected based on other selection conditions.

[0052] The above T1 and T2 are based on the following logic settings. A first functional relationship between the accuracy of the BCH algorithm and the number of repeated coding is established, and the first threshold is determined based on the slope of the first functional relationship. When the number of repeated coding increases, the accuracy will always increase (corresponding to Figure 4 BER will always decrease. However, there is a cost-effectiveness issue. When the rate of increase in accuracy (i.e., the slope) slows down, the corresponding number of repetitions becomes less cost-effective. Therefore, the number of repetitions corresponding to the maximum slope can be selected as T1. Alternatively, an optimal cost-effectiveness evaluation function can be set, and after substituting the slope into the function, the number of repetitions with the maximum calculated value can be selected. The slope corresponding to the number of repetitions should be understood as the slope of the line segment connecting the current point and the previous point.

[0053] Based on the same idea, a second functional relationship between the accuracy of the Hamming algorithm and the number of repeated encodings is established, and the second threshold is determined based on the slope of the second functional relationship.

[0054] In one embodiment, the third threshold is 0 to maximize the adaptability of the hidden watermark writing algorithm. The third threshold may also be set to a value not equal to 0 to improve the accuracy of the algorithm.

[0055] The above embodiment can also be summarized as follows: based on the maximum number of repetitions, selecting one of the at least two preset hidden watermark coding algorithms or reporting an error includes: sequentially calculating the maximum number of repetitions for the input image corresponding to each of the at least two preset hidden watermark coding algorithms; if the maximum number of repetitions obtained in one calculation meets a second preset condition, terminating subsequent calculations and selecting the current hidden watermark coding algorithm; if the maximum number of repetitions obtained in each calculation does not meet the second preset condition, reporting an error or selecting the hidden watermark coding algorithm corresponding to the maximum number of repetitions that best meets a third preset condition. The concept of "best meets the third preset condition" can be understood with reference to the concept of "best meets the first preset condition."

[0056] In order to fully evaluate Figure 5 The accuracy of the embodiment shown is demonstrated. The decoded watermark data is divided into three resolutions and three output formats: Raw, BMP, and JPG. The comparison methods selected are the BCH algorithm, the Hamming algorithm, and the No Coding algorithm. It should be understood that the algorithm here includes the encoding method and the information writing algorithm. Even if the encoding method of the BCH algorithm is adopted in this embodiment, the information writing method and the BCH algorithm remain different, that is, repeated writing.

[0057] Evaluation results such as Figure 6 and Figure 7 As shown, Figure 6 In tabular form, Figure 7 In the form of a bar graph, Figure 7 From left to right, the test results are in RAW, BMP and JPG formats. Figure 6 and Figure 7 It can be seen that, compared with the three prior arts, this embodiment has the lowest BER under different test conditions.

[0058] On the other hand, the present embodiment and other prior arts are used to write a hidden watermark on a specific input image, and the effect obtained is as follows: Figure 8 As shown by Figure 8 It can be seen that after the image is written in this embodiment, the human eye cannot perceive the difference, and the difference between the image obtained after writing and other existing technologies is also imperceptible, so it meets the basic requirements of the hidden watermark writing method.

[0059] This embodiment also provides a readable storage medium, which stores a program. When the program is executed, it executes the above-mentioned hidden watermark writing method. Since the program on the readable storage medium can execute the above-mentioned hidden watermark writing method, it can also solve the problems existing in the prior art.

[0060] In summary, this embodiment provides a hidden watermark writing method and a readable storage medium. The hidden watermark writing method calculates the maximum number of repetitions using at least two preset hidden watermark encoding algorithms, and uses this to determine whether to select the appropriate hidden watermark encoding algorithm or report an error. If no error is reported, the method writes the maximum number of repetitions corresponding to the selected hidden watermark encoding algorithm to the input image to generate an output image with a hidden watermark. This configuration, by selecting the appropriate encoding algorithm and repeating the algorithm the appropriate number of times, takes into account both high-resolution and low-resolution input images, combining the advantages of repetition encoding and error correction encoding, resulting in a high accuracy watermark extraction result for both high-resolution and low-resolution images, thus resolving the problems existing in the prior art.

[0061] The above description is only a description of the preferred embodiment of the present invention and does not limit the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure are within the scope of protection of the technical solution of the present invention.

Claims

1. A hidden watermark writing method, characterized in that: The hidden watermark writing method comprises the following steps: Get the input image to which the hidden watermark is to be added; Based on the maximum number of repeated encoding times, select one of at least two preset hidden watermark encoding algorithms or report an error; If no error is reported, writing the corresponding maximum number of repeated encoding times to the input image based on the selected hidden watermark encoding algorithm to generate an output image with the hidden watermark added; The ratios of data length to check code length in at least two preset hidden watermark encoding algorithms are different.

2. The hidden watermark writing method according to claim 1, characterized in that: The step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error based on the maximum number of repeated encoding times includes: Simultaneously calculating the maximum number of repetitive encoding times of the input image corresponding to each of at least two preset hidden watermark encoding algorithms; The hidden watermark encoding algorithm corresponding to the maximum number of repeated encodings that best meets the first preset condition is selected.

3. The hidden watermark writing method according to claim 1, characterized in that: The step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error based on the maximum number of repeated encoding times includes: sequentially calculating the maximum number of repetitive encoding times of the input image corresponding to each of at least two preset hidden watermark encoding algorithms; If the maximum number of repeated encodings obtained from one of the calculations meets the second preset condition, then subsequent calculations are stopped and the current hidden watermark encoding algorithm is selected; If the maximum number of repeated encodings calculated each time does not meet the second preset condition, an error is reported or the hidden watermark encoding algorithm corresponding to the maximum number of repeated encodings that best meets the third preset condition is selected.

4. The hidden watermark writing method according to claim 1, wherein: The at least two preset hidden watermark encoding algorithms include a BCH algorithm, a Hamming algorithm and a No Coding algorithm, wherein the No Coding algorithm refers to an algorithm that adds the watermark data to be added into the input image without making any changes.

5. The hidden watermark writing method according to claim 3, characterized in that: The at least two preset hidden watermark encoding algorithms are a BCH algorithm, a Hamming algorithm, and a No Coding algorithm, wherein the No Coding algorithm refers to an algorithm that adds the watermark data to be added to the input image without any modification. Based on the maximum number of repeated encodings, the step of selecting one of the at least two preset hidden watermark encoding algorithms or reporting an error includes: Calculate the maximum number of repetition encoding times of the input image corresponding to the BCH algorithm; If the maximum number of repeated codes corresponding to the BCH algorithm is greater than the first threshold, stop subsequent calculations and select the BCH algorithm; If the maximum number of repetition encodings corresponding to the BCH algorithm is less than or equal to the first threshold, calculating the maximum number of repetition encodings corresponding to the Hamming algorithm for the input image; If the maximum number of repeated encodings corresponding to the Hamming algorithm is greater than the second threshold, stop subsequent calculations and select the Hamming algorithm; If the maximum number of repeated encodings corresponding to the Hamming algorithm is less than or equal to the second threshold, calculating the maximum number of repeated encodings corresponding to the No Coding algorithm for the input image; If the maximum number of repeated encodings corresponding to the No Coding algorithm is greater than a third threshold, the No Coding algorithm is selected.

6. The hidden watermark writing method according to claim 5, characterized in that: Based on the maximum number of repeated encoding times, the step of selecting one of at least two preset hidden watermark encoding algorithms or reporting an error further includes: If the maximum number of repeated encodings corresponding to the No Coding algorithm is less than or equal to the third threshold, an error is reported.

7. The hidden watermark writing method according to claim 5, characterized in that: Establish a first functional relationship between the accuracy of the BCH algorithm and the number of repeated encodings, and determine the first threshold based on the slope of the first functional relationship; establish a second functional relationship between the accuracy of the Hamming algorithm and the number of repeated encodings, and determine the second threshold based on the slope of the second functional relationship.

8. The hidden watermark writing method according to claim 5 or 6, characterized in that: The third threshold is 0.

9. The hidden watermark writing method according to claim 2, characterized in that: The step of calculating the maximum number of repeated encoding times includes: calculating the maximum number of repeated encoding times based on the resolution of the input image.

10. A readable storage medium, characterized in that: The readable storage medium stores a program, and when the program is run on a processor, the hidden watermark writing method according to any one of claims 1 to 9 is executed.

Citation Information

Patent Citations

  • Device for detecting digital watermark

    CN101282469A

  • Double-effect digital watermarking method

    CN101923700A