A 2.5D color video generation and inverse decoding method and system

By using a 2.5D color video generation and reverse decoding method based on stroke texture and frame sequence encoding, the problems of unavoidable errors, poor security, low efficiency, and contradiction between encoding and artistic display in Chinese character recognition and video steganography are solved, achieving highly reliable reverse decoding and artistic free coloring effects.

CN123164307APending Publication Date: 2026-11-24XIXIN TECHNOLOGY CO LTD +7
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611488153.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-22
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing technologies for Chinese character recognition and video steganography suffer from problems such as unavoidable errors, poor security, low efficiency, limited encoding capacity, high reverse decoding error rate, and difficulty in resolving the conflict between encoding and artistic presentation.

Method used

A 2.5D color video generation and reverse decoding method based on stroke texture and frame order encoding is adopted. Through the collaboration of a security chip and the main processor, line texture is used to replace hue to encode stroke type, brightness level to encode stroke number, and video frame order to encode writing order. Error correction code and hash information are carried in an independent side channel file. Combined with deep learning texture recognition and error correction code error correction mechanism, the encoded information is resistant to compression, color shift, and artistic color separation.

Benefits of technology

It achieves a reverse decoding error rate as low as 10⁻⁶, ensuring encoding reliability and freedom of artistic expression. It outputs standard video files and side channel files smaller than 10KB, is compatible with existing playback and transmission formats, does not rely on special hardware, and has high engineering feasibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123164307A_ABST
    Figure CN123164307A_ABST
Patent Text Reader

Abstract

This invention discloses a 2.5D color video generation and reverse decoding system based on stroke texture and frame sequence encoding, comprising: an encoding end device and a decoding end device; the encoding end device includes an encoding end security chip and an encoding end main processor; the ROM of the encoding end security chip contains a stroke type-line texture mapping library, a stroke number-brightness level mapping rule, and error correction code parameters; the encoding end main processor includes a text preprocessing module, a 2.5D rendering module, a video encoding module, and a side channel file generation module; the decoding end device includes a decoding end main processor and a decoding end security chip; the decoding end main processor includes a video decoding module, a frame segmentation module, a texture recognition module, a brightness measurement module, and a stroke sequence reconstruction module; the decoding end security chip is used for decrypting the side channel file, error correction code correction, hash verification, and reconstructing the reconstructed stroke sequence into Chinese text by reverse lookup table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer graphics technology, and in particular relates to a color video generation system. Background Technology

[0002] Current Chinese digitization methods generally employ character encoding mapping, assigning a unique number to each character. Computers only recognize the number, not the character's structure, preventing Chinese from participating in calculations at a level smaller than the character itself. Regarding character visualization, existing calligraphy animations and stroke order tutorials only display the writing process in a two-dimensional plane, using a single color and failing to establish a mapping between stroke types and visual features. Furthermore, they lack the ability to reverse engineer text from video. When recognizing text from images, current technologies rely on optical character recognition (OCR), a reverse process of reconstructing characters from images. This is susceptible to inherent errors due to noise, confusion between similar-looking characters, handwriting distortion, and low resolution. Moreover, the recognition results are untraceable, insecure, and inefficient. The common root of these shortcomings lies in the lack of a finite, composable, and computable set of underlying basic units for Chinese, resulting in a long-standing lack of independent and controllable fundamental solutions for underlying fields such as cryptography, artificial intelligence, data compression, and retrieval.

[0003] Current video steganography primarily embeds information by modifying the least significant bit of pixels or Discrete Cosine Transform (DCT) coefficients. This method has limited embedding capacity, and the information is easily lost after video compression. Furthermore, the steganographic content is unrelated to the video's visual content. Color encoding schemes often use color blocks to encode information, but color blocks are discrete and static, unable to generate continuous dynamic video. Video compression uses 4:2:0 subsampling for the chroma channels, making it difficult to reliably distinguish between multiple hues after compression. Combined with differences in device color gamut and ambient light interference, adjacent hues are difficult to reliably distinguish, resulting in a high error rate during reverse decoding. When using line thickness encoding, anti-aliasing and video compression lead to large measurement errors in line thickness, making it impossible to reliably distinguish fine lines of 1 to 2 pixels. When using 3D spatial encoding, rendering 3D to 2D video frames involves information loss, making it unsuitable to reconstruct 3D coordinates from 2D projection. The loss of depth information makes reverse decoding theoretically irreversible. Furthermore, if visible light color simultaneously serves both encoding and artistic display functions, there is a fundamental contradiction between the two, making it impossible to achieve the "color pen" effect of free coloring; when embedding encrypted information into video frames, video compression will destroy the embedded information, metadata is easily deleted, and there is a lack of reliable encryption verification methods.

[0004] It should be noted that the above description of the technical background is only for the purpose of providing a clear and complete explanation of the technical solutions of the present invention and facilitating understanding by those skilled in the art. It should not be assumed that the above technical solutions are known to those skilled in the art simply because they have been described in the background section of this invention. Summary of the Invention

[0005] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method and system for generating and reverse decoding 2.5D color video based on stroke texture and frame sequence encoding.

[0006] This invention discloses a 2.5D color video generation and reverse decoding system based on stroke texture and frame sequence encoding, including an encoding end device and a decoding end device. Both the encoding end device and the decoding end device adopt an architecture in which a security chip and a main processor work together.

[0007] The aforementioned encoding device includes:

[0008] An encoding-end security chip has a read-only memory (ROM) containing a stroke type-line texture mapping library, a stroke number-brightness level mapping rule, and error correction code parameters. It also has a hardware lookup table circuit and a cryptographic operation unit. The hardware lookup table circuit is used to convert stroke type to line texture parameters and stroke number to brightness level. The cryptographic operation unit is used to perform error correction coding, hash calculation, and encryption operations on the complete stroke sequence to generate a side channel file.

