Method, device, electronic device and storage medium for determining an extended region of a component

By identifying target components in architectural drawings and determining the outward expansion direction and distance based on mapping relationships, the problem of large workload and inaccuracy in the outward expansion area in traditional methods is solved, achieving more efficient and accurate determination of the outward expansion area.

CN115311675BActive Publication Date: 2026-04-17WANYI TECH
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WANYI TECH
Filing Date
2022-07-26
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, when rectangular components are processed together, the workload of obtaining the outer expansion area is large and does not meet the needs of actual scenarios. Traditional geometric algorithms lead to inaccurate judgment results.

Method used

By acquiring images from architectural drawings, identifying target components, and determining the outward expansion direction and distance of the target components based on pre-set mapping relationships between components and reference components, the outward expansion area can be accurately determined.

Benefits of technology

This reduces the workload of external expansion operations, improves the accuracy of results, and ensures that the expanded area meets the needs of actual scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115311675B_ABST
    Figure CN115311675B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, electronic device, and storage medium for determining the expansion area of ​​a component. The method includes: acquiring an image of an architectural drawing; identifying a target component in the drawing that needs to be expanded from the image; identifying a target reference component in the image that matches the target component according to a pre-set first mapping relationship between the component and a reference component; determining the expansion direction of the target component based on the target reference component; and determining the expansion area of ​​the target component according to a preset expansion distance and direction. This embodiment, by first determining the expansion direction of the target component and then determining the expansion area according to the preset expansion distance and direction, requires less work compared to the traditional method of expanding the component outwards as a whole based on its outline. It also avoids the problem that using the traditional method of expanding the entire component outwards in the expansion direction can lead to results that do not meet the needs of actual scenarios when judging component intersections or overlaps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, electronic device and storage medium for determining the outer expansion area of ​​a component. Background Technology

[0002] When components in CAD architectural drawings are processed together (such as determining intersections and overlaps), the process essentially involves converting the CAD drawings into geometric data. This means transforming the coordinate data on the drawing into geometric data such as point sets, line types, and polygons. Components such as doors, windows, walls, or spaces are polygonal outlines composed of point sets.

[0003] When processing components (such as determining intersections and overlaps), due to errors in image pixel recognition or scene requirements, it is sometimes necessary to perform data expansion processing on the component outlines. Traditional expansion geometry algorithms are based on the overall expansion of polygonal outlines outwards, which cannot meet the processing requirements of corresponding rectangular building components such as doorways, elevators, air conditioners, parking spaces, or washing machines. For example, elevator expansion is used to determine whether the anteroom space in front of the elevator can accommodate a 2.4-meter space. Therefore, the elevator rectangle needs to be expanded outwards by 2.4 meters towards the anteroom to obtain the expansion area and determine whether it intersects with other components (such as walls). However, the traditional geometry algorithm expands the elevator rectangle outline outwards as a whole to obtain the expansion area and determines whether it intersects with other components. In reality, there are components such as electrical distribution rooms on other sides besides the elevator door side. These electrical distribution room components are reasonable to be included in the overall expansion area of ​​the elevator rectangle outline. Therefore, processing components according to the traditional geometry algorithm not only increases the workload but also does not meet the actual scene requirements. Summary of the Invention

[0004] This application provides a method, apparatus, electronic device, and storage medium for determining the outer expansion area of ​​a component, in order to solve the problems in the prior art where, when rectangular components need to be processed and operated on each other, the method for obtaining the outer expansion area of ​​the component is labor-intensive and the outer expansion area does not meet the needs of the actual scenario.

[0005] In a first aspect, embodiments of this application provide a method for determining the outer expansion region of a component, including:

[0006] Obtain images of architectural drawings;

[0007] Identify the target component in the architectural drawings that currently needs to be expanded from the image;

[0008] According to a pre-set first mapping relationship between components and reference components, identify the target reference component in the image that matches the target component;

[0009] Based on the target reference component, determine the outward expansion direction of the target component;

[0010] The expansion area of ​​the target component is determined according to the preset expansion distance and the expansion direction.

[0011] Optionally, determining the outward expansion direction of the target component based on the target reference component includes:

[0012] Using the target reference component, the second mapping relationship between the pre-set reference component and the outward expansion direction is queried to obtain the target outward expansion direction corresponding to the target reference component;

[0013] The outward expansion direction of the target is taken as the outward expansion direction of the target component.

[0014] Optionally, determining the outward expansion direction of the target component based on the target reference component includes:

[0015] When both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the X-axis direction.

[0016] When the target reference component is parallel to the target component, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the Y-axis direction in the image coordinate system.

[0017] Optionally, determining the outward expansion direction based on the X-axis direction includes:

[0018] Obtain the first contour coordinates of the target reference component in the image coordinate system, and the second contour coordinates of the target component in the image coordinate system;

[0019] A first coordinate value for the first contour coordinate in the X-axis direction is determined based on the first contour coordinate, and a second coordinate value for the second contour coordinate in the X-axis direction is determined based on the second contour coordinate.

