A method for identifying a square grid two-dimensional map and a computer readable storage medium

By identifying the intersection points and cutting segments of the lines inside the grid to determine the grid outline, and then reconstructing the grid by combining the boundary lines and corner points, the problem of inconsistent recognition between different drawing schemes is solved, and efficient grid 2D map recognition and elevation matching are achieved.

CN116994281BActive Publication Date: 2025-12-19GLODON CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311022386.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-14
Publication Date
2025-12-19
Estimated Expiration
2043-08-14

AI Technical Summary

Technical Problem

In the existing technology, different grid drawing schemes require different recognition strategies, and there is a lack of an accurate and universal grid 2D graph recognition method.

Method used

By identifying the intersections of lines within the grid, cutting line segments, and determining the grid outline based on the principle of maximizing the number of line segments, the grid is reconstructed by combining the grid boundary lines, side lengths, side directions, and corner points, and the target type elevation is matched.

Benefits of technology

It achieves accurate recognition of grids of any drawing type, improves recognition and matching efficiency, is applicable to grids with different drawing schemes, and solves the problem of inconsistent recognition in existing technologies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116994281B_ABST
    Figure CN116994281B_ABST
Patent Text Reader

Abstract

The application discloses a square grid two-dimensional graph identification method and a computer readable storage medium, and the method comprises the following steps: identifying all square grid internal lines from a square grid two-dimensional graph to be identified; cutting opposite square grid internal lines at each intersection point on each square grid internal line; dividing the line segments obtained after cutting into a plurality of line segment combinations, and determining the line segments in the line segment combination with the largest number of line segments as square frame lines; wherein each square grid internal line intersects with at least one other square grid internal line, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data recognition, and in particular to a square grid two-dimensional graph recognition method and a computer readable storage medium. BACKGROUND

[0002] A square grid graph includes square grid lines and elevation data on square grid corner points. Existing technologies often need to recognize square grid frame lines in the square grid graph and the elevation data corresponding to each square grid corner point to perform large earthwork calculation based on the recognized parameters. However, the inventors have found that there are two square grid drawing schemes, and different recognition strategies are needed for different square grid drawing schemes when recognizing square grid frame lines. Therefore, how to provide an accurate and universal square grid two-dimensional graph recognition scheme has become a technical problem that technicians in the field need to solve. SUMMARY

[0003] The purpose of the present application is to provide a square grid two-dimensional graph recognition method and a computer readable storage medium, which can accurately recognize square grid frame lines in a square grid two-dimensional graph regardless of the scheme used by engineers to draw the square grid.

[0004] According to one aspect of the present application, a square grid two-dimensional graph recognition method is provided, which includes:

[0005] identifying all square grid internal lines from a square grid two-dimensional graph to be recognized;

[0006] cutting the corresponding square grid internal line at each intersection point on each square grid internal line;

[0007] dividing the line segments obtained after cutting into a plurality of line segment combinations, and determining the line segments in the line segment combination with the most line segments as the square grid frame lines;

[0008] wherein each square grid internal line intersects with at least one other square grid internal line, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.

[0009] Optionally, the method further includes:

[0010] identifying all square grid boundary lines in the square grid two-dimensional graph;

[0011] identifying the length of the square grid frame line, denoted as the square grid side length;

[0012] identifying the direction of the square grid frame line, denoted as the square grid side direction;

[0013] identifying the end point of the square grid frame line, denoted as the square grid corner point;

[0014] reconstructing the square grid in the square grid two-dimensional graph according to the square grid boundary line, the square grid side length, the square grid side direction and the square grid corner point.

[0015] Optionally, the method further comprises:

[0016] acquiring all target type benchmarks in the square grid two-dimensional graph;

[0017] identifying all target type benchmarks in the square grid two-dimensional graph;

[0018] matching a corresponding target type benchmark for each to-be-matched corner point according to the length of the square grid frame line; wherein one to-be-matched corner point matches one target type benchmark.

[0019] Optionally, the identifying all target type benchmarks in the square grid two-dimensional graph comprises:

[0020] in response to a seed benchmark selection instruction, identifying a target type seed benchmark in the square grid two-dimensional graph;

[0021] acquiring the color and the layer of the target type seed benchmark, and identifying all target type benchmarks in the same layer and with the same color as the target type seed benchmark in the square grid two-dimensional graph.

[0022] Optionally, the matching a corresponding target type benchmark for each to-be-matched corner point according to the length of the square grid frame line comprises:

[0023] screening a first corner point matching the target type seed benchmark from the acquired to-be-matched corner points according to the length of the square grid frame line;

