A space recognition method, device, equipment and readable storage medium
By identifying feature information and target elements in architectural drawings, constructing closed curves, and deleting non-spatial curves, the problem of identification errors caused by the mixing of components is solved, and efficient and accurate spatial identification is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GLODON CO LTD
- Filing Date
- 2021-12-10
- Publication Date
- 2026-04-24
AI Technical Summary
Existing technologies struggle to accurately identify target architectural spaces in architectural drawings, especially when component layers are mixed, causing component identification errors to propagate to spatial identification and affecting accuracy.
By identifying feature information and target elements in the target drawings, closed curves are constructed, spatial candidate sets are determined, and non-spatial curves are deleted to obtain the target spatial set. This avoids reliance on layer conversion and component recognition, thus improving accuracy.
It achieves efficient spatial recognition without the need for layer conversion and component recognition, improving the accuracy and completeness of spatial recognition in target drawings and reducing errors and omissions.
Smart Images

Figure CN116259065B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of architectural drawing recognition technology, specifically to a spatial recognition method, apparatus, device, and readable storage medium. Background Technology
[0002] With the development of computer technology, drawing tools have gradually replaced manual drawing. Among them, computer-aided design (CAD) is the most widely used in industries such as architecture and machinery. Usually, when drawing, the drafters define the space according to their own needs. However, the space definition standards of CAD drawings are not uniform. At present, space recognition in architectural drawings requires identifying the components that make up the architectural space. The components are extracted and converted into images based on the layers in CAD. The edges of the space are identified based on edge detection. The closure search algorithm is used to obtain the closed spaces in the image. Small spaces with a certain threshold are filtered out. Finally, the name of the space is determined by searching for the text in the space.
[0003] However, in actual architectural drawings, there are various mixed layers. Recognition relies on the components that constitute the space (such as walls, doors, windows, etc.), which causes component recognition errors to be transmitted to space recognition. Components that constitute the space can be separated by layer. However, if they are mixed with other non-space-constituting components in the same layer, the image converted from that layer will have interference from furniture, etc., making it difficult to accurately identify the target architectural space in the CAD drawing. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a spatial identification method, apparatus, device, and readable storage medium to solve the problem of difficulty in accurately identifying target building spaces in CAD drawings.
[0005] According to a first aspect, embodiments of the present invention provide a spatial identification method, comprising: acquiring a target drawing; identifying feature information of a space to be identified contained in the target drawing and target primitives of the space to be identified; constructing a closed curve of the space to be identified based on the feature information and the target primitives; determining a spatial candidate set corresponding to the space to be identified; deleting non-spatial curves of the space to be identified from the spatial candidate set to obtain a target spatial set corresponding to the space to be identified.
[0006] The spatial recognition method provided in this invention identifies the feature information and target primitives of the space to be identified contained in the target drawing. Based on the feature information and target primitives, a closed curve of the space to be identified is constructed. A candidate set of spaces corresponding to the space to be identified is determined, and non-spatial curves of the space to be identified are deleted from the candidate set to obtain the target space set corresponding to the space to be identified. This method does not require identification of the layers of the target drawing, avoiding interference from layer-converted images used for spatial recognition. Furthermore, it does not rely on the identification of components constituting the space, preventing component identification errors from being transmitted to spatial recognition, thus improving the accuracy of spatial recognition in the target drawing.
[0007] In conjunction with the first aspect, in the first embodiment of the first aspect, identifying the feature information of the space to be identified contained in the target drawing includes: identifying text elements contained in the target drawing, determining the name text element of the space to be identified; obtaining the coordinate information of the name text element, calculating the center coordinates of the name text element; and determining the center coordinates as the feature information of the space to be identified.
[0008] In conjunction with the first embodiment of the first aspect, in the second embodiment of the first aspect, identifying the target graphic elements of the space to be identified includes: acquiring the graphic element object and composition mode of the target drawing; filtering text-type graphic elements corresponding to the target drawing based on the type attribute of the graphic element object to obtain a first graphic element set corresponding to the target drawing; filtering out graphic elements that do not meet the preset rules from the first graphic element set based on the preset rules corresponding to the composition mode to obtain a second graphic element set corresponding to the target drawing; and filtering out spatial identification interference graphic elements corresponding to the space to be identified from the second graphic element set to obtain the target graphic elements of the space to be identified.
[0009] The spatial recognition method provided in this invention identifies the name text element of the space to be recognized by recognizing text elements contained in the target drawing, and determines the center coordinates of the name text element as the feature information of the space to be recognized, thereby determining the center position of the space to be recognized and improving the recognition efficiency. Simultaneously, based on the type attributes of the element objects and the preset rules corresponding to the composition mode, all elements of the target drawing are filtered, and interfering elements that affect spatial recognition are filtered out. This yields the target element corresponding to the space to be recognized, which is used to construct the closed curve corresponding to the space to be recognized, ensuring accurate recognition of the target element and further guaranteeing the accuracy of spatial recognition of the target drawing.
[0010] In conjunction with the first aspect, in the third embodiment of the first aspect, the step of constructing a closed curve of the space to be identified based on the feature information and the target primitives, and determining the spatial candidate set corresponding to the space to be identified, includes: obtaining the target position of the feature information; constructing a closed curve around the target position based on the target primitives; and associating the closed curve with the feature information to obtain the spatial candidate set corresponding to the space to be identified.
[0011] The spatial recognition method provided in this invention obtains the target position surrounding the feature information, constructs a closed curve around the target position based on the target primitive, and associates the closed curve with the feature information to obtain a spatial candidate set corresponding to the space to be recognized. This allows for a more comprehensive acquisition of the closed curve corresponding to the space to be recognized. Even if the space to be recognized is an irregular space, the corresponding closed curve can be constructed by recognizing the target primitive, thus avoiding spatial recognition errors to a greater extent.
[0012] In conjunction with the first aspect, in the fourth embodiment of the first aspect, the step of deleting the non-spatial curves of the space to be identified from the spatial candidate set includes: determining whether each closed curve in the spatial candidate set is a non-spatial curve; when the closed curve is a non-spatial curve, deleting the non-spatial curve.
[0013] In conjunction with the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, determining whether each closed curve in the spatial candidate set is a non-spatial curve includes: obtaining the identification confidence level corresponding to each closed curve in the spatial candidate set; and designating the closed curve with a confidence level less than a preset value as the non-spatial curve.
[0014] In conjunction with the fourth embodiment of the first aspect, in the sixth embodiment of the first aspect, determining whether each closed curve in the spatial candidate set is a non-spatial curve includes: determining whether the closed curve in the spatial candidate set is a component closed curve; when the closed curve is the component closed curve, the component closed curve is taken as the non-spatial curve.
[0015] The spatial identification method provided in this embodiment of the invention addresses the issue that closed curves in the spatial candidate set may contain non-spatial curves. In such cases, the non-spatial curves in the spatial candidate set need to be deleted so that all closed curves in the spatial candidate set correspond to the space to be identified. This avoids non-spatial curves affecting the spatial identification of the target drawing and further improves the identification accuracy of the space to be identified.
[0016] In conjunction with the first aspect, in the seventh embodiment of the first aspect, the method further includes: obtaining a set of candidate spaces for the space to be identified; determining whether there are adjacent corridor spaces for the space to be identified; when there are no adjacent corridor spaces for the space to be identified, searching for adjacent spaces corresponding to the space to be identified from the set of candidate spaces, and determining the adjacent spaces as the corridor spaces.
[0017] In conjunction with the seventh embodiment of the first aspect, in the eighth embodiment of the first aspect, obtaining the candidate space set of the space to be identified includes: obtaining the internal void space between two non-adjacent spaces to be identified; determining whether the internal void space is an interior space of a building; and when the internal void space is an interior space of a building, determining the internal void space as the candidate space set.
[0018] The spatial identification method provided in this embodiment of the invention obtains a set of candidate spaces for the space to be identified, determines whether there are adjacent corridor spaces for the space to be identified, and searches for adjacent spaces corresponding to the space to be identified from the set of candidate spaces to identify the adjacent spaces as corridor spaces. This avoids the omission of special spaces such as corridor spaces and ensures the integrity of spatial identification.
[0019] In conjunction with the first aspect or any of the first to eighth embodiments of the first aspect, in the ninth embodiment of the first aspect, the method further includes: displaying spatial identification information of the target drawing; and filtering error information corresponding to the identification error instruction in response to the identification error instruction corresponding to the spatial identification information.
[0020] The spatial recognition method provided in this embodiment of the invention displays spatial recognition information of the target drawing so that the user can confirm whether there are errors in the recognition information during the spatial recognition process. When an error is confirmed, the method can respond to the recognition error instruction corresponding to the spatial recognition information, filter the error information corresponding to the recognition error instruction, avoid the error information from affecting spatial recognition, and further improve the accuracy of spatial recognition in the target drawing.
[0021] According to a second aspect, embodiments of the present invention provide a spatial identification device, comprising: an acquisition module, configured to acquire a target drawing, identify feature information of a space to be identified contained in the target drawing and target primitives of the space to be identified; a construction module, configured to construct a closed curve of the space to be identified based on the feature information and the target primitives, and determine a spatial candidate set corresponding to the space to be identified; and an identification module, configured to delete non-spatial curves of the space to be identified from the spatial candidate set, thereby obtaining a target spatial set corresponding to the space to be identified.
[0022] According to a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the spatial recognition method described in the first aspect or any embodiment of the first aspect.
[0023] According to a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, the computer instructions being used to enable the computer to perform the spatial identification method described in the first aspect or any embodiment of the first aspect.
[0024] It should be noted that the beneficial effects of the spatial identification device, electronic device, and computer-readable storage medium provided in the embodiments of the present invention can be found in the description of the corresponding content in the spatial identification method, and will not be repeated here. Attached Figure Description
[0025] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0026] Figure 1 This is a flowchart of a spatial identification method according to an embodiment of the present invention;
[0027] Figure 2 This is another flowchart of a spatial recognition method according to an embodiment of the present invention;
[0028] Figure 3 This is another flowchart of a spatial recognition method according to an embodiment of the present invention;
[0029] Figure 4 This is another flowchart of a spatial recognition method according to an embodiment of the present invention;
[0030] Figure 5 This is a structural block diagram of a spatial identification device according to an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] According to an embodiment of the present invention, an embodiment of a spatial identification method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0034] This embodiment provides a spatial recognition method that can be used in electronic devices such as mobile phones, tablets, and computers. Figure 1 This is a flowchart of a spatial recognition method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0035] S11, acquire the target drawing, identify the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing.
[0036] The target drawing is a completed architectural vector drawing. The target drawing can be designed by technicians using CAD drawing software, imported from external storage devices, or obtained from local storage space. The method of obtaining the target drawing is not specifically limited here, and those skilled in the art can determine it according to actual needs.
[0037] The space to be identified is the architectural space corresponding to the room in the target drawing. The feature information of the space to be identified is used to characterize its features; this feature information can be the name of the space, its type, etc. The target graphic elements of the space to be identified are the line elements that constitute the closed polygon corresponding to the space. After acquiring the target drawing, the electronic device can identify the text and graphic information contained in the drawing to determine the feature information and target graphic elements of the space to be identified.
[0038] S12, construct a closed curve of the space to be identified based on feature information and target primitives, and determine the spatial candidate set corresponding to the space to be identified.
[0039] The spatial candidate set is the set of candidate closed curves corresponding to the space to be identified. A closed curve is a closed polygon corresponding to the space to be identified; this polygon can be regular or irregular. The electronic device uses the location of the feature information as the center, identifies the target primitives around this center, and connects them sequentially based on their coordinate positions to obtain closed curves centered on the location of the feature information. This process yields multiple closed curves, which in turn create the spatial candidate set.
[0040] S13, remove the non-spatial curves of the space to be identified from the spatial candidate set to obtain the target space set corresponding to the space to be identified.
[0041] The target space set is the collection of closed curves corresponding to the spaces to be identified. Non-spatial curves are closed curves corresponding to other components or spaces in the target drawing; that is, the closed curves corresponding to these non-spatial curves do not correspond to the spaces to be identified. Electronic equipment can remove non-spatial curves from the space candidate set to obtain closed curves that satisfy the requirements of the spaces to be identified. These closed curves that satisfy the requirements of the spaces to be identified are then combined into the target space set. In other words, the closed curves in the target space set are the rooms that need to be identified from the target drawing.
[0042] The spatial recognition method provided in this embodiment identifies the feature information and target primitives of the space to be identified contained in the target drawing. Based on the feature information and target primitives, a closed curve of the space to be identified is constructed. A candidate set of spaces corresponding to the space to be identified is determined, and non-spatial curves of the space to be identified are deleted from the candidate set to obtain the target space set corresponding to the space to be identified. This method does not require the identification of layers in the target drawing, avoiding interference from layer-converted images used for spatial recognition. Furthermore, it does not rely on the identification of components constituting the space, preventing component identification errors from being transmitted to spatial recognition, thus improving the accuracy of spatial recognition in the target drawing.
[0043] This embodiment provides a spatial recognition method that can be used in electronic devices such as mobile phones, tablets, and computers. Figure 2 This is a flowchart of a spatial recognition method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0044] S21, acquire the target drawing, identify the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing.
[0045] Specifically, step S21 above may include:
[0046] S211, Obtain the target drawing. Detailed explanations are provided in the descriptions corresponding to the above embodiments, and will not be repeated here.
[0047] S212, Identify the text elements contained in the target drawing and determine the name text elements of the space to be identified.
[0048] Target drawings typically contain textual descriptions of room types and uses, as well as other information such as door and window numbers and special construction details. Electronic devices use a feature extractor to identify textual primitives within the target drawings and extract the textual features representing the space to be identified. From these textual primitives, the device identifies the corresponding name textual primitives for the space to be identified. This feature extractor can employ regularization algorithms, machine learning algorithms commonly used in NLP such as random forests and support vector machines, or various common short text classification deep learning models based on neural networks, such as FastText and BERT. Other algorithms can also be used; no specific limitations are specified here, and those skilled in the art can determine the appropriate algorithm based on actual needs.
[0049] S213, obtain the coordinate information of the name text element, and calculate the center coordinates of the name text element.
[0050] Electronic devices can establish a coordinate system corresponding to the target drawing, determine the coordinate information of the name text element corresponding to the space to be identified based on the coordinate system, and then calculate the center coordinate value corresponding to the name text element based on the coordinate information of the name text element.
[0051] S214, determine the center coordinates as the feature information of the space to be identified.
[0052] Electronic devices can use the centerline coordinates as feature information of the space to be identified, so that they can determine the location of the space to be identified in the target drawing based on the center coordinates of the name text element.
[0053] S215, retrieves the primitive objects and composition mode of the target drawing.
[0054] Graphical elements are the structured objects that constitute the architectural project in the target drawing, such as walls and columns. The composition mode is the pattern used to construct the architectural project based on these structured objects, such as a grid. Electronic devices can identify the structured objects that make up the architectural project by recognizing each graphic element in the target drawing, and can determine the composition mode of the target drawing based on the placement of each graphic element.
[0055] S216, Based on the type attribute of the graphic element object, filter the text-type graphic elements corresponding to the target drawing to obtain the first set of graphic elements corresponding to the target drawing.
[0056] Type attributes are the category attributes of graphic elements, such as text graphic elements, line segment graphic elements, etc. Electronic devices can identify whether graphic elements in the target drawing are text graphic elements or line segment graphic elements based on type attributes. When determining the target graphic elements corresponding to the space to be identified, electronic devices can efficiently and accurately filter out text graphic elements that affect space recognition, such as dimension annotations, text numbers, and other text graphic elements, based on type attributes, to obtain the first set of graphic elements.
[0057] S217, Based on the preset rules corresponding to the composition mode, filter out the elements that do not meet the preset rules from the first element set to obtain the second element set corresponding to the target drawing.
[0058] The preset rules are general drafting rules for architectural engineering design. The electronic device traverses multiple elements in the first set of elements, performs clustering and geometric configuration analysis on element features, and filters out elements that interfere with spatial recognition, i.e., elements that do not meet the preset rules, thus obtaining a second set of elements that meets the preset rules. The preset rules vary depending on the drafting mode. For example, if a grid uses a pattern of line segments plus axis numbers plus circles, the electronic device can filter the first set of elements according to the preset rule pattern corresponding to the grid.
[0059] S218, filter out the spatial recognition interference primitives corresponding to the space to be recognized from the second primitive set to obtain the target primitives of the space to be recognized.
[0060] Spatial recognition interference primitives are primitives that interfere with spatial recognition. After the above steps, the electronic device has basically completed the recognition of the primitives corresponding to the space to be recognized. For spatial recognition interference primitives that are difficult to identify, such as stair flight lines and furniture inside a room, a neural network model can be used for recognition. Specifically, the electronic device can convert the difficult-to-identify primitives into a matrix representation, and then input the primitives of this matrix representation into the neural network model for target detection to identify spatial recognition interference primitives. These interference primitives are then filtered out from the second primitive set to obtain the target primitives corresponding to the space to be recognized. The neural network model can be, but is not limited to, open-source models such as YOLO, RetinaNet, and Faster R-CNN, or a self-developed neural network model, as long as it can detect spatial recognition interference primitives. No specific limitation is made to the neural network model here; those skilled in the art can determine it according to actual needs.
[0061] S22, construct a closed curve of the space to be identified based on feature information and target primitives, and determine the spatial candidate set corresponding to the space to be identified.
[0062] Specifically, step S22 above may include:
[0063] S221, Obtain the target location of feature information.
[0064] The target location of the feature information can characterize the position of the space to be identified in the target drawing. Specifically, when the electronic device extracts the feature information corresponding to the space to be identified, it can determine the target location corresponding to the feature information according to the coordinate system of the target drawing.
[0065] S222, construct a closed curve around the target location based on the target primitives.
[0066] Using the target location as the center point of the space to be identified, the electronic device can expand outwards around the target location, determine the line elements that can form a closed curve from the target elements, and generate the closed curve corresponding to the space to be identified based on the determined line elements.
[0067] It should be noted that electronic devices can preprocess the line primitives that form a closed curve, and extend non-intersecting line primitives under a certain threshold control to ensure that the innermost line primitives in the space to be identified form a closed curve.
[0068] S223, associate the closed curve with the feature information to obtain the spatial candidate set corresponding to the space to be identified.
[0069] Since the closed curve is constructed based on feature information and target primitives, the content space corresponding to the closed curve is the space to be identified corresponding to the feature information, thus establishing the association between feature information and the closed curve. The electronic device sequentially traverses the closed curves corresponding to all feature information in the target drawing to obtain the space candidate set corresponding to the space to be identified in the target drawing.
[0070] S23, remove non-spatial curves of the space to be identified from the spatial candidate set to obtain the target space set corresponding to the space to be identified. Detailed explanations are provided in the descriptions corresponding to the above embodiments, and will not be repeated here.
[0071] The spatial recognition method provided in this embodiment identifies the name text element of the space to be recognized by recognizing the text elements contained in the target drawing, and determines the center coordinates of the name text element as the feature information of the space to be recognized, thereby determining the center position of the space to be recognized and improving the recognition efficiency. Simultaneously, based on the type attributes of the element objects and the preset rules corresponding to the composition mode, all elements of the target drawing are filtered, and interfering elements that affect spatial recognition are filtered out. This yields the target elements corresponding to the space to be recognized, which are then used to construct the closed curve corresponding to the space to be recognized, ensuring accurate recognition of the target elements and further guaranteeing the accuracy of spatial recognition of the target drawing.
[0072] By acquiring the target location surrounding the feature information and constructing a closed curve around the target location based on the target primitives, and associating the closed curve with the feature information, a spatial candidate set corresponding to the space to be identified is obtained. This allows for a more comprehensive acquisition of the closed curve corresponding to the space to be identified. Even if the space to be identified is an irregular space, the corresponding closed curve can be constructed by identifying the target primitives, thus avoiding spatial identification errors to a greater extent.
[0073] This embodiment provides a spatial recognition method that can be used in electronic devices such as mobile phones, tablets, and computers. Figure 3 This is a flowchart of a spatial recognition method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0074] S31, acquire the target drawing, and identify the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing. For detailed explanations, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0075] S32, construct a closed curve of the space to be identified based on feature information and target primitives, and determine the spatial candidate set corresponding to the space to be identified. For detailed explanations, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0076] S33, remove the non-spatial curves of the space to be identified from the spatial candidate set to obtain the target space set corresponding to the space to be identified.
[0077] Specifically, step S33 above may include:
[0078] S331, determine whether each closed curve in the spatial candidate set is a non-spatial curve.
[0079] Traverse each closed curve in the spatial candidate set to determine whether there is a non-spatial curve. If there is a closed curve corresponding to a non-spatial curve in the spatial candidate set, execute step S332; otherwise, determine that the closed curve corresponds to the space to be identified.
[0080] Optionally, step S331 above may include:
[0081] (1) Obtain the recognition confidence level of each closed curve in the spatial candidate set.
[0082] The recognition confidence score is the probability that a closed curve corresponds to a space to be recognized. The recognition confidence score can be determined based on information such as the name, shape, and area of the space to be recognized. Specifically, the electronic device calculates the recognition confidence score of each closed curve sequentially based on the name, shape, and area of the space to be recognized.
[0083] (2) The closed curve with a confidence level less than the preset value is used as the non-spatial curve.
[0084] The preset value is the minimum recognition confidence level corresponding to the closed curve. This preset value can be 90%, 95%, or other values. There is no limitation on the preset value here. Those skilled in the art can determine it based on experience.
[0085] The electronic device compares the recognition confidence level with a preset value to determine whether the recognition confidence level is less than the preset value. When the recognition confidence level is greater than the preset value, it indicates that the closed curve corresponds to the space to be recognized, and the electronic device can retain the closed curve with the recognition confidence level greater than the preset value in the spatial candidate set; when the recognition confidence level is less than the preset value, it indicates that the closed curve is a non-spatial curve, and the electronic device can then delete it from the spatial candidate set.
[0086] Optionally, step S331 above may further include:
[0087] (3) Determine whether the closed curve in the spatial candidate set is a component closed curve.
[0088] The closed curve of a component is a closed polygon of a component such as a wall or column. For the components in the target drawing, they have characteristics that distinguish them from rooms. The electronic device can extract the characteristics of each closed curve in the spatial candidate set to determine whether there is a component closed curve among the multiple closed curves contained in the spatial candidate set. When the electronic device determines that one or more closed curves are component closed curves, step (4) is executed; otherwise, they are still kept in the spatial candidate set.
[0089] (4) Treat the closed curve of the component as a non-spatial curve.
[0090] When the closed curve is a component closed curve, it means that it does not correspond to the space to be identified. At this time, the identified component closed curve can be determined as a non-space curve, and then the electronic device can delete it from the space candidate set.
[0091] S332, when the closed curve is a non-spatial curve, delete the non-spatial curve to obtain the target space set corresponding to the space to be identified.
[0092] When a non-spatial curve is detected in the spatial candidate set, the non-spatial curve is deleted from the spatial candidate set, resulting in the set of closed curves corresponding to the space to be identified, i.e., the target space set.
[0093] It should be noted that the electronic device can also use a target detector to cut out images of corresponding parts of closed curves that are difficult to determine from the target drawing, and input these images into the target detector to identify whether they are non-spatial curves. The target detector is a pre-trained classification model that can identify spaces such as elevators and stairs, and retain these spaces in the spatial candidate set. It can also identify non-spatial curves that are difficult to determine using the above methods, and remove the identified non-spatial curves from the spatial candidate set.
[0094] S34, Obtain the candidate space set for the space to be identified.
[0095] The candidate space set is the set of spaces that may be missed corresponding to the space to be identified, such as special corridor spaces. This candidate space set can be established by the topological space candidate set.
[0096] Specifically, such as Figure 4 As shown, step S34 above may include:
[0097] S341, Obtain the internal void space between two non-adjacent spaces to be identified.
[0098] Internal void spaces are the internal spaces corresponding to non-adjacent spaces to be identified. Electronic devices can identify the adjacency relationships between various spaces to be identified in the target drawing, determine the non-adjacent spaces to be identified, and determine whether there are internal void spaces between two non-adjacent spaces to be identified. If so, the internal void space portion of the two non-adjacent spaces to be identified is extracted.
[0099] S342, determine whether the internal cavity space is the interior space of the building.
[0100] When extracting internal void spaces, the electronic device can determine whether the internal void space is an internal space of the building based on building design rules. If the internal void space is an internal space of the building, step S343 is executed; otherwise, it means that the internal void space is not an internal space of the building and can be deleted.
[0101] S343, the internal void space is identified as the candidate space set.
[0102] When the internal void space is the interior space of the building, the internal void space is used as a candidate space set, so that the electronic equipment can complete the space to be identified based on the candidate space set and avoid the omission of the space to be identified.
[0103] S35, determine whether there are adjacent corridor spaces in the space to be identified.
[0104] The corridor space is necessary for the space to be identified. The electronic device can combine the overall building to determine whether there is an adjacent corridor space. If there is no adjacent corridor space, step S36 is executed; otherwise, it means that there is an adjacent corridor space.
[0105] S36, search for adjacent spaces corresponding to the space to be identified from the candidate space set, and identify the adjacent spaces as corridor spaces.
[0106] When there is no adjacent corridor space for the space to be identified, the electronic device searches for the adjacent space corresponding to the space to be identified in the candidate space set, and uses the adjacent space as the corridor space corresponding to the space to be identified, thus completing the spatial identification of the entire architectural project target drawing.
[0107] S37 displays the spatial identification information of the target drawing.
[0108] Spatial recognition information refers to the recognition results obtained during the recognition process of the target drawing. The electronic device can be equipped with a corresponding human-computer interaction interface, and the spatial recognition information during the recognition process of the target drawing can be displayed through the human-computer interaction interface so that technicians can determine whether the recognition results are correct.
[0109] S38, in response to the recognition error command corresponding to the spatial recognition information, filters the error information corresponding to the recognition error command.
[0110] An error recognition command indicates that there is an error in the spatial recognition information. This error recognition command can be input by technicians through a human-computer interaction interface. Correspondingly, the electronic device can respond to the error recognition command input by the technicians, determine the error information corresponding to the error recognition command, and filter the error information to avoid affecting the accuracy of spatial recognition.
[0111] The spatial recognition method provided in this embodiment addresses the issue that closed curves in the spatial candidate set may contain non-spatial curves. In such cases, the non-spatial curves in the spatial candidate set need to be deleted to ensure that all closed curves in the spatial candidate set correspond to the space to be recognized. This avoids non-spatial curves affecting the spatial recognition of the target drawing, further improving the accuracy of spatial recognition. By acquiring a candidate space set for the space to be recognized, it is determined whether there are adjacent corridor spaces. When no adjacent corridor spaces exist, the adjacent spaces corresponding to the space to be recognized are searched from the candidate space set and identified as corridor spaces. This avoids the omission of corridor spaces and other special spaces, ensuring the completeness of spatial recognition. By displaying the spatial recognition information of the target drawing, the user can confirm whether there are any errors in the recognition information during the spatial recognition process. When an error is confirmed, the system responds to the recognition error command corresponding to the spatial recognition information, filtering the error information corresponding to the recognition error command to prevent error information from affecting spatial recognition, further improving the accuracy of spatial recognition in the target drawing.
[0112] This embodiment also provides a spatial identification device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0113] This embodiment provides a spatial recognition device, such as... Figure 5 As shown, it includes:
[0114] The acquisition module 41 is used to acquire the target drawing and identify the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing. For detailed explanation, please refer to the relevant descriptions in the above method embodiments, which will not be repeated here.
[0115] Module 42 is used to construct a closed curve of the space to be identified based on feature information and target primitives, and to determine the spatial candidate set corresponding to the space to be identified. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.
[0116] The identification module 43 is used to delete non-spatial curves of the space to be identified from the spatial candidate set to obtain the target space set corresponding to the space to be identified. For detailed explanations, please refer to the relevant descriptions in the above method embodiments; they will not be repeated here.
[0117] The spatial recognition device provided in this embodiment identifies the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing. Based on the feature information and target primitives, it constructs a closed curve of the space to be identified, determines the candidate set of spaces corresponding to the space to be identified, and deletes non-spatial curves of the space to be identified from the candidate set to obtain the target space set corresponding to the space to be identified. This device does not require identification of the layers of the target drawing, avoiding interference from layer-converted images for spatial recognition. Furthermore, it does not rely on the identification of components constituting the space, preventing component identification errors from being transmitted to spatial recognition, thus improving the accuracy of spatial recognition in the target drawing.
[0118] In this embodiment, the spatial identification device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0119] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0120] This invention also provides an electronic device having the above-described features. Figure 5 The spatial identification device shown.
[0121] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the device may include: at least one processor 501, such as a CPU (Central Processing Unit), at least one communication interface 503, memory 504, and at least one communication bus 502. The communication bus 502 is used to enable communication between these components. The communication interface 503 may include a display screen or a keyboard; optionally, the communication interface 503 may also include a standard wired interface or a wireless interface. The memory 504 may be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 504 may also be at least one storage device located remotely from the aforementioned processor 501. The processor 501 may be combined with... Figure 5 The described apparatus has an application program stored in memory 504, and a processor 501 calls the program code stored in memory 504 to perform any of the above method steps.
[0122] The communication bus 502 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 502 can be divided into an address bus, a data bus, and a control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0123] The memory 504 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 504 may also include a combination of the above types of memory.
[0124] The processor 501 can be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
[0125] The processor 501 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0126] Optionally, memory 504 is also used to store program instructions. Processor 501 can call the program instructions to implement the functions described in this application. Figures 1 to 4 The spatial recognition method shown in the embodiments.
[0127] This invention also provides a non-transitory computer storage medium storing computer-executable instructions that can execute the spatial identification method processing method in any of the above-described method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0128] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and all such modifications and variations fall within the scope defined by the appended claims.
Claims
1. A spatial recognition method, characterized in that, include: Obtain the target drawing, and identify the feature information of the space to be identified and the target primitives of the space to be identified contained in the target drawing; Based on the feature information and the target primitives, a closed curve of the space to be identified is constructed, and the spatial candidate set corresponding to the space to be identified is determined; The non-spatial curves of the space to be identified are deleted from the spatial candidate set to obtain the target space set corresponding to the space to be identified.
2. The method according to claim 1, characterized in that, Identifying feature information of the space to be identified contained in the target drawing includes: Identify the text elements contained in the target drawing and determine the name text elements of the space to be identified; Obtain the coordinate information of the name text element and calculate the center coordinates of the name text element; The center coordinates are determined as the feature information of the space to be identified.
3. The method according to claim 2, characterized in that, Identifying target primitives in the space to be identified includes: Obtain the primitive objects and composition mode of the target drawing; Based on the type attribute of the graphic element object, the text-type graphic elements corresponding to the target drawing are filtered to obtain the first set of graphic elements corresponding to the target drawing. Based on the preset rules corresponding to the composition pattern, elements that do not meet the preset rules are filtered out from the first set of elements to obtain the second set of elements corresponding to the target drawing. The spatial identification interference primitives corresponding to the space to be identified are filtered out from the second primitive set to obtain the target primitives of the space to be identified.
4. The method according to claim 1, characterized in that, The step of constructing a closed curve of the space to be identified based on the feature information and the target primitives, and determining the spatial candidate set corresponding to the space to be identified, includes: The target location for obtaining the feature information; A closed curve is constructed around the target location based on the target primitives; By associating the closed curve with the feature information, a spatial candidate set corresponding to the space to be identified is obtained.
5. The method according to claim 1, characterized in that, The step of deleting non-spatial curves of the space to be identified from the spatial candidate set includes: Determine whether each closed curve in the spatial candidate set is a non-spatial curve; When the closed curve is a non-spatial curve, delete the non-spatial curve.
6. The method according to claim 5, characterized in that, The step of determining whether each closed curve in the spatial candidate set is a non-spatial curve includes: Obtain the recognition confidence level corresponding to each closed curve in the spatial candidate set; The closed curve with a recognition confidence level less than a preset value is used as the non-spatial curve.
7. The method according to claim 5, characterized in that, The step of determining whether each closed curve in the spatial candidate set is a non-spatial curve includes: Determine whether the closed curve in the spatial candidate set is a component closed curve; When the closed curve is the closed curve of the component, the closed curve of the component is taken as the non-spatial curve.
8. The method according to claim 1, characterized in that, Also includes: Obtain the candidate space set of the space to be identified; Determine whether the space to be identified has adjacent corridor spaces; When the space to be identified does not have an adjacent corridor space, the adjacent space corresponding to the space to be identified is searched from the candidate space set, and the adjacent space is determined as the corridor space.
9. The method according to claim 8, characterized in that, The step of obtaining the candidate space set of the space to be identified includes: Obtain the internal void space between two non-adjacent spaces to be identified; Determine whether the internal cavity space is an interior space of the building; When the internal void space is the interior space of a building, the internal void space is determined as the candidate space set.
10. The method according to any one of claims 1-9, characterized in that, Also includes: Display the spatial identification information of the target drawing; In response to the identification error command corresponding to the spatial identification information, the error information corresponding to the identification error command is filtered.
11. A spatial recognition device, characterized in that, include: The acquisition module is used to acquire the target drawing, identify the feature information of the space to be identified contained in the target drawing and the target primitives of the space to be identified; The construction module is used to construct a closed curve of the space to be identified based on the feature information and the target primitive, and to determine the spatial candidate set corresponding to the space to be identified; The identification module is used to delete the non-spatial curves of the space to be identified from the spatial candidate set to obtain the target space set corresponding to the space to be identified.
12. An electronic device, characterized in that, include: A memory and a processor are communicatively connected, the memory stores computer instructions, and the processor executes the spatial recognition method according to any one of claims 1-10 by executing the computer instructions.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a computer to perform the spatial identification method according to any one of claims 1-10.
Citation Information
Patent Citations
Space recognition method and device for CAD drawing, electronic equipment and storage medium
CN111008597A
Method for accurately identifying ramps in CAD (Computer Aided Design) ramp sample drawing
CN112883799A