CN114817604A - Method and device for retrieving drawing dimension labels, electronic equipment and storage medium - Google Patents

Method and device for retrieving drawing dimension labels, electronic equipment and storage medium Download PDF

Info

Publication number
CN114817604A
CN114817604A CN202210720654.6A CN202210720654A CN114817604A CN 114817604 A CN114817604 A CN 114817604A CN 202210720654 A CN202210720654 A CN 202210720654A CN 114817604 A CN114817604 A CN 114817604A
Authority
CN
China
Prior art keywords
target
labeling
marking
dimension
label
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210720654.6A
Other languages
Chinese (zh)
Other versions
CN114817604B (en
Inventor
刘浩
於其之
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Wanyi Digital Technology Co ltd
Original Assignee
Wanyi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wanyi Technology Co Ltd filed Critical Wanyi Technology Co Ltd
Priority to CN202210720654.6A priority Critical patent/CN114817604B/en
Publication of CN114817604A publication Critical patent/CN114817604A/en
Application granted granted Critical
Publication of CN114817604B publication Critical patent/CN114817604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures

Abstract

The application relates to a retrieval method and a retrieval device for drawing dimension marking, electronic equipment and a storage medium, which are applied to the technical field of computers, wherein the method comprises the following steps: acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points; determining a distance value between the target coordinate information of the two target picking points; and retrieving to obtain a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction. The problem that the size information of the component obtained through coordinate calculation is inaccurate in the related art is solved.

Description

Method and device for retrieving drawing dimension labels, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for retrieving a drawing dimension label, an electronic device, and a storage medium.
Background
When different designers draw the architectural drawings, the architectural drawings are not necessarily output according to the standard, and the situation that only visible marking data are modified in repeated drawing repair is also existed, so that the accurate size expressed by the drawings of the designers is represented by the marking data.
At present, the dimension information of the AI map-reviewing building element is calculated through element coordinates, and because the accurate dimension expressed by a designer is in the labeling data, the dimension information calculated through the coordinates is inconsistent with the dimension of the element actually expressed on a drawing, so that the condition that the dimension information of the element calculated through the coordinates is inaccurate is caused.
Disclosure of Invention
The application provides a method and a device for retrieving drawing dimension labels, electronic equipment and a storage medium, which are used for solving the problem that component dimension information obtained through coordinate calculation is inaccurate in the related art.
In a first aspect, an embodiment of the present application provides a method for retrieving a drawing dimension label, including:
acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
determining a distance value between the target coordinate information of the two target picking points;
and retrieving to obtain a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
Optionally, each size label in the pre-stored label storage structure includes an original label direction, an original size value, a label starting point, and a label end point;
the retrieving a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction includes:
determining a first size labeling set with the original labeling direction consistent with the target labeling direction in a pre-stored labeling storage structure;
determining a second dimension marking set in the first dimension marking set, wherein the difference value of the original dimension value and the distance value is within a first error range;
and determining the target size label from the second size label set based on the position relation between the target coordinate information and the label starting point and the label end point.
Optionally, the target coordinate information includes a pickup start coordinate and a pickup end coordinate;
the determining the target size label from the second size label set based on the position relationship between the target coordinate information and the label starting point and the label end point includes:
determining a third dimension labeling set in which a difference value between the coordinates of the picking start point and the coordinates of the labeling start point in a non-target labeling direction is within a second error range and a difference value between the coordinates of the picking end point and the coordinates of the labeling end point in the non-target labeling direction is within a third error range, wherein the non-target labeling direction is a direction perpendicular to the target labeling direction;
sorting the size labels in the third size label set according to the size difference value between the original size value and the distance value;
and determining the size label corresponding to the minimum value in the size difference value as the target size label.
Optionally, the obtaining target coordinate information of two target pickup points in the drawing includes:
acquiring initial coordinate information of the target picking point;
and correcting the initial coordinate information according to a labeling rule to obtain target coordinate information, wherein a connecting line of the target coordinate information of the two corrected target picking points is parallel to the target labeling direction.
Optionally, the labeling rule includes a target labeling direction;
correcting the initial coordinate information according to the labeling rule to obtain target coordinate information, wherein the method comprises the following steps:
determining a pickup starting point and a pickup end point in the target pickup points based on the target labeling direction;
correcting the coordinate value of the picking end point in the non-target labeling direction into the coordinate value of the picking start point in the non-target labeling direction to obtain a corrected coordinate value of the picking end point, wherein the non-target labeling direction is a direction vertical to the target labeling direction;
and determining coordinate values of the pickup starting point and correction coordinate values of the pickup end point as the target coordinate information.
Optionally, the determining a pickup start point and a pickup end point in the target pickup points based on the target labeling direction includes:
sequencing the two target picking points according to the sequence of the target picking points in the target marking direction;
and determining the target picking point appearing first in the target labeling direction as the picking starting point, and determining the target picking point appearing later in the target labeling direction as the picking end point.
Optionally, the process of the pre-stored label storage structure includes:
extracting the marking information of the dimension marking graphic elements in the drawing;
dividing the dimension marking primitive into at least one group of marking data groups based on the marking information, wherein the dimension marking primitive in each group of marking data groups is not adjacent to the dimension marking primitives in other marking data groups;
and storing the labeling information in each group of labeling data groups according to the adjacency relation among the dimension labeling primitives to obtain a labeling storage structure.
Optionally, the extracting the labeling information of the dimension labeling primitive in the drawing includes:
traversing all the primitives in the drawing, and extracting dimension marking primitives with primitive types as marking types;
and extracting the labeling information of the dimension labeling graphics primitive.
Optionally, the labeling information includes a labeling start point and a labeling end point, and based on the labeling information, the size labeling primitive is divided into at least one group of labeling data groups, including:
judging whether the labeling information of other dimension labeling primitives comprises the labeling starting point or the labeling end point of the dimension labeling primitive or not for any dimension labeling primitive;
if so, determining the dimension marking primitives with the same marking starting point or marking end point as mutually adjacent dimension marking primitives;
and determining the mutually adjacent dimension marking primitives as a group of marking data groups.
Optionally, the labeling information includes an original size value, a labeling start point, and a labeling end point; the step of storing the labeling information in each group of the labeling data groups according to the adjacency relation among the size labeling primitives to obtain a labeling storage structure comprises the following steps:
determining the marking starting point and the marking end point in each marking data group as node information;
merging the same node information among the dimension marking primitives with the adjacency relation to obtain a node storage structure;
and determining the original size value in each group of labeled data groups as attribute information among the node information in the node storage structure to obtain the labeled storage structure of each group of labeled data groups.
In a second aspect, an embodiment of the present application provides a device for retrieving drawings dimension labels, including:
the acquisition module is used for acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
the determining module is used for determining a distance value between the target coordinate information of the two target picking points;
and the retrieval module is used for retrieving to obtain the target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
In a third aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory, and implement the method for retrieving the drawing size label according to the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the method for retrieving a drawing dimension label according to the first aspect is implemented.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages: according to the method provided by the embodiment of the application, target coordinate information of two target picking points in a drawing and a target marking direction of the target picking points are obtained; determining a distance value between the target coordinate information of the two target picking points; and retrieving to obtain a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction. Therefore, when the length between two target picking points in a drawing needs to be determined, after target coordinate information and a target marking direction between the two target picking points are obtained, target size marks can be retrieved from the mark storage structure through the distance value between the two target picking points obtained through calculation, the target coordinate information and the target marking direction, and therefore the condition that the distance value is not accurate by directly adopting the coordinates of the two target picking points to directly calculate is avoided, the actual size between the two target picking points is obtained based on the obtained target size marks, and accuracy is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a view of an application scenario of a retrieval method for drawing dimension marking according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a method for retrieving a drawing dimension label according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a label storage structure in a method for retrieving a drawing dimension label according to an embodiment of the present application;
FIG. 4 is a schematic diagram illustrating a label storage structure in a method for retrieving a drawing dimension label according to another embodiment of the present application;
FIG. 5 is a block diagram of a retrieving apparatus for drawing dimension marking according to an embodiment of the present application;
fig. 6 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
According to an embodiment of the application, a method for retrieving drawing size labels is provided. Alternatively, in the embodiment of the present application, the method for retrieving the drawing size label may be applied to a hardware environment formed by the terminal 101 and the server 102 as shown in fig. 1. As shown in fig. 1, a server 102 is connected to a terminal 101 through a network, which may be used to provide services (such as video services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 102, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like.
The method for retrieving drawings and dimension labels in the embodiment of the present application may be executed by the server 102, by the terminal 101, or by both the server 102 and the terminal 101. The terminal 101 executes the method for retrieving the drawing size label according to the embodiment of the present application, or may be executed by a client installed thereon.
Taking a terminal to execute the retrieval method for drawing size marking in the embodiment of the present application as an example, fig. 2 is a schematic flow chart of a retrieval method for optional drawing size marking in the embodiment of the present application, and as shown in fig. 2, the flow of the method may include the following steps:
step 201, acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points.
In some embodiments, when a user needs to know the distance between two points, the two points generally need to be selected in a drawing, so that the terminal can monitor two target picked points selected by the user. The method comprises the steps that a marking direction is used as an input parameter of a query interface on a terminal, after a user clicks two target picking points, the target marking direction is input at the display position of the query interface, and therefore the target marking direction is obtained by the terminal.
For any point in the drawing, there is a corresponding coordinate. Therefore, after the target picking points are monitored by the terminal, the coordinate information of the two target picking points can be obtained. Generally, two target picking points clicked by a user are consistent with the target labeling direction or slightly deviated.
Specifically, if a connecting line of two target picking points is parallel to the target marking direction, determining coordinate information of the two target picking points as target coordinate information; if the connecting line of the two target picking points is not parallel to the target marking direction, the coordinate information of the two target picking points needs to be corrected to obtain the target coordinate information.
In an alternative embodiment, obtaining target coordinate information of two target pickup points in the drawing includes:
acquiring initial coordinate information of the target picking point; and correcting the initial coordinate information according to a labeling rule to obtain target coordinate information, wherein a connecting line of the target coordinate information of the two corrected target picking points is parallel to the target labeling direction.
In some embodiments, after a user clicks two target picking points in a drawing, a terminal acquires initial coordinate information of the two target picking points, and a connecting line of the obtained target coordinate information can be parallel to a target labeling direction after the initial coordinate information is corrected according to a labeling rule.
In an optional embodiment, the labeling rule includes a target labeling direction; correcting the initial coordinate information according to the labeling rule to obtain target coordinate information, wherein the method comprises the following steps:
determining a pickup starting point and a pickup end point in the target pickup points based on the target labeling direction; correcting the coordinate value of the picking end point in the non-target labeling direction into the coordinate value of the picking start point in the non-target labeling direction to obtain a corrected coordinate value of the picking end point, wherein the non-target labeling direction is a direction vertical to the target labeling direction; and determining coordinate values of the pickup starting point and correction coordinate values of the pickup end point as the target coordinate information.
In some embodiments, the two target pickup points selected by the user on the drawing may have some deviation from the target labeling direction, and therefore, the coordinate connection line of the two target pickup points may be corrected to be parallel to the target labeling direction.
Illustratively, two target pickup points are A, B, the coordinate of point a is (X1, Y1), the coordinate of point B is (X2, Y2), and the target labeling direction is the positive X-axis direction. When the target labeling direction is determined to be parallel to the positive direction of the X axis, the non-target labeling direction can be determined to be perpendicular to the direction of the X axis, namely the direction of the Y axis. If it is determined that point a is the pickup start point and point B is the pickup end point based on the target labeling direction, the ordinate of point B is corrected to coincide with the ordinate of point a, and the corrected coordinates of point B are obtained as (X2, Y1), and further, target coordinate information is determined as (X1, Y1) and (X2, Y1).
In an optional embodiment, the determining a pickup start point and a pickup end point of the target pickup points based on the target labeling direction includes:
sequencing the two target picking points according to the sequence of the target picking points in the target marking direction; and determining the target picking point appearing first in the target labeling direction as the picking starting point, and determining the target picking point appearing later in the target labeling direction as the picking end point.
In some embodiments, since a user may not select two target picked points according to the sequence of the target labeling directions when selecting the two target picked points, the two target picked points need to be sorted first, and then a pickup start point and a pickup end point are determined.
Illustratively, two target pickup points are A, B, the coordinates of point a are (X1, Y1), the coordinates of point B are (X2, Y2), where X1 is smaller than X2, and the target labeling direction is the positive X-axis direction. When sorting is performed in the positive direction of the X axis, since X1 is smaller than X2, point a is found first and then point B is found, and therefore point a is a pickup start point and point B is a pickup end point.
Step 202, determining a distance value between the target coordinate information of the two target pickup points.
In some embodiments, after obtaining the target coordinate information of two target pickup points, a distance value between the two target pickup points may be calculated according to the two target coordinate information. It can be understood that, when the connecting line of the target coordinate information is parallel to the target labeling direction, the difference value of the coordinates in the target labeling direction in the two target coordinate information may be calculated to obtain the difference value as the distance value between the two target picking points.
It can be understood that, if the original dimension value in the dimension label is the actual dimension, after the difference is obtained, the difference can be converted into the actual distance value between the two picked points according to the scale on the drawing.
And 203, retrieving to obtain a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
In some embodiments, when the length between two target picked points in the drawing needs to be determined, after target coordinate information and a target labeling direction between the two target picked points are obtained, a target size label can be retrieved from the label storage structure through the distance value between the two target picked points, the target coordinate information and the target labeling direction, which are obtained through calculation, so that the condition that the distance value is not accurately calculated directly by adopting coordinates of the two target picked points is avoided, the actual size between the two target picked points is obtained based on the obtained target size label, and the accuracy is improved.
It can be understood that, after the target size label is obtained, since the size value is included in the target size label, the size value in the target size label can be used as the true distance value between two target picked points.
The target size label can be obtained by screening in a label storage structure stored in advance based on the target coordinate information, the distance value and the target label direction.
In an optional embodiment, each size label in the pre-stored label storage structure comprises an original label direction, an original size value, a label starting point and a label end point;
the retrieving a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction includes:
determining a first size labeling set with the original labeling direction consistent with the target labeling direction in a pre-stored labeling storage structure; determining a second dimension marking set in the first dimension marking set, wherein the difference value of the original dimension value and the distance value is within a first error range; and determining the target size label from the second size label set based on the position relation between the target coordinate information and the label starting point and the label end point.
In some embodiments, after obtaining the target coordinate information, the distance value, and the target labeling direction, the target can be filtered from a pre-stored label storage structure based on the parameters. Each dimension label in the label storage structure comprises an original label direction, an original dimension value, a label starting point and a label end point, so that the parameters of the two target picking points can be compared with the storage labels in the label storage structure, and the target dimension labels can be determined.
Specifically, a first size label set which is consistent with a target label direction is firstly screened in the label storage structure by traversing the label storage structure, the first size label set is further screened by the distance value, the size labels with the distance value being as much as the original size value in the size labels in the first size label set are screened out, and a second size label set with the difference value between the original size value and the distance value within a first error range is obtained. And then, determining the target size label from the second size label set according to the position relation between the target coordinate information and the label starting point and the label end point.
When the distance value and the original dimension value are calculated, the distance value and the original dimension value are values on the same scale, and the first error range may be, but is not limited to, from-5 meters to 5 meters, taking the actual distance value calculation of the distance value and the original dimension value as an example.
In an alternative embodiment, the target coordinate information includes a pickup start point coordinate and a pickup end point coordinate;
the determining the target size label from the second size label set based on the position relationship between the target coordinate information and the label starting point and the label end point includes:
determining a third dimension labeling set in which a difference value between the coordinates of the picking start point and the coordinates of the labeling start point in a non-target labeling direction is within a second error range and a difference value between the coordinates of the picking end point and the coordinates of the labeling end point in the non-target labeling direction is within a third error range, wherein the non-target labeling direction is a direction perpendicular to the target labeling direction; sorting the size labels in the third size label set according to the size difference value between the original size value and the distance value; and determining the size label corresponding to the minimum value in the size difference value as the target size label.
In some embodiments, the size value of the size label in the second size label set is within the error tolerance range from the distance value of the two target pick-up points, and the labeling direction is the same as the target labeling direction, so that the size label in the second size label set is different from the two target pick-up points in the non-target labeling direction, so that the target coordinate information is different from the position relationship between the label starting point and the label ending point. When the labeling start point and the labeling end point have a large deviation from the target coordinate information, the corresponding size labels may not be the size labels corresponding to the two pickup points, so that the target coordinate information, the labeling start point and the labeling end point need to satisfy the following matching conditions: and a third dimension marking set, wherein the difference value between the coordinates of the picking start point and the coordinates of the marking start point in the non-target marking direction is within a second error range, and the difference value between the coordinates of the picking end point and the coordinates of the marking end point in the non-target marking direction is within a third error range.
Although there is a certain deviation between the two picked points selected by the user, the user often clicks the edge of the object whose size is desired to be obtained as accurately as possible when selecting the two picked points, and therefore, after the third set of size labels is obtained, the size labels in the set are sorted according to the difference between the original size value and the distance value, and the size label with the smallest difference is taken as the target size label.
In an ideal case, when the pick-up starting point, the pick-up end point, the mark starting point and the mark end point can form a rectangle, or the pick-up starting point coincides with the mark starting point and the pick-up end point coincides with the mark end point, the size mark corresponding to the mark starting point is the target size mark retrieved by the two pick-up points.
The pre-stored label storage structure summarized in the above embodiments may be that all size labels in the drawings are stored in the same file according to the same storage format, and are screened one by one during retrieval. The size labels can be classified and sorted firstly, so that during retrieval, direct screening can be performed according to each type of size labels, and the retrieval efficiency is improved.
In an alternative embodiment, the process of pre-storing the annotation storage structure comprises:
extracting the marking information of the dimension marking graphic elements in the drawing; dividing the dimension marking primitive into at least one group of marking data groups based on the marking information, wherein the dimension marking primitive in each group of marking data groups is not adjacent to the dimension marking primitives in other marking data groups; and storing the labeling information in each group of labeling data groups according to the adjacency relation among the dimension labeling primitives to obtain a labeling storage structure.
In some embodiments, in order to facilitate retrieval of the target dimension labels, the dimension labels in the drawing are stored in a label storage structure, the dimension labels are grouped in the label storage structure, and the dimension labels in each group are structurally stored, so that rapid retrieval is facilitated.
In the process of drawing an actual drawing, when components on a line are marked, size marks are often on the same line. Based on this, for each extracted dimension marking primitive, whether a dimension marking primitive adjacent to the extracted dimension marking primitive exists or not can be judged through marking information, so that the adjacent dimension marking primitives are divided into one group to obtain a plurality of initial groups, and for some dimension marking primitives, two adjacent dimension marking primitives may exist, so that the two adjacent dimension marking primitives exist in the two initial groups.
After the dimension marking primitives are grouped, the dimension marking primitives can be stored according to the adjacency relation based on the marking information in each group, and therefore the marking storage structure is obtained.
In an optional embodiment, the extracting the labeling information of the dimension labeling primitive in the drawing includes:
traversing all the primitives in the drawing, and extracting dimension marking primitives with primitive types as marking types; and extracting the labeling information of the dimension labeling graphics primitive.
In some embodiments, each primitive in the drawing has a primitive type, such as a label type, a component type, a view type, and the like, and by judging the primitive type, the primitive of the label type is extracted, and label information of the primitive of each label type is obtained.
In an optional embodiment, the annotation information includes an annotation start point and an annotation end point, and the dividing the size annotation primitive into at least one group of annotation data groups based on the annotation information includes:
judging whether the labeling information of other dimension labeling primitives comprises the labeling starting point or the labeling end point of the dimension labeling primitive or not for any dimension labeling primitive; if so, determining the dimension marking primitives with the same marking starting point or marking end point as mutually adjacent dimension marking primitives; and determining the mutually adjacent dimension marking primitives as a group of marking data groups.
In some embodiments, the extracted labeling information of the dimension labeling primitives includes a labeling start point and a labeling end point, when two dimension labeling primitives are adjacent, the labeling end point of one dimension labeling primitive coincides with the labeling start point of the other dimension labeling primitive, based on which, whether there is a labeling end point or a labeling start point of any dimension labeling primitive or a labeling end point coincides with the labeling start point or the labeling start point of the other dimension labeling primitive, if so, the two are considered as the adjacent dimension labeling primitives.
In an optional embodiment, the labeling information includes an original size value, a labeling start point and a labeling end point; the step of storing the labeling information in each group of the labeling data groups according to the adjacency relation among the size labeling primitives to obtain a labeling storage structure comprises the following steps:
determining the marking starting point and the marking end point in each marking data group as node information; merging the same node information among the dimension marking primitives with the adjacency relation to obtain a node storage structure; and determining the original size value in each group of labeled data groups as attribute information among the node information in the node storage structure to obtain the labeled storage structure of each group of labeled data groups.
In some embodiments, after determining the adjacency between the dimensioning primitives, an annotation storage structure can be constructed based on the adjacency and the original dimensions in the annotation information. Specifically, the labeling start point and the labeling end point in each group of labeling data groups can be used as node information, and the labeling start point and the labeling end point of the adjacent size labeling graphics primitives can coincide with each other. Therefore, different labeling starting points and labeling end points in each group of labeling data groups are associated to obtain a node storage structure. In addition, the label information also includes an original size value, and in the node storage structure, the label starting point and the label end point represented by two adjacent nodes take the corresponding original size value as the attribute information between the two node information, thereby obtaining the label storage structure.
Illustratively, a plurality of size annotation primitives with annotation starting points and annotation ending points of (V0, V1), (V1, V3), (V3, V4), (V0, V2) and (V2, V3) are included in an annotation data group, so five nodes of V0-V4 are obtained, and the node storage structure can be stored in the manner shown in fig. 3. And correspondingly storing the original size as attribute information between the two nodes to obtain a label storage structure.
For quick retrieval, the label storage structure can be stored in a manner of a contiguous matrix. Specifically, the node information in the labeled data group of each group is stored in a one-dimensional array, and the attribute information between nodes is stored in two-dimensional data, wherein elements in the array represent the attribute information between nodes represented by corresponding rows and columns.
Specifically, the node storage structure shown in fig. 3 may be represented by the adjacency matrix shown in fig. 4.
The size marking primitives in each group of marking data groups are in an adjacent relation, so that the size marking primitives in each group are all on the same line, and when the size marking primitives are stored in a marking storage structure, marking directions can be set for each group of marking data groups so as to be standardized and unified, and later-stage size marking retrieval is facilitated.
In a specific embodiment, the retrieval method for drawing dimension marking performs structured storage processing on dimension marking data, and realizes rapid retrieval processing on dimension marking based on a structured storage design scheme.
The size marking is structured specifically by performing data structuring and storage processing on the cad-analyzed primitive data. The structural design and data storage of drawing dimension marking are realized by extracting marking primitive data, grouping marking primitives, representing and performing structural processing on marking data graphs and the like.
The size labeling quick query scheme is specifically based on a size labeling structural design and a data storage scheme, storage processing is carried out by adopting a 'graph grouping' and 'adjacency matrix' structure according to distribution characteristics of drawing labeling data, and quick query of size labeling is promoted through preposed grouping coordinate filtering.
Specifically, the size labeling primitive extraction, grouping by line (line), and graph structured storage processing specifically include:
firstly, extracting and processing a dimension marking primitive according to the picture frame primitive data and the dimension marking type.
And secondly, carrying out independent and non-independent marking division on the dimension marking primitive according to whether the adjacent marking exists or not.
Thirdly, traversing the non-independent dimension labels, acquiring adjacent label data of all the non-independent dimension labels, performing primary grouping, and dividing dimension label primitives with consistent label starting points and label end points into the same group.
And fourthly, according to the non-independent marking grouping and the neighbor marking data thereof, grouping and merging are carried out by judging whether intersecting marks exist. The intersection of the two groups of marking data means that the two groups of marking data have a common size marking primitive.
And fifthly, traversing the grouped data, and storing each group of labeled data according to a graph structure represented by the adjacency matrix.
Specifically, the fast query processing of the size labeling data includes:
firstly, the coordinates of two input points (namely two target picking points) are sorted, the coordinates in the y-axis direction (vertical x-axis) are sequentially returned from bottom to top, and otherwise, the coordinates are sequentially returned from left to right.
And secondly, correcting the two sorted points according to the labeling direction (namely the target labeling direction).
Thirdly, traversing the grouped graph structure data according to the corrected data, and extracting possible target graph structure data. The labeling direction of the obtained target graph structure data is consistent with the target labeling direction, and the coordinates of the two corrected points are in the vertex range of the graph structure data.
And fourthly, traversing possible target graph structure data, and acquiring matched dimension labeling graph structure data according to matching conditions with equal distance and vertical (rectangular) distance.
Fifthly, effective size marking data are obtained by filtering the text marking data. The content of the labels in some dimensioning schemes may be such that the designer fills out the text string in addition to the numbers, and therefore filtering of the text label data is required.
And sixthly, sorting the effective size marking data to obtain the size marking with the best matching.
Based on the same concept, the embodiment of the present application provides a retrieval apparatus for drawing dimension labeling, and the specific implementation of the apparatus may refer to the description of the method embodiment section, and repeated details are not repeated, as shown in fig. 5, the apparatus mainly includes:
the acquisition module is used for acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
the determining module is used for determining a distance value between the target coordinate information of the two target picking points;
and the retrieval module is used for retrieving to obtain the target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
Based on the same concept, an embodiment of the present application further provides an electronic device, as shown in fig. 6, the electronic device mainly includes: a processor 601, a memory 602, and a communication bus 603, wherein the processor 601 and the memory 602 communicate with each other via the communication bus 603. The memory 602 stores a program executable by the processor 601, and the processor 601 executes the program stored in the memory 602 to implement the following steps:
acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
determining a distance value between the target coordinate information of the two target picking points;
and retrieving to obtain a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
The communication bus 603 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 603 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 6, but this is not intended to represent only one bus or type of bus.
The Memory 602 may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Alternatively, the memory may be at least one storage device located remotely from the processor 601.
The Processor 601 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like, and may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
In still another embodiment of the present application, there is also provided a computer-readable storage medium having stored therein a computer program, which, when run on a computer, causes the computer to execute the method for retrieving a drawing size label described in the above-described embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The available media may be magnetic media (e.g., floppy disks, hard disks, tapes, etc.), optical media (e.g., DVDs), or semiconductor media (e.g., solid state drives), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (13)

1. A method for retrieving drawing dimension labels is characterized by comprising the following steps:
acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
determining a distance value between the target coordinate information of the two target picking points;
and retrieving to obtain the target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
2. The method for retrieving drawings dimensioning according to claim 1, characterised in that each dimensioning in said prestored labelling storage structure includes an original labelling direction, an original dimensioning value, a labelling start point and a labelling end point;
the retrieving a target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction includes:
determining a first size labeling set with the original labeling direction consistent with the target labeling direction in a pre-stored labeling storage structure;
determining a second dimension marking set in the first dimension marking set, wherein the difference value of the original dimension value and the distance value is within a first error range;
and determining the target size label from the second size label set based on the position relation between the target coordinate information and the label starting point and the label end point.
3. The method for retrieving drawings dimensioning according to claim 2, characterized in that said target coordinate information includes pick-up start point coordinates and pick-up end point coordinates;
the determining the target size label from the second size label set based on the position relationship between the target coordinate information and the label starting point and the label end point includes:
determining a third dimension labeling set in which a difference value between the coordinates of the picking start point and the coordinates of the labeling start point in a non-target labeling direction is within a second error range and a difference value between the coordinates of the picking end point and the coordinates of the labeling end point in the non-target labeling direction is within a third error range, wherein the non-target labeling direction is a direction perpendicular to the target labeling direction;
sorting the size labels in the third size label set according to the size difference value between the original size value and the distance value;
and determining the size label corresponding to the minimum value in the size difference value as the target size label.
4. The method for retrieving drawing dimension labels of claim 1, wherein the obtaining target coordinate information of two target pick-up points in the drawing comprises:
acquiring initial coordinate information of the target picking point;
and correcting the initial coordinate information according to a labeling rule to obtain target coordinate information, wherein a connecting line of the target coordinate information of the two corrected target picking points is parallel to the target labeling direction.
5. The method of claim 4, wherein the labeling rules include a target labeling direction;
correcting the initial coordinate information according to the labeling rule to obtain target coordinate information, wherein the method comprises the following steps:
determining a pickup starting point and a pickup end point in the target pickup points based on the target labeling direction;
correcting the coordinate value of the picking end point in the non-target labeling direction into the coordinate value of the picking start point in the non-target labeling direction to obtain a corrected coordinate value of the picking end point, wherein the non-target labeling direction is a direction vertical to the target labeling direction;
and determining coordinate values of the pickup starting point and correction coordinate values of the pickup end point as the target coordinate information.
6. The method for retrieving drawing size labels of claim 5, wherein the determining a pick-up start point and a pick-up end point of the target pick-up points based on the target labeling direction comprises:
sequencing the two target picking points according to the sequence of the target picking points in the target marking direction;
and determining the target picking point appearing first in the target labeling direction as the picking starting point, and determining the target picking point appearing later in the target labeling direction as the picking end point.
7. The method for retrieving drawings dimensioning according to claim 1, characterized in that the procedure of the pre-stored dimensioning storage structure includes:
extracting the marking information of the dimension marking graphic elements in the drawing;
dividing the dimension marking primitive into at least one group of marking data groups based on the marking information, wherein the dimension marking primitive in each group of marking data groups is not adjacent to the dimension marking primitives in other marking data groups;
and storing the labeling information in each group of labeling data groups according to the adjacency relation among the dimension labeling primitives to obtain a labeling storage structure.
8. The method for retrieving the drawing dimension label of claim 7, wherein the extracting the label information of the dimension label primitive in the drawing comprises:
traversing all the primitives in the drawing, and extracting dimension marking primitives with primitive types as marking types;
and extracting the labeling information of the dimension labeling graphics primitive.
9. The method of claim 7, wherein the annotation information comprises an annotation start point and an annotation end point, and the dividing the dimension annotation primitive into at least one set of annotation data sets based on the annotation information comprises:
for any dimension marking primitive, judging whether marking information of other dimension marking primitives comprises a marking starting point or a marking end point of the dimension marking primitive;
if so, determining the dimension marking primitives with the same marking starting point or marking end point as mutually adjacent dimension marking primitives;
and determining the mutually adjacent dimension marking primitives as a group of marking data groups.
10. The method of claim 7, wherein the labeling information includes an original dimension value, a label start point, and a label end point; the step of storing the labeling information in each group of the labeling data groups according to the adjacency relation among the size labeling primitives to obtain a labeling storage structure comprises the following steps:
determining the marking starting point and the marking end point in each marking data group as node information;
merging the same node information among the dimension marking primitives with the adjacency relation to obtain a node storage structure;
and determining the original size value in each group of labeled data groups as attribute information among the node information in the node storage structure to obtain the labeled storage structure of each group of labeled data groups.
11. A drawing size labeling retrieval device is characterized by comprising:
the acquisition module is used for acquiring target coordinate information of two target picking points in a drawing and target marking directions of the target picking points;
the determining module is used for determining a distance value between the target coordinate information of the two target picking points;
and the retrieval module is used for retrieving to obtain the target size label from a pre-stored label storage structure based on the target coordinate information, the distance value and the target labeling direction.
12. An electronic device, comprising: the system comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
the memory for storing a computer program;
the processor is configured to execute the program stored in the memory to implement the method for retrieving a drawing dimension label according to any one of claims 1 to 10.
13. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the method for retrieving a drawing dimension label according to any one of claims 1 to 10.
CN202210720654.6A 2022-06-24 2022-06-24 Method and device for retrieving drawing dimension labels, electronic equipment and storage medium Active CN114817604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210720654.6A CN114817604B (en) 2022-06-24 2022-06-24 Method and device for retrieving drawing dimension labels, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210720654.6A CN114817604B (en) 2022-06-24 2022-06-24 Method and device for retrieving drawing dimension labels, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114817604A true CN114817604A (en) 2022-07-29
CN114817604B CN114817604B (en) 2022-10-11

Family

ID=82520424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210720654.6A Active CN114817604B (en) 2022-06-24 2022-06-24 Method and device for retrieving drawing dimension labels, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114817604B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115205471A (en) * 2022-09-13 2022-10-18 青岛艾德软件有限公司 Labeling method and system suitable for automatic drawing of assembly modeling
CN117408000A (en) * 2023-10-24 2024-01-16 哈尔滨航天恒星数据系统科技有限公司 Automatic marking and avoiding method for pipeline point coordinate extraction annotation, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09212539A (en) * 1996-02-06 1997-08-15 Matsushita Electric Ind Co Ltd Graphic processing method and device therefor
CN103822626A (en) * 2014-02-17 2014-05-28 惠州Tcl移动通信有限公司 Mobile terminal, digital map generation method or navigation method thereof and devices
CN109165422A (en) * 2018-08-03 2019-01-08 东莞市燕秀信息技术有限公司 A kind of straight line endpoint Labeling Coordinate method and system based on XY coordinate system
CN111814664A (en) * 2020-07-07 2020-10-23 广联达科技股份有限公司 Method and device for identifying marks in drawing, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH09212539A (en) * 1996-02-06 1997-08-15 Matsushita Electric Ind Co Ltd Graphic processing method and device therefor
CN103822626A (en) * 2014-02-17 2014-05-28 惠州Tcl移动通信有限公司 Mobile terminal, digital map generation method or navigation method thereof and devices
CN109165422A (en) * 2018-08-03 2019-01-08 东莞市燕秀信息技术有限公司 A kind of straight line endpoint Labeling Coordinate method and system based on XY coordinate system
CN111814664A (en) * 2020-07-07 2020-10-23 广联达科技股份有限公司 Method and device for identifying marks in drawing, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115205471A (en) * 2022-09-13 2022-10-18 青岛艾德软件有限公司 Labeling method and system suitable for automatic drawing of assembly modeling
CN117408000A (en) * 2023-10-24 2024-01-16 哈尔滨航天恒星数据系统科技有限公司 Automatic marking and avoiding method for pipeline point coordinate extraction annotation, electronic equipment and storage medium
CN117408000B (en) * 2023-10-24 2024-04-09 哈尔滨航天恒星数据系统科技有限公司 Automatic marking and avoiding method for pipeline point coordinate extraction annotation, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114817604B (en) 2022-10-11

Similar Documents

Publication Publication Date Title
CN114817604B (en) Method and device for retrieving drawing dimension labels, electronic equipment and storage medium
CN113190781B (en) Page layout method, device, equipment and storage medium
CN111814664B (en) Method, device, computer equipment and storage medium for identifying labels in drawing
CN112949661B (en) Detection frame self-adaptive external expansion method and device, electronic equipment and storage medium
CN102662675A (en) Method and device for providing software for terminal equipment
CN112241739A (en) Method, device, equipment and computer readable medium for identifying text errors
CN115357155A (en) Window identification method, device, equipment and computer readable storage medium
CN114283190A (en) Beam line splicing method, device, equipment and storage medium
CN114443592A (en) Data storage method and device, electronic equipment and storage medium
CN114445844A (en) Plate member identification method, device, equipment and storage medium
CN114741754A (en) Room area identification method and system based on building drawing
CN111260759A (en) Path determination method and device
CN114143109B (en) Visual processing method, interaction method and device for attack data
CN111767223B (en) File processing method and device, electronic equipment and storage medium
CN114882242A (en) Violation image identification method and system based on computer vision
CN113762292A (en) Training data acquisition method and device and model training method and device
CN110795922B (en) Form information display method and device for PDF document and electronic equipment
CN110569459A (en) statistical method and device for webpage information
CN111881050A (en) Method and device for clipping text layer and electronic equipment
CN114120016B (en) Character string extraction method, device, equipment and storage medium
CN111767938A (en) Abnormal data detection method and device and electronic equipment
CN111127592A (en) Picture color filling method and device, electronic equipment and readable storage medium
CN110543624B (en) Method and device for identifying check boxes in PDF document and electronic equipment
CN114491368B (en) Form locator generating method, form operation method, device, medium and equipment
CN112819511A (en) Method and device for displaying relation of object execution strategy and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230625

Address after: A601, Zhongke Naneng Building, No. 06 Yuexing 6th Road, Gaoxin District Community, Yuehai Street, Nanshan District, Shenzhen City, Guangdong Province, 518063

Patentee after: Shenzhen Wanyi Digital Technology Co.,Ltd.

Address before: 519031 715, No. 128, Xingsheng 1st Road, Hengqin New District, Zhuhai City, Guangdong Province

Patentee before: WANYI TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right