A method for generating dot matrix coordinate information

By using the offset position of the code point mark within the grid as a subdivision coordinate and providing a correction method in the virtual writing input device, the problem of low accuracy of dot matrix coordinate recognition is solved, and higher accuracy code point image recognition and fast handwriting reproduction are achieved.

CN116109697BActive Publication Date: 2026-02-17BEIJING LANGCONG TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing virtual writing input devices have low accuracy in recognizing the dot matrix coordinates of the writing medium's code points, which affects the accuracy and efficiency of handwriting reproduction.

Method used

By using the offset position of the code point mark within a single grid as the subdivision coordinate during the coordinate recognition process, and providing auxiliary correction methods, including image acquisition, black and white image conversion, grid subdivision, code point image recognition and code fusion processing, the accuracy of code point image recognition is optimized.

Benefits of technology

It improves the accuracy of code point image recognition in virtual writing input devices, reduces the handwriting optimization processing time of the host computer, and enables handwriting to be reproduced quickly and clearly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116109697B_ABST
    Figure CN116109697B_ABST
Patent Text Reader

Abstract

The embodiment of the present application relates to a kind of dot matrix coordinate information generation method, comprising: step 1 generates first image;Step 2 generates first black and white image;Step 3 generates first code point diagram;Step 4 generates first grid code point diagram;Step 5 the distance and angle of the center point of all grids with the center point of first grid code point diagram are generated first grid offset information group;Step 6 the offset quadrant of code point mark in all grids is generated first grid quadrant information group;Step 7 generates grid encoding information and is matched with position reference list to generate position information matching degree;Step 8 obtains position matching proportion value;Step 9 if position information matching degree is greater than or equal to position matching proportion value to step 11, position information matching degree is less than position matching proportion value, turn step 10;Step 10 carries out angle rotation processing to first code point diagram to generate first code point diagram and turns step 4;Step 11 generates first coordinate information group and sends to host computer.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data processing, in particular to a method for generating dot matrix coordinate information. BACKGROUND

[0002] With the popularization of virtual writing input devices such as electronic pens, writing media printed with code point marks with dot matrix coordinate information have been listed as important consumables. Virtual writing input devices can identify the dot matrix coordinate information of the code point marks on the writing media, and can transmit the writing traces of the people to the host computer for further trace reproduction processing without changing the conventional handwriting input method of the people. However, the existing virtual writing input devices have low accuracy in identifying the dot matrix coordinates of the code point marks on the writing media, which affects the accuracy and efficiency of the trace reproduction of the host computer. SUMMARY

[0003] The present application aims to solve the defects of the prior art, and provides a method for generating dot matrix coordinate information, which uses the offset position of the code point mark in a single grid as a subdivision coordinate, and provides an auxiliary correction means for the code point image in the coordinate identification process. Thus, the accuracy of the code point image identification of the virtual writing input device is improved, and the trace optimization processing time of the host computer connected to the virtual writing input device for reproducing the traces is reduced, so that the host computer can quickly and clearly reproduce the writing traces.

[0004] To achieve the above-mentioned purpose, the embodiment of the present application provides a method for generating dot matrix coordinate information, comprising:

[0005] Step 1: generating a first image through image acquisition processing by an image acquisition device;

[0006] Step 2: generating a first black and white image through black and white image conversion processing on the first image;

[0007] Step 3: generating a first code point image through code point mark identification processing on the first black and white image;

[0008] Step 4: generating a first grid code point image through grid subdivision processing on the first code point image;

[0009] Step 5: sequentially extracting all grids of the first grid code point image, and generating a first grid offset information group by counting the offset distance and angle of the center point of all grids from the center point of the first grid code point image;

[0010] Step 6: sequentially extracting all grids of the first grid code point image, and generating a first grid quadrant information group by counting the offset quadrant relationship between the code point mark in all grids and the center point of the grid;

[0011] Step 7, encode and fuse the first grid offset information set and the first grid quadrant information set to generate grid encoding information, and match and calculate the grid encoding information with a position reference list of a system area to generate a position information matching degree;

[0012] Step 8, obtain a position matching proportion value from the system area;

[0013] Step 9, determine whether the position information matching degree is greater than or equal to the position matching proportion value, if the position information matching degree is greater than or equal to the position matching proportion value, go to step 11, and if the position information matching degree is less than the position matching proportion value, go to step 10;

[0014] Step 10, perform grid image angle rotation processing on the first code point map to generate the first code point map, and go to step 4;

[0015] Step 11, generate the first coordinate information set according to the grid encoding information, and send the first coordinate information set to an upper computer.

[0016] Further, the method further comprises:

[0017] After the number of times of performing grid image angle rotation processing on the first code point map exceeds a preset maximum number of times of correction, exit the graphic processing flow and send graphic processing error information to the upper computer.

[0018] Further, the method further comprises:

[0019] After the first code point map is generated by performing grid image angle rotation processing on the first code point map, when the total number of code points of the first code point map is lower than a preset minimum total number of code points, exit the graphic processing flow and send graphic processing error information to the upper computer.

[0020] Further, the black-and-white image conversion processing on the first image to generate a first black-and-white image specifically comprises:

[0021] Obtain a black-and-white pixel switching value, a black pixel value and a white pixel value from the system area;