[0009] The main processor at the encoding end includes a text preprocessing module, a 2.5D rendering module, a video encoding module, and a side-channel file generation module. The text preprocessing module is used to convert the input Chinese text into a stroke sequence arranged in writing order and to classify the stroke sequence into eight basic stroke categories. The 2.5D rendering module is used to arrange the strokes in the X / Y plane according to the structure of Chinese characters, render the stroke animation with line texture and brightness levels frame by frame, and distinguish up to three levels by transparency. The video encoding module is used to output a standard video file. The side-channel file generation module is used to output a side-channel file that is separate from the video file but bound to it.

[0010] The aforementioned decoding device includes:

[0011] A decoding main-end processor, including a video decoding module, a frame segmentation module, a texture recognition module, a brightness measurement module, and a stroke sequence reconstruction module; the frame segmentation module is configured to segment the video into multiple stroke segments according to frame order and blank intervals between strokes; the texture recognition module is configured to identify the line texture type of each stroke segment using a deep learning classification model; the brightness measurement module is configured to measure the average brightness of the stroke line and map it to a brightness level; the stroke sequence reconstruction module is configured to reconstruct a stroke sequence by integrating the texture type, brightness level, and segment start frame number;

[0012] A decoding-end security chip, configured to perform decryption of side-channel files, error correction via error correction codes, hash verification, and reverse table lookup to restore the reconstructed stroke sequence into Chinese text; among them, the visible light RGB color channels do not undertake any encoding function and are only used for artistic coloring.

[0013] Further, the line textures are 8 predefined spatial domain textures, including solid line, dashed line, dotted line, wavy line, zigzag line, dash-dot line, double line, and dot-circle line; the 8 line textures have a one-to-one mapping relationship with the 8 basic strokes of the "Eight Principles of Yong" — horizontal, vertical, left-falling, right-falling, dot, rising, turning, and hook; the stroke number-brightness level mapping rule is a three-level discrete brightness mapping: the dark level corresponds to a brightness value of 20% to 35% and maps to stroke numbers 0 to 3, the medium level corresponds to a brightness value of 45% to 60% and maps to stroke numbers 4 to 6, and the bright level corresponds to a brightness value of 70% to 90% and maps to stroke numbers 7 to 9.

[0014] Further, the transparency layering rule of the 2.5D rendering module is: background layer transparency 50%, middle layer transparency 100%, foreground layer transparency 100% with additional outer glow; at least a 2-pixel interval is reserved between strokes without stroke connection; the information of each layer is encoded in the side-channel file and does not rely on video frame restoration; the stroke sequence reconstruction module is further configured with a dictionary-constrained disambiguation unit, which is configured to determine the exact stroke number within the interval by combining the Chinese character stroke dictionary and context constraints when the brightness measurement can only determine the interval where the stroke number is located; the texture recognition module and the error correction via the error correction code of the security chip form a dual-insurance decoding mechanism, the redundancy rate of the error correction code is 20%, and the error correction capability is for symbol errors not exceeding 20%.

[0015] The present invention also discloses a 2.5D color video generation method based on stroke texture and frame sequence encoding, comprising the following steps: S1. Inputting Chinese text and converting it into a stroke sequence arranged according to writing order, wherein the stroke sequence includes the stroke type and stroke number of each stroke, and the stroke types are grouped into 8 major categories of basic strokes; S2. Mapping stroke types to corresponding line texture parameters and stroke numbers to corresponding brightness levels through hardware table lookup in a security chip, allocating a continuous exclusive frame segment to each stroke according to writing order, and taking the starting frame number of the frame segment as the stroke order number of the stroke; calculating an error correction code and a hash value for the complete stroke sequence, encrypting them and writing into a side channel file; S3. Arranging stroke positions on the X / Y plane according to Chinese character structure, rendering stroke by stroke in frame order, wherein each stroke is gradually drawn from the starting point to the ending point within its exclusive frame segment, and blank interval frames are reserved between strokes; applying the corresponding line texture and brightness level to each stroke, and distinguishing at most 3 levels with transparency; the visible light color is freely specified by the user; S4. Encoding and outputting a standard video file, and outputting a side channel file that is separated from and mutually bound with the video file.

[0016] Further, the line texture parameters in step S2 are one of 8 predefined spatial domain textures, and the 8 spatial domain textures are in one-to-one correspondence with the 8 basic strokes of the Eight Principles of Yong; the brightness levels are three-level discrete brightness, the dark level corresponds to a brightness value of 20% to 35% and stroke numbers 0 to 3, the medium level corresponds to a brightness value of 45% to 60% and stroke numbers 4 to 6, and the bright level corresponds to a brightness value of 70% to 90% and stroke numbers 7 to 9; in step S3, each stroke exclusively occupies 10 frames by default, and 2 blank interval frames are reserved between strokes.

[0017] Further, the distinguishing of at most 3 levels with transparency in step S3 is specifically as follows: the background layer has a transparency of 50%, the middle layer has a transparency of 100%, and the foreground layer has a transparency of 100% with an additional outer glow; at least a 2-pixel interval is reserved between strokes without connecting strokes; information of each layer is written into the side channel file and not encoded in the video frame; the side channel file carries error correction codes, hash values, encrypted information and mode flags, and is transmitted separately from the video file, thus being unaffected by video compression.

[0018] This invention also discloses a 2.5D color video inverse decoding method based on stroke texture and frame order encoding, comprising the following steps: S1, inputting a video file and its bound side channel file, decoding the video, and segmenting the video into multiple stroke segments according to frame order and the blank interval between strokes; S2, for the intermediate frames of each stroke segment, identifying its line texture type using a deep learning classification model, and outputting the texture category and confidence level; S3, measuring the average brightness of the stroke lines of the stroke segment, mapping it to a brightness level, and determining the stroke number interval corresponding to the brightness level. S4. Sort the strokes according to the starting frame number of each stroke segment to determine the writing order of the strokes; S5. Reconstruct the stroke sequence by combining the stroke number range corresponding to the texture type and brightness level and the starting frame number of the segment; S6. Decrypt the side channel file in the security chip to obtain the error correction code and the original hash value. Use the error correction code to correct the errors in texture recognition or brightness measurement. Calculate the hash value of the reconstructed stroke sequence and compare it with the original hash value. If they match, mark it as a trusted decoder; S7. Reverse look up the reconstructed stroke sequence to restore the Chinese text and output the original text and decoding confidence.