[0024] determining a matching attribute of the target type seed benchmark and the first corner point;

[0025] matching a corresponding target type benchmark for each remaining to-be-matched corner point according to the matching attribute;

[0026] wherein the matching attribute comprises a first distance between the target type seed benchmark and the first corner point, a first direction of the target type seed benchmark relative to the first corner point, a data length of the target type seed benchmark, and a second direction of the target type seed benchmark relative to a target coordinate axis in a coordinate system to which the target type seed benchmark belongs.

[0027] Optionally, the screening a first corner point matching the target type seed benchmark from the acquired to-be-matched corner points according to the length of the square grid frame line comprises:

[0028] determining a circular range with the target type seed benchmark as the center and n times the length of the square grid frame line as the radius; wherein n is greater than 1.

[0029] screening out the to-be-matched corner points located in the circular range from the acquired to-be-matched corner points;

[0030] calculating a second distance between each of the screened to-be-matched corner points and the seed mark of the target type, respectively;

[0031] determining the to-be-matched corner point with the smallest second distance as the first corner point.

[0032] Optionally, the matching the corresponding target type mark for each of the remaining to-be-matched corner points according to the matching attributes comprises:

[0033] constructing a corresponding matching score calculation formula based on each parameter in the matching attributes, respectively;

[0034] traversing the remaining to-be-matched corner points, and determining a circular range with the currently traversed to-be-matched corner point as the center and n times the length of the square frame line as the radius;

[0035] calculating a matching total score between each target type mark located in the circular range and the currently traversed to-be-matched corner point according to all the constructed matching score calculation formulas, respectively;

[0036] determining a first target type mark with the largest matching total score, and judging whether the first target type mark has been matched by other corner points;

[0037] if yes, determining the corner point that should be matched with the first target type mark from the currently traversed to-be-matched corner point and a second corner point that has matched the first target type mark;

[0038] if no, establishing a matching relationship between the currently traversed to-be-matched corner point and the first target type mark.

[0039] Optionally, the determining the corner point that should be matched with the first target type mark from the currently traversed to-be-matched corner point and the second corner point that has matched the first target type mark comprises:

[0040] comparing the matching total score between the currently traversed to-be-matched corner point and the first target type mark and the matching total score between the second corner point and the first target type mark;

[0041] if the matching total score between the currently traversed to-be-matched corner point and the first target type mark is larger, canceling the matching relationship between the second corner point and the first target type mark, establishing a matching relationship between the currently traversed to-be-matched corner point and the first target type mark, and re-matching the corresponding target type mark for the second corner point according to all the constructed matching score calculation formulas.

[0042] If the total matching score between the second corner point and the first target type mark is large, the matching relationship between the second corner point and the first target type mark is maintained, and a corresponding target type mark is matched for the currently traversed to-be-matched corner point according to the constructed matching score calculation formula.

[0043] Optionally, the respective matching attribute-based data is used to construct a corresponding matching score calculation formula, including:

[0044] A distance matching score calculation formula is constructed based on the first distance in the matching attribute: Wherein, f1 represents the distance matching score, l represents the distance between the currently traversed to-be-matched corner point and a target type mark, bl represents the first distance, w l represents a preset distance weight;

[0045] A first direction matching score calculation formula is constructed based on the first direction in the matching attribute: Wherein, f2 represents the first direction matching score, θ represents the direction of a target type mark relative to the currently traversed to-be-matched corner point, bθ represents the first direction, w θ represents a preset relative direction weight;

[0046] An interval range score calculation formula is constructed based on the length of the target type seed mark in the matching attribute: Wherein, f3 represents the length matching score, g represents the length of a target type mark, bg represents the length of the target type seed mark, w g represents a preset length weight;

[0047] A second direction score calculation formula is constructed based on the second direction in the matching attribute: Wherein, f4 represents the second direction matching score, γ represents the direction of a target type mark relative to the target coordinate axis, bγ represents the second direction, w γ represents a preset second direction weight.

[0048] In order to achieve the above purpose, the application further provides a computer device, which specifically comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to realize the steps of the square grid two-dimensional graph recognition method.

[0049] In order to achieve the above object, the application further provides a computer readable storage medium, which stores a computer program, and the computer program realizes the steps of the above-mentioned square grid two-dimensional graph identification method when executed by a processor.

