Screen shooting scene-oriented anchor point synchronization fountain code anti-cutting text watermarking method

By constructing a watermark architecture consisting of a character instance-level embedding carrier layer, an anchor point synchronization positioning layer, and a fountain code data block recovery layer, the problem of missing watermark information caused by partial cropping in screen capture scenarios is solved, and reliable recovery of watermark information is achieved.

CN121860835AActive Publication Date: 2026-04-14NANJING UNIV OF INFORMATION SCI & TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING UNIV OF INFORMATION SCI & TECH
Filing Date
2026-03-16
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing digital watermarking technologies face the problem of structural loss of watermark information along with the embedded carrier due to partial cropping in screen capture scenarios, making reliable recovery difficult.

Method used

A three-layer watermarking architecture is adopted, consisting of a character instance-level embedding carrier layer, an anchor point synchronization positioning layer, and a fountain code data block recovery layer. The character instance-level embedding carrier layer uses a single character as the smallest unit, introduces an anchor point synchronization positioning mechanism, and employs a fountain code data block redundant encoding and unordered recovery mechanism to achieve stable positioning and recovery of watermark information.

Benefits of technology

Under conditions of screen capture degradation and partial cropping, the watermark information can be reliably recovered, improving the watermark reconstruction capability under conditions of partially embedded information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121860835A_ABST
    Figure CN121860835A_ABST
Patent Text Reader

Abstract

The invention discloses an anchor point synchronous fountain code anti-cutting text watermarking method for a screen shooting scene, and the method specifically comprises the steps: character instance extraction and carrier construction, watermark load construction and blocking, data block generation and in-block error correction, anchor point period mapping and character instance level embedding, screen shooting and cutting attack, watermark extraction and anchor point synchronous cutting. And carrying out data block screening, two-stage fountain recovery and global verification output. According to the invention, reliable recovery of watermark information under the condition of screen camera degradation and local cutting superposition can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital image processing and security technology, and particularly relates to an anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios. Background Technology

[0002] With the widespread dissemination of digital content in online environments and on mobile terminals, digital images have become an important carrier for information storage and transmission. To achieve copyright protection, source traceability, and integrity authentication of digital content, digital watermarking technology, as an important branch of information hiding technology, has received widespread attention. Digital watermarking protects digital content by embedding specific information into digital carriers such as images without significantly affecting visual quality. It has advantages such as concealed embedding, flexible implementation, and low communication overhead, and is therefore widely used in scenarios involving natural images, multimedia content, and document images.

[0003] Traditional robust image watermarking methods are primarily designed for natural images. They typically select appropriate frequency bands in the transform domain (such as discrete cosine transform and discrete wavelet transform) for watermark embedding to improve the watermark's robustness against compression, noise, and other conventional signal processing operations. Related research has systematically summarized robust watermarking embedding strategies, attack models, and performance evaluation methods, constructing a relatively mature theoretical framework. However, these methods generally use the entire image or fixed-size image blocks as embedding and detection units, assuming that the image has good spatial integrity during propagation. When the image undergoes geometric operations such as cropping or scaling, the spatial synchronization relationship of the watermark signal is easily disrupted, leading to difficulty in correct watermark extraction or even complete failure. These methods are structurally highly dependent on the complete existence of the embedding region; once the embedding region is destroyed or removed, the correspondence of the watermark information is difficult to maintain.

[0004] To address geometric attacks such as cropping and scaling, previous research has attempted to enhance watermark robustness by introducing geometrically invariant features or synchronization mechanisms. Related work shows that in practical applications, cropping often occurs simultaneously with scaling operations, forming a compound geometric attack, which places higher demands on the synchronization and recovery capabilities of watermarking systems. However, existing methods mostly focus on maintaining geometric correspondences and spatial synchronization structures, and typically lack systematic recovery mechanisms for the structural loss of the embedded carrier caused by cropping. When the embedded region carrying watermark information is completely removed, even if the remaining image content still exists, it is still difficult to achieve structured reconstruction and reliable recovery of the watermark information from the residual content.

[0005] In recent years, with the popularization of mobile terminals and display devices, the dissemination of digital images has gradually shifted from pure digital transmission to a screen capture dissemination mode of "screen display - camera shooting". Unlike traditional digital domain processing, screen capture introduces complex degradations such as perspective distortion, non-uniform lighting, display and imaging link noise, and resampling. Furthermore, in practical use, it often involves operations such as local cropping and screen rearrangement. For this type of scenario, existing research has proposed anti-screen capture watermarking techniques, attempting to maintain the detectability of watermarks under screen capture conditions. The aforementioned research shows that the robustness of watermarks under screen capture environments has independent research value; however, most related methods are still based on whole-image or region-level embedding strategies, which are highly dependent on the overall structure of the image content. When large-scale cropping or region removal occurs, the watermark information is still difficult to recover due to the loss of the embedding carrier.

[0006] In the field of document and text image technologies, some research has begun to apply watermarking techniques to document pages or text content, and has introduced deep learning methods to enhance adaptability to complex distortions. These methods reflect the trend of document image watermarking evolving from traditional rule-based design to learning-based methods, improving robustness against screen capture degradation to some extent. However, existing document image watermarking methods mostly use the entire page or local areas as the embedding object, focusing primarily on resisting screen capture or general geometric transformations. They lack specialized structured modeling and recovery mechanisms to address the problem of discrepancies in embedding units caused by cropping. Therefore, an effective technical solution has not yet been developed to achieve structured reconstruction of watermark information from residual content under the combined conditions of screen capture degradation and cropping attacks.

[0007] Furthermore, recent deep learning-based watermarking and information hiding methods have improved the robustness of watermarks under complex distortion conditions through learnable encoder and decoder structures, adversarial training, or noise modeling. While these methods have made some progress in natural images and screen capture scenarios, most still use whole images or fixed blocks as embedding carriers, relying primarily on model robustness to resist distortion interference. They do not systematically model or design recovery mechanisms to address the problem of missing embedding units caused by cropping at the structural and coding levels. When the cropping ratio is large, relying solely on model robustness is often insufficient to guarantee the complete recovery of watermark information.

[0008] In summary, while existing digital watermarking technologies have seen considerable research in areas such as natural image watermarking, anti-screen capture watermarking, and document image watermarking, a common problem remains: in practical applications where text images are displayed on a screen, captured by a camera, and then partially cropped, the watermark information is often irrecoverable due to structural defects in the embedded carrier. Current methods generally lack watermark encoding and structured recovery mechanisms tailored to discrete carrier structures, making it difficult to reliably reconstruct watermark content while retaining only partial embedded information. Therefore, there is an urgent need for a digital image watermarking technology that can reliably recover watermark information from the remaining content even when the embedded carrier is partially missing, based on structured encoding and error correction recovery mechanisms, to meet the higher robustness and reliability requirements of practical applications. Summary of the Invention