[0019] Furthermore, in step S2, the deep learning classification model is a lightweight convolutional neural network classification model, and its training samples are generated from the stroke morphology parameters extracted from the stroke comparison library; in step S6, the error correction code redundancy rate is 20%, the error correction capability is no more than 20% of the symbol errors, and the bit error rate is reduced to 10%. -6 the following.

[0020] Furthermore, in step S3, when the brightness measurement can only determine the interval in which the stroke number is located but cannot determine the precise number, in step S6, the precise stroke number is determined within the interval by combining the Chinese character stroke dictionary and contextual constraints; and in step S6, when the hash comparison is inconsistent, a decoding failure flag is output and text restoration is rejected.

[0021] Furthermore, the 2.5D color video reverse decoding method also includes a generation-verification self-supervised closed-loop step: the stroke sequence reconstructed in step S7 is used to regenerate the video using the forward generation method, and the regenerated video is compared with the video input in step S1. When the difference is higher than the threshold, the frame segmentation parameters, texture recognition model parameters, or brightness measurement parameters are adjusted, and steps S1 to S7 are re-executed until the difference is lower than the threshold. The final stroke sequence is used as the digital fingerprint of the video for copyright registration or content traceability.

[0022] The core of this invention lies in providing a method that encodes stroke types using line texture, stroke numbers using brightness levels, writing order using video frame sequence, and encrypted verification information using an independent side-channel file. This method places all encoded information on spatial and temporal domain features that are resistant to compression and color shift, while simultaneously allowing the visible light RGB color channels to be fully released for artistic coloring. Therefore, it ensures mathematical reversibility of reverse decoding and a bit error rate as low as 10%. -6 While achieving high reliability in reproduction, it also realizes a true "color pen" free coloring effect, fundamentally resolving the long-standing contradiction between coding reliability and artistic freedom.

[0023] The beneficial effects of this invention are as follows: It uses spatial domain line texture to replace hue-based stroke type encoding, three-level brightness levels to encode stroke numbering, and video frame order to encode writing sequence. Furthermore, it uses an independent side-channel file to carry error correction codes, hashes, and encryption information, making the encoded features resistant to video compression, color shift, and device differences. Combined with a dual-insurance mechanism of deep learning texture recognition and error correction code correction, as well as Chinese character dictionary constraint disambiguation, the reverse decoding error rate can be reduced to 10%. -6 The following features: 2.5D planar arrangement and up to three layers of transparency are used to avoid the loss of depth information in 3D projection, making reverse decoding mathematically reversible; the visible light RGB color channels are fully released for artistic coloring, fundamentally resolving the contradiction between encoding and artistic display, and achieving a true rainbow pen effect; outputs standard video files and side-channel files smaller than 10KB, compatible with existing playback and transmission formats, does not rely on special hardware such as near-infrared or 3D depth, has high engineering feasibility, and can reuse the Chinese stroke digitization generation-verification encoding and security chip architecture to form a technology cluster. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in an embodiment of the present invention or in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. The drawings described below are merely embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0025] Figure 1 This is a schematic diagram of a 2.5D color video generation and reverse decoding system based on stroke texture and frame sequence encoding in one embodiment of the present invention.

[0026] Figure 2 This is a flowchart of a 2.5D color video generation method based on stroke texture and frame sequence encoding in one embodiment of the present invention.

[0027] Figure 3 This is a flowchart of a 2.5D color video reverse decoding method based on stroke texture and frame sequence encoding in one embodiment of the present invention.

[0028] The reference numerals in the above figures are as follows:

[0029] 100, 2.5D Color Video Generation and Reverse Decoding System

[0030] 200. Encoding terminal device

[0031] 210. Encoding End Security Chip

[0032] 211. ROM Mapping Library

[0033] 212. Hardware lookup table circuit

[0034] 213. Cryptographic Operation Unit

[0035] 220. Encoding end main processor

[0036] 221. Text Preprocessing Module

[0037] 222, 2.5D rendering module

[0038] 223. Video Encoding Module

[0039] 224. Side channel file generation module

[0040] 300. Decoding device

[0041] 310. Decoding end main processor

[0042] 311. Video Decoding Module

[0043] 312. Frame Segmentation Module

[0044] 313. Texture Recognition Module

[0045] 314. Brightness Measurement Module

[0046] 315. Stroke Sequence Reconstruction Module

[0047] 316. Dictionary-constraint disambiguation unit

[0048] 320. Decoding-end security chip

[0049] 321. Side-channel file decryption unit

[0050] 322. Error Correction Code Error Correction Unit

[0051] 323. Hash Verification Unit

[0052] 324. Reverse lookup table unit

[0053] 400, video file

[0054] 500, Side-channel file

[0055] 600, 700, Chinese text. Detailed Implementation

[0056] To better understand this invention, the following embodiments are provided in conjunction with the accompanying drawings. It should be understood that the embodiments of this invention are for illustrative purposes only and not for limiting the invention; the scope of protection of this invention is defined solely by the claims. The embodiments provided are merely preferred embodiments and are not intended to limit the invention in any way. Those skilled in the art can make changes, equivalent substitutions, or modifications based on the content of this invention, resulting in different implementations. However, any changes and modifications, or equivalent substitutions, made to the method of this invention without departing from the inventive concept are within the scope of protection of this invention.

[0057] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0058] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, and / or combinations thereof.

[0059] First, please refer to Figure 1 . Figure 1 This is a schematic diagram of a 2.5D color video generation and reverse decoding system based on stroke texture and frame sequence encoding according to an embodiment of the present invention. Figure 1 As shown, the 2.5D color video generation and reverse decoding system 100 of the present invention consists of an encoding end device 200 and a decoding end device 300, both of which adopt an architecture in which a security chip and a main processor work together.

[0060] During encoding, the user inputs Chinese text 600 into the text preprocessing module 221 of the main processor 220 of the encoding terminal. The text preprocessing module 221 calls the prior Chinese stroke digitization generation-verification conversion to convert the text character by character into a stroke sequence arranged in the writing order. Each stroke has a stroke type and stroke number, and the 32 strokes are grouped into 8 basic stroke categories: horizontal, vertical, left-falling, right-falling, dot, rising, turning, and hook.