[0022] Perform pixel point polling on all pixel points of the first image, when a pixel value of a polled pixel point is less than or equal to the black-and-white pixel switching value, set the pixel value of the polled pixel point to the white pixel value, and when the pixel value of the polled pixel point is greater than the black-and-white pixel switching value, set the pixel value of the polled pixel point to the black pixel value;

[0023] The first image after completing the pixel point polling is taken as the corresponding first black-and-white image.

[0024] Further, the grid subdivision processing on the first code point map generates a first grid code point map, specifically comprising:

[0025] The first code point map is scanned by row and column, the interval distance of adjacent code point marks is counted, and a first code point interval distance sequence is generated;

[0026] The first code point interval distance sequence is subjected to interval distance mean value calculation processing to generate a grid interval distance;

[0027] The first code point interval distance sequence is subjected to interval distance data item difference processing to generate a first difference sequence;

[0028] A minimum difference distance threshold value is obtained from the system area, all data items of the first difference sequence are polled and compared, and all data items smaller than the minimum difference distance threshold value are extracted to generate a first comparison sequence;

[0029] The data items of the first comparison sequence are sequentially extracted, two adjacent interval distance data items corresponding to the data items of the first comparison sequence are extracted in the second interval distance sequence, and three code point marks corresponding to the two adjacent interval distance data items are sequentially connected in the first code point map;

[0030] The direction of all connection lines in the first code point map is counted to generate a grid horizontal axis direction and a grid vertical axis direction;

[0031] According to the first code point map, the center point of the first code point map is taken as the origin, the grid horizontal axis direction is taken as the horizontal axis direction, the grid vertical axis direction is taken as the vertical axis direction, and the grid interval distance is taken as the grid side length. The first code point map is subjected to grid subdivision processing to generate the first grid code point map.

[0032] Further, all grids of the first grid code point map are sequentially extracted, the offset distance and angle of the center point of all grids from the center point of the first grid code point map are counted to generate a first grid offset information group, specifically comprising:

[0033] Step 61, initialize the value of the first index to 1, obtain the total number of grids of the first grid code point map to generate a first total number, and initialize the first temporary grid offset information group to be empty;

[0034] Step 62, extract the first index grid image data of the first grid code point map to generate a first grid image;

[0035] Step 63, calculate the straight line connection distance between the center point of the first grid image and the center point of the first grid code point map to generate a first grid center distance;

[0036] Step 64: Using the vertical axis of the first grid dot map as a reference, calculate the angle between the center point of the first grid map and the center point of the first grid dot map to generate the first grid center offset angle;

[0037] Step 65: Combine the first index, the first grid center distance, and the first grid center offset angle to generate a first grid offset data item, and add the first grid offset data item to the first temporary grid offset information group.

[0038] Step 66: Increment the value of the first index by 1;

[0039] Step 67: Determine whether the first index is greater than the first total number. If the first index is greater than the first total number, proceed to step 68. If the first index is less than or equal to the first total number, proceed to step 62.

[0040] Step 68: Extract all data from the first temporary grid offset information group to generate the first grid offset information group.

[0041] Further, the step of sequentially extracting all grids of the first grid code point map and statistically analyzing the offset quadrant relationship between the code point symbols within all grids and the grid center point to generate the first grid quadrant information group specifically includes:

[0042] Step 71: Initialize the value of the second index to 1, obtain the total number of grids in the first grid code point map to generate the second total number, and initialize the first temporary grid quadrant information group to empty;

[0043] Step 72: Extract the second index grid image data of the first grid dot map to generate a second grid map;

[0044] Step 73: Divide the second grid map into four quadrants with equal area, taking the center point of the second grid map as the origin, the vertical axis of the second grid map as the vertical direction, and the horizontal axis of the second grid map as the horizontal direction, to generate the upper left quadrant, the upper right quadrant, the lower right quadrant, and the lower left quadrant.

[0045] Step 74: Initialize the grid quadrant values ​​to empty;

[0046] Step 75, setting the grid quadrant value to be binary value 00 when the code point mark in the second grid map is in the left upper quadrant region, setting the grid quadrant value to be binary value 01 when the code point mark in the second grid map is in the right upper quadrant region, setting the grid quadrant value to be binary value 10 when the code point mark in the second grid map is in the right lower quadrant region, and setting the grid quadrant value to be binary value 11 when the code point mark in the second grid map is in the left lower quadrant region;

[0047] Step 76, combining the second index and the grid quadrant value to generate a first grid quadrant data item, and adding the first grid quadrant data item to the first temporary grid quadrant information group;

[0048] Step 77, adding 1 to the value of the second index;

[0049] Step 78, judging whether the second index is greater than the second total number, if the second index is greater than the second total number, turning to step 79, and if the second index is less than or equal to the second total number, turning to step 72;

[0050] Step 79, extracting all data of the first temporary grid quadrant information group to generate the first grid quadrant information group.

[0051] Further, the matching calculation processing of the grid encoding information and the position reference list of the system area to generate the position information matching degree includes:

[0052] Obtaining the generation time of the grid encoding information to generate a first time, and obtaining the comparison time of the position reference list to generate a second time;

