Image index, document laying method thereof, and decoding method

By designing the coding unit and reference unit in the image index, the problem of code points being unable to be recognized and decoded in complex backgrounds was solved, thereby improving the recognition rate and decoding rate while maintaining the coding rules and reducing production costs.

CN122457722APending Publication Date: 2026-07-24SHENZHEN BANGBANGBANG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BANGBANGBANG TECH CO LTD
Filing Date
2025-01-23
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

When processing regions with complex backgrounds, existing technologies fail to effectively handle the impact of grayscale content on the code points, resulting in the code points being unable to be effectively identified and decoded.

Method used

Design an image index including an encoding unit and a reference unit in the dot matrix unit. The encoding unit represents the encoded information through a preset encoding algorithm, and the reference unit provides a coordinate reference. By adjusting the offset, rotation and number of pixel units of the encoding pattern and the reference pattern, it can adapt to different backgrounds and grayscale content, ensuring the recognizability and decoding of the code points in complex areas.

Benefits of technology

While maintaining the original code point encoding rules, it improves the recognition and decoding rates of code points in complex backgrounds, reduces production costs, reduces reliance on high-cost printing equipment, and is suitable for printing scenarios with different resolutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122457722A_ABST
    Figure CN122457722A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image recognition, solves the problem that the code point design of the prior art cannot effectively deal with the influence of gray content on the code point when processing a region containing a complex background, and provides an image index, a document laying method and a decoding method thereof.The image index comprises a plurality of dot matrix units, including a plurality of encoding units and / or a plurality of reference units, and in a dot matrix unit: the distance between the centers of adjacent reference units is a first preset distance, the reference pattern and the encoding pattern are different, the offset position and / or the rotation angle of the encoding pattern of the encoding unit representing different encoding information about the geometric center of the corresponding encoding unit are different;in different dot matrix units, the number of pixel units constituting the reference pattern is the same or different, and the number of pixel units constituting the encoding pattern is the same or different.The present application reduces the dependence on high-cost printing equipment, and at the same time improves the recognition rate of the code point in a complex background.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and in particular to an image index, its document laying method, and decoding method. Background Technology

[0002] In modern printing technology, codes (such as QR codes and barcodes) are widely used for information transmission and data identification. However, in practical applications, especially during printing using a single black dot, the "single black" problem is frequently encountered. This means that the image content appearing in the code dot area is printed as a single black dot, causing interference from the image content and making the code dots unrecognizable and undecoded. Traditional solutions to this problem mainly focus on adjusting printing parameters, optimizing code design, and improving printing processes.

[0003] Traditional code dot encoding techniques typically employ fixed encoding rules to represent data. These rules include the arrangement of the dot matrix units and the encoding pattern of each unit. A common problem when printing these code dots is that if the code dot area contains grayscale content (such as text or images), this grayscale content may be printed as a single black, leading to the loss of code dot information or decoding failure. This is because traditional code dot designs fail to effectively handle the impact of grayscale content on the code dots when dealing with areas containing complex backgrounds. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide image metrics, their document laying methods and decoding methods to solve the problem that the existing code point design fails to effectively handle the influence of grayscale content on code points when processing areas with complex backgrounds.

[0005] In a first aspect, embodiments of the present invention provide an image index, which is laid on a document including text and / or patterns. The image index comprises: a plurality of dot matrix units laid at different positions in the document, each dot matrix unit including a plurality of encoding units and / or a plurality of reference units. The encoding units are used to characterize encoded information obtained through a preset encoding algorithm. Each reference unit includes a reference pattern composed of a plurality of pixel units, the center of which is located at the geometric center of the reference unit. The encoding unit includes an encoding pattern composed of a plurality of pixel units.

[0006] In one of the dot matrix units: the spacing between the centers of adjacent reference units is a first preset distance; the reference pattern and the encoding pattern are different; the offset position and / or rotation angle of the encoding pattern of the encoding unit representing different encoding information about the geometric center of the corresponding encoding unit are different; the number of pixel units constituting the encoding pattern is the same or different; the number of pixel units constituting the encoding pattern and / or the reference pattern is determined based on the gray level of the text and / or pattern corresponding to the position of the encoding pattern and / or the reference pattern in the document.

[0007] Preferably, in one of the dot matrix units, the minimum spacing between the centers of adjacent coding units is the second preset distance, the spacing between the centers of the coding patterns of adjacent coding units is greater than or equal to the second preset distance, and the first preset distance is greater than or equal to the second preset distance; the minimum spacing between adjacent coding units is the third preset distance, and the second preset distance is greater than the third preset distance.

[0008] Preferably, the dot matrix unit is a polygon, the reference pattern is a symmetrical pattern, and the encoding pattern is a symmetrical or asymmetrical pattern; in one dot matrix unit, the reference unit is set at a specified position along the dot matrix unit, and the combined pattern composed of multiple reference units is used for the division of any two adjacent dot matrix units and / or coordinate reference positioning.

[0009] Secondly, embodiments of the present invention also provide a document laying method for image indicators, wherein the image indicator is any one of the image indicators described in the first aspect, and the document laying method includes:

[0010] Render the document to be laid to obtain the image to be laid;

[0011] The image to be laid is converted to grayscale to obtain a first grayscale image;

[0012] Based on the size information of the first grayscale image and the basic parameters of the dot matrix units in the image index, the position information of each dot matrix unit is determined;

[0013] The first grayscale image is segmented according to the location information to obtain a second grayscale image corresponding to each of the dot matrix units;

[0014] Based on the gray level of the second grayscale image, adjust the encoding pattern and / or reference pattern in the corresponding dot matrix unit to obtain the third grayscale image;

[0015] The target document image is obtained based on all the aforementioned third grayscale images.

[0016] Preferably, the step of adjusting the encoding pattern and / or reference pattern in the corresponding dot matrix unit according to the gray level of the second grayscale image to obtain the third grayscale image includes:

[0017] Based on the grayscale level of the second grayscale image, determine the first target number of pixel units constituting the coded pattern and / or the second target number of pixel units constituting the reference pattern in the corresponding dot matrix unit;

[0018] Based on the first target quantity and / or the second target quantity, adjust the coding pattern and / or the reference pattern in the corresponding dot matrix unit to obtain the target dot matrix unit;

[0019] The third grayscale image is obtained by replacing the corresponding second grayscale image with the target dot matrix unit.

[0020] Preferably, the basic parameters of the dot matrix unit include a first initial number of pixel units constituting the encoded pattern and a second initial number constituting the reference pattern. The step of determining the first target number of pixel units constituting the encoded pattern and / or the second target number of pixel units constituting the reference pattern in the corresponding dot matrix unit based on the grayscale level of the second grayscale image includes:

[0021] Based on the position of the text and / or pattern in the second grayscale image, determine the corresponding coded pattern and / or reference pattern that needs to be adjusted in the dot matrix unit, and denot them as the coded pattern to be adjusted and the reference pattern to be adjusted, respectively.

[0022] Based on the gray level, the first initial quantity, the second initial quantity, and the preset gray level mapping relationship, determine the coverage of the coded pattern to be adjusted and the reference pattern to be adjusted in the corresponding second gray level image;

[0023] Based on the coverage rate, determine the first target number of the coded pattern to be adjusted and / or the second target number of pixel units of the reference pattern to be adjusted.

[0024] Preferably, the step of adjusting the encoding pattern and / or the reference pattern in the corresponding dot matrix unit according to the first target quantity and / or the second target quantity to obtain the target dot matrix unit includes:

[0025] Obtain the offset direction of each of the coded patterns to be adjusted in the corresponding coded unit;

[0026] Based on the offset direction of each of the coded patterns to be adjusted, the expansion direction of the corresponding coded pattern to be adjusted is determined, wherein different offset directions correspond to different expansion directions;

[0027] The target coding pattern is obtained by expanding the corresponding coding pattern to be adjusted along the expansion direction according to the first difference between the first initial quantity and the first target quantity, and / or, the target reference pattern is obtained by expanding the reference pattern to be adjusted along the preset expansion direction according to the second difference between the second initial quantity and the second target quantity, wherein the offset direction of the target coding pattern and the corresponding coding pattern before expansion is the same.