[0061] Subsequently, the encoding end security chip 210 intervenes: its ROM mapping library 211 pre-embeds a stroke type-line texture mapping table, a stroke number-brightness level mapping rule, and error correction code parameters; the hardware lookup circuit 212 directly completes two lookups using combinational logic, first mapping the stroke type to the line texture parameter, and second mapping the stroke number to the brightness level, without requiring software to compare each item, and the lookup delay is constant; the cryptographic operation unit 213 performs error correction coding, SHA hash calculation, and AES encryption on the complete stroke sequence to generate a side channel file 500.

[0062] The 2.5D rendering module 222 of the main processor 220 at the encoding end arranges the stroke positions in the X / Y plane according to the structure of Chinese characters, and renders the stroke animation with line texture and brightness level stroke by stroke in frame order, and distinguishes up to 3 levels by transparency; the video encoding module 223 encodes the rendering result into a standard video file 400 using the H.264 or H.265 digital video codec standard; the side channel file generation module 224 outputs a side channel file 500 that is separate from the video file 400 but bound to it, and the two are delivered by binding with an identification field.

[0063] During decoding, the video decoding module 311 of the main processor 310 decodes the video file 400, and the frame segmentation module 312 segments the video into multiple stroke segments based on the frame order and the spacing between strokes. The texture recognition module 313 uses a deep learning classification model to identify the line texture type of each stroke segment. The brightness measurement module 314 measures the average brightness of the stroke lines and maps it to a brightness level. The stroke sequence reconstruction module 315 reconstructs the stroke sequence by combining the texture type, brightness level, and the starting frame number of the segment. Finally, the security chip 320 of the decoding end decrypts the side-channel file 500, performs error correction and hash verification, and the reverse lookup table unit restores the reconstructed stroke sequence into Chinese text 700 for output.

[0064] The visible light RGB color channel of the 2.5D color video generation and reverse decoding system 100 of the present invention does not undertake any encoding function, but is only used for artistic coloring. The encoding information is all located on the three dimensions of texture, brightness, and frame order and the side channel file 500. The four have a single responsibility and do not interfere with each other.

[0065] In an embodiment of the present invention, line textures adopt 8 predefined spatial-domain textures, namely solid line, dashed line, dotted line, wavy line, broken line, dash-dot line, double line, and dotted circle line, which form a one-to-one mapping with the 8 basic strokes of the Eight Principles of Yong: horizontal stroke corresponds to solid line, vertical stroke corresponds to dashed line, left-falling stroke corresponds to dotted line, right-falling stroke corresponds to wavy line, dot stroke corresponds to broken line, rising stroke corresponds to dash-dot line, turning stroke corresponds to double line, and hook stroke corresponds to dotted circle line. This mapping table is solidified in the ROM mapping library 211 of the encoding-side security chip 210, and the hardware lookup circuit 212 directly reads out the texture parameters using the stroke type as the address index. The reason why textures are selected instead of hues is that textures are spatial-domain features, whose geometric structures are still retained after compression by the H.264 or H.265 digital video codec standards, whereas adjacent hues will be merged under 4:2:0 chroma subsampling and cannot be stably distinguished; meanwhile, the 8 textures have significant morphological differences and can still be distinguished even at low resolution.

[0066] The brightness level adopts a three-level discrete mapping, with the mapping rules as follows: the dark level corresponds to a brightness value L=20% to 35%, mapping to stroke numbers 0 to 3; the medium level corresponds to a brightness value L=45% to 60%, mapping to stroke numbers 4 to 6; the bright level corresponds to a brightness value L=70% to 90%, mapping to stroke numbers 7 to 9.

[0067] It is worth noting that the brightness value can be calculated by the following formula:

[0068] L=0.299R+0.587G+0.114B (Equation 1)

[0069] In the formula, R, G, and B are the normalized red, green, and blue components of the stroke line pixels respectively, and the coefficients 0.299, 0.587, and 0.114 are the luminance weights of the ITU-R BT.601 standard, with the calculation result expressed as a percentage.

[0070] The reason why three levels instead of continuous brightness are selected is that the minimum interval between the three levels is 10 percentage points (between 35% and 45%), and the maximum interval reaches 35 percentage points (between 35% and 70%), which has large measurement tolerance and high reliability under the differences of video compression and display devices; meanwhile, the luminance channel is completely retained under 4:4:4 sampling and does not undergo chroma subsampling, so the brightness level can be stably restored. The three-level brightness only locates the stroke number to an interval, and the exact number is determined within the interval by the dictionary constraint disambiguation unit at the subsequent decoding end in combination with the Chinese character stroke dictionary and context constraints, thereby balancing encoding robustness and restoration accuracy through the method of "coarse encoding + dictionary refinement".

[0071] In one embodiment of the present invention, the transparency layering rule of the 2.5D rendering module 222 is as follows: the background layer has a transparency of 50%, the middle layer has a transparency of 100%, the foreground layer has a transparency of 100% and an additional external glow, with a maximum of 3 layers. The information of each layer is encoded in the side channel file 500 without relying on the video image restoration. At least 2 pixels are reserved between strokes and they are not connected, so that the decoding end frame segmentation module 312 can reliably segment stroke segments.

[0072] Here, transparency α is related to the composite pixel color C. out The relationship is:

[0073] C out =α·C 笔画 +(1-α)·C 背景 (Equation 2)

[0074] In the formula, C 笔画 C is the color for this stroke. 背景 The background color is set to α, which ranges from 0 to 1. For the background layer, α=0.5 makes the background strokes semi-transparent to create depth. For the middle and foreground layers, α=1 makes the strokes completely opaque. An outer glow is then overlaid on the foreground layer to enhance the depth.

[0075] The reason for using 2.5D instead of continuous 3D depth is that when 3D is rendered into 2D video frames, the depth information cannot be uniquely restored after projection, which is an unsuitable problem; while 2.5D is only arranged in a 2D plane and distinguished by transparency by a maximum of 3 layers, and the layer information is stored separately in the side channel file 500, so the reverse decoding is mathematically reversible.