[0050] The square grid two-dimensional graph identification method and the computer readable storage medium provided by the application identify the square frame lines of the square grid according to the intersection between the internal lines of the square grid and the principle that the number of the square frame lines in the square grid is the largest. Since any square grid drawn according to a drawing scheme satisfies the characteristics that there is an intersection between the internal lines of the square grid and the number of the square frame lines in the square grid is the largest, the square grid two-dimensional graph identification scheme based on the embodiment can be applied to any square grid drawn according to any drawing type, and solves the defect that square grids drawn according to different drawing schemes need to be matched with different square grid identification technologies in the prior art. BRIEF DESCRIPTION OF DRAWINGS

[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The accompanying drawings are included to provide a description of the preferred embodiments and are not intended to limit the scope of the application. Moreover, the same reference numerals in different figures represent the same or similar components. In the drawings:

[0052] Figure 1 An optional flowchart of the square grid two-dimensional graph identification method provided for the first embodiment;

[0053] Figure 2 A schematic diagram of the matching of the to-be-matched corner points with the target type elevation provided for the first embodiment

[0054] Figure 3 An optional structural schematic diagram of the square grid two-dimensional graph identification device provided for the second embodiment;

[0055] Figure 4 An optional hardware architecture schematic diagram of the computer device provided for the third embodiment. DETAILED DESCRIPTION

[0056] In order to make the objects, technical solutions and advantages of the application clearer, the application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the application and do not limit the application. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the application.

[0057] Embodiment one

[0058] The embodiment of the application provides a square grid two-dimensional graph identification method, which comprises the following steps: Figure 1As shown, the method comprises steps S1-S3, wherein:

[0059] Step S1, all the internal grid lines in the grid two-dimensional graph to be identified are identified.

[0060] The grid two-dimensional graph can be a grid two-dimensional vector graph, and the internal grid lines are two-dimensional vector lines in the grid lines except the boundary lines of the grid. The step of identifying the internal grid lines is: selecting a seed internal grid line in the grid two-dimensional graph as a grid seed internal line; determining the color of the grid seed internal line and the layer where it is located; identifying all the internal lines in the same layer and with the same color as the grid seed internal line in the grid two-dimensional graph, and taking the grid seed internal line and all the identified internal lines as all the internal grid lines in the grid two-dimensional graph.

[0061] Step S2, cutting each internal grid line at each intersection point on the internal grid line.

[0062] Each internal grid line intersects with at least one other internal grid line, and the number of line segments obtained after cutting each internal grid line is the number of intersection points on the internal grid line plus 1. For example, a certain internal grid line intersects with three other internal grid lines, so there are three intersection points on the internal grid line. The internal grid line is cut according to the intersection points, and four line segments are obtained.

[0063] Step S3, dividing the line segments obtained after cutting into a plurality of line segment combinations, and determining the line segments in the line segment combination with the most line segments as the grid frame lines; wherein the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.

[0064] The grid includes a plurality of grids, and can also include a plurality of incomplete grids, wherein the incomplete grid can be half, one-third, one-fifth, etc. of a grid. The grid in the grid is a square, and the side of the grid can be referred to as a grid frame line. Since the number of complete grids in the grid is the most, the number of line segments obtained after cutting is the most, and the line segments should be the grid frame lines. Therefore, the line segments obtained after cutting are grouped, and the line segments in the line segment combination with the most line segments are identified as the grid frame lines.

[0065] In the embodiment, firstly, the internal grid lines of the grid are cut based on the intersection between the internal grid lines to obtain a plurality of line segments; secondly, based on the characteristic that the number of complete grids in the grid is the largest, it is concluded that the line segment with the largest number among the line segments obtained after cutting should be the grid frame line, and based on the characteristic that the line segment cutting has a certain error, it is concluded that the line segments with a length difference within a certain range can be regarded as the same line segment, based on the above two conclusions, the same line segments are divided into a group, and the line segments in the combination with the largest number are regarded as the internal grid lines of the grid. Since there are intersection points between the internal grid lines and the number of grid frame lines in the grid is necessarily the largest, therefore, based on the grid recognition scheme of the embodiment, the grid recognition scheme can be applied to any drawing type of grid, and the defect that the grids of different drawing schemes need to match different grid recognition technologies in the prior art is solved.

[0066] Optionally, the method further comprises steps A1-A5, wherein:

[0067] Step A1, identifying all grid boundary lines in the grid two-dimensional diagram;

[0068] Step A2, identifying the length of the grid frame line, denoted as the grid side length;

[0069] Step A3, identifying the direction of the grid frame line, denoted as the grid side direction;

[0070] Step A4, identifying the end point of the grid frame line, denoted as the grid corner point;

[0071] Step A5, reconstructing the grid in the grid two-dimensional diagram according to the grid boundary line, the grid side length, the grid side direction, and the grid corner point.

[0072] The grid boundary line is a grid line used to determine the boundary range of the grid. The step of identifying the grid boundary line is: selecting a grid boundary line seed element in the grid two-dimensional diagram as a grid seed boundary line; determining the color of the grid seed boundary line and the layer where it is located; identifying all boundary lines in the same layer and with the same color as the grid seed boundary line in the grid two-dimensional diagram, and taking the grid seed boundary line and all the identified boundary lines as all the grid boundary lines in the grid two-dimensional diagram.

[0073] When reconstructing the grid, the boundary range of the grid is determined based on the grid boundary line, all the grid frame lines are traversed, a grid corner point position is determined based on the end point position of the currently traversed grid frame line, the direction of a grid side is determined based on the direction of the currently traversed grid frame line, and the length of each grid side is determined based on the length of any grid frame line, thereby realizing one-to-one restoration of the grid in the grid two-dimensional diagram.

[0074] Optionally, the method further comprises steps B1-B3, wherein:

[0075] Step B1: obtaining all the matching angle points in the grid two-dimensional graph.

[0076] All the matching angle points can be directly identified from the grid two-dimensional graph, or can be obtained according to the end points of the line segments after cutting. Specifically, step B1 can comprise: obtaining the end points of each line segment in each line segment combination; obtaining the end points of each grid boundary line in the grid two-dimensional graph; and performing a de-duplication process on all the obtained end points to obtain all the matching angle points in the grid two-dimensional graph. The vertex of each grid is the angle point of the grid.

[0077] Step B2: identifying all the target type benchmarks in the grid two-dimensional graph.

[0078] The target type benchmark is the original ground benchmark or the design surface benchmark, wherein the identification of the original ground benchmark and the design surface benchmark and the matching strategy with the angle point are consistent. Specifically, step B2 can comprise:

[0079] In response to a seed benchmark selection instruction, identifying a target type seed benchmark in the grid two-dimensional graph; wherein the target type seed benchmark can be selected by selecting a target type seed benchmark in the grid two-dimensional graph as the target type seed benchmark.

[0080] Obtaining the color of the target type seed benchmark and the layer where it is located, and identifying all the target type benchmarks in the same layer and with the same color as the target type seed benchmark in the grid two-dimensional graph; wherein the target type seed benchmark and all the identified target type benchmarks are all the target type benchmarks in the grid two-dimensional graph.

[0081] Step B3: matching a corresponding target type benchmark for each matching angle point according to the length of the grid frame line; wherein one matching angle point matches one target type benchmark. The distance between each matching angle point and the corresponding target type benchmark must be less than or equal to the length of the grid frame line, because the target type benchmark closest to the matching angle point and having a distance less than or equal to the length of the grid frame line can be matched with the matching angle point. As shown in Figure 2 When the target type benchmark is the original ground benchmark, Figure 2 the angle point in matches the original ground benchmark 1; when the target type benchmark is the design surface benchmark, Figure 2 the angle point in matches the design surface benchmark 1.

[0082] Optionally, step B3 comprises steps B31-B33, wherein:

[0083] Step B31, screening a first corner point matching the target type seed level from the obtained to-be-matched corner points according to the length of the square frame line;

[0084] Specifically, step B31 includes:

[0085] determining a circular range with the target type seed level as the center and n times the length of the square frame line as the radius, where n is greater than 1;

[0086] screening a to-be-matched corner point located in the circular range from the obtained to-be-matched corner points;

[0087] calculating a second distance between each screened to-be-matched corner point and the target type seed level, respectively;

[0088] determining the to-be-matched corner point with the smallest second distance as the first corner point.

[0089] Step B32, determining a matching attribute of the target type seed level and the first corner point;

[0090] The matching attribute includes a first distance between the target type seed level and the first corner point, a first direction of the target type seed level relative to the first corner point, a data length of the target type seed level, and a second direction of the target type seed level relative to a target coordinate axis in a coordinate system to which the target type seed level belongs.

[0091] Step B33, matching a corresponding target type level for each remaining to-be-matched corner point according to the matching attribute;

[0092] Specifically, each remaining to-be-matched corner point is traversed, the matching attribute of the currently traversed to-be-matched corner point and each target type level is calculated, the similarity between the matching attribute and the matching attribute of the target type seed level and the first corner point is calculated, and the target type level corresponding to the matching attribute with the largest similarity is taken as the currently traversed to-be-matched corner point.

[0093] Alternatively, step B33 can include steps B331 to B336, wherein:

[0094] Step B331, constructing a corresponding matching score calculation formula based on each parameter in the matching attribute as the basic data, respectively;

[0095] Step B332, traversing the remaining to-be-matched corner points, and determining a circular range with the currently traversed to-be-matched corner point as the center and n times the length of the square frame line as the radius;

[0096] Step B333, calculate the total matching score between each target type landmark within the circular range and the current traversed to-be-matched corner point according to the constructed matching score calculation formula of all matches respectively;

[0097] Step B334, determine the first target type landmark with the maximum total matching score, and judge whether the first target type landmark has been matched by other corner points;

[0098] Step B335, if yes, determine the corner point that should be matched with the first target type landmark from the current traversed to-be-matched corner point and the second corner point that has matched the first target type landmark;

[0099] Step B336, if no, establish the matching relationship between the current traversed to-be-matched corner point and the first target type landmark.

[0100] In the step B331, the following can be performed:

[0101] A distance matching score calculation formula is constructed based on the first distance in the matching attribute: Wherein, f1 represents the distance matching score, l represents the distance between the current traversed to-be-matched corner point and a certain target type landmark, bl represents the first distance, w l represents the preset distance weight;

[0102] A first direction matching score calculation formula is constructed based on the first direction in the matching attribute: Wherein, f2 represents the first direction matching score, θ represents the direction of a certain target type landmark relative to the current traversed to-be-matched corner point, bθ represents the first direction, w θ represents the preset relative direction weight;

[0103] An interval range score calculation formula is constructed based on the length of the target type seed landmark in the matching attribute: Wherein, f3 represents the length matching score, g represents the length of a certain target type landmark, bg represents the length of the target type seed landmark, w g represents the preset length weight;

[0104] A second direction score calculation formula is constructed based on the second direction in the matching attribute: Wherein, f4 represents the second direction matching score, γ represents the direction of a certain target type landmark relative to the target coordinate axis, bγ represents the second direction, w γ represents the preset second direction weight.

[0105] Step B333 can be: inputting the corresponding parameters into the above five formulas, and calculating the total score of f1 to f5 as the matching total score between the corresponding target type elevation and the currently traversed to-be-matched corner point.

[0106] Step B335 can be:

[0107] Comparing the matching total score between the currently traversed to-be-matched corner point and the first target type elevation and the matching total score between the second corner point and the first target type elevation;

[0108] If the matching total score between the currently traversed to-be-matched corner point and the first target type elevation is larger, the matching relationship between the second corner point and the first target type elevation is removed, the matching relationship between the currently traversed to-be-matched corner point and the first target type elevation is established, and the corresponding target type elevation matched by the second corner point is recalculated according to all the constructed matching score calculation formulas;

[0109] If the matching total score between the second corner point and the first target type elevation is larger, the matching relationship between the second corner point and the first target type elevation is maintained, and the corresponding target type elevation matched by the currently traversed to-be-matched corner point is recalculated according to all the constructed matching score calculation formulas.

[0110] The effects of the present application include: when recognizing the square grid map, it can be applied to different drawing type square grid two-dimensional maps; when determining the matching relationship between the corner point and the elevation, the matching efficiency is high, and the local optimal matching algorithm is used for matching, which effectively reduces the matching occupation time; the recognition rate of the square grid map is high, and through calculating the optimal solution, 99% of the matching competition scenes can be solved.

[0111] Embodiment two

[0112] The embodiment of the present application provides a square grid two-dimensional map recognition device, as shown in the figure, which specifically comprises the following components: Figure 3

[0113] The first recognition module 301 is used for recognizing all square grid internal lines from the square grid two-dimensional map to be recognized.

[0114] The cutting module 302 is used for cutting the corresponding square grid internal line at each intersection point on each square grid internal line.

[0115] The determination module 303 is used for dividing the line segments obtained after cutting into a plurality of line segment combinations, and determining the line segments in the line segment combination with the most line segments as the square frame lines.

[0116] ​Each internal line of the grid network intersects with at least one other internal line of the grid network, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.

[0117] Optionally, the device further comprises:

[0118] The second identification module is configured to identify all grid boundary lines in the grid network two-dimensional graph.

[0119] The third identification module is configured to identify the length of the grid frame line, denoted as a grid side length.

[0120] The fourth identification module is configured to identify the direction of the grid frame line, denoted as a grid side direction.

[0121] The fifth identification module is configured to identify the end point of the grid frame line, denoted as a grid corner point.

[0122] The reconstruction module is configured to reconstruct the grid network in the grid network two-dimensional graph according to the grid boundary line, the grid side length, the grid side direction, and the grid corner point.

[0123] Optionally, the device further comprises:

[0124] The acquisition module is configured to acquire all matching target type benchmarks in the grid network two-dimensional graph.

[0125] The sixth identification module is configured to identify all target type benchmarks in the grid network two-dimensional graph.

[0126] The matching module is configured to match a corresponding target type benchmark for each matching target type benchmark according to the length of the grid frame line; and one matching target type benchmark matches one target type benchmark.

[0127] Optionally, the sixth identification module comprises:

[0128] The first identification unit is configured to identify a target type seed benchmark in the grid network two-dimensional graph in response to a seed benchmark selection instruction.

[0129] The second identification unit is configured to acquire the color and layer of the target type seed benchmark, and identify all target type benchmarks in the same layer and with the same color as the target type seed benchmark in the grid network two-dimensional graph.

[0130] Optionally, the matching module comprises:

[0131] The screening unit is configured to screen a first corner point matching the target type seed benchmark from the acquired matching target type benchmarks according to the length of the grid frame line.

[0132] determining unit, configured to determine a matching attribute between the target-type seed label and the first corner point;

[0133] a matching unit, configured to match a corresponding target-type label for each remaining to-be-matched corner point according to the matching attribute;

[0134] The matching attribute includes a first distance between the target-type seed label and the first corner point, a first direction of the target-type seed label relative to the first corner point, a data interval range of the target-type seed label, a data length of the target-type seed label, and a second direction of the target-type seed label relative to a target coordinate axis in a coordinate system to which the target-type seed label belongs.

[0135] Optionally, the screening unit is specifically configured to:

[0136] determine a circular range with the target-type seed label as a center and a length n times of the square frame line as a radius, where n is greater than 1;

[0137] screen a to-be-matched corner point located in the circular range from the obtained to-be-matched corner points;

[0138] calculate a second distance between each screened to-be-matched corner point and the target-type seed label;

[0139] determine the to-be-matched corner point with the smallest second distance as the first corner point.

[0140] Optionally, the matching unit is specifically configured to:

[0141] construct a corresponding matching score calculation formula based on each parameter in the matching attribute as basic data;

[0142] traverse the remaining to-be-matched corner points, and determine a circular range with a currently traversed to-be-matched corner point as a center and a length n times of the square frame line as a radius;

[0143] calculate a matching total score between each target-type label located in the circular range and the currently traversed to-be-matched corner point according to all constructed matching score calculation formulas;

[0144] determine a first target-type label with a maximum matching total score, and determine whether the first target-type label has been matched by other corner points;

[0145] if yes, determine a corner point that should be matched with the first target-type label from the currently traversed to-be-matched corner point and a second corner point that has matched the first target-type label;

[0146] If not, a matching relationship between the current traversed to-be-matched corner point and the first target type mark is established.

[0147] Optionally, when the matching unit determines the corner point that should be matched with the first target type mark from the current traversed to-be-matched corner point and the second corner point that has matched the first target type mark, the matching unit is specifically configured to:

[0148] Compare the matching total score between the current traversed to-be-matched corner point and the first target type mark and the matching total score between the second corner point and the first target type mark;

[0149] If the matching total score between the current traversed to-be-matched corner point and the first target type mark is larger, the matching relationship between the second corner point and the first target type mark is released, a matching relationship between the current traversed to-be-matched corner point and the first target type mark is established, and the corresponding target type mark matched by the second corner point is recalculated according to all the constructed matching score calculation formulas;

[0150] If the matching total score between the second corner point and the first target type mark is larger, the matching relationship between the second corner point and the first target type mark is maintained, and the corresponding target type mark matched by the current traversed to-be-matched corner point is recalculated according to all the constructed matching score calculation formulas.

[0151] Optionally, when the matching unit constructs the corresponding matching score calculation formula based on each parameter in the matching attribute as the basis data, the matching unit is specifically configured to:

[0152] Construct a distance matching score calculation formula based on the first distance in the matching attribute as the basis data: wherein f1 represents the distance matching score, l represents the distance between the current traversed to-be-matched corner point and a certain target type mark, bl represents the first distance, w j represents a preset distance weight;

[0153] Construct a first direction matching score calculation formula based on the first direction in the matching attribute as the basis data: wherein f2 represents the first direction matching score, θ represents the direction of a certain target type mark relative to the current traversed to-be-matched corner point, bθ represents the first direction, w θ represents a preset relative direction weight;

[0154] Construct an interval range score calculation formula based on the area range of the target type seed mark in the matching attribute as the basis data: Wherein, f3 represents interval range matching score, s represents interval range of a certain target type elevation, bs represents interval range of the target type seed elevation, w s represents preset interval range weight;

[0155] Interval range score calculation formula is constructed based on length of the target type seed elevation in the matching attribute as basis data: Wherein, f4 represents length matching score, g represents length of a certain target type elevation, bg represents length of the target type seed elevation, w g represents preset length weight;

[0156] Second direction score calculation formula is constructed based on the second direction in the matching attribute as basis data: Wherein, f5 represents second direction matching score, γ represents direction of a certain target type elevation relative to the target coordinate axis, bγ represents the second direction, w γ represents preset second direction weight.

[0157] Embodiment three

[0158] The embodiment also provides a computer device, such as a smartphone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including a single server or a server cluster composed of multiple servers) which can execute programs. As shown in the figure, the computer device 40 of the embodiment at least includes but is not limited to a memory 401 and a processor 402 which can be connected to each other through a system bus. It should be pointed out that, Figure 4 Figure 4 Only the computer device 40 with components 401-402 is shown, but it should be understood that all the shown components are not required to be implemented, and more or less components can be alternatively implemented.