[0028] Based on the target encoding pattern and / or target reference pattern, the text and / or pattern in the corresponding second grayscale image are approximated to obtain the target dot matrix unit.

[0029] Preferably, the step of expanding the corresponding coding pattern to be adjusted along the expansion direction according to the first difference between the first initial quantity and the first target quantity to obtain the target coding pattern includes:

[0030] The boundary pixel threshold is determined based on the size of the encoding unit;

[0031] If the number of the first target is greater than the boundary pixel threshold, the corresponding coding pattern to be adjusted is expanded along the expansion direction according to the boundary pixel threshold to obtain the initial coding pattern;

[0032] Based on the second difference between the first target quantity and the boundary pixel threshold, the initial coding pattern is extended in a direction opposite to the extension direction to obtain the target coding pattern;

[0033] If the number of the first target is less than the boundary pixel threshold, the corresponding coding pattern is expanded along the expansion direction according to the first difference to obtain the target coding pattern.

[0034] Thirdly, embodiments of the present invention also provide a method for decoding image indicators, wherein the image indicator is any of the image indicators described in the first aspect, and the image indicator is laid on a target document using the document laying method for image indicators described in the second aspect, the decoding method comprising:

[0035] The infrared detection image of the target document is acquired using an image acquisition device;

[0036] The infrared image is preprocessed to obtain an initial detection image, wherein the preprocessing includes noise reduction and binarization.

[0037] Based on the initial detection image and the preset code point detection algorithm, obtain the initial coordinate information of all reference patterns and all encoded patterns in the initial detection image;

[0038] Based on the initial coordinate information of the reference pattern, obtain the perspective transformation matrix of the initial detection image and the standard image including the image index corresponding to the target document, wherein the number of reference patterns is greater than or equal to the preset number of reference patterns, and at least one of the reference patterns is not collinear with the rest of the reference patterns;

[0039] The initial detection image is inversely transformed according to the perspective transformation matrix to obtain the target detection image;

[0040] Based on the target detection image and the preset encoding algorithm, the target decoding information of the target dot matrix unit and the trajectory coordinates of the image acquisition device are obtained.

[0041] Preferably, the image acquisition device is disposed on a dot matrix pen, the dot matrix pen including a pen tip, a pen body, and an image acquisition device disposed on the pen body, wherein obtaining the target decoding information of the target dot matrix unit and the trajectory coordinates of the image acquisition device movement based on the target detection image and the preset encoding algorithm includes:

[0042] Acquire the acquisition time of the infrared detection image and / or the pressure data of the pen tip on the target document;

[0043] Based on the target detection image, the spacing between each of the reference patterns and at least one of the dot matrix units are obtained and denoted as the target dot matrix unit;

[0044] Based on the position coordinates of the target dot matrix unit, the spacing, and the distance between the image acquisition device and the pen tip, the position offset of the imaging device relative to the target dot matrix unit is obtained;

[0045] Based on the position offset and the position coordinate information of the punctuation matrix unit, the coordinate position of the pen tip on the target document is obtained and recorded as the pen tip coordinate information;

[0046] Based on all coding units in the target detection image and the preset coding algorithm, initial coding information is obtained;

[0047] Based on the pen tip coordinate information, the initial encoding information, the acquisition time, and the pressure data, the target decoding information and the trajectory coordinates of the image acquisition device are obtained.

[0048] In summary, the beneficial effects of the present invention are as follows:

[0049] The dot matrix unit in the image index of this invention includes several coding units and / or several reference units. The reference unit is composed of several pixel units, forming a reference pattern, the center of which is located at the geometric center of the reference unit. The coding unit includes a coding pattern composed of several pixel units, used to represent the coding information obtained through a preset coding algorithm. Multiple reference units combined, having a specific combination pattern, can determine the range of a dot matrix unit, used for the division of any two adjacent dot units and / or coordinate reference positioning. Within a dot matrix unit, reference units can be set in the same area of ​​each dot matrix unit according to pre-agreed coding rules. The most common setting position is, for example, setting it at the outermost edge or center of the dot matrix unit, but it can also be set in any other position within the same area. There is a fixed spacing (a first preset distance) between the centers of adjacent reference units, and the coding patterns of different coding units have different offset positions and / or rotation angles. This design allows the pattern of the coding unit to better adapt to different backgrounds and grayscale content. In the grayscale content area, code points with different code block coverage rates are used to approximate the grayscale image content within the code block. This method enables single-black printed documents without altering the code point encoding rules, ensuring that the text and images contained within are recognizable to the human eye. Simultaneously, it guarantees that the code points within the printed paper can be effectively captured and decoded by a dot matrix pen. Finally, the number of pixel units in the reference pattern and / or the encoded pattern can be the same or different. The number of pixel units is determined based on the grayscale level of the text and / or image at the location of the reference pattern and / or encoded pattern. By separating the reference unit from the encoded unit and dynamically adjusting the number of pixel units based on grayscale levels, efficient decoding in various complex documents is ensured. This image index design is suitable for printing scenarios with different resolutions. When code points are located in areas containing grayscale content such as text and images, different code block coverage rates are used to approximate the grayscale information of these areas. In low-resolution scenarios, the encoded pattern and the reference pattern can be dynamically adjusted to ensure human visual recognizability. This invention not only solves the "single black" problem in traditional technologies but also improves printing and printing quality while maintaining the original code point encoding rules. By optimizing the design of the dot matrix units and encoding units, the reliance on high-cost printing equipment is reduced, while the recognition rate of code dots in complex backgrounds is improved. Thus, this invention not only effectively enhances the readability of code dots but also reduces production costs, making this code dot representation method promising for a wide range of applications. Attached Figure Description

[0050] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments of the present invention will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, and these are all within the protection scope of the present invention.

[0051] Figure 1a This is a schematic diagram of the structure of the image index in an embodiment of the present invention.

[0052] Figure 1b This is a schematic diagram of the dot matrix unit of the image index according to an embodiment of the present invention, with the reference unit located at the edge of the dot matrix unit.

[0053] Figure 1c This is a schematic diagram of another dot matrix unit of the image index in an embodiment of the present invention, with the reference unit located at the center of the dot matrix unit.

[0054] Figure 1d This is a schematic diagram of the spacing between the centers of the reference units described in an embodiment of the present invention.

[0055] Figure 1e This is a schematic diagram of the spacing between the centers of the encoding units according to an embodiment of the present invention.

[0056] Figure 1f This is a schematic diagram of the spacing between encoding units according to an embodiment of the present invention.

[0057] Figure 2a This is a schematic diagram of the structure of the encoding unit according to an embodiment of the present invention.

[0058] Figure 2b This is another structural schematic diagram of the encoding unit in an embodiment of the present invention.

[0059] Figure 2c This is another structural schematic diagram of the encoding unit in an embodiment of the present invention.

[0060] Figure 2d This is a schematic diagram of the structure of the reference unit in an embodiment of the present invention.

[0061] Figure 3 This is a schematic diagram of the spacing between encoding units in an embodiment of the present invention.

[0062] Figure 4 This is a schematic diagram of an 8*8 dot matrix unit according to an embodiment of the present invention.

[0063] Figure 5 This is a flowchart illustrating the document laying method for image indicators according to an embodiment of the present invention.

[0064] Figure 6 This is another flowchart illustrating the document laying method for image indicators according to an embodiment of the present invention.

[0065] Figure 7 This is a schematic diagram illustrating the approximate fitting of character A according to an embodiment of the present invention.

[0066] Figure 8 This is a schematic diagram illustrating the expansion of the encoding pattern in an embodiment of the present invention.

[0067] Figure 9 This is a flowchart illustrating the image index decoding method according to an embodiment of the present invention.

[0068] Figure 10a This is a schematic diagram of the original region of the document image in an embodiment of the present invention.

[0069] Figure 10b This is a schematic diagram of the document image tiling result in an embodiment of the present invention.

[0070] Figure 10c This is a photographic representation of the effect of printing a document image after being laid out with code, according to an embodiment of the present invention. Detailed Implementation

[0071] The features and exemplary embodiments of various aspects of the present invention will now be described in detail. To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present invention and are not configured to limit the present invention. For those skilled in the art, the present invention can be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the invention.