[0053] According to the second time, performing continuous time matching verification processing on the first time to generate a first matching degree parameter;

[0054] Obtaining the comparison position encoding information of the position reference list, and performing continuous position encoding matching verification processing on the grid encoding information according to the comparison position encoding information to generate a second matching degree parameter;

[0055] According to the first matching degree parameter and the second matching degree parameter, performing matching parameter fusion calculation to generate the position information matching degree.

[0056] Further, the grid image angle rotation processing of the first code point map to generate the first code point map includes:

[0057] Obtaining an angle rotation value from the system area to generate a first angle value, and obtaining an angle rotation direction to generate a first direction;

[0058] set the first code point mark in the upper left corner of the first code point map as a rotation origin point;

[0059] when the first direction is specifically a positive direction, all code point marks in the first code point map except the rotation origin point are shifted in a counterclockwise direction by the first angle value without changing the length of the connection with the rotation origin point;

[0060] when the first direction is specifically a positive direction, all code point marks in the first code point map except the rotation origin point are shifted in a clockwise direction by the first angle value without changing the length of the connection with the rotation origin point;

[0061] after the position shift is successfully performed, all shifted code point mark position information is obtained to regenerate the first code point map.

[0062] Preferably, the method further comprises:

[0063] during the position shift, code point abandonment processing is performed on code point marks whose shifted positions are out of the range of the first code point map.

[0064] The embodiment of the present application provides a generation method of dot matrix coordinate information, uses the offset position of a code point mark in a single grid as a subdivision coordinate, and provides an auxiliary correction means for a code point image in a coordinate identification process to perform optimization, thereby improving the code point image recognition precision of a virtual writing input device and reducing the handwriting optimization processing time of a host computer connected with the virtual writing input device for reproducing handwriting, so that the host computer can quickly and clearly reproduce the writing handwriting. BRIEF DESCRIPTION OF DRAWINGS

[0065] Figure 1 FIG. 1 is a schematic diagram of a generation method of dot matrix coordinate information provided by an embodiment of the present application;

[0066] Figure 2 FIG. 2 is a schematic diagram of a generation method of dot matrix coordinate information provided by an embodiment of the present application;

[0067] Figure 3 FIG. 3 is a schematic diagram of a code point map provided by the embodiment of the present application;

[0068] Figure 4 FIG. 4 is a schematic diagram of a grid code point map provided by the embodiment of the present application;

[0069] Figure 5 FIG. 5 is a schematic diagram of a grid quadrant provided by the embodiment of the present application;

[0070] Figure 6A FIG. 6 is a schematic diagram of a code point map rotation provided by the embodiment of the present application;

[0071] Figure 6B An angle-rotated post-code point diagram is provided for the embodiment of the present application. DETAILED DESCRIPTION

[0072] The technical solutions of the present application are described in further detail below with reference to the drawings and embodiments.

[0073] In the first embodiment of the present application, as shown in the following, Figure 1 A method for generating dot matrix coordinate information is shown in the diagram, which comprises:

[0074] Step 1: An image acquisition device is used to generate a first image.

[0075] Here, a virtual writing input device (such as an electronic pen) uses an image acquisition device (such as a camera) to take an image of the area where the tip of the electronic pen is located on the writing medium with code point marks and the taken image is taken as the image acquisition result, i.e., the first image.

[0076] Step 2: The first image is subjected to black-and-white image conversion processing to generate a first black-and-white image,

[0077] Specifically, it comprises the following steps: Step 21: Obtain a black-and-white pixel switching value, a black pixel value, and a white pixel value from the system area.

[0078] Step 22: Poll all pixel points of the first image, and when the pixel value of the polled pixel point is less than or equal to the black-and-white pixel switching value, set the pixel value of the polled pixel point to the white pixel value; when the pixel value of the polled pixel point is greater than the black-and-white pixel switching value, set the pixel value of the polled pixel point to the black pixel value.

[0079] Step 23: Take the first image after the pixel point polling as the corresponding first black-and-white image.

[0080] Here, since the recognition code points printed on the writing medium are affected by environmental light or the color of the printed medium itself, the pixel value of each pixel point in the sub-image of the first image group obtained by the image acquisition device has a large range, which is not conducive to further positioning and recognizing the code points. Therefore, the black-and-white image conversion processing here is to perform the first image noise filtering on the sub-image, and according to a predetermined black-and-white pixel distinction value, all pixel points are only distinguished as black and white, and most of the low pixel value points are set as white points for screening.

[0081] Step 3: Perform code point mark recognition processing on the first black-and-white image to generate a first code point diagram.

[0082] Specifically, as shown in the following, Figure 3A code point diagram provided by an embodiment of the present application is shown in a schematic diagram.

[0083] Step 4, grid subdivision processing is performed on the first code point diagram to generate a first grid code point diagram,

[0084] Specifically comprising: step 41, the interval distances of adjacent code point marks are counted in a row scanning and column scanning manner of the first code point diagram to generate a first code point interval distance sequence;

[0085] Step 42, mean value calculation processing is performed on the first code point interval distance sequence to generate a grid interval distance;

[0086] Step 43, difference processing is performed on the interval distance data items of the first code point interval distance sequence to generate a first difference sequence;