[0076] The stroke sequence reconstruction module 315 at the decoding end is also equipped with a dictionary constraint disambiguation unit 316. When the brightness measurement can only determine the range of the stroke number (0-3, 4-6 or 7-9), the precise stroke number is determined within the range by combining the Chinese character stroke dictionary and context constraints.

[0077] It is worth noting that the texture recognition module 313 and the error correction unit 322 of the decoding security chip 320 constitute a double-insurance decoding mechanism: the texture recognition outputs the texture category and confidence level, the error correction code redundancy rate is 20%, and its error correction capability t is related to the number of check bits nk as follows: (Equation 3)

[0078] In the formula, n is the total length of the codeword, k is the length of the information code element, and nk is the number of check code elements;

[0079] Redundancy (Equation 4)

[0080] That is, a redundancy rate of 20% can correct no more than 20% of symbol errors.

[0081] After error correction, the hash of the reconstructed sequence is calculated and compared with the original hash in the side-channel file 500. If they match, it is marked as a trusted decoder, thereby reducing the overall bit error rate to 10%. -6 If the hash comparison does not match, a decoding failure flag will be output and text restoration will be rejected.

[0082] Please refer to Figure 2 . Figure 2 This is a flowchart of a 2.5D color video generation method based on stroke texture and frame sequence encoding according to an embodiment of the present invention. Figure 2 As shown, the color video generation method of the above-mentioned 2.5D color video generation and reverse decoding system includes steps S1 to S4.

[0083] S1 Text Preprocessing: Input Chinese text 600 into the text preprocessing module 221 of the main processor 220 at the encoding end. The text preprocessing module 221 calls the prior Chinese stroke digitization generation-verification conversion to convert the text character by character into a stroke sequence arranged in the writing order. Each stroke has a stroke type and stroke number, and the 32 strokes are grouped into 8 basic stroke categories: horizontal, vertical, left-falling, right-falling, dot, rising, turning, and hook.

[0084] S2 encoding parameter generation: Within the security chip 210 at the encoding end, the hardware lookup table circuit 212 looks up the ROM mapping library 211. First, the stroke type is mapped to the corresponding line texture parameter, and second, the stroke number is mapped to the corresponding brightness level. At the same time, a continuous exclusive frame segment is allocated to each stroke according to the writing order. The starting frame number of the frame segment is used as the stroke order number of the stroke. For example, the first stroke occupies frames 1 to 10, and the second stroke occupies frames 13 to 22. Therefore, the stroke order number of the first stroke is 1, and the stroke order number of the second stroke is 13. Thus, the stroke order can be read directly from the frame number without measurement and deduction. Subsequently, the cryptographic operation unit 213 calculates the error correction code and SHA hash value for the complete stroke sequence, and writes it into the side channel file 500 after AES encryption.

[0085] S3 2.5D rendering: The 2.5D rendering module 222 arranges the strokes in the X / Y plane according to the structure of Chinese characters, and renders them one by one in frame order. Each stroke is drawn step by step from the beginning to the end within its own exclusive frame segment, and blank interval frames are reserved between strokes. Each stroke applies its corresponding line texture and brightness level, and is distinguished by transparency in up to 3 levels. The visible light color can be freely specified by the user.

[0086] S4 Output: The video encoding module 223 encodes and outputs a standard video file 400, and the side-channel file generation module 224 outputs a side-channel file 500 that is separated from and mutually bound to the video file 400. The aforementioned separation means that the video file 400 and the side-channel file 500 are two independent file entities that are stored and transmitted separately; the side-channel file 500 is not embedded within video frames and does not undergo a video encoding / decoding process, so it is not affected by video compression. The aforementioned mutual binding means that the two are in one-to-one correspondence through the same unique identifier field; the error correction code, hash value, and encrypted information in the side-channel file 500 are calculated based on the complete stroke sequence corresponding to the video file 400. During decoding, both must be loaded simultaneously and verified via the identifier field and hash check before the reconstructed stroke sequence can be marked as trusted and decoded.

[0087] As an example: when inputting the Chinese character "人", the first stroke "pie" (left-falling stroke) with number 3 is mapped to a dotted line texture, dark brightness level, and frame segments 1 to 10; the second stroke "na" (right-falling stroke) with number 5 is mapped to a wavy line texture, medium brightness level, and frame segments 13 to 22 (with 2 blank frames in between). After the user colors the "pie" stroke gold and the "na" stroke silver, an MP4 video and a .sig side-channel file are output after rendering.

[0088] In an embodiment of the present invention, the line texture parameters in step S2 are one of 8 predefined spatial-domain textures: solid line, dashed line, dotted line, wavy line, polyline, dash-dot line, double line, and dot-dash line, which are in one-to-one correspondence with the 8 basic strokes of the Eight Principles of Yong: horizontal stroke, vertical stroke, left-falling stroke, right-falling stroke, dot stroke, rising stroke, turning stroke, and hook stroke. This mapping table is solidified in the ROM mapping library 211 and directly read out by the hardware lookup circuit 212.

[0089] The brightness levels are three discrete brightness levels: the dark level corresponds to a brightness value L=20% to 35% and stroke numbers 0 to 3, the medium level corresponds to a brightness value L=45% to 60% and stroke numbers 4 to 6, and the bright level corresponds to a brightness value L=70% to 90% and stroke numbers 7 to 9. The brightness value is calculated according to the following formula:

[0090] L=0.299R+0.587G+0.114B (Equation 1)

[0091] In the formula, R, G, and B are the normalized red, green, and blue components of the stroke line pixels, and the coefficients are derived from the ITU-R BT.601 standard.

[0092] In step S3, each stroke occupies 10 frames by default, and 2 blank interval frames are reserved between strokes. Therefore, the starting frame number F of the m-th stroke m can be expressed as:

[0093] F m =1+(m-1)×12 (Equation 5)

[0094] For example, the starting frame number of the first stroke is 1, the starting frame number of the second stroke is 13, the starting frame number of the third stroke is 25, and so on.

[0095] This formula enables the frame segmentation module 312 to directly reversely derive the stroke sequence number during decoding.