[0072] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.

[0073] It should be noted that all actions involving the acquisition of signals, information, or data in this invention are carried out in compliance with the relevant data protection laws and regulations of the locality and with authorization from the owner of the relevant device.

[0074] Example 1

[0075] This invention provides an image index, which is laid on a document including text and / or images. The image index includes: a plurality of dot matrix units laid at different positions in the document. The dot matrix units include a plurality of reference units and / or a plurality of encoding units. The encoding units are used to characterize encoded information obtained by a preset encoding algorithm. The reference unit includes a reference pattern composed of a plurality of pixel units. The reference pattern is set at the geometric center of the reference unit. The encoding unit includes an encoding pattern composed of a plurality of pixel units.

[0076] In one of the dot matrix units: the spacing between the centers of adjacent reference units is a first preset distance; the reference pattern and the encoding pattern are different; the offset position and / or rotation angle of the encoding pattern of the encoding unit representing different encoding information about the geometric center of the corresponding encoding unit are different; the number of pixel units constituting the encoding pattern is the same or different; the number of pixel units constituting the encoding pattern and / or the reference pattern is determined based on the gray level of the text and / or pattern corresponding to the position of the encoding pattern and / or the reference pattern in the document.

[0077] Specifically, such as Figures 1a to 1b As shown, a dot matrix unit is the basic component of the entire dot matrix code, consisting of a specific set of pixels. These dot matrix units are arranged together to form the image structure of the entire dot matrix code. In the dot matrix code, each dot matrix unit carries different information.

[0078] A reference cell contains a reference pattern, composed of several pixel units, typically located at the geometric center of the reference cell. The main function of the reference pattern is to provide a fixed reference point, enabling the decoding algorithm to identify and locate the specific positions of the pixel units. During image acquisition and processing, the geometric center of the reference pattern serves as a crucial reference for correcting perspective distortion in the image.

[0079] In one embodiment, the dot matrix unit includes several encoding units and several reference units. The reference units are used for coordinate reference calibration, and the encoding units are used to store encoded information. The reference units provide a stable coordinate reference, while the encoding units carry the key information of the document. Data storage and transmission are achieved through different encoding patterns. By decoding the patterns of the encoding units based on the positioning information of the reference units, the target encoded information can be extracted.

[0080] In one embodiment, the dot matrix unit is composed of several coding units. However, some coding units with the same position relative to the dot matrix unit can be regarded as reference units to provide reference positioning information. The remaining coding units are used to store information. Specifically, the function of the reference unit is realized through the common pattern of the coding units. The repeated coding pattern can be selected as a virtual reference unit. The coordinate reference is provided by calculating the center point or offset position or other rules of the coding unit. In this embodiment, the coding unit undertakes both information storage and reference functions, optimizing space utilization. During actual decoding, based on all coding units in the document, the repeated common parts are extracted to determine the virtual reference unit. The position of the reference unit is corrected by the least squares method to determine the document coordinate system. The coordinate reference of the virtual reference unit is used to decode the information of other coding units.

[0081] In one embodiment, the dot matrix unit consists only of reference units. Each reference unit contains a reference pattern, and the reference pattern is set at the geometric center of the reference unit, forming a checkerboard-like grid structure. The fixed spacing and pattern characteristics between the reference units can be used to record the device's motion trajectory, providing relative trajectory information. By analyzing the displacement changes of the device in the document through pattern offset analysis, the relative coordinates of any position can be located based on the grid. The decoding process relies on the geometric characteristics of the reference units and does not require the participation of encoding units. High-precision grid point detection can be achieved through image matching algorithms, and offsets can be corrected through the geometric relationships of the grid. In some applications, the focus is on high-precision relative position positioning and trajectory recording. The case of only reference units is mostly used in positioning and trajectory-related scenarios, emphasizing accuracy, stability, and simplicity. Although it cannot transmit encoded information, it can provide higher positioning accuracy and stronger anti-interference capabilities, while reducing the demand for computing resources, making it a preferred solution for specific application scenarios.

[0082] like Figure 1c As shown, the spacing between the centers of adjacent reference units is a fixed preset distance (first preset distance). This distance is determined during the design of the dot matrix code and remains unchanged in practical applications. This distance helps to correctly identify the position of each dot matrix unit during decoding, avoiding decoding errors caused by distance errors.

[0083] An encoding unit is the part of a matrix unit used to represent actual data. It contains an encoding pattern, which itself is composed of several pixel units. For example... Figure 1d As shown, the minimum distance between the centers of the coding units is a fixed value (the second preset distance). Figure 1f As shown, the minimum distance between the encoding patterns of the encoding units is a fixed value (the third preset distance).

[0084] The information in the encoding unit can be paper ID, location coordinates, document type, etc. For example... Figures 2a to 2c The pattern of the encoding unit may have different offsets or rotations at its geometric center to represent different encoded information. Different offsets are used to express different encoded information, increasing the amount of information that each dot matrix unit can store. By adjusting the offset position of the encoding pattern, multiple different encoding patterns can be generated, thus representing more types of encoded information. The encoding pattern can also be rotated relative to the geometric center, with different rotation angles representing different encoded information. This design is very effective when storing a large amount of different information, because each different rotation angle can be used to distinguish different encoded information.

[0085] In different dot matrix units, the number of pixel units constituting the encoded pattern may be the same or different, and the number of pixel units constituting the reference pattern may also be the same or different. The number of pixel units constituting the encoded pattern and / or the reference pattern can be determined based on the text and / or image corresponding to the position of the encoded pattern in the document. This means that different dot matrix units can have encoded patterns and / or reference patterns with different complexities to adapt to different documents. Some encoded patterns may contain more pixel units, thus achieving higher coverage. When processing normal blank areas, the encoding rules of the code points can remain unchanged, which reduces the complexity of the system. When the encoded pattern is located in an area containing grayscale content such as text and images, encoded patterns composed of different numbers of pixel units are used to approximate the text and patterns in these areas. Specifically, the number of pixel units in the encoded pattern and / or reference pattern can be adjusted as needed to better match the required visual effect and print quality. By precisely adjusting the code block coverage and the number of pixel units, the text and patterns contained in the final printed document can be clearly recognized by the human eye.

[0086] On a blank sheet of paper, the printed image indicators will be rendered in grayscale according to the code dot specifications. When generating the image indicators, it is essential to ensure that each code dot is at a certain distance from its nearest neighbor, so that the dot matrix code image captured by the camera can be distinguished from any single dot matrix code dot after processing.

[0087] like Figures 3-4 As shown, the number of coded patterns contained in each dot matrix unit determines its available coding range, usually represented as M*N. The average distance D between coded patterns can be fixed, and this distance will vary at different print resolutions. A coded pattern can be represented by a number of pixels within an m*n pixel rectangular area, where 0 <m<D,0<n<D。

[0088] For simplicity, m=n and M=N are typically chosen, meaning square dot matrix units and code point specifications are used. At different printing resolutions, the average distance D of the encoded pattern is an integer multiple of the smallest pixel size at that resolution, and this distance D is constant in actual paper printing. For example, at 300 dpi resolution, D is 4 pixels, at 600 dpi, D is 8 pixels, and so on.

[0089] Within a square dot matrix unit, it can be divided into M×M small square regions of size DXD, which are called code blocks. Each coding pattern is slightly offset within a code block region according to coding rules to represent a coding element within the dot matrix unit.

[0090] The more valid coded patterns contained within a dot matrix unit, the richer the coded information it can represent. However, the number of code dots cannot be increased indefinitely. Too many code dots require higher precision printing equipment, and the black coverage of the paper will increase, potentially resulting in the entire sheet of paper appearing almost entirely black. Common dot matrix unit specifications include 4x4, 5x5, 6x6, 7x7, and 8x8, meaning that the number of code blocks in the horizontal and vertical directions within a single dot matrix unit varies from 4 to 8. The actual physical size of each dot matrix unit is typically between 0.1 and 1 centimeter, although these specific parameters may vary depending on the type of encoding.