[0087] Step 44, a minimum difference distance threshold value is obtained from a system area, all data items of the first difference sequence are polled and compared, and all data items smaller than the minimum difference distance threshold value are extracted to generate a first comparison sequence;

[0088] Step 45, the data items of the first comparison sequence are sequentially extracted, two adjacent interval distance data items corresponding to the data items of the first comparison sequence are extracted in the second interval distance sequence, and three code point marks corresponding to the two adjacent interval distance data items are sequentially connected in the first code point diagram;

[0089] Step 46, direction statistics are performed on all connection directions in the first code point diagram to generate a grid horizontal axis direction and a grid vertical axis direction;

[0090] Step 47, according to the first code point diagram, taking the center point of the first code point diagram as an origin, taking the grid horizontal axis direction as a horizontal axis direction, taking the grid vertical axis direction as a vertical axis direction, and taking the grid interval distance as a grid side length, grid subdivision processing is performed on the first code point diagram to generate a first grid code point diagram.

[0091] Here, because the interval distance data items in the first interval distance sequence are actually in a row-first-column-second manner, for example, a first row interval distance data item set, a second row interval distance data item set, and a last row interval distance data item set, a first column interval distance data item set, a second column interval distance data item set, and a last column interval distance data item set; the specific structure of the first difference sequence is also a first row difference data item set, a second row difference data item set, and a last row difference data item set, a first column difference data item set, a second column difference data item set, and a last column difference data item set.

[0092] Each data item of the first comparison sequence corresponds to a data item of the first difference sequence, each data item of the first difference sequence corresponds to two adjacent interval distance data items in the second interval distance sequence, and the two adjacent interval distance data items correspond to three continuous code point symbols in the same row or column in the first code point graph. The three continuous code point symbols are sequentially connected to obtain a row direction or a column direction, i.e., an actual horizontal direction and a vertical direction of the first code point graph, and the row direction is defined as a horizontal direction of the grid and the column direction is defined as a vertical direction of the grid for the convenience of drawing the grid.

[0093] After the first code point graph is finely divided, a grid code point graph is generated, and the grid code point graph is specifically as shown in a grid code point graph schematic view provided by an embodiment of the present application. Figure 4 The grid code point graph schematic view is shown in the embodiment of the present application.

[0094] Step 5: all grids of the first grid code point graph are sequentially extracted, offset distance and angle between the center points of all grids and the center point of the first grid code point graph are counted to generate a first grid offset information group,

[0095] Specifically, step 51: the value of the first index is initialized as 1, the total number of grids of the first grid code point graph is obtained to generate a first total number, and the first temporary grid offset information group is initialized as empty;

[0096] Step 52: the first index grid image data of the first grid code point graph is extracted to generate a first grid image;

[0097] Step 53: the straight line connection distance between the center point of the first grid image and the center point of the first grid code point graph is calculated to generate a first grid center distance;

[0098] Step 54: the included angle between the center point of the first grid image and the center point of the first grid code point graph is calculated with the vertical direction of the first grid code point graph as a reference to generate a first grid center offset angle;

[0099] Step 55: the first index, the first grid center distance, and the first grid center offset angle are combined to generate a first grid offset data item, and the first grid offset data item is added to the first temporary grid offset information group;

[0100] Step 56: the value of the first index is increased by 1;

[0101] Step 57: whether the first index is greater than the first total number is judged, if the first index is greater than the first total number, the process proceeds to step 58, and if the first index is less than or equal to the first total number, the process proceeds to step 52;

[0102] Step 58: all data of the first temporary grid offset information group are extracted to generate the first grid offset information group.

[0103] Step 6, all grids of the first grid code point image are extracted in sequence, and the offset quadrant relationship between the code point mark in all grids and the center point of the grid is counted to generate the first grid quadrant information group,

[0104] Specifically comprising: step 61, initializing the value of the second index to 1, obtaining the total number of grids of the first grid code point image to generate the second total number, and initializing the first temporary grid quadrant information group to be empty;

[0105] Step 62, extracting the second index grid image data of the first grid code point image to generate the second grid image;

[0106] Step 63, performing equal-area four-quadrant division processing on the second grid image with the center point of the second grid image as the origin, the vertical direction of the second grid image as the vertical direction, and the horizontal direction of the second grid image as the horizontal direction, to generate the left upper quadrant area, the right upper quadrant area, the right lower quadrant area, and the left lower quadrant area;

[0107] Step 64, initializing the grid quadrant value to be empty;

[0108] Step 65, setting the grid quadrant value to be binary value 00 when the code point mark in the second grid image is in the left upper quadrant area, to be binary value 01 when the code point mark in the second grid image is in the right upper quadrant area, to be binary value 10 when the code point mark in the second grid image is in the right lower quadrant area, and to be binary value 11 when the code point mark in the second grid image is in the left lower quadrant area;

[0109] Step 66, combining the second index and the grid quadrant value to generate the first grid quadrant data item, and performing data item adding processing on the first grid quadrant data item to the first temporary grid quadrant information group;

[0110] Step 67, adding 1 to the value of the second index;

[0111] Step 68, judging whether the second index is greater than the second total number, if the second index is greater than the second total number, turning to step 69, and if the second index is less than or equal to the second total number, turning to step 62;