[0096] An illustrative example is provided as follows: the input character "Yong" consists of 8 strokes. The first stroke "dot" with the number 7 is mapped to a polyline texture, a brightness level, and frame segments 1 to 10; the second stroke "horizontal" with the number 1 is mapped to a solid line texture, a dark level, and frame segments 13 to 22; the third stroke "vertical" with the number 2 is mapped to a dashed line texture, a dark level, and frame segments 25 to 34. The remaining strokes are sequentially extended, with 2 blank frames reserved between each pair of strokes.

[0097] In an embodiment of the present invention, the transparency differentiation in step S3 includes at most 3 levels, specifically: the background layer has a transparency of 50%, the middle layer has a transparency of 100%, and the foreground layer has a transparency of 100% with an additional outer glow. The compositing relationship is as follows:

[0098] C out =α·C 笔画 +(1-α)·C 背景 (Equation 2)

[0099] In the equation, α is the transparency with a value ranging from 0 to 1, C 笔画 is the color of the stroke, and C 背景 is the background color. The background layer with α=0.5 represents depth, while the middle layer and the foreground layer with α=1 make the strokes completely opaque, and the foreground layer is further overlaid with an outer glow. A gap of at least 2 pixels is maintained between strokes without connecting them, so that the frame segmentation module 312 at the decoding end can reliably segment stroke fragments. Information of each layer is written into the side-channel file 500 instead of being encoded in the video frame. The side-channel file 500 carries error correction codes, hash values, encrypted information, and mode flags, and is transmitted separately from the video file 400, thus being unaffected by video compression. Its size is usually less than 10KB, facilitating bundled delivery with the video.

[0100] A practical example is provided: for the character "Yue", three-layer rendering is adopted. The background layer is placed with outer frame strokes (α=0.5), the middle layer is placed with two internal horizontal strokes (α=1), and the foreground layer is placed with the final vertical hook stroke with an outer glow (α=1). Information of all three layers is recorded in the .sig file. After the video is secondarily compressed by social media platforms, the texture and frame sequence can still be restored from the frame, while the layer information is directly read from the .sig file.

[0101] It should be noted that the crossing and connecting relationships between strokes of original Chinese characters have been converted into an independent stroke sequence arranged in writing order during the text preprocessing stage. After being processed by the aforementioned 2.5D rendering module, the rendered result maintains a gap of at least 2 pixels between the aforementioned independent strokes without connecting or crossing them.

[0102] Please refer to Figure 3. Figure 3 This is a flowchart of a 2.5D color video reverse decoding method based on stroke texture and frame sequence encoding according to an embodiment of the present invention. Figure 3 As shown, this method is executed by the decoding device 300 and includes steps S1 to S7.

[0103] S1 Input and Frame Segmentation: The video file 400 and its bound side channel file 500 are input to the video decoding module 311 of the main processor 310 at the decoding end. After decoding the video, the frame segmentation module 312 divides the video into multiple stroke segments according to the frame order and the blanking interval between strokes, for example, according to the aforementioned F... m The formula, along with a 2-frame blank interval, can be used to cut out segments such as frames 1 to 10 and frames 13 to 22.

[0104] S2 Texture Recognition: The texture recognition module 313 uses a deep learning classification model to identify the line texture type of each stroke segment's intermediate frames, outputting the texture category and confidence level. For example, segment 1 is identified as a dotted line (confidence level 0.98), and segment 2 is identified as a wavy line (confidence level 0.97).

[0105] S3 Brightness Measurement: The brightness measurement module 314 measures the average brightness of the stroke lines of the stroke segment and maps it to a brightness level, thereby determining the stroke number range corresponding to the brightness level. For example, if the brightness of segment 1 is measured to be 28%, it belongs to the dark level and corresponds to the number 0 to 3, and the brightness of segment 2 is 52%, it belongs to the medium level and corresponds to the number 4 to 6.

[0106] S4 Stroke order determination: The stroke sequence reconstruction module 315 determines the writing order by sorting the starting frame numbers of each stroke segment, for example, starting frame number 1 first and frame number 13 last.

[0107] S5 Stroke Sequence Reconstruction: Reconstruct the stroke sequence by combining the stroke number range corresponding to the texture type and brightness level, as well as the fragment start frame number.

[0108] S6 Error Correction and Verification: The side channel file 500 is decrypted in the security chip 320 at the decoding end. The side channel file decryption unit 321 obtains the error correction code and the original hash value. The error correction code correction unit 322 corrects the errors in texture recognition or brightness measurement with the error correction code. The hash verification unit 323 calculates the hash value of the reconstructed stroke sequence and compares it with the original hash value. If they match, it is marked as a trusted decoder.

[0109] S7 Text Restoration: The reverse lookup unit 324 restores the reconstructed stroke sequence into Chinese text 700 by reverse lookup, and outputs the original text and decoding confidence.

[0110] As a practical example: in the previous example, the identified dotted line corresponds to a pie stroke and the wavy line corresponds to a na stroke, with brightness ranges of 0 to 3 and 4 to 6 respectively, and the frame order is pie stroke first and na stroke later. After error correction and dictionary constraint, the pie stroke is determined to be number 3 and the na stroke is number 5. The hash check passes, and reverse table lookup restores the character "人" with a confidence of 99.99%.

[0111] It is worth noting that in an embodiment of the present invention, the deep learning classification model in the texture recognition of step S2 is a lightweight convolutional neural network classification model. Its training samples are generated from the stroke shape parameters extracted from the stroke comparison library, that is, from the stroke comparison library covering all Chinese characters in GB18030, stroke shape parameters are extracted according to 8 texture categories, and texture images under different resolutions, different compression intensities, and different color cast conditions are synthesized as the training set, so that the model is robust to H.264 or H.265 compression, device color gamut differences, and ambient light interference.

[0112] In step S6, the redundancy rate of the error correction code is 20%, and the relationship between its error correction capability t and the number of check symbols n-k is: (Equation 3)

[0113] In the equation, n is the total codeword length, k is the information symbol length, and n-k is the number of check symbols;

[0114] Redundancy rate (Equation 4)