[0009] Purpose of the invention: In order to solve the problems existing in the prior art, the present invention provides an anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios.

[0010] Technical Solution: This invention provides an anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios, specifically including:

[0011] Watermark embedding stage:

[0012] The input text image is preprocessed and the text region is filtered to retain the valid text region containing character content. The valid text region is then subjected to character-level recognition and structured analysis to obtain the location box of the character instance and organize and number it according to the text line.

[0013] A watermark bit sequence is generated as the payload, and a global verification field is introduced into the watermark bit sequence;

[0014] The global sequence of payloads, consisting of the payload and the global check field, is divided into multiple source blocks of the same length.

[0015] Each line of text is assigned an independent deterministic seed. The source block is then encoded in an unordered and redundant manner based on the deterministic seed to generate a data block. In the unordered and redundant encoding, intra-block error correction encoding is introduced to further encode each data block into a region block.

[0016] The region block is split into bit blocks, each bit block is of equal length, and the bit block is embedded in each character instance. An anchor point is written after every B region blocks, and the structure consisting of B region blocks and one anchor point is a periodic structure.

[0017] Watermark extraction stage:

[0018] For text images displayed on a screen, captured by a camera, or potentially partially cropped, locate the regions containing character instances and organize and number them by line.

[0019] Extract the bit blocks from each character instance to obtain the bit sequence of each line, and number each bit in the bit sequence starting from zero; introduce a synchronizer to enumerate the candidate left crop bit amounts crop_bits;

[0020] Anchor points are extracted based on each candidate crop_bits, and the matching cost of each anchor point is calculated; region blocks are extracted based on each candidate crop_bits, and the cost of the region blocks is evaluated.

[0021] The optimal left clipping amount for each row is selected based on the matching cost and cost evaluation results;

[0022] Watermark information is extracted based on the optimal left cropping amount.

[0023] Furthermore, a fountain coding method is used to perform unordered redundant encoding on the source block, and an independent deterministic seed is set for each line of text, specifically:

[0024] seed = row × 100000 + t_local;

[0025] Where row is the row number and t_local is the block number of the region within the row; the index and degree of the source block that constitutes the data block are determined based on the deterministic seed.

[0026] Furthermore, the method also includes introducing a line-end redundancy writing strategy during the watermark embedding stage: for any line of text, without writing new anchor points, the remaining space at the end of the line is covered by real region blocks.

[0027] Furthermore, the region block is split into 1 bit.

[0028] Furthermore, the enumeration of candidate left cropping values ​​(crop_bits) is as follows: candidate crop_bits are sequentially selected from 0 to max_crop_bits; when crop_bits=0, it represents the ideal no-crop case; when crop_bits=1, it represents a left cropping of 1 bit, and max_crop_bits represents the preset maximum left cropping value, where max_crop_bits<L, and L is the length of the bit sequence.

[0029] Furthermore, for each cycle existing within a row, they are sequentially numbered starting from zero, and anchor points are extracted based on each candidate crop_bits, specifically as follows:

[0030] For any candidate crop_bits, when extracting the i-th anchor bit_i from the row bit sequence according to the periodic structure, the anchor bit should satisfy the following condition:

[0031] 0 ≤obs_a_i and obs_a_i + anchor_len≤L;

[0032] Where obs_a_i is the starting point of the i-th anchor point, anchor_len is the length of the anchor point, and L is the length of a row of bit sequences;

[0033] bits_i = row_bits[obs_a_i : obs_a_i + anchor_len];

[0034] Where row_bits is the bitstream extraction function, and the expression for obs_a_i is as follows:

[0035] obs_a_i= orig_a_i - crop_bits;

[0036] Where orig_a_i is the starting point of the i-th anchor point in the ideal no-clipping case, and the expression for orig_a_i is as follows:

[0037] orig_a_i= cycle_idx × cycle_len + B×block_len;

[0038] Where cycle_idx is the cycle number corresponding to the i-th anchor point, cycle_len is the length of the cycle, and block_len is the length of the block.

[0039] The specific steps for calculating the matching cost of anchor points are as follows:

[0040] For any candidate crop_bits, perform soft decoding on the i-th anchor point to determine the Hamming distance between different bits in the i-th anchor point; and determine the matching cost of the i-th anchor point under the candidate crop_bits according to the following three cases:

[0041] Case 1: If a unique and minimum Hamming distance `dist` can be determined, and `dist` is less than or equal to a preset threshold, then the anchor count is incremented by 1, and the matching cost of the i-th anchor is calculated according to the following formula:

[0042] cost = anchor_cost_for_dist(dist);

[0043] Among them, anchor_cost_for_dist is the Hamming distance cost function, which is used to calculate different Hamming distance costs based on the value of dist. The larger the dist, the larger the Hamming distance cost.

[0044] Case 2: If dist is less than or equal to the preset threshold, but there are multiple consecutive minimum Hamming distances dist, then the anchor count is incremented by 1, and the matching cost of the i-th anchor is calculated according to the following formula:

[0045] cost = anchor_cost_for_dist(dist)+ cost_anchor_ambiguous;

[0046] Where cost_anchor_ambiguous is the preset ambiguity penalty value;

[0047] Case 3: If dist is greater than the preset threshold, the matching cost of the i-th anchor point is calculated according to the following formula:

[0048] cost = cost_anchor_miss;

[0049] Where cost_anchor_miss is the preset miss penalty value, and cost_anchor_miss > cost_anchor_ambiguous;

[0050] The matching costs of all anchors under a candidate crop_bits are summed to obtain the anchor matching cost of that candidate crop_bits.

[0051] Furthermore, region blocks are extracted based on each candidate crop_bits, specifically as follows:

[0052] When the synchronizer extracts the bi-th region block in cycle_jdx, the bi-th region block should meet the following conditions:

[0053] obs_start_bi ≥ 0 and obs_start_bi + block_len ≤L;

[0054] Where, obs_start_bi is the starting point of the bi-th region block;

[0055] bitsblock = row_bits[obs_start_bi : obs_start_bi + block_len];

[0056] Where bitsblock is the extracted region block, bi = 0, 1, ..., B-1; the expression for obs_start_bi is:

[0057] obs_start_bi= orig_start_ bi - crop_bits;

[0058] Where, orig_start_bi is the starting point of the bi-th region block in the ideal no-clipping scenario:

[0059] orig_start_ bi = cycle_jdx * cycle_len + bi * block_len;

[0060] The cost assessment for the block is as follows:

[0061] Perform intra-block error correction on the bi-th region:

[0062] Scenario 1: If no correction is needed and the process proceeds directly, the number of blocks is incremented by 1, and the cost_block of the bi-th block is calculated according to the following formula:

[0063] cost_block=reward_block_clean;