[0091] like Figure 4 As shown, taking an 8x8 dot matrix unit as an example, if a resolution of 600 dpi is used, the average spacing between adjacent code dots is 8 pixels, and the length and width of each code dot unit are 56 pixels, each code dot unit contains 36 x 1 + 4 x 6 x 0.5 + 4 x 0.25 = 49 code dots, of which the central 6x6 is the entire code dot, the four surrounding central 24 half-code dots, and the four corner half-code dots. The ideal coverage of different code dot sizes is shown in Table 1 below:

[0092] Table 1: Average Coverage of Different Encoded Patterns with Pixel Counts at 600dpi

[0093] Specification Number of pixels per bit Average coverage 1X1 1 1.56% 2X2 4 6.25% 3X3 9 14.06% 4X4 16 25.00% 5X5 25 39.06% 6X6 36 56.25% 7X7 49 76.56% 8X8 64 100.00%

[0094] Preferably, in one of the dot matrix units, the minimum spacing between the centers of adjacent coding units is the second preset distance, the spacing between the centers of the coding patterns of adjacent coding units is greater than or equal to the second preset distance, and the first preset distance is greater than or equal to the second preset distance.

[0095] Specifically, the distance between the center of the reference unit and the center of the adjacent coding units is set to a relatively large value. This distance helps maintain the clarity of the pattern during printing or printing, ensuring that each coding unit exists independently and does not cause information confusion due to proximity.

[0096] The minimum spacing between the reference patterns of adjacent reference units and / or the encoding patterns of encoding units is set to a third preset distance. This means that the distance between two adjacent reference patterns and / or encoding patterns must be greater than or equal to the third preset distance. This setting ensures the separation of reference patterns and / or encoding patterns, avoiding visual confusion.

[0097] Preferably, the dot matrix unit is a polygon, the reference pattern is a symmetrical pattern, and the coding pattern is a symmetrical or asymmetrical pattern; in one dot matrix unit, the reference unit is set at a specified position along the dot matrix unit, and a combined pattern composed of multiple reference units is used for the division of any two adjacent dot units and / or coordinate reference positioning.

[0098] Specifically, the dot matrix units can be polygonal, meaning their shape is not limited to traditional squares or rectangles, but can be pentagons, hexagons, or other polygons. Polygonal structures may have advantages in certain applications, such as improving space utilization or enhancing the visual effect of patterns.

[0099] like Figure 2d As shown, the reference pattern is a pattern used for calibration and is typically designed to be symmetrical. This symmetry helps to quickly locate and identify reference units during decoding because symmetrical patterns have the same visual effect at different angles, facilitating algorithm detection.

[0100] Encoding patterns, used to store actual information, can be designed as symmetrical or asymmetrical patterns. Symmetrical patterns are easier to process visually and computationally, while asymmetrical patterns may offer more encoding variations and richer information representation. In polygonal dot matrix cells, reference cells are typically placed along the edges of the polygon. This layout ensures that reference cells are evenly distributed throughout the dot matrix cell, enhancing image calibration and aiding in perspective correction and image restoration during decoding. Encoding cells are arranged inside the reference cells, i.e., in the central region of the polygon. This design ensures that the encoding cells can stably express information under the protection of the reference cells and avoid interference from the outer edges.

[0101] In summary, these settings and design principles collectively ensure a balance between coding density, decoding accuracy, and space utilization in the dot matrix unit. The symmetry of the reference pattern and the flexibility of the coding pattern provide a reliable structural foundation for the dot matrix code system, enabling it to efficiently and accurately transmit and resolve information in practical applications.

[0102] Example 2

[0103] like Figure 5 As shown, Embodiment 2 of the present invention also provides a document laying method for image indicators, wherein the image indicators are those described in Embodiment 1, and the document laying method includes:

[0104] S1. Render the document to be laid to obtain the image to be laid.

[0105] Specifically, the document to be rendered refers to the original document on which raster technology will be applied. This document may contain text, images, or other content, and is usually in a digital document format such as PDF or Word. Image rendering also refers to the process of converting document content into a visual image format, typically combining text, vector graphics, and other elements into a bitmap image.

[0106] The document content is rendered into a bitmap image format using image processing software or programming tools (such as Adobe Acrobat, the PIL library in Python, etc.). Specifically, the program converts the document content line by line and page by page into an image, generating an image representation consistent with the original document content. An appropriate resolution is chosen for rendering the image to ensure that the rendered image has sufficient clarity for subsequent processing. The rendered image accurately reflects the visual content of the original document, providing a reliable foundation for subsequent steps.

[0107] S2. Perform grayscale processing on the image to be laid to obtain a first grayscale image;

[0108] Specifically, grayscale conversion is the process of converting a color image to a grayscale image. This simplifies the image by converting the color information of each pixel into a grayscale value (0-255), retaining only the brightness information. Image processing algorithms are used to convert color images to grayscale. A typical method is to convert the RGB values ​​of each pixel into grayscale values ​​using a weighted average formula. The processed image is a single-channel image, with each pixel having only one grayscale value, ranging from 0 (black) to 255 (white).

[0109] Grayscale processing simplifies image information, making subsequent dot matrix placement more targeted. The use of grayscale images helps to accurately express the brightness variations of document content through dot matrix coding technology. Grayscale processing reduces data volume, improves image processing efficiency, and ensures the overall fidelity of image content.

[0110] S3. Determine the position information of each dot matrix unit based on the size information of the first grayscale image and the basic parameters of the dot matrix unit in the image index;

[0111] Specifically, the size information of the first grayscale image refers to its basic parameters such as width, height, and resolution. Based on the size and layout rules of the dot matrix units in the image metrics, the required number of dot matrix units to cover the entire image, as well as the position and size of each unit, are calculated. The dot matrix units are arranged on the image according to certain rules (e.g., from left to right, from top to bottom) to ensure that each unit is in the correct position. Precise positional calculations ensure that the dot matrix units are arranged in an orderly and uniform manner, providing a reliable foundation for subsequent image segmentation and dot matrix code laying.

[0112] S4. The first grayscale image is segmented according to the location information to obtain a second grayscale image corresponding to each of the dot matrix units;

[0113] Specifically, to divide the first grayscale image into multiple small image blocks according to the dot matrix units, so as to facilitate the subsequent adjustment of the dot matrix unit layout based on the grayscale information of each small block, the position information determined in the previous step is used to divide the first grayscale image into multiple small image blocks, each small image block corresponding to one dot matrix unit. Each segmented small image block is the second grayscale image, which retains the grayscale information of the corresponding region.

[0114] Image segmentation simplifies and modularizes complex image processing, facilitating the separate handling of each pixel's layout. Segmentation ensures that the grayscale information of each pixel can be processed independently, increasing the flexibility of image processing.

[0115] S5. Based on the gray level of the second grayscale image, adjust the coding pattern and / or reference pattern in the corresponding dot matrix unit to obtain the third grayscale image;

[0116] Specifically, by adjusting the encoding pattern and / or reference pattern, it is made to better adapt to the grayscale variations of the image, thereby accurately representing the brightness contrast of the image in monochrome mode. This is achieved by analyzing the grayscale levels of each second grayscale image and determining suitable dot matrix unit specifications (such as dot matrix unit size, density, and arrangement) based on the grayscale values. The dot matrix units are then adjusted according to the grayscale levels. For example, if the grayscale value is low (indicating a darker area), it may be necessary to increase the complexity of the encoding pattern, such as by adding more pixel units to increase information density. If the grayscale value is high (indicating a brighter area), the information density can be reduced by decreasing the number of pixel units, thereby avoiding excessive interference with the background. Furthermore, the number of pixel units in the reference pattern can be moderately varied according to the changes in grayscale values ​​to provide stable reference information in different brightness areas.

[0117] The components of each dot matrix unit (encoding pattern and reference pattern) will be optimized according to the grayscale level of that area, so that the final generated image can effectively encode information without compromising the readability of the document content.

[0118] Preferably, such as Figure 6 As shown, the step of adjusting the encoding pattern and / or reference pattern in the corresponding dot matrix unit according to the gray level of the second grayscale image to obtain the third grayscale image includes:

[0119] S51. Based on the gray level of the second grayscale image, determine the first target number of pixel units constituting the coded pattern and / or the second target number of pixel units constituting the reference pattern in the corresponding dot matrix unit.