[0112] Step 69, extracting all data of the first temporary grid quadrant information group to generate the first grid quadrant information group.

[0113] Here, the area of each grid is certainly greater than the area of the code point mark, the method divides the grid vertically to generate four quadrant positions, left upper, right upper, right lower and left lower respectively; define common binary representation as a mark for the four quadrants, for example: 00 represents left upper, 01 represents right upper, 10 represents right lower, and 11 represents left lower; The second offset information of the code point mark in which quadrant is the binary mark information of the grid; The concept of grid offset is introduced to improve the recognition accuracy and the capacity of position coding, specifically, such as Figure 5 A grid quadrant diagram provided by the embodiment of the application is shown.

[0114] Step 7, encode and fuse the first grid offset information group and the first grid quadrant information group to generate grid coding information, and match and calculate the grid coding information with the position reference list of the system area to generate a position information matching degree,

[0115] Specifically, step 71, the generation time of the grid coding information is obtained to generate a first time, and the comparison time of the position reference list is obtained to generate a second time;

[0116] Step 72, according to the second time, continuously time matching inspection processing is performed on the first time to generate a first matching degree parameter;

[0117] Step 73, the comparison position coding information of the position reference list is obtained, and the grid coding information is continuously position coding matching inspection processing according to the comparison position coding information to generate a second matching degree parameter;

[0118] Step 74, according to the first matching degree parameter and the second matching degree parameter, the matching parameter fusion calculation is performed to generate the position information matching degree.

[0119] Step 8, the position matching proportion value is obtained from the system area.

[0120] Step 9, judge whether the position information matching degree is greater than or equal to the position matching proportion value, if the position information matching degree is greater than or equal to the position matching proportion value, go to step 11, if the position information matching degree is less than the position matching proportion value, go to step 10.

[0121] Step 10, the first code point graph is subjected to grid image angle rotation processing to generate a first code point graph, and step 4 is turned to,

[0122] Specifically, step 10-1, the angle rotation value is obtained from the system area to generate a first angle value, and the angle rotation direction is obtained to generate a first direction;

[0123] Step 10-2, the first code point mark at the left upper of the first code point graph is set as a rotation origin;

[0124] Step 10-3, in the case that the first direction is positive, all the code point symbols in the first code point graph except the rotation origin are moved in the anticlockwise direction by the first angle value without changing the length of the connection with the rotation origin;

[0125] Step 10-4, in the case that the first direction is positive, all the code point symbols in the first code point graph except the rotation origin are moved in the clockwise direction by the first angle value without changing the length of the connection with the rotation origin;

[0126] Step 10-5, after the position migration is successfully executed, the position information of all the migrated code point symbols is obtained to regenerate the first code point graph, and the process goes to step 4.

[0127] Here, in continuous writing, the writer's body adjustment, writing angle adjustment, writing medium inclination and the like often occur, which will cause the collected pictures and converted code point graphs to be displaced and inclined. Once the displacement and inclination occur, the coordinate position information generated by the code point grid graph can be mismatched with the previous continuous information stored in the position reference list. In order to improve the compatibility, the method of the present application will displace the code point graph multiple times when the mismatch is found, and then generate the grid graph and extract the coordinate information to compare with the position reference list. Within the range allowed by the set comparison times, the method tries to be compatible with various unexpected situations as much as possible, so that the user can use the virtual input device more freely. Figure 6A A code point graph rotation schematic diagram provided for the embodiment of the present application is shown in Figure 6A , and the relationship between the code point graph form before rotation and the rotation processing is shown in Figure 6B . Figure 6B A code point graph schematic diagram after angle rotation provided for the embodiment of the present application is shown in

[0128] Step 11, the first coordinate information group is generated according to the grid encoding information, and the first coordinate information group is sent to the host computer.

[0129] Here, the host computer is a device, equipment, computer or server connected with the virtual writing input device (such as an electronic pen) for realizing handwriting reproduction, which can have a display module or can be connected with other display devices to display the reproduced handwriting.

[0130] Embodiment two of the present application is shown in Figure 2 A dot matrix coordinate information generation method schematic diagram provided for the embodiment two of the present application is shown, which includes:

[0131] Step 101, the value of the graph angle rotation counter is initialized to 0, the maximum number of correction times is obtained, the minimum code point total number is obtained, the first code point graph is obtained and the first grid code point graph is generated.

[0132] Step 102, sequentially extract all grids of the first grid code point map, count the offset distance and angle of the center point of all grids from the center point of the first grid code point map to generate a first grid offset information group,

[0133] Specifically, step 1021 initializes the value of the first index to 1, obtains the total number of grids of the first grid code point map to generate a first total number, and initializes the first temporary grid offset information group to be empty;

[0134] Step 1022, extract the first index grid image data of the first grid code point map to generate a first grid image;

[0135] Step 1023, calculate the straight line connection distance between the center point of the first grid image and the center point of the first grid code point map to generate a first grid center distance;

[0136] Step 1024, taking the longitudinal axis direction of the first grid code point map as a reference, calculate the included angle between the center point of the first grid image and the center point of the first grid code point map to generate a first grid center offset angle;

[0137] Step 1025, combine the first index, the first grid center distance, and the first grid center offset angle to generate a first grid offset data item, and perform data item addition processing on the first grid offset data item to the first temporary grid offset information group;