[0064] Where reward_block_clean is the reward value corresponding to the preset case one;

[0065] Scenario 2: If correction is required and the correction is successful, the number of blocks is incremented by 1, and the cost value (cost_block) of the bi-th block is calculated according to the following formula:

[0066] cost_block = cost_block_corrected;

[0067] Where cost_block_corrected is the reward value corresponding to the preset case two;

[0068] Scenario 3: If it cannot be corrected, then calculate the cost_block of the bi-th region block according to the following formula:

[0069] cost_block = cost_block_uncorrectable;

[0070] Where cost_block_uncorrectable is the penalty value corresponding to the preset case three;

[0071] The sum of the values ​​of all regions in any candidate crop_bits is used as the region block value of that candidate crop_bits.

[0072] Furthermore, the optimal left cropping amount for each row is selected by adding the anchor matching cost and the region block cost of the candidate crop_bits.

[0073] If there exists a unique minimum sum value, select the candidate crop_bits corresponding to the minimum sum value as the optimal left crop amount;

[0074] If the minimum sum value is not unique, then the candidate crop_bits with the largest number of anchor blocks among the minimum sum values ​​is selected as the optimal left clipping amount;

[0075] If the maximum number of anchor blocks in the minimum sum value is not unique, first filter out the candidate crop_bits with the minimum sum value and the maximum number of anchor blocks, and select the candidate crop_bits with the maximum number of region blocks from the filtered candidate crop_bits as the optimal left clipping amount.

[0076] If the maximum number of anchor blocks and the maximum number of data blocks among the minimum sum values ​​are not unique, then first filter out the candidate crop_bits with the minimum sum value, the maximum number of anchor blocks and the maximum number of data blocks, and select the candidate crop_bits with the smallest value from the filtered candidate crop_bits as the optimal left crop amount.

[0077] Furthermore, the watermark extraction based on the optimal left cropping amount is specifically as follows:

[0078] After determining the optimal left pruning amount for each row of bit sequence, the region blocks of each row are obtained, forming a set of region blocks. Intra-block error correction is performed on the region blocks. Uncorrectable region blocks are discarded directly. For region blocks that need correction and pass after correction, their corresponding data blocks are output. The set of these data blocks is denoted as corrected. For region blocks that do not need correction, their corresponding data blocks are output. The set of these data blocks is denoted as clean.

[0079] First, the corresponding source block is recovered using the data blocks in the clean set. The source blocks are then concatenated to obtain the global load sequence. The global load sequence is then globally validated. If the validation passes, a watermark is output. Otherwise, the data blocks in the corrected set are added to the clean set. The source block is recovered again, and the source blocks are concatenated to obtain the global load sequence. The global load sequence is then globally validated. If the validation passes, a watermark is output. Otherwise, extraction failure is output.

[0080] A computer device includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to implement the steps of the anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios.

[0081] Beneficial effects: This invention constructs a watermark embedding and extraction mechanism with character instances as the smallest embedding carrier unit, enabling watermark information to be distributed in the text image in the form of single-character bits. Simultaneously, this invention introduces an anchor point synchronization positioning mechanism to achieve stable positioning and alignment of the watermark bit stream under conditions of bit sequence errors, misalignments, and missing bits caused by screen capture degradation and cropping. Furthermore, it employs a fountain code data block redundancy encoding and unordered recovery mechanism to organize and reconstruct the watermark information, allowing the original watermark content to be recovered through iterative decoding even when only a portion of the valid data blocks are obtained. This achieves reliable recovery of watermark information under conditions of screen capture degradation and local cropping. Attached Figure Description

[0082] Figure 1 This is a flowchart of the present invention. Detailed Implementation

[0083] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0084] In the actual transmission of text and document images, image content is often transmitted across devices via screen display and camera capture, forming a typical "screen display—camera capture" transmission link. This transmission link introduces imaging degradation such as perspective distortion, non-uniform lighting, noise, blurring, and resampling, leading to a decrease in the reliability of watermark bit extraction. Furthermore, in practical applications, screen capture images are often accompanied by operations such as partial cropping, screen rearrangement, and region cropping, causing structural defects in the text area where the watermark is embedded, further disrupting the spatial correspondence and synchronization structure of the watermark data.

[0085] Existing text image watermarking methods mostly use whole images or fixed regions / blocks as embedding and detection units, typically relying on the spatial integrity of the embedding region to maintain synchronization and data organization. Even when using a distributed embedding strategy, they often lack a structured recovery mechanism to address the issue of "cropping leading to the loss of a large number of embedding units." When screen capture degradation and local cropping occur, the watermark bit sequence is prone to misalignment, loss, and the introduction of errors, making it difficult for the decoding end to stably complete group boundary positioning and effective data filtering. Consequently, it becomes impossible to reconstruct the complete watermark content while retaining only a portion of the embedded information.

[0086] To address the aforementioned technical issues, this invention proposes an anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios. The overall scheme is as follows: This invention constructs a three-layer watermarking architecture consisting of a "character instance-level embedding carrier layer + anchor point synchronization positioning layer + fountain code data block recovery layer." The character instance-level embedding carrier layer uses a single character instance as the smallest physical carrier unit, with each character instance containing a watermark bit (one bit embedded in this embodiment). This allows the watermark information to be distributed and covered in the text content area in a fine-grained manner, thereby improving the probability of remaining watermarks under screen capture degradation and cropping conditions. The anchor point synchronization positioning layer periodically inserts anchor points into the line-level bitstream and determines the in-line alignment offset at the decoding end through a soft matching and cost scoring mechanism, achieving stable correction and block positioning of the overall displacement misalignment introduced by cropping. The fountain code data block recovery layer organizes the original watermark into source blocks, generates unordered data blocks, and performs intra-block error correction encoding. Even if the decoding end only obtains a portion of the valid data blocks, it can still recover the source blocks and reconstruct the original watermark through the iterative solution mechanism of the fountain code, achieving the goal of recovering even when the carrier is partially missing.

[0087] like Figure 1 As shown, the specific process of this invention is as follows: character instance extraction and carrier construction, watermark payload construction and segmentation, fountain code data block generation and intra-block error correction, anchor point periodic mapping and character instance-level embedding, screen capture and cropping attacks, watermark extraction and anchor point synchronous segmentation, data block filtering and two-stage fountain recovery, and global verification output.

[0088] Watermark payload construction, global verification, and source block partitioning:

[0089] Before embedding, an original watermark bit sequence is generated as the payload, and a global check field is introduced as the final success criterion to reduce the probability of misjudgment under complex noise conditions. In this embodiment, the original watermark length can be set to 32 bits, and a 16-bit CRC (Cyclic Redundancy Check) check is added to form a 48-bit global bit sequence of the payload to be encoded. This global CRC is used to verify the consistency of the finally recovered bit sequence at the decoding end, so that the system can reliably reject erroneous results in the presence of erroneous equations, erroneous synchronization, or accidental solvable but incorrect results.