[0120] Specifically, this involves determining how many pixel units are needed in each dot matrix to represent the grayscale information of that region. By adjusting the number of pixel units, the coding pattern can be matched to the grayscale levels of the image, thus accurately representing the brightness variations of the image. The grayscale levels of each dot matrix unit in the second grayscale image are analyzed. For example, rather than limiting, lower grayscale areas can be coded with a higher density pattern. This is because darker areas can carry more information, and denser patterns help highlight the coded information. Higher grayscale areas can therefore have a lower density of coding pattern. Brighter areas should avoid excessive dot matrix coverage to maintain visual brightness, and this also applies to the baseline pattern.

[0121] By precisely calculating the number of pixel units, it can be ensured that the dot matrix units are both accurate and efficient in representing the grayscale information of the image. This step lays the foundation for subsequent adjustments to the encoding pattern and reference pattern, enabling the final dot matrix code to both preserve image details and achieve efficient encoding.

[0122] Preferably, the basic parameters of the dot matrix unit include a first initial number of pixel units constituting the encoded pattern and a second initial number constituting the reference pattern. Determining the first target number of pixel units constituting the encoded pattern in the corresponding dot matrix unit based on the grayscale level of the second grayscale image includes:

[0123] S511. Based on the position of the text and / or pattern in the second grayscale image, determine the corresponding encoding pattern and / or reference pattern that need to be adjusted in the dot matrix unit, and record them as the encoding pattern to be adjusted and the reference pattern to be adjusted, respectively.

[0124] Specifically, based on the layout of text and / or patterns in the document, locate the bitmap units that need adjustment and their corresponding coded patterns and / or reference patterns. This ensures that the coded patterns are accurately aligned with the content in the grayscale image. First, identify the location regions of text or patterns in the image. Based on image metrics and document layout, locate the bitmap units corresponding to these regions. Mark the coded patterns in the bitmap units that need adjustment as the bitmap patterns to be adjusted, preparing for subsequent adjustments.

[0125] S512. Based on the gray level, the first initial quantity, the second initial quantity, and the preset gray level mapping relationship, determine the coverage of the coding pattern to be adjusted and the reference pattern to be adjusted in the corresponding second gray level image.

[0126] Specifically, during initial setup, the number of pixels for each coded pattern and the reference pattern is predefined. These initial numbers affect the size and shape of the pattern. During image processing and encoding, the system pre-sets the difference contrast between different gray levels to guide the selection of appropriate dot matrix code specifications (such as 1x1 or 3x3) to represent the grayscale information of the image. In the dot matrix code, the preset grayscale level contrast determines which size of code dots should be selected for image representation at different grayscale levels. For example, the preset 1x1 code dots are used for lower grayscale levels, and the 3x3 code dots are used for higher grayscale levels; the contrast between the two ensures visual clarity. By analyzing the grayscale levels of the second grayscale image and comparing them with the preset grayscale level contrast, the appropriate coverage of each dot matrix unit is determined. This step aims to ensure that the coded pattern of the dot matrix unit can accurately reflect the brightness changes of the image, maintaining image clarity and readability.

[0127] The coverage calculation ensures that the dot matrix units can express image information in the best way at different gray levels. For example, in the area of ​​the character "A", 3x3 dot matrix is ​​used to improve coverage and ensure that the character can be clearly displayed, while in the background area used to lay out image indicators, 1x1 dot matrix is ​​used to reduce coverage and reduce visual interference.

[0128] S513. Based on the coverage rate, determine the first target number of the coded pattern to be adjusted and / or the second target number of pixel units of the reference pattern to be adjusted.

[0129] Specifically, by analyzing the coverage results, the system determines a target number for each pattern to be adjusted. Areas with higher coverage will select larger coded patterns or baseline patterns, while areas with lower coverage will select smaller patterns.

[0130] S52. Adjust the coding pattern and / or the reference pattern in the corresponding dot matrix unit according to the first target quantity and / or the second target quantity to obtain the target dot matrix unit;

[0131] Specifically, based on the determined number of first targets and / or second targets, the coding pattern and / or reference pattern in the dot matrix unit are adjusted so that it accurately reflects the grayscale level of the corresponding area. By adjusting the coding pattern and / or reference pattern, the matching degree between the dot matrix code and the image content is ensured.

[0132] For example, the number of pixel units in the encoded pattern can be adjusted to match the number of the first target. If the number of the first target is large, the number of pixel units in the encoded pattern is increased to make the pattern denser; if the number of the first target is small, the number of pixel units is reduced to make the pattern sparser. The adjusted target dot matrix units can match the grayscale levels, thereby optimizing the expressiveness of the dot matrix code. By flexibly adjusting the encoded pattern, more image details can be retained in monochrome printing, enhancing the visual effect.

[0133] Preferably, the basic parameters of the dot matrix unit include the initial number of pixel units constituting the encoded pattern, and the step of adjusting the encoded pattern in the corresponding dot matrix unit according to the first target number to obtain the target dot matrix unit includes:

[0134] S521. Obtain the offset direction of each of the coded patterns to be adjusted in the corresponding coded unit;

[0135] Specifically, the initial quantity refers to the number of pixel units contained in the initial state of the coded pattern within the dot matrix unit. The coded pattern is offset relative to the geometric center within the coded unit, and the offset direction can be horizontal (left, right), vertical (up, down), or diagonal (upper left, upper right, lower left, lower right). This offset direction determines how the pixel units are expanded, ensuring the consistency and orientation of the coded pattern. Determining the offset position helps maintain the overall orientation of the coded pattern during subsequent expansion, ensuring that the expanded pattern still accurately represents the coded information and maintains visual consistency.

[0136] S522. Based on the offset direction of each of the coded patterns to be adjusted, determine the expansion direction of the corresponding coded pattern to be adjusted, wherein different offset positions correspond to different expansion directions;

[0137] For details, please refer to Figure 8The expansion direction refers to the direction in which pixel units are added during pattern expansion. The expansion direction depends on the offset position of the coded pattern and can be horizontal, vertical, or diagonal. A suitable expansion direction is selected based on the offset position determined in the previous step. For example, if the offset position of the coded pattern is in the upper left, the expansion directions include left, upper, and upper left, ensuring that the expansion direction matches the offset position. Different offset positions correspond to different expansion directions to ensure that the expanded pattern retains its initial offset characteristics. By reasonably selecting the expansion direction, it is ensured that the coded pattern does not lose its original structure and orientation during the expansion process. This is crucial for maintaining the pattern's recognizability and decoding accuracy. In one embodiment, specific expansion directions can be found in Table 2.

[0138] Table 2: Rules for Expanding the Coding Pattern Direction

[0139] Offset direction Expansion direction Top left Left, top, top left Top right Right, top, top right Bottom right Right, bottom, bottom right Bottom left Left, bottom, bottom left

[0140] S523. Based on the first difference between the first initial quantity and the first target quantity, the corresponding coding pattern to be adjusted is expanded along the expansion direction to obtain a target coding pattern, and / or, based on the second difference between the second initial quantity and the second target quantity, the reference pattern to be adjusted is expanded along the preset expansion direction to obtain a target reference pattern, wherein the offset direction of the target coding pattern and the corresponding coding pattern before expansion is the same.

[0141] Specifically, the coded pattern is expanded to the target number of pixel units as needed (i.e., the first difference), while maintaining the pattern's orientation. Pixel units are gradually added along a determined expansion direction based on the calculated first difference. For example, if the difference is 2 and the expansion direction is to the right, two pixel units are added to the right side of the coded pattern. This ensures that the expanded target coded pattern is oriented the same as the original coded pattern, meaning the expansion process does not change the initial offset direction of the pattern. This expansion is repeated until the number of pixel units in the target coded pattern reaches the first target number. This expansion method guarantees that the orientation and structure of the coded pattern remain unchanged while increasing the number of pixel units, ensuring the integrity and consistency of the coded information. S524: The target dot matrix unit is obtained by approximating the text and / or data in the corresponding second grayscale image based on the target coded pattern.