[0159] ​In this embodiment, the memory 401 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 401 can be an internal storage unit of the computer device 40, such as a hard disk or a memory of the computer device 40. In other embodiments, the memory 401 can also be an external storage device of the computer device 40, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 40. Of course, the memory 401 can also include both the internal storage unit and the external storage device of the computer device 40. In this embodiment, the memory 401 is generally used to store an operating system and various application software installed on the computer device 40. In addition, the memory 401 can also be used to temporarily store various data that have been output or will be output.

[0160] The processor 402 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 402 is generally used to control the overall operation of the computer device 40.

[0161] Specifically, in this embodiment, the processor 402 is used to execute the program of the grid network two-dimensional graph recognition method stored in the memory 401, and the program of the grid network two-dimensional graph recognition method is executed to implement the following steps:

[0162] Identify all grid network internal lines from the grid network two-dimensional graph to be recognized;

[0163] Cut the corresponding grid network internal line at each intersection point on each grid network internal line;

[0164] Divide the line segments obtained after cutting into a plurality of line segment combinations, and determine the line segments in the line segment combination with the most line segments as the grid frame lines;

[0165] Wherein, each grid network internal line intersects with at least one other grid network internal line, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.

[0166] The specific embodiment process of the above method steps can be referred to Embodiment One, which will not be repeated here.