[0090] The global bit sequence of the payload is divided into multiple source blocks with a fixed symbol width. In one implementation, the symbol width is 4-bit binary data units (nibble), so 48 bits can be divided into 12 source blocks; the set of source blocks constitutes the message symbol sequence of the fountain code, providing the basis for the subsequent generation and recovery of unordered data blocks.

[0091] Fountain code data block generation mechanism and intra-block error correction coding

[0092] This invention employs the concept of Fountain Code to perform unordered redundant encoding of source blocks. The basic principle of Fountain Code is that the encoding end continuously generates data blocks, and each data block is formed by bitwise combination of several source blocks (in this embodiment, bitwise XOR is used as the sign operation), thereby forming an equation.

[0093] Once the receiving end has collected enough independent equations, all source blocks can be recovered through iterative elimination or stripping decoding. This mechanism is naturally suited for scenarios with missing data blocks because decoding does not depend on the order or continuity of data blocks; recovery can be completed as long as a sufficient number of valid data blocks are retained in the remaining content.

[0094] To ensure that the encoding end and the decoding end (receiving end) can still reproduce the equation structure of the same data block under disordered conditions, this invention introduces a deterministic seed for each data block, which determines the set of source block indices and their degrees that participate in combining the data block.

[0095] The degree refers to the number of source blocks that make up a data block. degree=1 means that the data block comes from only 1 source block; degree=2 means that it comes from the XOR of 2 source blocks; degree=3 means that it comes from the XOR of 3 source blocks.

[0096] The function of degrees is mainly twofold:

[0097] First, the degree determines the sparsity of the fountain equations, thus affecting the initiation and speed of stripping decoding. An equation with degree=1 is equivalent to directly obtaining the value of a source block, which can be used as the starting point for stripping decoding. After solving a source block, it can be substituted into other equations and stripped step by step, thereby chaining the recovery process forward.

[0098] Second, the degree needs to be balanced between recovery success rate and coding efficiency / complexity. Too low a degree may require more data blocks to provide sufficient information; too high a degree involves too many variables in each equation, making decryption difficult to initiate or prone to stalling. Therefore, in engineering practice, a fixed degree is usually not used; instead, a degree is randomly selected according to a predetermined probability distribution to achieve better overall solvability.

[0099] In this embodiment, the degree is sampled according to a preset distribution. For example, the probabilities of degree=1, 2, and 3 are 0.50, 0.35, and 0.15, respectively, thus balancing decoding startup efficiency and overall redundancy efficiency. When the equation with degree=1 exists, it can significantly promote the startup and progress of stripping decoding and reduce the probability of decoding stall. For scenarios that require further improvement in decodability, fountain codes can also be equipped with systematic strategies, such as forcing some seeds to generate equations with degree=1, to improve recoverability under conditions of low effective block count.

[0100] Considering that the bits obtained from single-character decoding may still have flipping errors under screen capture noise, this invention introduces intra-block error correction coding (Block ECC) into the fountain code data block. This further encodes the symbol value of each data block into a fixed-length region block to obtain single-block self-correction / erasability determination capability. In this embodiment, the data block symbol is a 4-bit nibble, encoded into an 8-bit region block using extended Hamming code. After error correction decoding of each 8-bit block, the decoding end outputs three types of determination results: first, usable and requiring no error correction (clean); second, usable but having undergone single-bit correction (corrected); and third, uncorrectable. Uncorrectable data blocks are directly erased and discarded, not entering any fountain equation set, thus avoiding erroneous equations from contaminating the subsequent solution process.

[0101] Anchor point synchronization structure, periodic layout and inline mapping method

[0102] To address the issues of overall misalignment of the intra-line bitstream and difficulty in locating group boundaries caused by pruning, this invention designs an anchor synchronization structure and employs a fixed-beat periodic layout to map "region blocks + anchor points" to the character instance sequence within the text line. This enables the decoding end to stably lock the alignment offset through anchor soft matching and cut blocks accordingly.

[0103] In one implementation, text is written at a fixed period within each line of text, with the period structure being "block × B + Anchor". Here, B represents the number of consecutive blocks preceding each anchor point; for example, B=2. In this embodiment, the anchor point length is 7 bits, so the period length is 2×8+7=23 bits. The anchor point is located in a fixed slot within the period, following the preceding B blocks, thus providing a stable period boundary signal for the decoding end. This fixed-slot anchor point structure transforms the synchronization localization problem into a solvable problem of enumerating possible left-clipping offsets and performing matching scoring at the anchor point slot.

[0104] Anchor point encoding employs short codes with a large code distance to improve detectability under noisy conditions and reduce the probability of false triggering. In one embodiment, the anchor points use a simplex code family (7,3,4) (a total of 8 codewords, with a minimum Hamming distance of not less than 4) to represent phase information from 0 to 7. The encoder maps the phase to 7 anchor bits and writes them in. Because this code family has a large code distance, the decoder can use the minimum Hamming distance for soft decision-making: the smaller the distance, the more reliable the match; the larger the distance, the less reliable the match. Furthermore, if necessary, anchor point matches with large distances can be considered missing or false matches and penalized more severely, thereby improving the robustness of alignment selection.

[0105] To reduce the risk of incorrect block cutting caused by residual space at the end of the line, this invention can also introduce a redundant writing strategy at the end of the line: without writing new anchor points, use real region blocks to cover the remaining space at the end of the line (e.g., write up to B-1 region blocks), to avoid the default padding value at the end of the line (e.g., all 0s) being misidentified as a valid data block at the decoding end, thereby reducing the sources of error equations and improving recovery stability from a probabilistic perspective.

[0106] Character instance-level carrier construction and embedding implementation steps

[0107] At the embedding end, this invention first preprocesses and filters the input text image, removing non-text areas such as illustrations and backgrounds, retaining only valid text areas containing character content. Subsequently, character-level OCR recognition and structured analysis are performed on the valid text areas to obtain a set of bounding boxes for character instances, which are then organized and numbered line-wise according to the text lines. To ensure embedding stability, character instances that are too small, too simple in structure, or have blurred edges, making them unsuitable for stable embedding (such as punctuation marks and special symbols), can be removed to improve the reliability of single-character bit embedding and extraction.

[0108] After completing the carrier construction, this invention performs watermark payload construction and source block partitioning, and generates fountain code data blocks based on deterministic seeds. To facilitate the reproduction of the equation structure at the decoding end, this embodiment constructs a seed independently for each row. The seed can be composed of "row number row and block number t_local within the row", for example, using the construction method of seed = row × 100000 + t_local. After each data block is generated, its symbol value is encoded with intra-block error correction to obtain an 8-bit region block, which is then written sequentially into the character instance sequence corresponding to the row according to a periodic structure. At the end of each cycle, 7 phase anchor bits are written to the anchor point, so that the row forms a beat structure of "data block - anchor point - data block - anchor point".

