Method, device, equipment and storage medium for identifying dimension markings
By acquiring images of architectural drawings and using a neural network model to identify and calculate the coordinates and direction offset parameters of the endpoints, the problem of the existing technology being unable to identify non-horizontal or vertical dimensioning is solved, and accurate recognition of non-vertical and non-horizontal dimensioning is achieved.
Patent Information
- Application Number
- CN202211026367.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-08-25
AI Technical Summary
The existing technology cannot recognize dimensioning in non-horizontal or vertical directions.
By acquiring images of architectural drawings, the coordinates and direction offset parameters of each endpoint of the dimension annotation are identified, the endpoint direction is calculated using a neural network model, and the dimension annotation is identified by combining the coordinates and direction.
It realizes the accurate recognition of non-vertical and non-horizontal dimensioning, and improves the recognition accuracy of dimensioning.
Smart Images

Figure CN115455504B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, apparatus, device, and storage medium for identifying dimension markings. Background Art
[0002] With the development of computer technology and informatization, the manufacturing industry is increasingly moving towards digitalization, intelligence, and integration. For example, an engineering design system with CAD / CAPP / CAM as the core is used for product design. The product design process includes overall design, motion design, and structural design. The structural design is to digitally define the three-dimensional model of the product. On the premise of reasonable structural design, engineering information including dimensions must be marked. Among them, the main function of dimensioning is to accurately describe the structural characteristics, shape characteristics, and precision characteristics of parts.
[0003] The related art can only recognize dimension markings in the horizontal or vertical direction, but cannot recognize dimension markings in non-horizontal or non-vertical directions. Summary of the Invention
[0004] The present application provides a method, apparatus, device and storage medium for identifying dimension annotations, so as to solve the problem in the related art that dimension annotations in non-horizontal or vertical directions cannot be identified.
[0005] In a first aspect, a method for identifying dimension marking is provided, comprising:
[0006] Acquire an image of a building drawing to be recognized;
[0007] Identifying the coordinates of each endpoint of the dimension annotation in the image, and identifying a direction offset parameter of each endpoint using a first neural network model, wherein the direction offset parameter represents an offset angle of the direction of the endpoint relative to a predetermined direction;
[0008] Obtaining the endpoint directions of the respective endpoints based on the direction offset parameters;
[0009] Dimensions in the architectural drawing are identified based on the coordinates and the endpoint directions.
[0010] Optionally, identifying the coordinates of respective endpoints belonging to the dimension annotation in the image includes:
[0011] A second neural network model is used to identify a heat map for each of the endpoints; the heat map includes coordinates of at least one hotspot and a coordinate offset of each hotspot relative to the endpoint, different hotspots in the at least one hotspot have different response values, and the response value represents a probability that the hotspot belongs to the dimensioned endpoint;
[0012] The coordinates of each endpoint are calculated based on the heat map.
[0013] Optionally, calculating the coordinates of each endpoint based on the heat map includes:
[0014] For any endpoint among the endpoints, obtaining a target hotspot with the highest response value from a heat map of the endpoint;
[0015] The coordinates of any endpoint are calculated using the coordinates and coordinate offset of the target hotspot.
[0016] Optionally, calculating the endpoint directions of the endpoints based on the direction offset parameter includes:
[0017] For any endpoint among the endpoints, obtaining an offset category and an offset amount in a direction offset parameter of the endpoint; the offset category corresponds to an angle interval;
[0018] Based on the angle interval, obtaining the interval center angle corresponding to the offset category;
[0019] The endpoint direction of any endpoint is calculated based on the interval center angle and the offset.
[0020] Optionally, identifying dimension annotations in the architectural drawing based on the coordinates and the endpoint directions includes:
[0021] For any endpoint among the endpoints, based on the endpoint direction, searching for at least one target endpoint from the endpoints; the direction of any target endpoint is the same as the direction of the endpoint; the direction of a line segment formed by any target endpoint and any endpoint is the same as the direction of the endpoint;
[0022] Based on the coordinates, selecting a first endpoint closest to any endpoint from the at least one target endpoint;
[0023] Based on the any endpoint and the first endpoint, a dimension annotation in the architectural drawing is obtained.
[0024] Optionally, obtaining a dimension annotation in the architectural drawing based on any endpoint and the first endpoint includes:
[0025] Determine whether there is a pixel point between any endpoint and the first endpoint in the drawing;
[0026] If so, use the line segment between any endpoint and the first endpoint as the dimension;
[0027] Otherwise, a second endpoint is selected from the at least one target endpoint, and the distance between the second endpoint and the any endpoint is only smaller than the distance between the first endpoint and the any endpoint; and the line segment between the any endpoint and the second endpoint is used as the dimension annotation.
[0028] Optionally, the first neural network model and the second neural network model are implemented by the same multi-task convolutional neural network model, and the multi-task convolutional neural network model outputs the heat map and direction offset parameters through different tasks.
[0029] In a second aspect, a device for identifying dimension marking is provided, comprising:
[0030] an acquisition module, for acquiring an image of a building drawing to be recognized;
[0031] a first recognition module, configured to identify the coordinates of each endpoint of a dimension annotation in the image, and to identify a direction offset parameter of each endpoint using a first neural network model, wherein the direction offset parameter represents an offset angle of the direction of the endpoint relative to a preset direction;
[0032] A calculation module, configured to calculate the endpoint direction of each of the endpoints based on the direction offset parameter;
[0033] The second recognition module is configured to recognize dimension annotations in the architectural drawing based on the coordinates and the endpoint directions.
[0034] In a third aspect, an electronic device is provided, comprising: a processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus;
[0035] The memory is used to store computer programs;
[0036] The processor is used to execute the program stored in the memory to implement the method for identifying dimension annotations described in the first aspect.
[0037] In a fourth aspect, a computer-readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the method for identifying dimension annotations described in the first aspect.
[0038] The technical solution provided by the embodiments of the present application has the following advantages over the prior art: the method provided by the embodiments of the present application obtains an image of an architectural drawing to be identified; identifies the coordinates of each endpoint belonging to a dimension annotation in the image; and uses a first neural network model to identify a direction offset parameter for each endpoint, wherein the direction offset parameter represents the angle of deviation of the endpoint's direction relative to a preset direction; calculates the endpoint direction of each endpoint based on the direction offset parameter; and identifies the dimension annotation in the architectural drawing based on the coordinates and endpoint direction. Because the endpoint direction can be obtained, the solution of this embodiment can accurately identify dimension annotations in non-vertical and non-horizontal directions. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] 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.
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] Figure 1 A schematic flow chart of a method for identifying dimension markings in an embodiment of the present application;
[0042] Figure 2 This is a schematic diagram of a heat map in an embodiment of the present application;
[0043] Figure 3 This is a schematic diagram of the structure of a device for identifying dimension marks in an embodiment of the present application;
[0044] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0045] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0046] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0047] The embodiment of the present application provides a method for identifying dimension markings, which can be applied to electronic devices;
[0048] The electronic device described in this embodiment may include a terminal or a server, which is not limited in this embodiment. The terminal device may be a mobile terminal such as a mobile phone, a tablet computer, a laptop computer, a PDA, a PAD (Personal Digital Assistant), a PMP (Portable Media Player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc.
[0049] like Figure 1 As shown, the method may include the following steps:
[0050] Step 101: Acquire an image of a building drawing to be recognized.
[0051] Step 102: Identify the coordinates of each endpoint of the dimension annotation in the image, and use a first neural network model to identify a direction offset parameter of each endpoint, where the direction offset parameter represents an offset angle of the endpoint relative to a preset direction.
[0052] This embodiment provides the following two methods for identifying the coordinates of each endpoint of a dimension:
[0053] First, the dimension annotations in the image are identified through a pre-trained neural network model, and the coordinates of the endpoints of the dimension annotations are obtained.
[0054] Secondly, a second neural network model is used to identify the heat map of each endpoint; the heat map includes the coordinates of at least one hotspot and the coordinate offset of each hotspot relative to the endpoint, and different hotspots in at least one hotspot have different response values, and the response value represents the probability that the hotspot belongs to the dimensioned endpoint; the coordinates of each endpoint are calculated based on the heat map.
[0055] It should be noted that the coordinate offset includes the coordinate offset amount and the coordinate offset direction, so the coordinates of the endpoint can be calculated based on the coordinate offset and the coordinates of the corresponding hotspot. Figure 2 , Figure 2 This is a schematic diagram of a hotspot map shown in this embodiment, where hotspot 1 is the hotspot of endpoint A, dx and dy are the coordinate offsets of hotspot 1 relative to endpoint A, and the arrow indicates the direction of the coordinate offset.
[0056] It should be understood that a heat map can include multiple hotspots. Hotspots closer to an endpoint have higher response values, indicating a higher probability of being an endpoint. For example, if the response value of a hotspot is in the range of 0 to 1, a hotspot with a response value of 1 indicates that the hotspot is an endpoint. For example, if the first hotspot has a response value of 0.8 and the second hotspot has a response value of 0.6, since 0.8 is closer to 1, the first hotspot is more likely to be an endpoint than the second hotspot.
[0057] In this embodiment, in order to improve the accuracy of the coordinates of the endpoints identified by the second neural network model, the coordinates of the endpoints are calculated using the hotspot with the highest response value in the heat map.
[0058] In a specific implementation, in an optional embodiment, for any endpoint, the target hotspot with the highest response value is obtained from the heat map of any endpoint; the coordinates of any endpoint are calculated using the coordinates and coordinate offset of the target hotspot.
[0059] It should be understood that the heat map output by the second neural network model includes multiple hotspots because the second neural network model downsamples the image when recognizing the architectural drawing, resulting in a lower resolution of the downsampled image relative to the pre-downsampled image, which in turn prevents the second neural network model from accurately obtaining the coordinates of the endpoints. It should also be understood that when training the second neural network model, the coordinates of the dimensioned endpoints in the training samples are annotated, enabling the second neural network to learn to recognize the dimensioned endpoints based on the training samples.
[0060] In this embodiment, in order to reduce the consumption of hardware resources, the first neural network model and the second neural network model are implemented by the same multi-task convolutional neural network model, and the multi-task convolutional neural network model outputs heat maps and direction offset parameters by different tasks.
[0061] Step 103: Calculate the endpoint direction of each endpoint based on the direction offset parameter.
[0062] In this embodiment, the direction offset parameter includes an offset category and an offset amount. The offset category corresponds to an angle interval, and the offset amount represents the offset angle and offset direction relative to the center angle of the interval.
[0063] In a specific implementation, in an optional embodiment, for any endpoint among the endpoints, the offset category and offset amount in the direction offset parameter of any endpoint are obtained; the offset category corresponds to an angle interval; based on the angle interval, the interval center angle corresponding to the offset category is obtained; based on the interval center angle and the offset amount, the endpoint direction of any endpoint is calculated.
[0064] It should be understood that the center angle of the interval here is the median value in the angle interval. For example, if the angle interval is 0 to 30 degrees, then it can be confirmed that the center angle of the interval is 15 degrees.
[0065] It should be understood that when calculating the endpoint direction of any endpoint, the sum of the interval center angle and the offset can be calculated, and the sum result can be used as the endpoint direction of any endpoint.
[0066] In the application, the first neural network model divides the range from 0 to 180 degrees into several intervals based on direction. For example, six intervals are divided into six categories. 0 to 30 degrees is one category, 30 to 60 degrees is another category, and so on. The first neural network model outputs the offset category and offset amount, which is used to accurately determine the direction.
[0067] Step 104: Identify dimension annotations in the architectural drawings based on the coordinates and endpoint directions.
[0068] In this embodiment, after obtaining the position and direction of the endpoint, based on the principle of the nearest neighbor and the same direction, all endpoints are traversed to find the endpoint with the same direction, and then the nearest neighbor is matched as a dimension line segment. In this way, all dimension lines in the drawing can be found.
[0069] In a specific implementation, in an optional embodiment, for any endpoint among the endpoints, based on the endpoint direction, at least one target endpoint is searched from each endpoint; the direction of any target endpoint is the same as the endpoint direction; the direction of the line segment formed by any target endpoint and any endpoint is the same as the endpoint direction; based on the coordinates, the first endpoint closest to any endpoint is filtered from at least one target endpoint; based on any endpoint and the first endpoint, the dimension annotation in the architectural drawing is obtained.
[0070] It should be understood that the dimensioning obtained by using this embodiment is a dimensioning with direction and coordinates, wherein the direction is the direction of the endpoint and the coordinates are the coordinates of the two endpoints of the dimensioning.
[0071] In application, the line segment formed by any endpoint and the first endpoint can be directly used as a dimension.
[0072] In the application, considering that there may be multiple dimension annotations in the same direction, and the distance between two adjacent endpoints of different dimension annotations may be smaller than the size of the dimension annotation itself, in order to prevent misjudgment in this case, in the process of obtaining the dimension annotation based on any endpoint and the first endpoint, it is necessary to identify again in the image whether there are pixels between any endpoint and the first endpoint.
[0073] In a specific implementation, in an optional embodiment, it is determined whether there is a pixel point between any endpoint and the first endpoint in the drawing; if so, the line segment between any endpoint and the first endpoint is used as a dimension annotation; otherwise, a second endpoint is selected from at least one target endpoint, and the distance between the second endpoint and any endpoint is only less than the distance between the first endpoint and any endpoint; the line segment between any endpoint and the second endpoint is used as a dimension annotation.
[0074] It should be understood that when there is a pixel point between any endpoint and the first endpoint, it means that there is indeed a connection between any endpoint and the first endpoint in the image. In this case, any endpoint and the first endpoint can be determined as the two endpoints of the dimension annotation; if there is no pixel point between any endpoint and the first endpoint, it means that there is actually no connection between any endpoint and the first endpoint in the image, that is, the distance between two adjacent endpoints of different dimension annotations is smaller than the size of the dimension annotation itself. In this case, the second endpoint is screened from at least one target endpoint, and the dimension annotation is determined based on the second endpoint and any endpoint.
[0075] It should be understood that in actual applications, in order to ensure accuracy and improve reliability, when determining the dimension based on the second endpoint and any endpoint, it is also possible to confirm in the image again whether there is a pixel point between the second endpoint and any endpoint.
[0076] The technical solution provided in this embodiment involves acquiring an image of an architectural drawing to be recognized; identifying the coordinates of each endpoint of a dimension annotation in the image; and using a first neural network model to identify a direction offset parameter for each endpoint, the direction offset parameter representing the angle of the endpoint's orientation relative to a preset orientation; calculating the endpoint orientation of each endpoint based on the direction offset parameter; and recognizing the dimension annotation in the architectural drawing based on the coordinates and endpoint orientation. Because the endpoint orientation can be obtained, the solution of this embodiment can accurately recognize dimension annotations in non-vertical and non-horizontal directions.
[0077] Based on the same concept, a device for identifying dimension marking is provided in the embodiment of the present application. The specific implementation of the device can be found in the description of the method embodiment part, and the repeated parts will not be repeated. Figure 3 As shown, the device mainly includes:
[0078] An acquisition module 301 is used to acquire an image of a building drawing to be identified;
[0079] A first recognition module 302 is configured to recognize the coordinates of each endpoint of a dimension annotation in the image, and to recognize a direction offset parameter of each endpoint using a first neural network model, wherein the direction offset parameter represents an offset angle of the direction of the endpoint relative to a predetermined direction;
[0080] A calculation module 303 is configured to calculate the endpoint direction of each endpoint based on the direction offset parameter;
[0081] The second recognition module 304 is configured to recognize dimension annotations in architectural drawings based on coordinates and endpoint directions.
[0082] The first identification module 302 is used to:
[0083] A second neural network model is used to identify a heat map for each endpoint; the heat map includes coordinates of at least one hotspot and a coordinate offset of each hotspot relative to the endpoint, and different hotspots in the at least one hotspot have different response values, the response value representing a probability that the hotspot belongs to the dimensioned endpoint;
[0084] The coordinates of each endpoint are calculated based on the heat map.
[0085] The first identification module 302 is used to:
[0086] For any endpoint among the endpoints, obtain the target hotspot with the highest response value from the heat map of any endpoint;
[0087] The coordinates of either endpoint are calculated using the coordinates of the target hotspot and the coordinate offset.
[0088] The calculation module 303 is used to:
[0089] For any endpoint among the endpoints, obtain the offset category and offset amount in the direction offset parameter of any endpoint; the offset category corresponds to an angle interval;
[0090] Based on the angle interval, obtain the interval center angle corresponding to the offset category;
[0091] Calculate the endpoint direction of any endpoint based on the interval center angle and offset.
[0092] The second identification module 304 is used to:
[0093] For any endpoint among the endpoints, based on the endpoint direction, at least one target endpoint is searched from the endpoints; the direction of any target endpoint is the same as the endpoint direction; the direction of the line segment formed by any target endpoint and any endpoint is the same as the endpoint direction;
[0094] Based on the coordinates, selecting a first endpoint closest to any endpoint from at least one target endpoint;
[0095] Based on any endpoint and the first endpoint, the dimensioning in the architectural drawing is obtained.
[0096] The second identification module 304 is used to:
[0097] Determine whether there is a pixel between any endpoint and the first endpoint in the drawing;
[0098] If so, use the line segment between any endpoint and the first endpoint as the dimension;
[0099] Otherwise, a second endpoint is selected from at least one target endpoint, and the distance between the second endpoint and any endpoint is only smaller than the distance between the first endpoint and any endpoint; and the line segment between any endpoint and the second endpoint is used as a dimension.
[0100] The first neural network model and the second neural network model are implemented by the same multi-task convolutional neural network model, and the multi-task convolutional neural network model outputs a heat map and direction offset parameters according to different tasks.
[0101] Based on the same concept, an electronic device is also provided in the embodiment of the present application, such as Figure 4 As shown, the electronic device mainly includes: a processor 401, a memory 402 and a communication bus 403, wherein the processor 401 and the memory 402 communicate with each other via the communication bus 403. The memory 402 stores a program that can be executed by the processor 401, and the processor 401 executes the program stored in the memory 402 to implement the following steps:
[0102] An image of an architectural drawing to be identified is obtained; the coordinates of each endpoint belonging to a dimension annotation in the image are identified, and a direction offset parameter of each endpoint is identified using a first neural network model, where the direction offset parameter represents an offset angle of the endpoint relative to a preset direction; the endpoint direction of each endpoint is calculated based on the direction offset parameter; and the dimension annotation in the architectural drawing is identified based on the coordinates and the endpoint direction.
[0103] The communication bus 403 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 403 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0104] The memory 402 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor 401.
[0105] The above-mentioned processor 401 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., and can 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 gate or transistor logic devices, and discrete hardware components.
[0106] In another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method for identifying dimension annotations described in the above embodiment.
[0107] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can 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 the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions are transmitted from a website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape, etc.), an optical medium (e.g., a DVD) or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0108] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0109] The foregoing description is intended only to provide specific embodiments of the present invention, which will enable those skilled in the art to understand and implement the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not intended to be limited to the embodiments shown herein, but is intended to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A method for identifying dimension marking, characterized in that: include: Acquire an image of a building drawing to be recognized; Identifying the coordinates of each endpoint of the dimension annotation in the image, and identifying a direction offset parameter of each endpoint using a first neural network model, wherein the direction offset parameter represents an offset angle of the direction of the endpoint relative to a predetermined direction; Obtaining the endpoint directions of the respective endpoints based on the direction offset parameters; identifying a dimension in the architectural drawing based on the coordinates and the endpoint directions; The step of calculating the endpoint directions of the endpoints based on the direction offset parameter includes: For any endpoint among the endpoints, obtaining an offset category and an offset amount in a direction offset parameter of the endpoint; the offset category corresponds to an angle interval; Based on the angle interval, obtaining the interval center angle corresponding to the offset category; Calculating the endpoint direction of any endpoint based on the interval center angle and the offset, wherein the sum of the interval center angle and the offset is calculated and the sum result is used as the endpoint direction of any endpoint; The step of identifying the dimension annotation in the architectural drawing based on the coordinates and the endpoint directions includes: For any endpoint among the endpoints, based on the endpoint direction, searching for at least one target endpoint from the endpoints; the direction of any target endpoint is the same as the direction of the endpoint; the direction of a line segment formed by any target endpoint and any endpoint is the same as the direction of the endpoint; Based on the coordinates, selecting a first endpoint closest to any endpoint from the at least one target endpoint; Based on the any endpoint and the first endpoint, a dimension annotation in the architectural drawing is obtained.
2. The method according to claim 1, characterized in that Identifying the coordinates of respective endpoints of the dimension annotation in the image includes: A second neural network model is used to identify a heat map for each of the endpoints; the heat map includes coordinates of at least one hotspot and a coordinate offset of each hotspot relative to the endpoint, different hotspots in the at least one hotspot have different response values, and the response value represents a probability that the hotspot belongs to the dimensioned endpoint; The coordinates of each endpoint are calculated based on the heat map.
3. The method according to claim 2, characterized in that Calculating the coordinates of each endpoint based on the heat map includes: For any endpoint among the endpoints, obtaining a target hotspot with the highest response value from a heat map of the endpoint; The coordinates of any endpoint are calculated using the coordinates and coordinate offset of the target hotspot.
4. The method according to claim 1, wherein Obtaining a dimension annotation in the architectural drawing based on the any endpoint and the first endpoint includes: Determine whether there is a pixel point between any endpoint and the first endpoint in the drawing; If so, use the line segment between any endpoint and the first endpoint as the dimension; Otherwise, a second endpoint is selected from the at least one target endpoint, and the distance between the second endpoint and the any endpoint is only smaller than the distance between the first endpoint and the any endpoint; and the line segment between the any endpoint and the second endpoint is used as the dimension annotation.
5. The method according to claim 2, characterized in that The first neural network model and the second neural network model are implemented by the same multi-task convolutional neural network model, and the multi-task convolutional neural network model outputs the heat map and direction offset parameters through different tasks.
6. A device for identifying dimension marking, characterized in that: include: an acquisition module, for acquiring an image of a building drawing to be recognized; a first recognition module, configured to identify the coordinates of each endpoint of a dimension annotation in the image, and to identify a direction offset parameter of each endpoint using a first neural network model, wherein the direction offset parameter represents an offset angle of the direction of the endpoint relative to a preset direction; A calculation module, configured to calculate the endpoint direction of each of the endpoints based on the direction offset parameter; a second recognition module, configured to recognize dimension annotations in the architectural drawing based on the coordinates and the endpoint directions; The step of calculating the endpoint directions of the endpoints based on the direction offset parameter includes: For any endpoint among the endpoints, obtaining an offset category and an offset amount in a direction offset parameter of the endpoint; the offset category corresponds to an angle interval; Based on the angle interval, obtaining the interval center angle corresponding to the offset category; Calculating the endpoint direction of any endpoint based on the interval center angle and the offset, wherein the sum of the interval center angle and the offset is calculated and the sum result is used as the endpoint direction of any endpoint; The step of identifying the dimension annotation in the architectural drawing based on the coordinates and the endpoint directions includes: For any endpoint among the endpoints, based on the endpoint direction, searching for at least one target endpoint from the endpoints; the direction of any target endpoint is the same as the direction of the endpoint; the direction of a line segment formed by any target endpoint and any endpoint is the same as the direction of the endpoint; Based on the coordinates, selecting a first endpoint closest to any endpoint from the at least one target endpoint; Based on the any endpoint and the first endpoint, a dimension annotation in the architectural drawing is obtained.
7. An electronic device, characterized in that: include: A processor, a memory, and a communication bus, wherein the processor and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the method for identifying dimension markings according to any one of claims 1 to 5.
8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for identifying dimension annotations according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
A coordinate marking method and system of a straight line end point based on an XY coordinate system
CN109165422A
Drawing size mark retrieval method and device, electronic equipment and storage medium
CN114817604A