[0115] That is, a redundancy rate of 20% can correct no more than 20% of symbol errors.

[0116] For example, if n=100 and k=80, the number of check symbols is 20, and t=10 symbol errors can be corrected, that is, no more than 20% of symbol errors. After the double insurance mechanism of texture recognition and error correction code error correction, the overall bit error rate drops to 10 -6 or less.

[0117] An example is as follows: if 2 strokes in a sequence of 10 strokes have their textures misidentified, as long as the number of error symbols does not exceed 20%, the RS (Reed-Solomon, abbreviated as RS) error correction can correct them; if the error correction capability is exceeded, the hash check unit 323 will detect it and output a decoding failure flag to avoid outputting erroneous text.

[0118] In an embodiment of the present invention, in the brightness measurement of step S3, when the brightness measurement can only determine the interval where the stroke number is located but cannot determine the exact number, in the error correction and check of step S6, the dictionary constraint disambiguation unit 316 combines the Chinese character stroke dictionary and context constraints to determine the exact stroke number within the interval.

[0119] As an example: the measured brightness of the first stroke is in the dark level, with the number range 0 to 3, and it cannot be directly determined whether it is 0, 1, 2 or 3; at this time, the dictionary constraint disambiguation unit 316 queries the Chinese character stroke dictionary, and only the left-falling stroke (No. 3) in the first stroke candidate set of the character "人" meets the requirements, and the context constraint requires the first stroke to be a left-falling stroke and the second stroke to be a right-falling stroke, so No. 3 is uniquely determined. For another example, the prefix stroke of the character "永" is a dot (No. 7), and the second stroke is a horizontal stroke (No. 1). If the measured first stroke belongs to the bright level (No. 7 to 9) and the second stroke belongs to the dark level (No. 0 to 3), it can be uniquely determined by combining the stroke dictionary and stroke order constraints of the character "永".

[0120] In the error correction and verification of step S6, when the hash comparison is inconsistent, the hash verification unit 323 outputs a decoding failure flag and rejects text restoration, thereby avoiding outputting incorrect text in an untrusted state. This two-level decoding method of "coarse coding + dictionary refinement" enables the brightness to only stably distinguish three levels, and the precise number is supplemented by the dictionary and context, which takes into account both robustness and accuracy.

[0121] It is worth noting that, in an embodiment of the present invention, a generation-verification self-supervised closed loop step is further included: regenerating a video from the stroke sequence reconstructed by text restoration in step S7 according to the above forward generation method, comparing the difference between the regenerated video and the video input in step S1 input and frame segmentation, and adjusting the frame segmentation parameters, texture recognition model parameters or brightness measurement parameters when the difference is higher than a threshold, then re-executing steps S1 to S7 until the difference is lower than the threshold; and taking the finally obtained stroke sequence as the digital fingerprint of the video for copyright deposit or content traceability.

[0122] The difference measure may adopt pixel-level difference or structural similarity SSIM, which is defined as: (Equation 6)

[0123] In the formula, x and y are the original video frame and the regenerated video frame respectively, μ x and μ y are their mean values, and are their variances, σ xy is their covariance, and C1 and C2 are small constants to avoid the denominator being zero; when the SSIM is higher than a threshold (for example, 0.98), it is determined that the difference is lower than the threshold and the closed loop converges.

[0124] For example, consider a video of the calligraphy piece "Bright Moonlight Before My Bed" in seven colors. The initial decomposition resulted in a SSIM (Segment Simulation Index) of only 0.90 due to frame segmentation boundary offset. Therefore, after calling back the blank interval judgment threshold of frame segmentation module 312, steps S1 to S7 were re-executed. The second SSIM increased to 0.99, and the loop converged. Finally, the stroke sequence was written as the video's digital fingerprint into the copyright registration record for infringement detection and AI content tracing. This closed loop requires no manual annotation of training data and can continuously improve decomposition accuracy during use.

[0125] The embodiments of the present invention described above can be implemented in various hardware, software codes, or combinations thereof. For example, embodiments of the present invention can also be program code executing the above methods in a Digital Signal Processor (DSP). The present invention can also relate to various functions executed by a computer processor, digital signal processor, microprocessor, or Field Programmable Gate Array (FPGA). The processor described above can be configured to perform specific tasks according to the present invention, which are accomplished by executing machine-readable software code or firmware code defining the specific methods disclosed in the present invention. The software code or firmware code can be developed into different programming languages ​​and different formats or forms. The software code can also be compiled for different target platforms. However, the different code styles, types, and languages ​​of the software code performing tasks according to the present invention and other types of configuration code do not depart from the spirit and scope of the present invention.

Claims

1. A 2.5D color video generation and reverse decoding system based on stroke texture and frame sequence coding, comprising: An encoding device and a decoding device are provided, both of which adopt an architecture that integrates a security chip and a main processor. The encoding device includes an encoding security chip and an encoding main processor; The ROM of the security chip at the encoding end contains a stroke type-line texture mapping library, a stroke number-brightness level mapping rule, and error correction code parameters, and is equipped with a hardware lookup table circuit and a cryptographic operation unit. The hardware lookup table circuit is used to complete the conversion from stroke type to line texture parameters and the conversion from stroke number to brightness level. The cryptographic operation unit is used to perform error correction coding, hash calculation, and encryption operation on the complete stroke sequence to generate a side channel file. The main processor at the encoding end includes a text preprocessing module, a 2.5D rendering module, a video encoding module, and a side-channel file generation module. The text preprocessing module converts the input Chinese text into a stroke sequence arranged in writing order and categorizes the stroke sequence into eight basic stroke categories. The 2.5D rendering module arranges the strokes in the X / Y plane according to the structure of Chinese characters, renders the stroke animation with line textures and brightness levels frame by frame, and distinguishes up to three levels by transparency. The video encoding module outputs a standard video file. The side-channel file generation module outputs a side-channel file separate from the video file. The decoding device includes a decoding main processor and a decoding security chip; The main processor at the decoding end includes a video decoding module, a frame segmentation module, a texture recognition module, a brightness measurement module, and a stroke sequence reconstruction module. The frame segmentation module is used to segment the video into multiple stroke segments based on the frame order and the blanking intervals between strokes. The texture recognition module is used to identify the line texture type of each stroke segment using a deep learning classification model. The brightness measurement module is used to measure the average brightness of the stroke lines and map it to a brightness level. The stroke sequence reconstruction module is used to reconstruct the stroke sequence by combining the texture type, brightness level, and the starting frame number of the segment. The decoding end security chip is used for decrypting side-channel files, error correction code correction, hash verification, and reconstructing the stroke sequence into Chinese text by reverse lookup table.