[0138] Step 1026, add 1 to the value of the first index;

[0139] Step 1027, determine whether the first index is greater than the first total number, if the first index is greater than the first total number, go to step 1028, if the first index is less than or equal to the first total number, go to step 1022;

[0140] Step 1028, extract all data of the first temporary grid offset information group to generate a first grid offset information group.

[0141] Step 103, sequentially extract all grids of the first grid code point map, count the offset distance and angle of the center point of all grids from the center point of the first grid code point map to generate a first grid offset information group,

[0142] Specifically, step 1031 initializes the value of the first index to 1, obtains the total number of grids of the first grid code point map to generate a first total number, and initializes the first temporary grid offset information group to be empty;

[0143] Step 1032, extract the first index grid image data of the first grid code point map to generate a first grid image;

[0144] Step 1033, the second grid map is equally divided into four quadrants with the center point of the second grid map as the origin, the longitudinal axis direction of the second grid map as the vertical direction, and the transverse axis direction of the second grid map as the horizontal direction, to generate a left upper quadrant region, a right upper quadrant region, a right lower quadrant region, and a left lower quadrant region;

[0145] Step 1034, the grid quadrant value is initialized as null;

[0146] Step 1035, the grid quadrant value is set as binary 00 when the second grid map code point mark is in the left upper quadrant region, as binary 01 when the second grid map code point mark is in the right upper quadrant region, as binary 10 when the second grid map code point mark is in the right lower quadrant region, and as binary 11 when the second grid map code point mark is in the left lower quadrant region;

[0147] Step 1036, the second index and the grid quadrant value are combined to generate a first grid quadrant data item, and the first grid quadrant data item is added to the first temporary grid quadrant information group;

[0148] Step 1037, the value of the second index is increased by 1;

[0149] Step 1038, it is judged whether the second index is greater than the second total number. If the second index is greater than the second total number, go to step 1039. If the second index is less than or equal to the second total number, go to step 1032;

[0150] Step 1039, all data of the first temporary grid quadrant information group are extracted to generate a first grid quadrant information group.

[0151] Step 104, the first grid offset information group and the first grid quadrant information group are encoded and fused to generate grid encoding information, and the grid encoding information is matched and calculated with the position reference list of the system area to generate a position information matching degree,

[0152] Specifically, it includes: step 1041, a first time is generated by acquiring the generation time of the grid encoding information, and a second time is generated by acquiring the comparison time of the position reference list;

[0153] Step 1042, a first matching degree parameter is generated by performing continuous time matching inspection processing on the first time according to the second time;

[0154] Step 1043, a second matching degree parameter is generated by performing continuous position encoding matching inspection processing on the grid encoding information according to the comparison position encoding information of the position reference list;

[0155] Step 1044, according to the first matching degree parameter, the second matching degree parameter, the matching parameter fusion calculation is generated position information matching degree.

[0156] Step 105, acquiring the position matching proportion value from the system area.

[0157] Step 106, judging whether the position information matching degree is greater than or equal to the position matching proportion value, if the position information matching degree is greater than or equal to the position matching proportion value, turning to step 110, if the position information matching degree is less than the position matching proportion value, adding 1 to the value of the graphic angle rotation counter and turning to step 107.

[0158] Step 107, judging whether the graphic angle rotation counter is greater than the maximum number of times of rectification value, if the graphic angle rotation counter is greater than the maximum number of times of rectification value, turning to step 410, if the graphic angle rotation counter is less than or equal to the maximum number of times of rectification value, turning to step 108;

[0159] Here, in the case that the rectification cannot be matched after several times, the device is not avoided into the dead loop, and a maximum number of times of rectification is set as the correction parameter;

[0160] Step 108, performing the grid image angle rotation processing on the first code point graph to generate the first code point graph, and turning to step 109,

[0161] Specifically, it includes: step 1081, acquiring the angle rotation value from the system area to generate the first angle value, and acquiring the angle rotation direction to generate the first direction;

[0162] Step 1082, setting the first code point mark of the upper left of the first code point graph as the rotation origin;

[0163] Step 1083, when the first direction is specifically positive, in the case that the connection length with the rotation origin is unchanged, performing the position migration processing on all code point marks in the first code point graph except the rotation origin in the counterclockwise direction according to the first angle value;

[0164] Step 1084, when the first direction is specifically positive, in the case that the connection length with the rotation origin is unchanged, performing the position migration processing on all code point marks in the first code point graph except the rotation origin in the clockwise direction according to the first angle value;

[0165] Step 1085, after the position migration is successfully executed, acquiring the position information of all code point marks after the migration to regenerate the first code point graph.

[0166] Step 109: Obtain the total number of code points in the first code point map, and determine whether the total number of code points in the first code point map is less than the minimum total number of code points. If the total number of code points in the first code point map is less than the minimum total number of code points, proceed to step 420. If the total number of code points in the first code point map is greater than or equal to the minimum total number of code points, proceed to step 102.

[0167] Here, because the correction process may cause the loss of the bottom code point marks of the original first code point map, which will affect the accuracy of the coordinate data and cause mismatch during matching, a minimum total code point value is conventionally set. It is believed that if the total number of code points in a code point map is lower than this value, it is not capable of coordinate extraction, and this also avoids the device from getting stuck in an infinite loop when processing the correction.