[0142] If a reference pattern is to be expanded, the number of pixel units to be added (the second difference) is first determined. The preset direction can be expansion along a symmetrical or regular direction. For example, if the reference pattern is a symmetrical structure, expansion is preferentially carried out along the axis of symmetry. If the difference is 2 and the expansion direction is to the right, two pixel units are added to the right side of the reference pattern to ensure that its overall geometric properties remain unchanged. If the expansion disrupts the symmetry of the reference pattern, the entire pattern is readjusted to restore its geometric symmetry.

[0143] The expanded target reference pattern is obtained, with the number of pixel units reaching the target number, while maintaining the geometric characteristics of the reference pattern.

[0144] Approximate fitting is performed by selecting pixel units of appropriate size based on the image content. Approximate fitting refers to adjusting the number of pixels in the coded pattern to match the text or pattern in the grayscale image. For example... Figure 7 As shown, for the graphic area of ​​the text "A", a 3x3 pixel unit is used for fitting. The fitting process converts the original grayscale information into a set of grayscale values ​​represented by pixel units, and obtains the fitted grayscale level.

[0145] Approximate fitting enables the encoded pattern to faithfully represent grayscale content, achieving high-quality visual presentation and information encoding. This design ensures that the document content remains clearly visible even when printed in monochrome, while guaranteeing reliable decoding of the encoded information.

[0146] S53. Replace the corresponding second grayscale image with the target dot matrix unit to obtain the third grayscale image.

[0147] Specifically, this step replaces the target dot matrix units at the corresponding positions in the second grayscale image. This means that the system inserts the previously determined target pattern into the dot matrix units at the corresponding positions in the image. This replacement process is a "mapping" process; the system converts the pixel information of the image into corresponding dot matrix patterns based on the grayscale information. This synthesis process ensures the integrity and coherence of the image content, making the final image suitable for both visual presentation and subsequent printing and decoding applications. After all the dot matrix units are replaced, the system obtains a new image—the third grayscale image. This image contains the results of replacing the coded pattern based on the target dot matrix units and the reference pattern. After the replacement, the image becomes more "rasterized," with the pattern in each region replaced by the dot matrix pattern required according to its grayscale value. Thus, visually, each region of the image will exhibit different dot matrix densities and sizes, consistent with its original grayscale information. This rasterization effect is more suitable for applications such as printing or scanning because even on low-resolution display or scanning devices, users can still "recognize" the image.

[0148] Preferably, the step of expanding the corresponding coding pattern to be adjusted along the expansion direction according to the first difference between the first initial quantity and the first target quantity to obtain the target coding pattern includes:

[0149] S5231. Determine the boundary pixel threshold based on the size of the encoding unit;

[0150] Specifically, the size of a coding unit refers to its physical size or number of pixels, which determines the total number of pixels that can be accommodated within the unit. The boundary pixel threshold is the maximum number of pixels in the coded pattern that reaches the boundary of the coding unit during the expansion process. This threshold represents the maximum number of pixels that can be expanded in a certain direction; exceeding this value limits expansion. Based on the expansion direction of the pattern, the maximum number of pixels that can be accommodated in that direction is determined and set as the boundary pixel threshold. For example, if the width of the coding unit is 10 pixels and the expansion direction is horizontal to the right, then the boundary pixel threshold might be 8 pixels, reserving 2 pixels as a safety margin for the pattern.

[0151] S5232. If the number of the first target is greater than the boundary pixel threshold, the corresponding coding pattern is extended along the extension direction according to the boundary pixel threshold to obtain an initial coding pattern.

[0152] Specifically, when the required number of pixel units exceeds the boundary pixel threshold, the number of pixel units is increased as much as possible in the expansion direction until the boundary pixel threshold is reached. It is then checked whether the number of the first target is greater than the boundary pixel threshold. If so, pixel units are increased in the expansion direction until the boundary pixel threshold is reached. For example, if the boundary pixel threshold is 8 pixels and the number of the first target is 12 pixels, then 8 pixels are added in the expansion direction to generate the initial coding pattern. It is ensured that the initial coding pattern does not exceed the boundary of the coding unit during the expansion process and that the consistency of the expansion direction is maintained. By limiting the number of pixels in the expansion direction, it is ensured that the coding pattern does not exceed the boundary of the coding unit, while leaving space for subsequent expansion.

[0153] S5233. Based on the second difference between the first target quantity and the boundary pixel threshold, the initial coding pattern is extended in a direction opposite to the extension direction to obtain the target coding pattern.

[0154] Specifically, when the expansion in the expansion direction has reached the boundary pixel threshold but still does not meet the first target number, supplementary expansion in the opposite direction is needed to add the remaining pixel units. Expansion is performed in the opposite direction to the initial expansion direction, adding the remaining 4 pixel units to reach the first target number. It is ensured that after expansion, the center position of the target encoded pattern remains consistent with the center of the initial encoded pattern, without any directional shift. By supplementing the expansion in the opposite direction, the number of pixels in the encoded pattern can be flexibly adjusted, ensuring that the pattern reaches the required number of pixels while maintaining the pattern's directional and positional stability.

[0155] S5234. If the number of the first target is less than the boundary pixel threshold, the corresponding coding pattern is extended along the extension direction according to the first difference to obtain the target coding pattern.

[0156] Specifically, when the number of the first target is less than the boundary pixel threshold, the required pixel units are directly added in the expansion direction to reach the number of the first target, without the need for supplementary expansion in the opposite direction. This direct expansion method is simple and efficient, suitable for situations where the number of the first target is small, ensuring that the encoded pattern can quickly reach the required number of pixels while maintaining the integrity and directionality of the pattern.

[0157] S6. Obtain the target document image based on all the third grayscale images.

[0158] Specifically, all adjusted third-level grayscale images are stitched together according to their position information in the original image to generate the complete target document image. The target document image undergoes final inspection and adjustments to ensure image integrity and visual quality. The target document image is then saved in a printable format, such as PDF, high-resolution bitmap, or other image formats.

[0159] By stitching together all the processed image blocks, a complete target document image is generated, which can both reflect the content of the original image and encode and decode information through dot matrix technology.

[0160] In one specific embodiment, such as Figures 10a-10c As shown, Figure 10aThis is the original image of the document, containing elements such as text, patterns, and symbols. First, based on the image's grayscale information, the system converts it into an encoded form suitable for printing or display. For example, depending on the image's grayscale levels, different sizes and shapes of dot matrix patterns may be used to encode the image information. These dot matrix patterns replace the pixel information of the original image, forming a new rasterized image suitable for display on low-resolution devices (such as dot matrix printers). During the encoding process, appropriate dot matrix units are selected based on grayscale levels and coverage. The size and shape of these dot matrix units (such as 1x1, 3x3, etc.) determine the image's detail representation, ensuring that the image content is conveyed as accurately as possible, even at low resolutions.

[0161] Figure 10b This is the encoded image of the target document, which may look like a rasterized version. In this image, each character or pattern is encoded into a raster unit. At this point, each area of ​​the image is processed into a printable format to ensure clear display during printing and to avoid the inability to display details correctly due to resolution limitations.

[0162] Figure 10c This displays the actual photographic quality of the printed target document image. It's created by printing the image with a printer and then photographing the printed document using a video device (such as a camera or scanner). During the printing process, the layout and density of the dot matrix pattern determine the print quality and sharpness. At lower resolutions, the image may not be as sharp as... Figure 10a It is so smooth, yet it still retains enough detail and legibility, especially in the text and main graphic parts, making it recognizable.

[0163] Example 3

[0164] Thirdly, embodiments of the present invention also provide a method for decoding image metrics, wherein the image metrics are laid on a target document using the document laying method for image metrics described in any of the second aspects, and the decoding method includes:

[0165] S01. Acquire an infrared detection image of the target document using an image acquisition device;

[0166] Specifically, an image acquisition device refers to a device used to capture images, such as an infrared camera or scanner. This device is specifically designed to acquire image information of a target document, especially in dot matrix barcode applications. Infrared cameras are widely used because they can accurately capture barcode information under various lighting conditions. An infrared detection image refers to an image acquired by an infrared camera. This image is typically used to detect and read dot matrix barcodes because infrared light can effectively penetrate surface reflection interference, obtaining a clear image of the barcode dots. Acquiring an infrared image of the target document lays the foundation for subsequent image processing and decoding. This step ensures that the acquired image accurately reflects the dot matrix barcode information on the document.