[0020] The first coordinate value and the second coordinate value are compared. If the first coordinate value is greater than the second coordinate value, the outward expansion direction is determined to be the negative direction of the X-axis direction. If the first coordinate value is less than the second coordinate value, the outward expansion direction is determined to be the positive direction of the X-axis direction.

[0021] Optionally, determining the outward expansion direction based on the Y-axis direction in the image coordinate system includes:

[0022] Obtain the third contour coordinates of the target reference component in the image coordinate system, and the fourth contour coordinates of the target component in the image coordinate system;

[0023] The third coordinate value of the third contour coordinate in the Y-axis direction is determined based on the third contour coordinate, and the fourth coordinate value of the fourth contour coordinate in the Y-axis direction is determined based on the fourth contour coordinate;

[0024] The third coordinate value and the fourth coordinate value are compared. If the third coordinate value is greater than the fourth coordinate value, the outward expansion direction is determined to be the negative direction of the Y-axis. If the third coordinate value is less than the fourth coordinate value, the outward expansion direction is determined to be the positive direction of the Y-axis.

[0025] Optionally, determining the expansion region of the target component according to the preset expansion distance and the expansion direction includes:

[0026] When the outward expansion direction is the X-axis direction in the image coordinate system, the target component is expanded by the outward expansion distance in the outward expansion direction to obtain a first region, and the first region is used as the outward expansion region of the target component;

[0027] When the outward expansion direction is the Y-axis direction in the image coordinate system, the angle formed by the target component and the image coordinate system is determined; and the actual outward expansion distance is obtained based on the angle and the outward expansion distance; the target component is expanded by the actual outward expansion distance in the outward expansion direction to obtain a second region, and the second region is used as the outward expansion region of the target component.

[0028] Optionally, determining the outward expansion direction of the target component based on the target reference component includes:

[0029] Determine whether the target component is a rectangular component;

[0030] When the target component is the rectangular component, the outward expansion direction of the target component is determined based on the target component.

[0031] Secondly, embodiments of this application provide an apparatus for determining the outward expansion region of a component, comprising:

[0032] The acquisition module is used to acquire images of architectural drawings;

[0033] The first identification module is used to identify the target component that needs to be expanded outward in the architectural drawings from the image;

[0034] The second recognition module is used to recognize the target reference component in the image that matches the target component according to a pre-set first mapping relationship between the component and the reference component;

[0035] The first determining module is used to determine the outward expansion direction of the target component based on the target reference component;

[0036] The second determining module is used to determine the expansion area of ​​the target component according to the preset expansion distance and the expansion direction.

[0037] Thirdly, embodiments of this application provide an electronic device, including:

[0038] The processor, memory, and communication bus are used to communicate with each other.

[0039] The memory is used to store computer programs;

[0040] The processor is configured to execute the program stored in the memory to implement the method for determining the outer expansion region of the component as described in the first aspect.

[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that implements the method for determining the outer expansion region of a component as described in the first aspect.

[0042] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application acquires an image of an architectural drawing, identifies the target component that needs to be expanded outward from the image, identifies a target reference component that matches the target component in the image according to a pre-set first mapping relationship between the component and the reference component, determines the outward expansion direction of the target component based on the target reference component, and determines the outward expansion area of ​​the target component according to a preset outward expansion distance and direction. This embodiment, by first determining the outward expansion direction of the target component and then determining the outward expansion area of ​​the target component according to a preset outward expansion distance and direction, has a smaller workload compared with the traditional method of expanding the component outward as a whole based on the component outline. It also avoids the problem that the results obtained from judging the intersection or overlap of components due to the use of the traditional outward expansion direction to expand the component as a whole do not meet the needs of the actual scenario. Attached Figure Description

[0043] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0045] Figure 1 This is an architecture diagram of the network system in the embodiments of this application;

[0046] Figure 2This is a flowchart illustrating a method for determining the outer expansion region of a component according to an embodiment of this application;

[0047] Figure 3 This is a schematic diagram illustrating the determination of the outer expansion area of ​​a parking space in an embodiment of this application;

[0048] Figure 4 This is a schematic diagram illustrating the determination of the elevator's external expansion area in an embodiment of this application;

[0049] Figure 5 This is a schematic diagram illustrating the determination of the outer expansion area of ​​a drum washing machine in an embodiment of this application;

[0050] Figure 6 This is a schematic diagram of the structure of a device for determining the outer expansion region of a component in an embodiment of this application;

[0051] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0053] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0054] First, we will introduce the network system architecture that the solution of this application embodiment may be applied to.

[0055] Please see Figure 1 , Figure 1 An architecture diagram of a network system provided in this application embodiment, such as Figure 1 As shown, the network system includes a terminal 101, a drawing review server 102, and a database 103.

[0056] The network system is connected via wired or wireless networks, such as virtual private networks, local area networks, wide area networks, or metropolitan area networks, and the specific communication transmission protocol is not limited.