[0168] Step 110: Generate a first coordinate information group based on the grid coding information, and send the first coordinate information group to the host computer.

[0169] Here, the host computer is a device, equipment, computer, or server connected to a virtual writing input device (such as an electronic pen) to reproduce handwriting. The host computer may have its own display module or can be connected to other display devices to display the reproduced handwriting.

[0170] Step 410: Exit the graphics processing flow and send a graphics processing error message to the host computer: The number of times the first code point image has undergone grid image angle rotation processing exceeds the preset maximum number of corrections.

[0171] The main reason for this type of error is that too many code point symbols are lost after the code point file is corrected, so the coordinate information extracted from the code points can never meet the requirements, and it is meaningless to perform further correction and extraction.

[0172] Step 420: Exit the graphics processing flow and send a graphics processing error message to the host computer: The total number of code points in the first code point image is lower than the preset minimum total number of code points.

[0173] The main cause of this type of error is likely either that there are too few code point symbols in the original image when generating the code point image, or that code point symbols are lost in the code point file after multiple corrections, thus making the code point image unable to meet the requirements.

[0174] This invention provides a method for generating dot matrix coordinate information. The method uses the offset position of the code dot mark within a single grid as the subdivision coordinate. Then, during the coordinate recognition process, it provides an auxiliary correction method for the code dot image to optimize it. This not only improves the code dot image recognition accuracy of the virtual writing input device, but also reduces the handwriting optimization processing time of the host computer connected to the virtual writing input device for reproducing handwriting, enabling the host computer to quickly and clearly reproduce the handwriting.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them; although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications can still be made to the specific implementation of the present invention or equivalent substitutions can be made to some technical features without departing from the spirit of the technical solutions of the present invention, and all such modifications and substitutions should be covered within the scope of the technical solutions claimed in the present invention.

Claims

1. A method for generating dot matrix coordinate information, characterized in that, The method includes: Step 1: Generate a first image by performing image acquisition and processing using an image acquisition device; Step 2: Perform black and white image conversion processing on the first image to generate a first black and white image; Step 3: Perform code dot recognition processing on the first black and white image to generate a first code dot image; Step 4: Perform grid subdivision processing on the first code dot map to generate a first grid code dot map; Step 5: Extract all grids of the first grid code dot map in sequence, and calculate the offset distance and angle between the center point of each grid and the center point of the first grid code dot map to generate the first grid offset information group; Step 6: Extract all grids of the first grid code point map in sequence, and calculate the offset quadrant relationship between the code point marks in all grids and the grid center point to generate the first grid quadrant information group; Step 7: Encode and fuse the first grid offset information group and the first grid quadrant information group to generate grid encoding information, and perform matching calculation on the grid encoding information and the position reference list of the system area to generate position information matching degree; Step 8: Obtain the position matching ratio value from the system area; Step 9: Determine whether the location information matching degree is greater than or equal to the location matching ratio value. If the location information matching degree is greater than or equal to the location matching ratio value, proceed to step 11. If the location information matching degree is less than the location matching ratio value, proceed to step 10. Step 10: Perform grid image angle rotation processing on the first code dot image to generate the first code dot image, and then proceed to step 4; Step 11: Generate a first coordinate information group based on the grid encoding information, and send the first coordinate information group to the host computer.

2. The method according to claim 1, characterized in that, The method further includes: After the number of times the first code dot image undergoes grid image angle rotation processing exceeds the preset maximum number of corrections, the graphics processing flow is exited and a graphics processing error message is sent to the host computer.

3. The method according to claim 1, characterized in that, The method further includes: After generating the first code dot image by performing grid image angle rotation processing, when the total number of code dots in the first code dot image is lower than the preset minimum total number of code dots, the image processing process is exited and an image processing error message is sent to the host computer.

4. The method according to claim 1, characterized in that, The step of performing black-and-white image conversion processing on the first image to generate the first black-and-white image specifically includes: Obtain the black and white pixel switching value, black pixel value, and white pixel value from the system area; Pixel polling is performed on all pixels of the first image. When the pixel value of the polled pixel is less than or equal to the black-and-white pixel switching value, the pixel value of the polled pixel is set to the white pixel value. When the pixel value of the polled pixel is greater than the black-and-white pixel switching value, the pixel value of the polled pixel is set to the black pixel value. The first image that has completed pixel polling is used as the corresponding first black and white image.

5. The method according to claim 1, characterized in that, The step of subdividing the first code point image into grids to generate the first grid code point image specifically includes: By scanning the first code point map by row and column, the interval distance between adjacent code point symbols is calculated to generate the first code point interval distance sequence. The first code point interval distance sequence is processed by calculating the average interval distance to generate a grid interval distance; Perform interval distance data term difference processing on the first code point interval distance sequence to generate a first difference sequence; Obtain the minimum difference distance threshold from the system region, poll and compare all data items in the first difference sequence, and extract all data items smaller than the minimum difference distance threshold to generate the first comparison sequence; The data items of the first alignment sequence are extracted sequentially. Two adjacent interval distance data items corresponding to the data items of the first alignment sequence are extracted from the first code point interval distance sequence. The three code point symbols corresponding to the two adjacent interval distance data items are connected sequentially in the first code point diagram. Perform directional statistics on all connecting lines in the first code dot diagram to generate the horizontal and vertical directions of the grid. Based on the first code dot map, the first code dot map is subdivided into grids, with the center point of the first code dot map as the origin, the horizontal axis of the grid as the horizontal axis, the vertical axis of the grid as the vertical axis, and the grid spacing distance as the grid side length, to generate the first grid code dot map.