[0167] Embodiment Four

[0168] The embodiment also provides a computer readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application store, etc., which stores a computer program. When the computer program is executed by a processor, the following method steps are implemented:

[0169] Identify all the grid internal lines from the grid two-dimensional image to be identified;

[0170] Cut the corresponding grid internal line at each intersection point on each grid internal line;

[0171] Divide the line segments obtained after cutting into a plurality of line segment combinations, and determine the line segments in the line segment combination with the most line segments as the grid frame lines;

[0172] Wherein, each grid internal line intersects with at least one other grid internal line, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold.

[0173] The specific embodiment process of the above method steps can be referred to Embodiment One, which will not be repeated here.

[0174] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0175] The above embodiment numbers of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.

[0176] Through the above description of the embodiments, those skilled in the art can clearly understand that the above embodiment methods can be realized by means of software and necessary general hardware platform, of course, also can be realized by hardware, but in many cases, the former is a better embodiment.

[0177] The above merely describes the preferred embodiments of the present application, and is not intended to limit the patent scope of the present application, and any equivalent structure or equivalent process conversion, or direct or indirect application in other related technical fields, which are made by using the content of the present application specification and drawings, are also included in the patent protection scope of the present application.

Claims

1. A method of identifying a square grid two-dimensional map, characterized by, The method comprises: identifying all grid internal lines from a grid two-dimensional image to be identified; cutting the corresponding grid internal line at each intersection point on each grid internal line; dividing the cut line segments into a plurality of line segment combinations, and determining the line segments in the line segment combination with the most line segments as the grid frame lines; obtaining all matching corner points in the grid two-dimensional image; identifying all target type benchmarks in the grid two-dimensional image; matching each matching corner point with a corresponding target type benchmark according to the length of the grid frame line; wherein each grid internal line intersects with at least one other grid internal line, the number of line segments obtained after cutting each grid internal line is the number of intersection points on the grid internal line plus 1, and the absolute value of the length difference between any two line segments in each line segment combination is less than or equal to a preset length threshold; one matching corner point matches one target type benchmark.