[0057] Terminal 101 can be used to submit a component identification request to the drawing review server 102 via program code or touch signal, thereby requesting the drawing review server 102 to perform the relevant steps of component identification.

[0058] As the execution entity, the drawing review server 102 can be the backend server of the intelligent drawing review platform in some embodiments. The intelligent drawing review platform automatically reviews architectural drawings by standardizing the review standards for architectural design drawings in the architectural industry. Component recognition is one of the processes in the architectural drawing review. The drawing review server 102 uses a processor to execute program code to process a series of spatial classification models and component classification models, such as building a convolutional neural network and generating a small set of drawings for training from the input sample architectural drawings, etc.

[0059] Database 103 can be used to store information such as sample architectural drawings, small drawing sets, training results, test results, spatial classification results, and component classification results. Developers can extract the required information from database 103 by entering conditional query statements through the terminal, such as extracting spatial classification results or component classification results. This database 103 can be a local database, such as Vanke's VanBu database, or a third-party database independent of the drawing review server 102, such as the databases of some design institutes, or it can also be a cloud database.

[0060] It should be understood that the terminal 101 in this embodiment can be a desktop computer, tablet computer, supercomputer or other devices; the drawing review server 102 can be a local server, a cloud server or a server cluster.

[0061] It should be understood that Figure 1 The network system architecture shown is just one example, and it can include many other components such as routers and switches.

[0062] based on Figure 1 The network system architecture shown below, in conjunction with the relevant accompanying drawings, details the method for determining the outer expansion area of ​​components proposed in this application. Please refer to the attached drawings. Figure 2 , Figure 2 A flowchart illustrating a method for determining the outer expansion region of a component, as provided in an embodiment of this application, is shown below. Figure 2 As shown, it includes the following steps:

[0063] Step 201: Obtain the image of the architectural drawings.

[0064] In this embodiment, the architectural drawings can be CAD drawings or other formats of two-dimensional architectural drawings, which are pre-stored by the user in database 103 for direct retrieval when needed.

[0065] In this embodiment, the drawing review server 101 retrieves architectural drawings from the database 103 based on a first signal triggered by a first external input device, and performs an image printing operation on the retrieved architectural drawings based on a second signal triggered by a second external input device, so as to obtain a drawing image corresponding to the architectural drawings.

[0066] Example: The first external input device or the second external input device includes, but is not limited to, a mouse, a keypad, or a touchpad.

[0067] It should be understood that the first external input device and the second external input device can be the same type of input device or different types of input devices. This embodiment does not specifically limit this.

[0068] It should be understood that when the drawing review server 102 performs an image printing operation on architectural drawings, it is actually a process of converting the format of the architectural drawings, that is, converting the architectural drawings from a drawing format to an image format. Taking the architectural drawings as CAD drawings and the image format as JPEG as an example, performing an image printing operation on architectural drawings is actually converting the architectural drawings from dwg format to JPEG format.

[0069] Step 202: Identify the target component that needs to be expanded from the architectural drawings in the image.

[0070] In a specific embodiment, the image is input into a pre-trained component classification model to identify different components in the image, and then the target component that needs to be expanded is identified from the different components.

[0071] In practical applications, the corresponding components include doorways, elevators, air conditioners, parking spaces, washing machines, etc. Among them, the elevator extension is used to determine whether the anteroom space in front of the elevator can meet the 2.4m accommodation space; the parking space extension is used to determine that fire hydrants should not affect the opening of the car door of the vehicle located in the parking space; the washing machine extension is used to determine that the washing machine door is not affected by other components when fully opened.

[0072] Step 203: Identify the target reference component in the image that matches the target component according to the pre-set mapping relationship between the component and the reference component.

[0073] It should be understood that the mapping relationship between components and reference components is used to bind the correspondence between the two, so that when a target component is identified, the corresponding target reference component can be queried based on the mapping relationship.

[0074] In practical applications, the corresponding components include doorways, elevators, air conditioners, parking spaces, washing machines, etc. When the target component is a parking space, the fire hydrant on the side of the parking space is the target reference component of the parking space.

[0075] It should be understood that the target reference component for the parking space can also be other components on the side of the parking space (such as a wall), and this embodiment does not limit the specific target reference component.

[0076] Step 204: Determine the outward expansion direction of the target component based on the target reference component.

[0077] It should be understood that when determining the outward expansion direction of the target component, it is necessary to judge whether the target component is a rectangular component. If the target component is a rectangular component, the outward expansion direction of the target component is determined based on the target component.

[0078] It should be understood that when the target component is an irregular polygon, there is no concept of direction. Therefore, when the target component is a rectangular component, the outward expansion direction of the target component can be determined.

[0079] In this embodiment, when determining the outward expansion direction of a component, it is determined whether the target component is a rectangular component. When the target component is a rectangular component, the outward expansion direction of the target component is determined based on the target component, which avoids the use of traditional outward expansion direction integral outward expansion components, and the workload during outward expansion is smaller.

[0080] In a specific embodiment, based on the target reference component, the outward expansion direction of the target component can be determined in the following manner.