6. The method according to claim 1, characterized in that, The step of sequentially extracting all grids from the first grid code point image and calculating the offset distance and angle between the center point of each grid and the center point of the first grid code point image to generate a first grid offset information group specifically includes: Step 61: Initialize the value of the first index to 1, obtain the total number of grids in the first grid code point map to generate the first total number, and initialize the first temporary grid offset information group to empty; Step 62: Extract the first index grid image data of the first grid dot map to generate the first grid map; Step 63: Calculate the straight-line distance between the center point of the first grid map and the center point of the first grid dot map to generate the first grid center distance; Step 64: Using the vertical axis of the first grid dot map as a reference, calculate the angle between the center point of the first grid map and the center point of the first grid dot map to generate the first grid center offset angle; Step 65: Combine the first index, the first grid center distance, and the first grid center offset angle to generate a first grid offset data item, and add the first grid offset data item to the first temporary grid offset information group. Step 66: Increment the value of the first index by 1; Step 67: Determine whether the first index is greater than the first total number. If the first index is greater than the first total number, proceed to step 68. If the first index is less than or equal to the first total number, proceed to step 62. Step 68: Extract all data from the first temporary grid offset information group to generate the first grid offset information group.

7. The method according to claim 1, characterized in that, The step of sequentially extracting all grids of the first grid code point map and statistically analyzing the offset quadrant relationship between the code point symbols within all grids and the grid center point to generate the first grid quadrant information group specifically includes: Step 71: Initialize the value of the second index to 1, obtain the total number of grids in the first grid code point map to generate the second total number, and initialize the first temporary grid quadrant information group to empty; Step 72: Extract the second index grid image data of the first grid dot map to generate a second grid map; Step 73: Divide the second grid map into four quadrants with equal area, taking the center point of the second grid map as the origin, the vertical axis of the second grid map as the vertical direction, and the horizontal axis of the second grid map as the horizontal direction, to generate the upper left quadrant, the upper right quadrant, the lower right quadrant, and the lower left quadrant. Step 74: Initialize the grid quadrant values ​​to empty; Step 75: When the code point in the second grid diagram is located in the upper left quadrant, the grid quadrant value is set to binary value 00; when the code point in the second grid diagram is located in the upper right quadrant, the grid quadrant value is set to binary value 01; when the code point in the second grid diagram is located in the lower right quadrant, the grid quadrant value is set to binary value 10; and when the code point in the second grid diagram is located in the lower left quadrant, the grid quadrant value is set to binary value 11. Step 76: Combine the second index and the grid quadrant value to generate a first grid quadrant data item, and add the first grid quadrant data item to the first temporary grid quadrant information group. Step 77: Increment the value of the second index by 1; Step 78: Determine whether the second index is greater than the second total. If the second index is greater than the second total, proceed to step 79. If the second index is less than or equal to the second total, proceed to step 72. Step 79: Extract all data from the first temporary grid quadrant information group to generate the first grid quadrant information group.

8. The method according to claim 1, characterized in that, The step of matching and calculating the location information matching degree by matching the grid-coded information with the location reference list of the system area specifically includes: The generation time of the grid encoding information is obtained to generate the first time, and the comparison time of the location reference list is obtained to generate the second time; Based on the second time, perform continuous time matching verification on the first time to generate a first matching degree parameter; Obtain the comparison position encoding information of the position reference list, and perform continuous position encoding matching verification processing on the grid encoding information based on the comparison position encoding information to generate a second matching degree parameter; The location information matching degree is generated by performing matching parameter fusion calculation based on the first matching degree parameter and the second matching degree parameter.

9. The method according to claim 1, characterized in that, The step of generating the first code dot image by performing grid image angle rotation processing specifically includes: A first angle value is generated by obtaining an angle rotation value from the system area, and a first direction is generated by obtaining the angle rotation direction. Set the top left first code point of the first code point diagram as the origin of rotation; When the first direction is specifically positive, and the connection length with the rotation origin remains unchanged, all code point symbols in the first code point diagram except for the rotation origin are moved in the counterclockwise direction according to the first angle value. When the first direction is specifically positive, and the connection length with the rotation origin remains unchanged, all code point symbols in the first code point diagram except for the rotation origin are moved clockwise according to the first angle value. After the position migration is successfully executed, the position information of all migrated code point symbols is obtained and the first code point map is regenerated.

10. The method according to claim 9, characterized in that, The method further includes: During the location migration process, code points whose positions after migration are outside the range of the first code point map are discarded.

Citation Information

Patent Citations

  • Dot matrix two-dimensional code coding and recognition method

    CN105760919A

  • Method, device and system for determining position code of multi-system coding pattern

    CN110110573A