2. The 2.5D color video generation and reverse decoding system according to claim 1, characterized in that: The line textures are eight predefined spatial domain textures, including solid lines, dashed lines, dotted lines, wavy lines, broken lines, dotted-dash lines, double lines, and round-dot lines. The eight line textures and the eight basic strokes—horizontal, vertical, left-falling, right-falling, dot, rising, turning, and hook—form a one-to-one mapping relationship. The stroke number-brightness level mapping rule is a three-level discrete brightness mapping.

3. The 2.5D color video generation and reverse decoding system according to claim 1, characterized in that, The transparency layering rules of the 2.5D rendering module are as follows: background layer transparency 50%, middle layer transparency 100%, foreground layer transparency 100% with added outer glow; strokes are spaced at least 2 pixels apart and are not connected; the information of each layer is encoded in the side channel file without relying on video image reconstruction; The stroke sequence reconstruction module is also equipped with a dictionary constraint disambiguation unit, which is used to determine the precise stroke number in the interval by combining the Chinese character stroke dictionary and context constraints when the brightness measurement can only determine the interval where the stroke number is located. The texture recognition module and the error correction code of the decoding end security chip constitute a double-insurance decoding mechanism.

4. A method for generating 2.5D color video based on stroke texture and frame sequence coding, comprising the following steps: S1. Input Chinese text and convert it into a stroke sequence arranged in writing order. The stroke sequence includes the stroke type and stroke number of each stroke, and the stroke types are grouped into 8 basic stroke categories. S2. Within the security chip, a hardware lookup table is used to map stroke types to corresponding line texture parameters, stroke numbers to corresponding brightness levels, and a continuous exclusive frame segment is allocated to each stroke according to the writing order. The starting frame number of the frame segment is used as the stroke order number of the stroke. Error correction codes and hash values ​​are calculated for the complete stroke sequence, encrypted, and written to the side channel file. S3. Arrange the strokes in the X / Y plane according to the structure of Chinese characters, and render them one by one in frame order. Each stroke is drawn step by step from the beginning to the end in its own frame segment, and blank interval frames are reserved between strokes. Each stroke applies its corresponding line texture and brightness level, and distinguishes up to 3 levels by transparency. The visible light color can be freely specified by the user. S4. Encode and output a standard video file, and output a side channel file that is separate from and bound to the video file.

5. The 2.5D color video generation method according to claim 4, characterized in that: The line texture parameter in step S2 is one of eight predefined spatial domain textures, and the eight spatial domain textures are mapped one-to-one with the eight basic strokes; the brightness level is three discrete brightness levels; in step S3, each stroke occupies 10 frames by default, and two blank interval frames are reserved between strokes.

6. The 2.5D color video generation method according to claim 4, characterized in that, The transparency distinction in step S3 is divided into up to three levels: background layer with 50% transparency, middle layer with 100% transparency, and foreground layer with 100% transparency and an added outer glow; the strokes are spaced at least 2 pixels apart and are not connected; the information of each layer is written into the side channel file and not encoded in the video frame; the side channel file carries error correction code, hash value, encryption information and mode flag, and is transmitted separately from the video file and is therefore not affected by video compression.

7. A method for reverse decoding of 2.5D color video based on stroke texture and frame sequence encoding, comprising the following steps: S1. Input the video file and its bound side channel file, decode the video, and divide the video into multiple stroke segments according to the frame order and the blank interval between strokes. S2. For the intermediate frames of each stroke segment, use a deep learning classification model to identify its line texture type and output the texture category and confidence level. S3. Measure the average brightness of the stroke lines of the stroke segment, map it to a brightness level, and determine the stroke number range corresponding to the brightness level. S4. Sort the strokes according to the starting frame number of each stroke segment to determine the writing order of the strokes; S5. Combine the stroke number range corresponding to the texture type and brightness level, as well as the fragment start frame number, to reconstruct the stroke sequence; S6. Decrypt the side channel file within the security chip, obtain the error correction code and the original hash value, use the error correction code to correct errors in texture recognition or brightness measurement, calculate the hash value of the reconstructed stroke sequence and compare it with the original hash value. If they match, mark it as a trusted decoder. S7. Reverse lookup the reconstructed stroke sequence to restore the Chinese text, and output the original text and decoding confidence score.

8. The 2.5D color video reverse decoding method according to claim 7, characterized in that: The deep learning classification model mentioned in step S2 is a lightweight convolutional neural network classification model, whose training samples are generated from the stroke morphology parameters extracted from the stroke comparison library; the error correction code redundancy rate mentioned in step S6 is 20%, the error correction capability is no more than 20% of the code symbol errors, and the bit error rate is reduced to 10%. -6 the following.

9. The 2.5D color video reverse decoding method according to claim 7, characterized in that, In step S3, when the brightness measurement can only determine the range of the stroke number but not the exact number, in step S6, the exact stroke number is determined within the range by combining the Chinese character stroke dictionary and contextual constraints; and in step S6, when the hash comparison is inconsistent, a decoding failure flag is output and text restoration is rejected.

10. The 2.5D color video reverse decoding method according to claim 7, characterized in that, It also includes a generation-verification self-supervised closed-loop step: the stroke sequence reconstructed in step S7 is used to regenerate the video using the forward generation method. The regenerated video is compared with the video input in step S1. When the difference is higher than the threshold, the frame segmentation parameters, texture recognition model parameters, or brightness measurement parameters are adjusted and steps S1 to S7 are re-executed until the difference is lower than the threshold. The final stroke sequence is used as the digital fingerprint of the video for copyright registration or content traceability.