2. The method of claim 1, wherein, The method further comprises: identifying all grid boundary lines in the grid two-dimensional image; identifying the length of the grid frame line, denoted as the grid side length; identifying the direction of the grid frame line, denoted as the grid side direction; identifying the end point of the grid frame line, denoted as the grid corner point; reconstructing the grid in the grid two-dimensional image according to the grid boundary line, the grid side length, the grid side direction, and the grid corner point.

3. The method of claim 1, wherein, The identification of all target type benchmarks in the grid two-dimensional image comprises: in response to a seed benchmark selection instruction, identifying a target type seed benchmark in the grid two-dimensional image; obtaining the color of the target type seed benchmark and the layer it is in, and identifying all target type benchmarks in the same layer and with the same color as the target type seed benchmark in the grid two-dimensional image.

4. The method of claim 3, wherein, The matching of each matching corner point with a corresponding target type benchmark according to the length of the grid frame line comprises: screening a first corner point matching the target type seed benchmark from the obtained matching corner points according to the length of the grid frame line; determining the matching attribute of the target type seed benchmark and the first corner point; matching each remaining matching corner point with a corresponding target type benchmark according to the matching attribute; wherein the matching attribute comprises: a first distance between the target type seed benchmark and the first corner point, a first direction of the target type seed benchmark relative to the first corner point, a data length of the target type seed benchmark, and a second direction of the target type seed benchmark relative to a target coordinate axis in its own coordinate system.