[0109] In the single-character embedding process, this invention adopts a deep learning watermark embedding model with screen capture robustness for each character instance region. The bits to be written are embedded into the character instance by micro-perturbation and feature modulation of the character edge structure and local texture, ensuring text readability and overall visual quality, while also ensuring that the embedded bits still have high decodeability under screen capture degradation conditions.

[0110] Decoding implementation steps: single character decoding, anchor point synchronous block segmentation, data block filtering, and two-stage fountain recovery.

[0111] At the decoding end, this invention, for text images that have been displayed on a screen, captured by a camera, and may have undergone partial cropping, first performs the same preprocessing and character-level OCR (Optical Character Recognition) structuring process as at the embedding end, locating the remaining character instance regions and organizing them line by line. Then, for each character instance region, a pre-trained deep learning watermark decoding model is used to output the corresponding bit (one bit in this embodiment), thus obtaining the bit sequence (lines_bits) for each line, which serves as the input for subsequent synchronous localization and segmentation.

[0112] To address the overall misalignment within a row caused by cropping, this invention introduces an anchor synchronizer to independently estimate the alignment of each row's bit sequence. The synchronizer enumerates candidate left cropping amounts (crop_bits) and, for each candidate crop_bit, extracts a 7-bit anchor at the expected anchor slot based on the periodic structure for anchor soft decoding, obtaining the minimum Hamming distance (dist). Based on this, the anchor matching cost is accumulated, specifically as follows:

[0113] The candidate crop_bits takes values ​​from 0 to max_crop_bits. When crop_bits=0, it represents the ideal case of no cropping. When crop_bits=1, it represents the left cropping amount of 1 bit. max_crop_bits represents the preset maximum left cropping amount. max_crop_bits<L, where L is the length of a row of bit sequences.

[0114] For any candidate crop_bits, extract 7 anchor bits:

[0115] Number the existing cycles within the row starting from zero;

[0116] For any row of bit sequences, in the ideal, unpruned case, the starting point of the i-th anchor point with period number cycle_idx should be:

[0117] orig_a_i = cycle_idx ×cycle_len + anchor_slot;

[0118] Where cycle_len represents the cycle length, cycle_len = B × block_len + anchor_len, where block_len is the length of the region block and anchor_len is the length of the anchor point; anchor_slot = B × block_len.

[0119] Considering the cropping misalignment is crop_bits, the starting point of the i-th anchor point with cycle_idx should be:

[0120] obs_a_i= orig_a_i - crop_bits;

[0121] The i-th 7-bit anchor bit_i is extracted only if the window is completely within the visible area (when 0 ≤ obs_a_i and obs_a_i + anchor_len ≤ L):

[0122] bits_i = row_bits[obs_a_i : obs_a_i + anchor_len];

[0123] Where L is the length of a row of bit sequences. row_bits is the function for extracting the bit stream.

[0124] Calculate the anchor matching cost:

[0125] The anchor point matching cost is derived from the minimum Hamming distance (dist) of the anchor point soft decoding plus the ambiguity level, then mapped to a fractional cost and accumulated into the total cost of the candidate crop_bits. The steps are detailed below:

[0126] Step 1: Soft decoding of anchor points to obtain dist and ambiguous: Soft decode the extracted bits_i, outputting:

[0127] dist: The smallest Hamming distance (0 / 1 / 2 / 3..., the smaller the distance, the more reliable) between the 7-bit anchor point and the closest codeword in the anchor point codebook.

[0128] ambiguous: Whether there are situations such as "limited distances being tied" that make it impossible to uniquely determine the minimum Hamming distance.

[0129] Step 2: Apply a soft acceptance threshold to the minimum Hamming distance of dist: if dist ≤ anchor_soft_max_dist (default 3), it is considered a soft hit, where anchor_soft_max_dist is the preset threshold; otherwise, it is considered a miss.

[0130] Step 3: Hierarchical cost mapping and accumulation:

[0131] When a soft hit occurs,

[0132] 1) Increment the anchor point count by 1;

[0133] 2) If ambiguous = False (i.e., there exists a unique minimum dist), the cost of matching the anchor point is:

[0134] cost = anchor_cost_for_dist(dist);

[0135] Among them, anchor_cost_for_dist is the Hamming distance cost function, which is used to calculate different Hamming distance costs based on the value of dist. The larger the dist, the larger the Hamming distance cost.

[0136] anchor_cost_for_dist(dist=0) → -6 (reward);

[0137] anchor_cost_for_dist(dist=1) → 0;

[0138] anchor_cost_for_dist(dist=2) → 6;

[0139] anchor_cost_for_dist(dist=3) → 12.

[0140] 3) If ambiguous = True (i.e., there exists a case where the minimum dist is not unique), and an ambiguity penalty is added, then the expression for the entire cost becomes:

[0141] cost = anchor_cost_for_dist(dist)+ cost_anchor_ambiguous (default 15);

[0142] Here, cost_anchor_ambiguous is the preset ambiguity penalty value.

[0143] When a player misses: A penalty of "miss" is added directly.

[0144] cost = cost_anchor_miss;

[0145] Wherein, cost_anchor_miss is a preset miss penalty value, which is 30 in this embodiment.

[0146] The matching cost of anchor points in a row of bit sequences under a candidate crop_bits is accumulated to obtain the matching cost of that row of bit sequences.

[0147] Simultaneously, the synchronizer extracts an 8-bit region block at the expected data block slot and performs error correction prediction. Based on the error correction result, it evaluates the region block cost of the candidate crop_bits:

[0148] For each candidate crop_bits, the synchronizer extracts an 8-bit window for each region block slot in each cycle, first runs an intra-block error correction decoding prediction, and obtains the cost of the region block.

[0149] Window extraction

[0150] First, calculate the starting point of the bi-th region block (bi=0..B-1) with cycle_idx in an ideal case:

[0151] orig_start_ bi = cycle_jdx * cycle_len + bi * block_len;

[0152] Consider the observation starting point after crop_bits are misaligned:

[0153] obs_start_bi= orig_start_ bi - crop_bits;

[0154] The window corresponding to the 8-bit region block is extracted only if the window falls entirely within the visible area (when obs_start_bi ≥ 0 and obs_start_bi + block_len ≤ L).

[0155] bitsblock = row_bits[obs_start_bi : obs_start_bi + block_len];

[0156] Where block_len is the length of the region block.

[0157] Intra-block error correction prediction

[0158] Perform intra-block ECC (Error Correcting Code) decoding on bitsblock to predict whether the results are "ok" or "corrected".

[0159] ok = False means unusable, i.e., cannot be corrected; ok = True and corrected = True means it passes after correction; ok = True and corrected = False means it passes directly without correction.