[0081] The first method involves using a target reference component, querying the second mapping relationship between the pre-set reference component and the outward expansion direction, obtaining the target outward expansion direction corresponding to the target reference component, and using the target outward expansion direction as the outward expansion direction of the target component.

[0082] It should be understood that the second mapping relationship between the reference component and the outward expansion direction is used to obtain the target outward expansion direction corresponding to the target reference component, so that when the target reference component is identified, the outward expansion direction of the target component can be determined.

[0083] In practical implementation, when the target component is a drum washing machine, the drum washing machine is placed against the wall. The outward expansion direction of the drum washing machine is the opposite direction of the wall and the two sides of the drum washing machine perpendicular to the wall. The outward expansion in the opposite direction of the wall avoids the drum washing machine door being affected by other components when opening, and the outward expansion in the two sides provides enough area to place clothes and daily chemical products.

[0084] In this embodiment, by querying the second mapping relationship between the pre-set reference component and the outward expansion direction, the outward expansion direction of the target component can be quickly determined based on the target reference component.

[0085] The second method involves determining the positional relationship between the target reference component and the target component and the X-axis in the image coordinate system. When both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the X-axis direction. When the target reference component and the target component are parallel, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the Y-axis direction in the image coordinate system.

[0086] In a specific embodiment, determining the outward expansion direction based on the X-axis direction can be achieved by obtaining the first contour coordinates of the target reference component in the image coordinate system and the second contour coordinates of the target component in the image coordinate system, determining the first coordinate value of the first contour coordinate in the X-axis direction based on the first contour coordinates, and determining the second coordinate value of the second contour coordinate in the X-axis direction based on the second contour coordinates, comparing the first coordinate value and the second coordinate value, and determining the outward expansion direction as the negative direction of the X-axis direction when the first coordinate value is greater than the second coordinate value, and determining the outward expansion direction as the positive direction of the X-axis direction when the first coordinate value is less than the second coordinate value.

[0087] In practice, the target component and the target reference component do not overlap, meaning that the target component and the target reference component do not have the same coordinates in the image coordinate system.

[0088] It should be understood that the first contour coordinate of the target reference component in the image coordinate system can be any coordinate point on the target reference component, and the second contour coordinate of the target component in the image coordinate system can be any coordinate point on the target component.

[0089] It should be understood that the first contour coordinate can also be the center point of the target reference component, and the second contour coordinate can also be the center point of the target component.

[0090] It should be understood that the first coordinate value of the first contour coordinate in the X-axis direction is determined based on the first contour coordinate, and the second coordinate value of the second contour coordinate in the X-axis direction is determined based on the second contour coordinate, and the second coordinate value of the second contour coordinate in the X-axis direction is determined based on the second contour coordinate.

[0091] In a specific embodiment, the outward expansion direction can be determined based on the Y-axis direction in the image coordinate system by obtaining the third contour coordinates of the target reference component in the image coordinate system and the fourth contour coordinates of the target component in the image coordinate system, determining the third coordinate value of the third contour coordinate in the Y-axis direction based on the third contour coordinates, and determining the fourth coordinate value of the fourth contour coordinate in the Y-axis direction based on the fourth contour coordinates; comparing the third coordinate value and the fourth coordinate value, if the third coordinate value is greater than the fourth coordinate value, the outward expansion direction is determined to be the negative direction of the Y-axis direction, and if the third coordinate value is less than the fourth coordinate value, the outward expansion direction is determined to be the positive direction of the Y-axis direction.

[0092] It should be understood that the third contour coordinate of the target reference component in the image coordinate system is the center point of the target reference component, and the fourth contour coordinate of the target component in the image coordinate system is the center point of the target reference component.

[0093] It should be understood that the X-value of the center point coordinate of the target reference component in the graphic coordinate system is equal to the X-value of the center point coordinate of the target component in the graphic coordinate system.

[0094] It should be understood that the third coordinate value in the Y-axis direction is determined based on the third contour coordinate, and the fourth coordinate value in the Y-axis direction is determined based on the fourth contour coordinate, and the fourth coordinate value in the Y-axis direction is determined based on the fourth contour coordinate, and the fourth contour coordinate is determined based on the fourth contour coordinate.

[0095] In this embodiment, by determining the positional relationship between the target reference component and the target component and the X-axis in the image coordinate system, when both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined to be the X-axis direction; when neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined to be the Y-axis direction. Furthermore, by determining the contour coordinates of the target reference component and the target component and the magnitude of the corresponding coordinate values, the outward expansion direction of the target component is accurately determined.

[0096] Step 205: Determine the expansion area of ​​the target component according to the preset expansion distance and expansion direction.

[0097] In a specific embodiment, when the outward expansion direction is the X-axis direction in the image coordinate system, the target component is expanded outward by an outward distance in the outward expansion direction to obtain a first region, and the first region is used as the outward expansion region of the target component.