5. The method of claim 4, wherein, The screening of a first corner point matching the target type seed benchmark from the obtained matching corner points according to the length of the grid frame line comprises: determining a circular range with the target type seed benchmark as the center and n times the length of the grid frame line as the radius; wherein n is greater than 1; screening the matching corner points located in the circular range from the obtained matching corner points; calculating the second distance between each screened matching corner point and the target type seed benchmark; determining the matching corner point with the smallest second distance as the first corner point.

6. The method of claim 4, wherein, The corresponding target type mark is matched to each remaining to-be-matched corner point according to the matching attribute, comprising: Each parameter in the matching attribute is taken as basis data to construct a corresponding matching score calculation formula; Each to-be-matched corner point is traversed, and a circular range is determined with the currently traversed to-be-matched corner point as the center and n times the length of the square frame as the radius; The matching total score value between each target type mark in the circular range and the currently traversed to-be-matched corner point is calculated according to all the constructed matching score calculation formulas; The first target type mark with the maximum matching total score value is determined, and it is judged whether the first target type mark has been matched by other corner points; If yes, the corner point that should be matched with the first target type mark is determined from the currently traversed to-be-matched corner point and a second corner point that has matched the first target type mark; If no, a matching relationship between the currently traversed to-be-matched corner point and the first target type mark is established.