[0167] S02. The infrared image is preprocessed to obtain an initial detection image, wherein the preprocessing includes noise reduction and binarization.

[0168] Specifically, in image processing, preprocessing refers to the initial processing of the original image to improve the effectiveness of subsequent analysis. Common preprocessing steps include noise reduction and binarization. Image filtering algorithms (such as median filtering or Gaussian filtering) are used to remove noise points or other interference from the image while retaining key code point information. The denoised image is then converted into a binary image, typically by setting a threshold, turning pixels above the threshold white and pixels below the threshold black, thus making the code point information clearer.

[0169] The preprocessing steps effectively improve image quality, making subsequent code point detection more accurate. Noise reduction and binarization ensure that code point and pattern information can still be clearly extracted even against complex backgrounds.

[0170] S03. Based on the initial detection image and the preset code point detection algorithm, obtain the initial coordinate information of all reference patterns and all encoded patterns in the initial detection image;

[0171] Specifically, a pre-defined code point detection algorithm is used to identify and extract the location information of code points in the binarized image. This algorithm typically detects specific patterns, such as reference patterns and coded patterns, based on the geometric features of the image. Once these patterns are identified, their pixel coordinates in the image are recorded, forming initial coordinate information. This coordinate information will be used in subsequent image correction and decoding processes.

[0172] By accurately extracting the initial coordinate information of the reference pattern and the coded pattern, a reliable foundation is provided for subsequent image perspective correction and decoding, ensuring the accuracy of the decoding process.

[0173] S04. Based on the initial coordinate information of the reference pattern, obtain the perspective transformation matrix of the initial detection image and the standard image including the image index corresponding to the target document, wherein the number of reference patterns is greater than or equal to the preset number of reference patterns, and at least one of the reference patterns is not collinear with the rest of the reference patterns.

[0174] Specifically, the perspective transformation matrix is ​​used to correct distorted or tilted images to a standard viewing angle. The perspective transformation matrix is ​​calculated based on the positional relationships of reference patterns. A preset number of reference patterns represents the minimum number required for perspective transformation correction. Generally, at least four non-collinear reference patterns are needed to calculate the perspective transformation matrix.

[0175] Based on the initial coordinate information, identify the reference patterns in the image, ensuring that the number of identified reference patterns is greater than or equal to the preset number of reference patterns (usually at least 4). Check that at least one of these reference patterns is not collinear with other reference patterns, so that the perspective transformation matrix can be accurately calculated. Using the initial coordinate information of these reference patterns, compare them with the corresponding positions of the reference patterns in the standard image to calculate the perspective transformation matrix.

[0176] S05. Perform an inverse transformation on the initial detection image according to the perspective transformation matrix to obtain the target detection image;

[0177] Specifically, an inverse transformation is performed on the initial detection image using a perspective transformation matrix. The inverse transformation process involves correcting the position of each pixel in the image to return it to its viewpoint position in the standard image. After the inverse transformation, the resulting target detection image should be perfectly aligned with the standard image of the target document, without any perspective distortion.

[0178] By using inverse transformation, the initial detection image can be restored to an image under a standard viewpoint, ensuring that subsequent decoding operations are based on an accurate and distortion-free image, thereby improving the accuracy and efficiency of decoding.

[0179] S06. Obtain target decoding information based on the target detection image and the preset encoding algorithm.

[0180] Specifically, the image after inverse transformation correction is a standardized image, having eliminated perspective distortion, making it suitable for decoding. A preset encoding algorithm scans the target detection image, identifying and parsing the encoded patterns within. During decoding, the algorithm extracts encoded information based on the characteristics of the encoded patterns (such as position, shape, and arrangement), which may include data such as document ID and content location. The decoded information is then organized into a usable data format and output as the decoding result.

[0181] Preferably, the image acquisition device is disposed on a dot matrix pen, the dot matrix pen including a pen tip, a pen body, and an image acquisition device disposed on the pen body, wherein obtaining the target decoding information of the target dot matrix unit and the trajectory coordinates of the image acquisition device movement based on the target detection image and the preset encoding algorithm includes:

[0182] S061. Obtain the acquisition time of the infrared detection image and the pressure data of the pen tip on the target document;

[0183] Specifically, a dot matrix pen is a device used for image acquisition and processing. It combines the traditional functions of a pen with modern imaging technology. The pen tip is the part that directly contacts the target document. It is used to mark, draw, or input data on the document. The pen body is the main structural part of the dot matrix pen, containing all electronic components and image acquisition devices. It provides support and transmits electronic signals to external devices. The imaging device is used to capture the movement and position of the dot matrix pen on the target document. This can be a camera, sensor array, or other types of image acquisition devices. A pressure sensor integrated in the pen tip or pen body measures the pressure applied by the pen tip to the document. The sensor converts the pressure into an electrical signal and records it along with the image data. The dot matrix pen records image data, pressure data, and acquisition time, and transmits this data to external devices or systems for further processing.

[0184] S062. Based on the target detection image, obtain the spacing between each of the reference patterns and at least one of the dot matrix units, denoted as the target dot matrix unit;

[0185] Specifically, image processing algorithms (such as edge detection and pattern recognition) are used to identify reference patterns in the target detection image. The position of each reference pattern is determined, and the actual spacing between these patterns is calculated. The spacing between the reference patterns and the position information of the selected dot matrix units are recorded for calculation in subsequent steps. This step accurately identifies and records the dot matrix units and their spacing, providing a foundation for subsequent coordinate calculation and decoding, and ensuring the accuracy of data processing.

[0186] S063. Based on the position coordinate information of the target dot matrix unit, the spacing, and the distance between the imaging device and the pen tip, obtain the position offset of the imaging device relative to the target dot matrix unit;

[0187] Specifically, to calculate the positional offset of the imaging device relative to the target dot matrix unit and ensure the accuracy of the acquired image data with the actual document position, the actual positional offset of the imaging device relative to the target dot matrix unit is calculated using the coordinate information of the target dot matrix unit and the parameters of the imaging device. The known distance between the imaging device and the pen tip is used to adjust the calculation results and correct for the offset caused by different device positions. By combining the above information, the offset of the imaging device relative to the target dot matrix unit is calculated.

[0188] S064. Based on the position offset and the position coordinate information of the punctuation matrix unit, obtain the coordinate position of the pen tip on the target document, and record it as the pen tip coordinate information;

[0189] Specifically, by combining the coordinates of each dot matrix unit and its corresponding offset, the actual position of the pen tip on the target document is calculated. If there are multiple dot matrix units, the above calculation is performed on each dot matrix unit to obtain the pen tip coordinates at each position. By applying the position offset to the coordinate information of the dot matrix units, the actual position of the pen tip on the target document can be determined more accurately, reducing the impact of positional errors between the device and the pen tip.

[0190] S065. Obtain initial coding information based on all coding units in the target detection image and the preset coding algorithm;

[0191] Specifically, the goal of this step is to convert the coded patterns in the image into initial data that can be used for analysis. In the object detection image, all coded units are identified using a pre-defined coding algorithm. This typically involves image processing techniques such as edge detection, pattern recognition, and pattern matching. Based on the offset of the coded patterns in the identified coded units, relevant coded data is extracted from the image, and the extracted coded data is integrated into an initial set of coded information.

[0192] S066. Based on the pen tip coordinate information, the initial encoding information, the acquisition time, and the pressure data, obtain the target decoding information and the trajectory coordinates of the image acquisition device.

[0193] Specifically, by combining pen tip coordinate information, initial encoding information, acquisition time, and pressure data, accurate target decoding information and the trajectory coordinates of the image acquisition device are obtained. This information typically includes the decoded data content, such as the actual information of the document or the recognized content. By combining this multi-faceted information, the accuracy and reliability of decoding are improved, especially in dot matrix pen applications, where this combination can correct potential errors or ambiguity.

[0194] It should be clarified that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of the present invention.

[0195] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this invention are programs or code segments used to perform the required tasks. The programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0196] It should also be noted that the exemplary embodiments mentioned in this invention describe methods or systems based on a series of steps or apparatus. However, this invention is not limited to the order of the steps described above; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0197] The above description is merely a specific embodiment of the present invention. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the protection scope of the present invention.