[0098] It should be understood that when the outward expansion direction is the X-axis direction in the image coordinate system, both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, and therefore the target reference component and the target component are square rectangles in the image coordinate system.

[0099] It should be understood that when the target component is a square rectangle and the outward expansion direction is the X-axis direction in the image coordinate system, the coordinates of the four outward expansion points (s1, s2, s3, and s4) of the target component in the image coordinate system are obtained. When the outward expansion direction is the positive direction of the X-axis, the coordinates of the two outward expansion points with larger X values ​​(s1 and s2) are determined. The outward expansion length is directly added to the X values ​​of the two outward expansion point coordinates, while the Y value remains unchanged, to obtain the coordinates of the two endpoints of the outward expansion area (S1 and S2). The area constructed based on the coordinates of the two outward expansion points and the coordinates of the two endpoints (s1, s2, S1, and S2) is the outward expansion area of ​​the target component. When the outward expansion direction is the negative direction of the X-axis, determine the coordinates of the two outward expansion points (s3 and s4) with smaller X values ​​among the four outward expansion point coordinates. Directly subtract the outward expansion length from the X values ​​of the two outward expansion point coordinates, while keeping the Y value unchanged, to obtain the coordinates of the two endpoints of the outward expansion area (S3 and S4). The area constructed based on the coordinates of the two outward expansion points and the coordinates of the two endpoints (s3, s4, S3 and S4) is the outward expansion area of ​​the target component.

[0100] It should be understood that the expansion point is located on the long side or the extension line of the long side of the target component.

[0101] To make it easier to understand, here's an example: in an image, the four quadrants are divided into top, bottom, left, and right, such as... Figure 3 As shown, based on the actual situation, when a car is parked in a parking space, the area where the car door can move is 1400mm away from the short side of the parking space. Therefore, when determining the outer extension area of ​​the parking space, four points 1400mm away from the short side of the long side of the parking space are designated as the outer extension points, namely s1, s2, s3, and s4. The outer extension of the parking space is determined by extending 300mm outward from one side of the long side of the parking space. It is determined whether it intersects with fire hydrants or other components (such as walls). Therefore, the seat area of ​​the vehicle parked in the parking space can be used as the target reference component. The direction of the outer extension point on the long side to the left of the target reference component is the negative direction of the X-axis. The X-value of the coordinates of the left outer extension point (s3 and s4) is subtracted from the outer extension length, while the Y-value remains unchanged, to obtain the coordinates of the two endpoints of the outer extension area (S3 and S4). The area A constructed based on the coordinates (s3, s4, S3 and S4) is the outer extension area on the left side of the parking space. The outward expansion point located on the long side to the right of the target reference component expands in the positive direction of the X-axis. Similarly, based on the above method, region B, constructed based on coordinates (s1, s2, S1, and S2), is the outward expansion area to the right of the parking space. Regions A and B are used as the outward expansion areas of the parking space.

[0102] In a specific embodiment, when the outward expansion direction is the Y-axis direction in the image coordinate system, the angle formed by the target component and the image coordinate system is determined; and the actual outward expansion distance is obtained based on the angle and the outward expansion distance. The target component is expanded by the actual outward expansion distance in the outward expansion direction to obtain a second region, and the second region is used as the outward expansion region of the target component.

[0103] It should be understood that when the outward expansion direction is the Y-axis direction in the image coordinate system, the target reference component is parallel to the target component, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system. In this case, the target component and the target reference component in the image coordinate system are tilted rectangles, or both the target reference component and the target component are parallel to the X-axis in the image coordinate system.

[0104] In a specific embodiment, when the target component is an inclined rectangle and the outward expansion direction is the Y-axis direction, the angle α between any long side of the target component and the X-axis in the coordinate system can be determined. Based on the angle α and the outward expansion distance s, the actual outward expansion distance S = s / |cos α| can be determined, and the coordinates of the four endpoints of the target component in the image coordinate system can be obtained, thereby determining the coordinates of the endpoints of the two long sides of the target component.

[0105] In a specific implementation, the included angle between any side of the target component and any coordinate axis in the image coordinate system can be determined. This embodiment does not impose any specific limitations.

[0106] It should be understood that by determining different angles between different sides of the target component and any coordinate axis, angle conversion can be performed to determine the actual outward expansion distance, or the corresponding trigonometric function can be selected based on the results of different angles to determine the actual outward expansion distance.

[0107] It should be understood that when the expansion direction is the positive direction of the Y-axis, the coordinates of the two expansion points (m1 and m2) on the side with the larger Y-value among the four expansion points on the two long sides of the target component are determined. The actual expansion distance is added to the Y-values ​​of these two expansion points, while the X-value remains unchanged, to obtain the coordinates of the two endpoints of the expansion area (M1 and M2). The area of ​​the component based on these two expansion point coordinates and the two endpoint coordinates (m1, m2, M3, and M4) is the expansion area of ​​the target component. When the expansion direction is the negative direction of the Y-axis, the coordinates of the two expansion points (m3 and m4) on the side with the smaller Y-value among the two long sides of the target component are determined. The actual expansion distance is subtracted from the Y-values ​​of these two expansion points, while the X-value remains unchanged, to obtain the coordinates of the two endpoints of the expansion area (M3 and M4). The area of ​​the component based on these two expansion point coordinates and the two endpoint coordinates (m3, m4, M3, M4) is the expansion area of ​​the target component.