7. The method of claim 6, wherein, The corner point that should be matched with the first target type mark is determined from the currently traversed to-be-matched corner point and a second corner point that has matched the first target type mark, comprising: The size between the matching total score value of the currently traversed to-be-matched corner point and the first target type mark and the matching total score value of the second corner point and the first target type mark is compared; If the matching total score value of the currently traversed to-be-matched corner point and the first target type mark is larger, the matching relationship between the second corner point and the first target type mark is released, the matching relationship between the currently traversed to-be-matched corner point and the first target type mark is established, and the corresponding target type mark is matched to the second corner point according to all the constructed matching score calculation formulas; If the matching total score value of the second corner point and the first target type mark is larger, the matching relationship between the second corner point and the first target type mark is maintained, and the corresponding target type mark is matched to the currently traversed to-be-matched corner point according to all the constructed matching score calculation formulas.

8. The method of claim 6, wherein, Each parameter in the matching attribute is taken as basis data to construct a corresponding matching score calculation formula, comprising: A distance matching score calculation formula is constructed based on the first distance in the matching attribute: ; wherein, represents the distance matching score, represents the distance between the current traversed to-be-matched corner point and a certain target type elevation, represents the first distance, represents a preset distance weight; A first direction matching score calculation formula is constructed based on the first direction in the matching attribute: ; wherein, represents the first direction matching score, represents a direction of a certain target type elevation relative to a currently traversed to-be-matched corner point, represents the first direction, represents a preset relative direction weight; A length of the target type seed mark in the matching attribute is taken as basis data to construct an interval range score calculation formula: ; wherein, represents a length matching score, represents a length of a certain target type mark, represents a length of the target type seed mark, represents a preset length weight; A second direction score calculation formula is constructed based on the second direction in the matching attribute: ; wherein, represents a second direction matching score, represents a direction of a certain target type elevation relative to the target coordinate axis, represents the second direction, represents a preset second direction weight.

9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 8. The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Table recognition method and device, electronic equipment and storage medium

    CN111428700A

  • Table reconstruction methods and apparatus, computer-readable storage media and electronic devices

    CN114936542A