Claims

1. An image indicator, said image indicator being laid on a document including text and / or patterns, characterized in that, The image metrics include: a plurality of dot matrix units laid at different locations in the document, wherein the dot matrix units include a plurality of encoding units and / or a plurality of reference units, wherein the encoding units are used to characterize the encoding information obtained by a preset encoding algorithm, the reference units include a reference pattern composed of a plurality of pixel units, the center of the reference pattern is set at the geometric center of the reference unit, and the encoding units include an encoding pattern composed of a plurality of pixel units. In one of the dot matrix units: the spacing between the centers of adjacent reference units is a first preset distance; the reference pattern and the encoding pattern are different; the offset position and / or rotation angle of the encoding pattern of the encoding unit representing different encoding information about the geometric center of the corresponding encoding unit are different; the number of pixel units constituting the encoding pattern is the same or different; the number of pixel units constituting the encoding pattern and / or the reference pattern is determined based on the gray level of the text and / or pattern corresponding to the position of the encoding pattern and / or the reference pattern in the document.

2. The image index according to claim 1, characterized in that, In one of the dot matrix units, the minimum spacing between the centers of adjacent coding units is the second preset distance, the spacing between the centers of the coding patterns of adjacent coding units is greater than or equal to the second preset distance, and the first preset distance is greater than or equal to the second preset distance; the minimum spacing between adjacent coding units is the third preset distance, and the second preset distance is greater than the third preset distance.

3. The image index according to claim 1, characterized in that, The dot matrix unit is a polygon, the reference pattern is a symmetrical pattern, and the encoding pattern is a symmetrical or asymmetrical pattern; in one dot matrix unit, the reference unit is set at a specified position along the dot matrix unit, and the combined pattern composed of multiple reference units is used for the division of any two adjacent dot matrix units and / or coordinate reference positioning.

4. A method for laying out image metrics in a document, characterized in that, The image index is the image index according to any one of claims 1-3, and the document laying method includes: Render the document to be laid to obtain the image to be laid; The image to be laid is converted to grayscale to obtain a first grayscale image; Based on the size information of the first grayscale image and the basic parameters of the dot matrix units in the image index, the position information of each dot matrix unit is determined; The first grayscale image is segmented according to the location information to obtain a second grayscale image corresponding to each of the dot matrix units; Based on the gray level of the second grayscale image, adjust the encoding pattern and / or reference pattern in the corresponding dot matrix unit to obtain the third grayscale image; The target document image is obtained based on all the aforementioned third grayscale images.

5. The document laying method for image indicators according to claim 4, characterized in that, The step of adjusting the encoding pattern and / or reference pattern in the corresponding dot matrix unit according to the gray level of the second gray image to obtain the third gray image includes: Based on the grayscale level of the second grayscale image, determine the first target number of pixel units constituting the coded pattern and / or the second target number of pixel units constituting the reference pattern in the corresponding dot matrix unit; Based on the first target quantity and / or the second target quantity, adjust the coding pattern and / or the reference pattern in the corresponding dot matrix unit to obtain the target dot matrix unit; The third grayscale image is obtained by replacing the corresponding second grayscale image with the target dot matrix unit.

6. The document laying method for image indicators according to claim 5, characterized in that, The basic parameters of the dot matrix unit include a first initial number of pixel units constituting the encoded pattern and a second initial number constituting the reference pattern. Determining the first target number of pixel units constituting the encoded pattern and / or the second target number of pixel units constituting the reference pattern in the corresponding dot matrix unit, based on the grayscale level of the second grayscale image, includes: Based on the position of the text and / or pattern in the second grayscale image, determine the corresponding coded pattern and / or reference pattern that needs to be adjusted in the dot matrix unit, and denot them as the coded pattern to be adjusted and the reference pattern to be adjusted, respectively. Based on the gray level, the first initial quantity, the second initial quantity, and the preset gray level mapping relationship, determine the coverage of the coded pattern to be adjusted and the reference pattern to be adjusted in the corresponding second gray level image; Based on the coverage rate, determine the first target number of the coded pattern to be adjusted and / or the second target number of pixel units of the reference pattern to be adjusted.

7. The document laying method for image indicators according to claim 6, characterized in that, The step of adjusting the encoding pattern and / or the reference pattern in the corresponding dot matrix unit according to the first target quantity and / or the second target quantity to obtain the target dot matrix unit includes: Obtain the offset direction of each of the coded patterns to be adjusted in the corresponding coded unit; Based on the offset direction of each of the coded patterns to be adjusted, the expansion direction of the corresponding coded pattern to be adjusted is determined, wherein different offset directions correspond to different expansion directions; The target coding pattern is obtained by expanding the corresponding coding pattern to be adjusted along the expansion direction according to the first difference between the first initial quantity and the first target quantity, and / or, the target reference pattern is obtained by expanding the reference pattern to be adjusted along the preset expansion direction according to the second difference between the second initial quantity and the second target quantity, wherein the offset direction of the target coding pattern and the corresponding coding pattern before expansion is the same. Based on the target encoding pattern and / or target reference pattern, the text and / or pattern in the corresponding second grayscale image are approximated to obtain the target dot matrix unit.

8. The document laying method for image indicators according to claim 7, characterized in that, The step of expanding the corresponding coding pattern to be adjusted along the expansion direction according to the first difference between the first initial quantity and the first target quantity to obtain the target coding pattern includes: The boundary pixel threshold is determined based on the size of the encoding unit; If the number of the first target is greater than the boundary pixel threshold, the corresponding coding pattern to be adjusted is expanded along the expansion direction according to the boundary pixel threshold to obtain the initial coding pattern; Based on the second difference between the first target quantity and the boundary pixel threshold, the initial coding pattern is extended in a direction opposite to the extension direction to obtain the target coding pattern; If the number of the first target is less than the boundary pixel threshold, the corresponding coding pattern is expanded along the expansion direction according to the first difference to obtain the target coding pattern.

9. A method for decoding image indicators, characterized in that, The image indicator is the image indicator according to any one of claims 1-3, and the image indicator is laid on the target document using the document laying method of the image indicator according to any one of claims 4-8, wherein the decoding method includes: The infrared detection image of the target document is acquired using an image acquisition device; The infrared image is preprocessed to obtain an initial detection image, wherein the preprocessing includes noise reduction and binarization. Based on the initial detection image and the preset code point detection algorithm, obtain the initial coordinate information of all reference patterns and all encoded patterns in the initial detection image; Based on the initial coordinate information of the reference pattern, obtain the perspective transformation matrix of the initial detection image and the standard image including the image index corresponding to the target document, wherein the number of reference patterns is greater than or equal to the preset number of reference patterns, and at least one of the reference patterns is not collinear with the rest of the reference patterns; The initial detection image is inversely transformed according to the perspective transformation matrix to obtain the target detection image; Based on the target detection image and the preset encoding algorithm, the target decoding information of the target dot matrix unit and the trajectory coordinates of the image acquisition device are obtained.

10. The image index decoding method according to claim 9, characterized in that, The image acquisition device is disposed on a dot matrix pen, the dot matrix pen including a pen tip, a pen body, and an image acquisition device disposed on the pen body. The step of obtaining target decoding information of the target dot matrix unit and the trajectory coordinates of the image acquisition device's movement based on the target detection image and the preset encoding algorithm includes: Acquire the acquisition time of the infrared detection image and / or the pressure data of the pen tip on the target document; Based on the target detection image, the spacing between each of the reference patterns and at least one of the dot matrix units are obtained and denoted as the target dot matrix unit; Based on the position coordinates of the target dot matrix unit, the spacing, and the distance between the image acquisition device and the pen tip, the position offset of the imaging device relative to the target dot matrix unit is obtained; Based on the position offset and the position coordinate information of the punctuation matrix unit, the coordinate position of the pen tip on the target document is obtained and recorded as the pen tip coordinate information; Based on all coding units in the target detection image and the preset coding algorithm, initial coding information is obtained; Based on the pen tip coordinate information, the initial encoding information, the acquisition time, and the pressure data, the target decoding information and the trajectory coordinates of the image acquisition device are obtained.