[0160] If ok = False, calculate the cost_block of the bi-th region block according to the following formula:

[0161] cost_block=r cost_block_uncorrectable;

[0162] Wherein, cost_block_uncorrectable is a preset penalty value, which is 50 in this embodiment;

[0163] If ok = True and corrected = True, then the number of blocks is incremented by one, and the cost_block of the bi-th block is calculated according to the following formula:

[0164] cost_block = cost_block_corrected;

[0165] Wherein, cost_block_corrected is a preset reward value, which is 6 in this embodiment;

[0166] If ok = True and corrected = False, then the number of blocks is incremented by one, and the cost_block of the bi-th block is calculated according to the following formula:

[0167] cost_block=reward_block_clean;

[0168] Where reward_block_clean is a preset reward value, which is -1 in this embodiment.

[0169] The cost value of a row of bits is obtained by summing the cost values ​​of the regions in the bit sequence of a candidate crop_bits.

[0170] For any row of bits, add the matching cost and the cost value of that row of bits to get cost(crop_bits).

[0171] The rule for selecting the optimal left pruning amount for a given bit sequence is as follows:

[0172] First, select the candidate with the smaller cost (crop_bits); if there are multiple candidates with the smallest cost (crop_bits), then prioritize the candidate with the most anchor points; then prioritize the candidate with the most hit regions; finally, prioritize the candidate with the smaller crop_bits.

[0173] After determining the optimal crop_bits for each line, the synchronizer outputs a set of parsed region blocks. Each region block contains its line number, its starting position in the intra-line bitstream, and its intra-line block number. Subsequently, the decoder performs intra-block error correction decoding on all parsed 8-bit region blocks: region blocks that cannot be corrected are directly erased and discarded, and are not allowed to enter any fountain equation set; region blocks that do not require error correction are output as 4-bit data blocks and added to the clean equation pool; region blocks that have undergone error correction and passed are output as 4-bit data blocks and added to the corrected equation pool for subsequent fallback decoding.

[0174] In the fountain recovery phase, this invention employs a two-stage fountain decoding strategy to balance correctness and recoverability. The first stage uses only the clean equation pool for fountain decoding, recovering all source blocks through stripping decoding or equivalent iterative solutions, and assembling the global bit sequence of the payload. A global CRC check is then performed. If the first stage is successful and the CRC passes, the original payload is output as the final watermark recovery result. If the first stage fails to solve completely or the CRC check fails, the second stage, a fallback decoding, is initiated. The corrected equation pool is added and merged with the clean equation pool before resolving, improving the recovery probability under conditions of high noise and insufficient available blocks. The second stage must also pass a global CRC check to output the result. Through this two-stage mechanism of "clean first, then correct," this invention significantly reduces the probability of erroneous recovery caused by incorrect equations and can improve the recovery success rate when necessary by utilizing error-correcting blocks, thereby enhancing the overall robustness of the system under conditions of screen degradation and cropping.

[0175] Anti-cutting test

[0176] Several text images containing a large amount of English text were selected as experimental carriers. Watermark generation and embedding were completed according to the method of this invention to obtain watermarked text images. The embedded images were displayed on a display device in full screen or at a fixed ratio, and screen capture images were obtained by taking pictures using a camera at different shooting distances, shooting angles and lighting conditions.

[0177] A local cropping attack is applied to the captured screen image to simulate screenshot, cropping, and content rearrangement scenarios in real-world applications. The cropping can cover different locations and proportions, including but not limited to cropping from the left, right, top, bottom, or center of the image.

[0178] The watermark extraction and information recovery process of this invention is executed on the cropped image, and the recovery results and process statistics are recorded. Evaluation indicators may include global CRC pass rate (recovery success rate), whether the recovered payload is completely consistent (information accuracy rate), anchor point synchronization hit and alignment success, number of valid data blocks and their clean / corrected / discarded ratios, etc. By comparing statistics under different cropping ratios, different cropping positions, and different screen capture conditions, this invention can be used to verify that even under the "superimposed conditions of screen capture degradation and cropping attack," it can still rely on anchor point synchronization positioning and fountain code disordered recovery mechanism to reliably recover watermark information from the data blocks carried by residual character instances.

[0179] Regarding anchor structure, anchor coding can be replaced with other short codes with larger code distances or synchronization marker structures with checksums. For example, BCH (Bose–Chaudhuri–Hocquenghem) codes, short RS (Reed–Solomon) codes, or fixed sequence families with CRC can be used. Alternatively, multi-anchor repeating layouts or multi-scale anchors (overlapping different periods) can be employed to improve synchronization probability under severe pruning. Anchor matching can use either hard thresholding or a soft distance cost function. Besides improving codeword diversity, anchor phase information can also be used as a consistency constraint, such as requiring several anchors to satisfy periodic consistency in phase advancement to further reduce the probability of false locking.

[0180] Regarding fountain codes, the type can be a variant such as LT (Luby Transform) code or Raptor code. The degree distribution can adopt a robust soliton distribution or an engineered modified distribution. The symbol width can be extended from 4 bits to 8 bits or 16 bits to adapt to different capacity and complexity requirements. Symbol operations can be performed on a finite field or implemented using bitwise XOR to reduce implementation complexity. To improve the efficiency of stripping and decoding startup, a systematic strategy can be selected to force some data blocks to be degree=1 equations, thereby improving solvability when the number of blocks is insufficient.

[0181] For intra-block error correction, structures such as BCH, convolutional codes, duplicate codes + voting, and CRC detection + erasure can be adopted. The key is to retain the filtering mechanism of available / error-corrected available / unavailable erasure, so that erroneous blocks do not enter the fountain equation set and avoid polluting the recovery process.

[0182] For synchronous search, the intra-line pruning amount can be determined by full enumeration, or by using bundle search, dynamic programming, or hierarchical search to reduce computational cost. Cost term weights can be adaptively adjusted based on noise models and experimental statistics. For example, in high-noise scenarios, increasing the corrected penalty and enhancing the hierarchical penalty for anchor soft dist can improve locking stability. For scenarios involving consistent pruning across rows, inter-line constraints can also be added to further improve alignment reliability.

[0183] Traditional natural image watermarking methods typically embed watermark information within transform domains such as DCT / DWT or fixed image blocks. Their detection and decoding processes rely on the spatial integrity and synchronization of the embedded region. When a local image is cropped, the fixed block structure or synchronization is easily disrupted, making it difficult to correctly align and aggregate the watermark information, leading to decoding failure or overall failure. This invention employs a character instance-level embedding method, using discrete character instances as the smallest physical carrier unit. This allows the watermark bits to be distributed across multiple lines of character sequences along with the text content. Cropping only results in the loss of some character instances without necessarily destroying the overall carrier structure. Simultaneously, this invention uses fountain codes to perform unordered redundant encoding of the watermark payload. The fountain code recovery mechanism does not depend on the continuity and order of data blocks; it only needs to obtain a sufficient number of valid data blocks from the residual content to complete the source block recovery and information reconstruction. Therefore, even when local cropping leads to the loss of a large number of embedding units, this invention can still achieve watermark content recovery based on the data blocks carried by the residual character instances, structurally solving the problem of "carrier loss equals information failure."