[0108] In a specific embodiment, when the target component is parallel to the X-axis in the image coordinate system, the angle between any long side of the target component and the X-axis in the image coordinate system is 180°. According to the preset trigonometric function relationship S=s / |cos 180°|, the actual outward expansion distance is the preset outward expansion distance. The calculation of the outward expansion area of ​​the target component is the same as the method of calculating the outward expansion area when the target component is an inclined rectangle. In this embodiment, the repeated parts will not be described again.

[0109] To make it easier to understand, here's an example: in an image, the four quadrants are divided into top, bottom, left, and right, such as... Figure 4 As shown, the outward expansion of the elevator door is used to determine whether the vestibule space in front of the elevator door can meet the 2400mm accommodation space. Therefore, when determining the outward expansion area of ​​the elevator door, the elevator car can be used as the target reference component of the elevator door. In the figure, the elevator door is located below the elevator car, so the outward expansion direction is downward, that is, in the opposite direction of the Y-axis in the image. Then, determine the coordinates of the two outward expansion points on the side with the smaller Y value among the two long sides of the elevator door, i.e., the outward expansion point coordinates. The method for obtaining the outward expansion point coordinates can be based on the outward expansion length and the long side of the elevator door, such as... Figure 4 As shown in (1), if the outward expansion length is greater than the length of the long side of the elevator door, then expand the elevator door to the left and right by the same distance L to find the coordinates of two outward expansion points (m3-1 and m4-1). Based on the Y value of the coordinates of m3-1 and m4-1, subtract the actual outward expansion distance of 2400mm, and keep the X value unchanged to obtain the coordinates of the two endpoints of the outward expansion area (M3-1 and M4-1). Based on the coordinates (m3-1, m4-1, M3-1 and M4-1), determine that the outward expansion area A is the outward expansion area of ​​the elevator door.

[0110] It should be understood that another situation exists in this embodiment, such as... Figure 4 As shown in (2), the outward expansion length is greater than the length of the long side of the elevator door. The long side of the elevator door with the smaller Y value expands to the left and right by the same distance L. There is an overlap between the left or right side and other components. Then, the length from the starting point of the overlap to the endpoint of the line segment on the overlapping side is superimposed on the other side to determine the coordinates of the outward expansion point (m3-2 and m4-2). Based on the above method, the coordinates of the two endpoints of the outward expansion area (M3-2 and M4-2) are obtained. Based on the coordinates (m3-2, m4-2, M3-2 and M4-2), the outward expansion area B is determined to be the outward expansion area of ​​the elevator door.

[0111] like Figure 5 As shown in the diagram, this embodiment provides an expansion area diagram of a drum washing machine. The image is divided into four quadrants: top, bottom, left, and right. The drum washing machine is placed against a wall, and the area below it is defined as the expansion direction of the washing machine: left, right, and top. The top expansion is to prevent the washing machine door from being affected by other components when opening, while the left and right expansion provides sufficient space for clothes and daily necessities. Therefore, the area C where the drum washing machine expands to the left, right, and top is defined as the expansion area of ​​the drum washing machine.

[0112] In this embodiment, an image of an architectural drawing is acquired, and the target component that needs to be expanded outward in the drawing is identified from the image. According to a pre-set first mapping relationship between components and reference components, a target reference component matching the target component is identified in the image. Based on the target reference component, the outward expansion direction of the target component is determined. The outward expansion area of ​​the target component is determined according to a preset outward expansion distance and direction. This embodiment, by first determining the outward expansion direction of the target component and then determining the outward expansion area according to the preset outward expansion distance and direction, requires less work compared to the traditional method of expanding the component outwards as a whole based on its outline. It also avoids the problem that using the traditional outward expansion direction to expand the component as a whole can leads to results that do not meet the needs of the actual scenario when judging component intersections or overlaps.

[0113] Based on the same concept, this application provides a device for determining the outer expansion region of a component. The specific implementation of this device can be found in the description of the method embodiments section; repeated details will not be repeated here. Figure 6 As shown, the device mainly includes:

[0114] The acquisition module 601 is used to acquire images of architectural drawings.

[0115] The first identification module 602 is used to identify the target component that needs to be expanded from the architectural drawings in the image.

[0116] The second recognition module 603 is used to recognize the target reference component in the image that matches the target component according to the first mapping relationship between the component and the reference component set in advance.

[0117] The first determining module 604 is used to determine the outward expansion direction of the target component based on the target reference component.

[0118] The second determining module 605 is used to determine the expansion area of ​​the target component according to the preset expansion distance and expansion direction.

[0119] In one specific embodiment, the first determining module 604 is used to:

[0120] Using a target reference component, query the second mapping relationship between the pre-set reference component and the outward expansion direction to obtain the target outward expansion direction corresponding to the target reference component; and use the target outward expansion direction as the outward expansion direction of the target component.

[0121] In one specific embodiment, the first determining module 604 is used to:

[0122] When both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the X-axis direction; when the target reference component is parallel to the target component, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the Y-axis direction in the image coordinate system.

[0123] In one specific embodiment, the first determining module 604 is used to:

[0124] Obtain the first contour coordinates of the target reference component in the image coordinate system, and the second contour coordinates of the target component in the image coordinate system; determine the first coordinate value of the first contour coordinate in the X-axis direction based on the first contour coordinate, and determine the second coordinate value of the second contour coordinate in the X-axis direction based on the second contour coordinate; compare the first coordinate value and the second coordinate value, and if the first coordinate value is greater than the second coordinate value, determine the outward expansion direction as the negative direction of the X-axis direction, and if the first coordinate value is less than the second coordinate value, determine the outward expansion direction as the positive direction of the X-axis direction.

[0125] In one specific embodiment, the first determining module 604 is used to:

[0126] Obtain the third contour coordinates of the target reference component in the image coordinate system, and the fourth contour coordinates of the target component in the image coordinate system; determine the third coordinate value of the third contour coordinate in the Y-axis direction based on the third contour coordinates, and determine the fourth coordinate value of the fourth contour coordinate in the Y-axis direction based on the fourth contour coordinates; compare the third coordinate value and the fourth coordinate value, and if the third coordinate value is greater than the fourth coordinate value, determine the outward expansion direction as the negative direction of the Y-axis direction, and if the third coordinate value is less than the fourth coordinate value, determine the outward expansion direction as the positive direction of the Y-axis direction.

[0127] In one specific embodiment, the second determining module 605 is used to:

[0128] When the expansion direction is the X-axis direction in the image coordinate system, the target component is expanded by an expansion distance in the expansion direction to obtain a first region, and the first region is used as the expansion region of the target component; when the expansion direction is the Y-axis direction in the image coordinate system, the angle formed between the target component and the image coordinate system is determined; and the actual expansion distance is obtained based on the angle and the expansion distance; the target component is expanded by the actual expansion distance in the expansion direction to obtain a second region, and the second region is used as the expansion region of the target component.

[0129] In one specific embodiment, the first determining module 604 is used to:

[0130] Determine whether the target component is a rectangular component. If the target component is a rectangular component, determine the outward expansion direction of the target component based on the target component.

[0131] Based on the same concept, this application also provides an electronic device, such as... Figure 7As shown, the electronic device mainly includes a processor 701, a memory 702, and a communication bus 703. The processor 701 and the memory 702 communicate with each other via the communication bus 703. The memory 702 stores programs that can be executed by the processor 701. The processor 701 executes the programs stored in the memory 702 to perform the following steps:

[0132] The system acquires images of architectural drawings, identifies the target components that need to be expanded from the architectural drawings, identifies the target reference components that match the target components in the image according to the pre-set first mapping relationship between components and reference components, determines the expansion direction of the target components based on the target reference components, and determines the expansion area of ​​the target components according to the preset expansion distance and expansion direction.

[0133] The communication bus 703 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 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.

[0134] The memory 702 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor 701.

[0135] The processor 701 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., or 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, or discrete hardware components.

[0136] In another embodiment of this application, a computer-readable storage medium is provided, which stores a computer program that, when run on a computer, causes the computer to perform a method for determining the outer expansion region of a component as described in the above embodiments.

[0137] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. 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, for example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.

[0138] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0139] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the 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 invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for determining the outer expansion region of a component, characterized in that, include: Obtain images of architectural drawings; Identify the target component in the architectural drawings that currently needs to be expanded from the image; According to a pre-set first mapping relationship between components and reference components, identify the target reference component in the image that matches the target component; Based on the target reference component, determine the outward expansion direction of the target component; The expansion area of ​​the target component is determined according to the preset expansion distance and the expansion direction; Determining the outward expansion direction of the target component includes: When both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the X-axis direction. When the target reference component is parallel to the target component, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the Y-axis direction in the image coordinate system. Determining the outward expansion direction based on the X-axis direction includes: Obtain the first contour coordinates of the target reference component in the image coordinate system, and the second contour coordinates of the target component in the image coordinate system; A first coordinate value for the first contour coordinate in the X-axis direction is determined based on the first contour coordinate, and a second coordinate value for the second contour coordinate in the X-axis direction is determined based on the second contour coordinate. The first coordinate value and the second coordinate value are compared. If the first coordinate value is greater than the second coordinate value, the outward expansion direction is determined to be the negative direction of the X-axis direction. If the first coordinate value is less than the second coordinate value, the outward expansion direction is determined to be the positive direction of the X-axis direction. Determining the outward expansion direction based on the Y-axis direction in the image coordinate system includes: Obtain the third contour coordinates of the target reference component in the image coordinate system, and the fourth contour coordinates of the target component in the image coordinate system; The third coordinate value of the third contour coordinate in the Y-axis direction is determined based on the third contour coordinate, and the fourth coordinate value of the fourth contour coordinate in the Y-axis direction is determined based on the fourth contour coordinate; The third coordinate value and the fourth coordinate value are compared. If the third coordinate value is greater than the fourth coordinate value, the outward expansion direction is determined to be the negative direction of the Y-axis. If the third coordinate value is less than the fourth coordinate value, the outward expansion direction is determined to be the positive direction of the Y-axis. Determining the expansion area of ​​the target component according to the preset expansion distance and the expansion direction includes: When the outward expansion direction is the X-axis direction in the image coordinate system, the target component is expanded by the outward expansion distance in the outward expansion direction to obtain a first region, and the first region is used as the outward expansion region of the target component; When the outward expansion direction is the Y-axis direction in the image coordinate system, the angle formed by the target component and the image coordinate system is determined; and the actual outward expansion distance is obtained based on the angle and the outward expansion distance; the target component is expanded by the actual outward expansion distance in the outward expansion direction to obtain a second region, and the second region is used as the outward expansion region of the target component.