[0184] In the screen capture link, the decoding bits of a single character are inevitably affected by noise and distortion. If the watermark data organization adopts a long synchronization field, a long group structure, or a parsing method that strongly depends on group boundaries, then under the same single-bit error rate, the overall error probability of the long field is higher, which can easily lead to group boundary positioning failure, misparsing of fields within the group, and the mixing of erroneous data, thus significantly reducing the overall recovery success rate. In terms of structural design, this invention organizes key synchronization information and data blocks into short anchor points and short data blocks: the anchor points are shorter and use anchor point encoding with a larger code distance. The decoding end can perform soft matching based on Hamming distance and use distance as the synchronization cost, so that synchronization clues can still be preserved and alignment can be achieved even when there is a lot of noise; the data blocks are shorter and are equipped with intra-block error correction encoding. The decoding end can directly erase and discard data blocks that cannot be corrected, avoiding erroneous data blocks from entering the subsequent recovery process. Compared to solutions that encapsulate longer data into character groups, the anchor points and data blocks of this invention are all short field structures. Furthermore, synchronous positioning not only relies on a single hit, but also on the cumulative scores of multiple anchor points and the error correction status within the block, thus making it less likely to cause "accidental misalignment" under high-noise screen capture conditions, reducing the probability of misparsing and misalignment, and improving the stability of synchronous positioning.

[0185] Under conditions of pruning and noise superposition, the decoding end may experience misalignment, the inclusion of erroneous data blocks, or contamination of the equation set, thus posing a risk of "accidentally solvable but incorrectly recovered content." This invention improves recovery reliability through a combined mechanism of "completely discarding erroneous blocks + two-stage fountain recovery + global verification final judgment." First, intra-block error correction decoding classifies data blocks into three categories: no error correction required, error-correctable, and no error correction required. Uncorrectable data blocks are directly erased and not allowed to enter the fountain equation set, reducing erroneous equation contamination at the source. Second, fountain recovery employs a two-stage strategy, prioritizing the use of high-confidence data blocks that do not require error correction to improve the correctness of the recovery result; only when high-confidence data blocks are insufficient to complete the recovery is the erroneously corrected data block introduced as a fallback to improve the recovery success rate. Finally, the recovered complete bit sequence must pass a global CRC check before output; if the check fails, the output result is rejected, effectively suppressing false recovery and misjudgment output, and improving the security and reliability of the system under complex attack conditions.

[0186] In traditional block coding or fixed-group structure schemes, each data unit typically requires an explicit index and boundary fields to support sequential reassembly and positioning. When the data unit length is short, the index and check fields consume a significant proportion of metadata overhead, reducing the effective payload ratio that a unit of carrier can carry. This invention employs a fountain code unordered data block mechanism, where the decoder restores the sequential reassembly independent of data blocks. Therefore, it eliminates the need to explicitly carry a block number field for each data block, thereby reducing metadata overhead. The fountain equation structure is implicitly determined by a deterministic seed, and the decoder can reproduce the equation structure and participate in the solution based on the row number and intra-row block sequence number, avoiding the bit occupation caused by explicit indexes. Thus, under the same character count and embedding density, this invention can improve the effective payload ratio and carrier utilization.

[0187] Traditional natural image watermarking adjusts coefficients in the transform domain or block domain to achieve robustness, often requiring the introduction of energy variations over a large range to resist compression and noise. Text images, however, are sensitive to readability, and noticeable texture disturbances are more likely to cause visual defects. This invention employs a character instance-level one-bit embedding method, limiting the embedding operation to a local region of a single character. It uses a deep learning embedding model to perform micro-structural modulation on character edges and local textures, thereby achieving stable embedding while ensuring text readability and overall visual quality. Simultaneously, the key parameters and modules of this invention are configurable and replaceable. For example, the anchor point encoding method, anchor point periodic layout, fountain code type and degree distribution, intra-block error correction code type, and synchronous scoring weights can all be adjusted according to different screen capture noise conditions and carrier layout characteristics. This gives the solution strong engineering adaptability and scalability, facilitating deployment and application in screen capture dissemination scenarios with different devices, font sizes, and document formats.

[0188] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. To avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.

Claims

1. A method for anchor-synchronized fountain code anti-cropping text watermarking for screen capture scenarios, characterized in that, Specifically, it includes: Watermark embedding stage: The input text image is preprocessed and the text region is filtered to retain the valid text region containing character content. The valid text region is then subjected to character-level recognition and structured analysis to obtain the location box of the character instance and organize and number it according to the text line. A watermark bit sequence is generated as the payload, and a global verification field is introduced into the watermark bit sequence; The global sequence of payloads, consisting of the payload and the global check field, is divided into multiple source blocks of the same length. Each line of text is assigned an independent deterministic seed. The source block is then encoded in an unordered and redundant manner based on the deterministic seed to generate a data block. In the unordered and redundant encoding, intra-block error correction encoding is introduced to further encode each data block into a region block. The region block is split into bit blocks, each bit block is of equal length, and the bit block is embedded in each character instance. An anchor point is written after every B region blocks, and the structure consisting of B region blocks and one anchor point is a periodic structure. Watermark extraction stage: For text images displayed on a screen, captured by a camera, or potentially partially cropped, locate the regions containing character instances and organize and number them by line. Extract the bit blocks from each character instance to obtain the bit sequence of each line, and number each bit in the bit sequence starting from zero; introduce a synchronizer to enumerate the candidate left crop bit amounts crop_bits; Anchor points are extracted based on each candidate crop_bits, and the matching cost of each anchor point is calculated; region blocks are extracted based on each candidate crop_bits, and the cost of the region blocks is evaluated. The optimal left clipping amount for each row is selected based on the matching cost and cost evaluation results; Watermark information is extracted based on the optimal left cropping amount.

2. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, The source block is encoded using a fountain coding method with unordered redundancy, and an independent deterministic seed is assigned to each line of text. Specifically: seed = row × 100000 + t_local; Where row is the row number and t_local is the block number of the region within the row; the index and degree of the source block that constitutes the data block are determined based on the deterministic seed.

3. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, The method also includes introducing a line-end redundancy writing strategy during the watermark embedding stage: for any line of text, the remaining space at the end of the line is covered by a real region block without writing a new anchor point.

4. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, The region block is split into 1 bit.

5. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, The enumeration of candidate left cropping values ​​(crop_bits) is as follows: candidate crop_bits are sequentially selected from 0 to max_crop_bits; when crop_bits=0, it represents the ideal no-crop case; when crop_bits=1, it represents a left cropping of 1 bit, max_crop_bits represents the preset maximum left cropping, max_crop_bits<L, where L is the length of a row of bit sequences.

6. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, For each cycle existing within a row, number them sequentially starting from zero, and extract the anchor point based on each candidate crop_bits, specifically as follows: For any candidate crop_bits, when extracting the i-th anchor bit_i from the row bit sequence according to the periodic structure, the anchor bit should satisfy the following condition: 0 ≤obs_a_i and obs_a_i + anchor_len≤L; Where obs_a_i is the starting point of the i-th anchor point, anchor_len is the length of the anchor point, and L is the length of a row of bit sequences; bits_i = row_bits[obs_a_i : obs_a_i + anchor_len]; Where row_bits is the bitstream extraction function, and the expression for obs_a_i is as follows: obs_a_i= orig_a_i - crop_bits; Where orig_a_i is the starting point of the i-th anchor point in the ideal no-clipping case, and the expression for orig_a_i is as follows: orig_a_i= cycle_idx × cycle_len + B×block_len; Where cycle_idx is the cycle number corresponding to the i-th anchor point, cycle_len is the length of the cycle, and block_len is the length of the block. The specific steps for calculating the matching cost of anchor points are as follows: For any candidate crop_bits, perform soft decoding on the i-th anchor point to determine the Hamming distance between different bits in the i-th anchor point; and determine the matching cost of the i-th anchor point under the candidate crop_bits according to the following three cases: Case 1: If a unique and minimum Hamming distance `dist` can be determined, and `dist` is less than or equal to a preset threshold, then the anchor count is incremented by 1, and the matching cost of the i-th anchor is calculated according to the following formula: cost = anchor_cost_for_dist(dist); Among them, anchor_cost_for_dist is the Hamming distance cost function, which is used to calculate different Hamming distance costs based on the value of dist. The larger the dist, the larger the Hamming distance cost. Case 2: If dist is less than or equal to the preset threshold, but there are multiple consecutive minimum Hamming distances dist, then the anchor count is incremented by 1, and the matching cost of the i-th anchor is calculated according to the following formula: cost = anchor_cost_for_dist(dist)+ cost_anchor_ambiguous; Where cost_anchor_ambiguous is the preset ambiguity penalty value; Case 3: If dist is greater than the preset threshold, the matching cost of the i-th anchor point is calculated according to the following formula: cost = cost_anchor_miss; Where cost_anchor_miss is the preset miss penalty value, and cost_anchor_miss > cost_anchor_ambiguous; The matching costs of all anchors under a candidate crop_bits are summed to obtain the anchor matching cost of that candidate crop_bits.

7. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 6, characterized in that, Extracting region blocks based on each candidate crop_bits, specifically: When the synchronizer extracts the bi-th region block in cycle_jdx, the bi-th region block should meet the following conditions: obs_start_bi ≥ 0 and obs_start_bi + block_len ≤L; Where, obs_start_bi is the starting point of the bi-th region block; bitsblock = row_bits[obs_start_bi : obs_start_bi + block_len]; Where bitsblock is the extracted region block, bi = 0, 1, ..., B-1; the expression for obs_start_bi is: obs_start_bi= orig_start_ bi - crop_bits; Where, orig_start_bi is the starting point of the bi-th region block in the ideal no-clipping scenario: orig_start_ bi = cycle_jdx * cycle_len + bi * block_len; The cost assessment for the block is as follows: Perform intra-block error correction on the bi-th region: Scenario 1: If no correction is needed and the process proceeds directly, the number of blocks is incremented by 1, and the cost_block of the bi-th block is calculated according to the following formula: cost_block=reward_block_clean; Where reward_block_clean is the reward value corresponding to the preset case one; Scenario 2: If correction is required and the correction is successful, the number of blocks is incremented by 1, and the cost value (cost_block) of the bi-th block is calculated according to the following formula: cost_block = cost_block_corrected; Where cost_block_corrected is the reward value corresponding to the preset case two; Scenario 3: If it cannot be corrected, then calculate the cost_block of the bi-th region block according to the following formula: cost_block = cost_block_uncorrectable; Where cost_block_uncorrectable is the penalty value corresponding to the preset case three; The sum of the values ​​of all regions in any candidate crop_bits is used as the region block value of that candidate crop_bits.

8. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 7, characterized in that, The optimal left cropping amount for each row is selected by adding the anchor matching cost and the region block cost of the candidate crop_bits. If there exists a unique minimum sum value, select the candidate crop_bits corresponding to the minimum sum value as the optimal left crop amount; If the minimum sum value is not unique, then the candidate crop_bits with the largest number of anchor blocks among the minimum sum values ​​is selected as the optimal left clipping amount; If the maximum number of anchor blocks in the minimum sum value is not unique, first filter out the candidate crop_bits with the minimum sum value and the maximum number of anchor blocks, and select the candidate crop_bits with the maximum number of region blocks from the filtered candidate crop_bits as the optimal left clipping amount. If the maximum number of anchor blocks and the maximum number of data blocks among the minimum sum values ​​are not unique, then first filter out the candidate crop_bits with the minimum sum value, the maximum number of anchor blocks and the maximum number of data blocks, and select the candidate crop_bits with the smallest value from the filtered candidate crop_bits as the optimal left crop amount.

9. The anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios according to claim 1, characterized in that, The watermark extraction based on the optimal left cropping amount is specifically as follows: After determining the optimal left pruning amount for each row of bit sequence, the region blocks of each row are obtained, forming a set of region blocks. Intra-block error correction is performed on the region blocks. Uncorrectable region blocks are discarded directly. For region blocks that need correction and pass after correction, their corresponding data blocks are output. The set of these data blocks is denoted as corrected. For region blocks that do not need correction, their corresponding data blocks are output. The set of these data blocks is denoted as clean. First, the corresponding source block is recovered using the data blocks in the clean set. The source blocks are then concatenated to obtain the global load sequence. The global load sequence is then globally validated. If the validation passes, a watermark is output. Otherwise, the data blocks in the corrected set are added to the clean set. The source block is recovered again, and the source blocks are concatenated to obtain the global load sequence. The global load sequence is then globally validated. If the validation passes, a watermark is output. Otherwise, extraction failure is output.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the anchor-synchronized fountain code anti-cropping text watermarking method for screen capture scenarios as described in any one of claims 1 to 9.

Citation Information

Patent Citations

  • Screen leakage protection method based on block chain

    CN113360860A

  • Teaching document anti-copy protection method and system based on OCR interference resistance

    CN121564722A

  • Digital watermark encoding and decoding with localization and payload replacement

    US10147433B1