2. The method according to claim 1, characterized in that, Based on the target reference component, determining the outward expansion direction of the target component includes: Using the target reference component, the second mapping relationship between the pre-set reference component and the outward expansion direction is queried to obtain the target outward expansion direction corresponding to the target reference component; The outward expansion direction of the target is taken as the outward expansion direction of the target component.

3. The method according to claim 1, characterized in that, Based on the target reference component, determining the outward expansion direction of the target component includes: Determine whether the target component is a rectangular component; When the target component is the rectangular component, the outward expansion direction of the target component is determined based on the target component.

4. A device for determining the outer expansion region of a component, characterized in that, include: The acquisition module is used to acquire images of architectural drawings; The first identification module is used to identify the target component that needs to be expanded outward in the architectural drawings from the image; The second recognition module is used to recognize the target reference component in the image that matches the target component according to a pre-set first mapping relationship between the component and the reference component; The first determining module is used to determine the outward expansion direction of the target component based on the target reference component; The second determining module is used to determine the expansion area of ​​the target component according to the preset expansion distance and the expansion direction; Determining the outward expansion direction of the target component includes: When both the target reference component and the target component are perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the X-axis direction. When the target reference component is parallel to the target component, and neither the target reference component nor the target component is perpendicular to the X-axis in the image coordinate system, the outward expansion direction is determined based on the Y-axis direction in the image coordinate system. Determining the outward expansion direction based on the X-axis direction includes: Obtain the first contour coordinates of the target reference component in the image coordinate system, and the second contour coordinates of the target component in the image coordinate system; A first coordinate value for the first contour coordinate in the X-axis direction is determined based on the first contour coordinate, and a second coordinate value for the second contour coordinate in the X-axis direction is determined based on the second contour coordinate. The first coordinate value and the second coordinate value are compared. If the first coordinate value is greater than the second coordinate value, the outward expansion direction is determined to be the negative direction of the X-axis direction. If the first coordinate value is less than the second coordinate value, the outward expansion direction is determined to be the positive direction of the X-axis direction. Determining the outward expansion direction based on the Y-axis direction in the image coordinate system includes: Obtain the third contour coordinates of the target reference component in the image coordinate system, and the fourth contour coordinates of the target component in the image coordinate system; The third coordinate value of the third contour coordinate in the Y-axis direction is determined based on the third contour coordinate, and the fourth coordinate value of the fourth contour coordinate in the Y-axis direction is determined based on the fourth contour coordinate; The third coordinate value and the fourth coordinate value are compared. If the third coordinate value is greater than the fourth coordinate value, the outward expansion direction is determined to be the negative direction of the Y-axis. If the third coordinate value is less than the fourth coordinate value, the outward expansion direction is determined to be the positive direction of the Y-axis. Determining the expansion area of ​​the target component according to the preset expansion distance and the expansion direction includes: When the outward expansion direction is the X-axis direction in the image coordinate system, the target component is expanded by the outward expansion distance in the outward expansion direction to obtain a first region, and the first region is used as the outward expansion region of the target component; When the outward expansion direction is the Y-axis direction in the image coordinate system, the angle formed by the target component and the image coordinate system is determined; and the actual outward expansion distance is obtained based on the angle and the outward expansion distance; the target component is expanded by the actual outward expansion distance in the outward expansion direction to obtain a second region, and the second region is used as the outward expansion region of the target component.

5. An electronic device, characterized in that, include: The processor, memory, and communication bus are used to communicate with each other. The memory is used to store computer programs; The processor is configured to execute the program stored in the memory to implement the method for determining the outer expansion region of a component as described in any one of claims 1-3.

6. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for determining the outer expansion region of a component as described in any one of claims 1-3.

Citation Information

Patent Citations

  • Automatic drawing method for wall-mounted component of CAD electrical construction plan

    CN113971709A