An automatic extraction method, system and device for building drawing walls and doors and windows based on pixel feature and axis fusion and a storage medium

CN122990738APending Publication Date: 2026-10-27GUIZHOU CONSTR SCI RES & DESIGN INST OF CSCEC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610769678.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-01
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

然而,该类方法严重依赖边缘算子,当图纸中存在大量噪点、文字标注或阴影时,算子极易提取出“伪墙体”;且强制矫正逻辑无法解决线段断裂问题

Benefits of technology

[0016]本发明的有益效果:本发明直接面向建筑图纸矢量化过程中的工程痛点,在实际落地中显著提升了自动化处理精度与建模效率。针对传统人工描摹方式效率低下、易引入人为误差的问题,本发明实现了从光栅图纸到结构化矢量数据的全自动转换,大幅减少设计师的手工修正工作量。针对现有边缘检测算法易受图纸中家具图块、尺寸标注、阴影等无关黑色像素干扰而提取出“伪墙体”的缺陷,本发明采用轴线强约束空间过滤,将墙体候选点严格限定在建筑轴线容差范围内,从而有效剔除非墙体噪点,使提取出的墙面线段真实反映实际建筑结构,避免了后续建模中的错误墙体清理工作。针对常规矢量化算法因线条断裂、像素模糊导致墙体线段不闭合、不连贯的问题,本发明基于四向特征像素密度统计进行连通性智能判定,能够从局部像素分布中推导出完整墙面线段,即使原始图纸存在扫描噪点或轻微断裂,也能生成连续、正交、闭合的墙体轮廓,直接满足CAD重建和BIM三维拉伸建模的输入要求。针对门窗识别坐标因图像形变或绘制误差偏离墙体轴线、导致三维模型中门窗悬空或错位的问题,本发明采用一维坐标最小距离自适应吸附算法,将门窗构件精确对齐至最近的墙体轴线上,保证门窗与墙体的贴合关系正确无误。整体上,本发明输出的矢量数据高度结构化,无需人工修线或坐标校正,可直接用于建筑数字化存档、室内设计施工图生成、老旧小区改造逆向建模等实际工程场景,显著提升从图纸到模型的数据流转效率与准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990738A_ABST
    Figure CN122990738A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on pixel feature and axis fusion building drawing wall and door and window automatic extraction method, system, equipment and storage medium, it is related to image processing technical field, method includes: obtaining grating building drawing and axis data, constructs horizontal and vertical axis set;Based on color threshold or coordinate data extraction black pixel, obtains wall pixel point by axis space filtering and connectivity verification;Orthogonal combination axis generates grid intersection array, searches nearest node in four directions and statistics pixel quantity and connecting line length;Calculate density, determine wall line segment according to criterion and output;Obtain door and window graph element, correct coordinate to nearest axis, merge and output structured data;The application can significantly improve the vectorization noise immunity of building drawing, generate closed orthogonal wall line segment, and realize door and window and axis accurate alignment, and output data can be directly used for CAD reconstruction and BIM modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, system, device, and storage medium for automatically extracting walls and doors and windows from architectural drawings based on pixel feature and axis fusion. Background Technology

[0002] With the widespread adoption of Building Information Modeling (BIM) and digital design, the rapid and accurate conversion of existing architectural drawings, especially raster-formatted JPG and PNG floor plans or coordinate datasets, into structured vector data has become an industry necessity. However, in practical engineering applications, technical challenges arise when processing architectural laser scan data: currently, whether laser scan data is 3D and then converted to 2D through slicing, or directly as 2D data, the large amount of furniture and decoration obstructing the view inside existing buildings makes it difficult to obtain complete information about the building structure. Therefore, converting it into standard CAD drawings requires manual outlining of the building's walls, windows, doors, etc., based on the point cloud data. Furthermore, areas that are obstructed or not scanned need to be filled in, which is inefficient and prone to introducing errors.

[0003] In existing technologies, some solutions employ deep learning to assist in the recognition of CAD walls. The core approach involves rasterizing the floor plan and then using edge operators such as Canny and Sobel to extract the boundary lines between walls and space, forcibly correcting slanted line segments into horizontal or vertical straight lines. However, this type of method heavily relies on edge operators. When the drawing contains a large amount of noise, text annotations, or shadows, the operators are prone to extracting "pseudo-walls." Furthermore, the forced correction logic cannot address the problem of broken line segments. Another approach identifies walls by reading the closure state, line width, and parallel line spacing of CAD primitives. However, this requires the drawing to have complete vector primitive information. If the original image is a pure raster image, line spacing cannot be obtained, or lines are broken, the algorithm will fail. In addition, while existing image recognition technologies can detect door and window symbols, due to image distortion or drawing errors, the identified door and window coordinates often cannot accurately match the wall axis, leading to a mismatch between doors / windows and walls. Summary of the Invention

[0004] In view of the above-mentioned problems, the present invention provides a method, system, device and storage medium for automatic extraction of walls and doors and windows in architectural drawings based on pixel feature and axis fusion.

[0005] Therefore, the technical problem solved by this invention is: how to accurately extract wall pixels and generate closed orthogonal wall line segments from laser scanning data with occlusion and partial missing parts, and how to adaptively align the door and window outlines to the wall axis.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion, comprising: Acquire raster architectural drawings and axis data, and construct horizontal and vertical axis sets based on the direction of the axis endpoints; Black pixels are extracted based on color thresholds or coordinate data, and spatial distance filtering and connectivity verification are performed using horizontal and vertical axis sets to generate a set of wall pixels. By orthogonally combining the horizontal and vertical axes, a global grid intersection array is generated; Traverse each node in the grid intersection array, search for the nearest neighbor node in four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. Pixel density is calculated based on the number of pixels and the length of the connection. The density and the pixel coverage on the path are comprehensively judged according to the preset wall determination criteria. In response to the determination result that a wall exists, a wall line segment is generated between the corresponding two nodes, and a set of wall line segments is output. Obtain door and window elements from the axis data, determine the layout direction based on the diagonal coordinates, and in response to vertical layout, correct the horizontal coordinate to the nearest vertical axis; in response to horizontal layout, correct the vertical coordinate to the nearest horizontal axis; merge the wall segments and the corrected door and window segments into structured data.

[0007] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: The acquisition of raster architectural drawings and axis data, and the construction of horizontal and vertical axis sets based on the direction of the axis endpoints, includes: Obtain metadata of the raster building plan and the corresponding axis diagram; Extract the start and end coordinates of each axis from the axis map metadata, and calculate the absolute value of the difference between the start and end points in the horizontal axis direction and the absolute value of the difference in the vertical axis direction. In response to the absolute value of the difference on the horizontal axis being greater than the absolute value of the difference on the vertical axis, the axis is determined to be horizontal, and the vertical coordinate of the axis is stored in the set of horizontal axes. Conversely, if the direction is not vertical, the x-coordinate of the axis is stored in the vertical axis set.

[0008] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: The process of extracting black pixels based on color thresholds or coordinate data, using horizontal and vertical axis sets for spatial distance filtering and connectivity verification, and generating a set of wall pixel points includes: The raster image is converted to a color space, a color threshold is set, and black pixels with values ​​of each channel below the color threshold are extracted from the image to form a set of black pixels. The spatial position of the black pixel set is constrained by the established set of horizontal and vertical axes. Black pixels whose distance from any axis is less than the preset tolerance are retained as candidate points for the wall. Perform a four-neighbor connectivity check on the candidate points on the wall, remove isolated points, and obtain the final set of wall pixels.

[0009] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: For each node in the traversal of the grid intersection array, the nearest neighbor node is searched in four orthogonal directions, and the number of wall pixels and the length of the connection between nodes are counted, including: Using each node in the global grid intersection array as the target node, rays are emitted in four directions, namely the positive and negative directions of two mutually perpendicular axes, and the nearest other node to the target node is searched in each direction.

[0010] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: The process of traversing each node in the grid intersection array, searching for the nearest neighbor node in four orthogonal directions, and counting the number of wall pixels and the length of the connection between nodes also includes: Obtain the straight-line path between the target node and the nearest node in each direction, count the number of pixels on the path that belong to the set of wall pixels, and use this as the number of wall pixels in the corresponding direction. Also calculate the length of the path, which is used as the length of the connection in the corresponding direction.

[0011] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: The pixel density is calculated based on the number of pixels and the connection length. A comprehensive judgment is made on the density and pixel coverage along the path according to a preset wall determination criterion. In response to the determination result indicating the existence of a wall, a wall segment is generated between the corresponding two nodes, and a set of wall segments is output, including: For each direction, the ratio of the number of wall pixels to the length of the connecting line is calculated as the pixel density; In response to a pixel density exceeding a first density threshold and the number of wall pixels exceeding a quantity threshold, or a pixel density exceeding a second density threshold higher than the first density threshold, it is determined that there is a solid wall segment between two nodes in the corresponding direction, and a wall segment is generated between the two nodes. Summarize all generated wall segments and output a set of wall segments.

[0012] As a preferred solution for an automatic extraction method of walls and doors / windows from architectural drawings based on pixel feature and axis fusion, wherein: The process involves obtaining door and window elements from the axis data, determining the arrangement direction based on the diagonal coordinates, correcting the horizontal coordinate to the nearest vertical axis for vertical arrangement, and correcting the vertical coordinate to the nearest horizontal axis for horizontal arrangement. The wall segments and the corrected door and window segments are then merged and output as structured data, including: Obtain door and window data, parse the diagonal coordinates, and determine the layout direction of doors and windows based on the comparison of the horizontal and vertical spans of the diagonal coordinates. When the arrangement direction is vertical, the horizontal coordinates of the doors and windows are replaced with the horizontal coordinates of the axes in the set of vertical axes that are closest to the original horizontal coordinates; When the arrangement direction is horizontal, the vertical coordinates of the doors and windows are replaced with the vertical coordinates of the axes in the set of horizontal axes that are closest to the original vertical coordinates; Combine the generated wall segments with the door and window segments after coordinate correction into structured data in a standard format and output it.

[0013] Secondly, the present invention provides an automatic extraction system for walls and doors / windows in architectural drawings based on pixel feature and axis fusion, comprising: The axis set construction module is used to acquire raster architectural drawings and axis data, and to construct horizontal axis sets and vertical axis sets based on the direction of the axis endpoints; The wall pixel extraction module is used to extract black pixels based on color thresholds or coordinate data, and to perform spatial distance filtering and connectivity verification using horizontal and vertical axis sets to generate a set of wall pixel points. The grid intersection generation module is used to orthogonally combine the horizontal and vertical axes to generate a global grid intersection array; The ray pixel statistics module is used to traverse each node in the grid intersection array, search for the nearest neighbor node in four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. The wall segment determination module is used to calculate the pixel density based on the number of pixels and the length of the connection. It makes a comprehensive judgment on the density and the pixel coverage on the path according to the preset wall determination criteria. In response to the judgment result that a wall exists, it generates a wall segment between the corresponding two nodes and outputs a set of wall segments. The door and window alignment output module is used to obtain door and window elements from the axis data, determine the arrangement direction based on the coordinates of the diagonal points, and in response to vertical arrangement, correct the horizontal coordinate to the nearest vertical axis; in response to horizontal arrangement, correct the vertical coordinate to the nearest horizontal axis; and merge the wall line segments with the corrected door and window line segments to output structured data.

[0014] Thirdly, the present invention provides a computer device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, they implement the steps of the method for automatically extracting walls and doors and windows from architectural drawings based on pixel feature and axis fusion.

[0015] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of an automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion.

[0016] The beneficial effects of this invention are as follows: This invention directly addresses the pain points in the vectorization process of architectural drawings, significantly improving the accuracy of automated processing and modeling efficiency in practical applications. Addressing the inefficiency and susceptibility to human error inherent in traditional manual tracing methods, this invention achieves fully automated conversion from raster drawings to structured vector data, drastically reducing the workload of manual corrections by designers. Recognizing the shortcomings of existing edge detection algorithms that are easily interfered with by irrelevant black pixels such as furniture blocks, dimension annotations, and shadows in drawings, resulting in the extraction of "false walls," this invention employs strong axis-constrained spatial filtering. This strictly limits candidate wall points to within the tolerance range of the architectural axis, effectively eliminating non-wall noise and ensuring that the extracted wall lines accurately reflect the actual building structure, thus avoiding the need for subsequent error wall cleanup during modeling. To address the issues of broken lines and pixel blurring leading to discontinuous or non-closed wall segments in conventional vectorization algorithms, this invention employs intelligent connectivity determination based on four-directional feature pixel density statistics. This allows for the derivation of complete wall segments from local pixel distributions, generating continuous, orthogonal, and closed wall outlines even if the original drawing contains scanning noise or minor breaks, directly meeting the input requirements for CAD reconstruction and BIM 3D extrusion modeling. To address the problem of door and window recognition coordinates deviating from the wall axis due to image distortion or drawing errors, resulting in suspended or misaligned doors and windows in the 3D model, this invention uses a one-dimensional coordinate minimum distance adaptive adsorption algorithm to precisely align door and window components to the nearest wall axis, ensuring accurate fit between doors / windows and the wall. Overall, the vector data output by this invention is highly structured, requiring no manual line trimming or coordinate correction. It can be directly used in practical engineering scenarios such as building digital archiving, interior design construction drawing generation, and reverse modeling of old residential area renovations, significantly improving the efficiency and accuracy of data flow from drawings to models. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is an overall flowchart of a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion, provided by the present invention.

[0019] Figure 2 This invention provides an original architectural plan of a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion.

[0020] Figure 3 This invention provides a method for automatically extracting walls and doors / windows from architectural drawings based on pixel features and axis fusion, which involves setting the axis.

[0021] Figure 4 This invention provides an automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion, which inserts doors and windows (windows: green, doors: blue).

[0022] Figure 5 This invention provides an automatic method for extracting wall and door / window features from architectural drawings based on pixel feature and axis fusion, which automatically draws wall lines (bright yellow).

[0023] Figure 6 This invention provides a method for automatically extracting walls and doors / windows from architectural drawings based on pixel features and axis fusion, which displays wall lines.

[0024] Figure 7 This invention provides a CAD drawing result of an automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion. Detailed Implementation

[0025] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.

[0026] Example 1, referring to Figure 1 This is the first embodiment of the present invention, which provides a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion, including: S1: Obtain raster architectural drawings and axis data, and construct horizontal and vertical axis sets based on the direction of the axis endpoints; S2: Extract black pixels based on color threshold or coordinate data, and use horizontal and vertical axis sets to perform spatial distance filtering and connectivity verification to generate a set of wall pixel points; S3: Combine the horizontal and vertical axes orthogonally to generate a global grid intersection array; S4: Traverse each node in the grid intersection array, search for the nearest neighbor node in the four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. S5: Calculate the pixel density based on the number of pixels and the length of the connection. Make a comprehensive judgment on the density and the pixel coverage on the path according to the preset wall judgment criteria. In response to the judgment result that there is a wall, generate a wall line segment between the corresponding two nodes and output the wall line segment set. S6: Obtain door and window elements from the axis data, determine the layout direction based on the diagonal coordinates, and in response to vertical layout, correct the horizontal coordinate to the nearest vertical axis; in response to horizontal layout, correct the vertical coordinate to the nearest horizontal axis; merge the wall segments and the corrected door and window segments and output them as structured data.

[0027] It should be noted that through steps S1-S6, the walls and doors and windows in the raster architectural drawings are automatically converted into structured vector data with axes as the reference, geometric orthogonal and with accurate coordinates, and directly output a standardized set of components that can be used for CAD reconstruction or BIM modeling.

[0028] Example 2, refer to Figure 1 As an embodiment of the present invention, based on the previous embodiment, a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion is provided, including: In this embodiment, the step S1 above, which involves obtaining the raster architectural drawing and axis data, and constructing a set of horizontal and vertical axes based on the direction of the axis endpoints, includes: Obtain a raster image containing the building's floor plan, or a dataset containing the building's floor plan coordinates, including the location coordinates of each point and their corresponding color values ​​or classification labels, along with the corresponding initial JSON file. Based on the input JSON image data, parse and extract the set of horizontal axes of the building structure. and the set of vertical axes : That is, to store the ordinates of all horizontal axes; That is, it stores the x-coordinates of all vertical axes.

[0029] like Figure 2 The original building floor plan shown is as follows: Figure 3 The axis is set as shown.

[0030] Specifically, identify feature data of type 'axis' in JSON, based on its starting point. and the end point , Calculate the direction of extension of the axis; like If the axis is determined to be horizontal, its Y-coordinate is stored in the horizontal axis set; otherwise, it is determined to be vertical, and its X-coordinate is stored in the vertical axis set.

[0031] In this embodiment, step S2 above, which extracts black pixels based on color thresholds or coordinate data, and uses horizontal and vertical axis sets for spatial distance filtering and connectivity verification to generate a set of wall pixels, includes: Read the raster image and convert it to the RGB color space. Set a color threshold and iterate through the image to extract the pixel set of a specific component.

[0032] For the set of black pixels representing the wall The extraction criteria are: in, For image coordinates, This is the pixel value at that point. The black threshold value is set, and in this embodiment, it is preferably set to 10.

[0033] For points in the coordinate dataset, their color values ​​(or grayscale values) must also be lower than [a certain value]. It is treated as a black pixel.

[0034] In the case of coordinate data, replace the RGB values ​​with the color components or grayscale values ​​associated with the point.

[0035] To eliminate noise in other areas of the drawing, axis set pairs were used. Apply spatial position constraints. If the distance of a black pixel from any axis is within the set tolerance... If it is inside, it is determined to be a candidate point on the wall. In this embodiment, a tolerance of 5 pixels is preferably set. Candidate points on the wall are represented as follows: Then, a 4-neighborhood connectivity check is performed on the candidate points to remove isolated points, resulting in the final confirmed set of wall pixels. .

[0036] Specifically, iterate through the image to obtain RGB pixels, and extract points where R, G, and B are all less than 10 and store them in the black pixel coordinate set; Traverse the set of black pixel coordinates and determine whether the point is within ±5 pixels of the set of vertical axis or horizontal axis. If so, add it to the initial screening set. Perform connectivity checks on the initial set based on the surrounding four points (up, down, left, and right) to remove isolated noise points and obtain the accurate set of wall pixels.

[0037] In this embodiment, step S3 above, which involves orthogonally combining the horizontal and vertical axes to generate a global grid intersection array, includes: Construct a set of all grid nodes formed by the intersection of axes.

[0038] Specifically, the sets of horizontal and vertical axes are orthogonally arranged to generate a global set of grid intersection points for the building. .

[0039] In this embodiment, step S4 above involves traversing each node in the grid intersection array, searching for the nearest neighbor node in four orthogonal directions, and counting the number of wall pixels and the length of the connection between nodes, including: For the target intersection point in the set It emits rays in four directions: positive X, negative X, positive Y, and negative Y, to find the nearest other nodes. Starting with the positive X direction... For example, let the nearest node be... ,in .

[0040] Statistical analysis of the distance between two nodes Number of pixels in the set Specifically, in the positive X direction, it can be denoted as And calculate the length of the connecting line. , represented as: Specifically, traverse the set of grid intersections. For each node, calculate and find its nearest node in the positive and negative directions of the X-axis and Y-axis.

[0041] Count the number of wall pixels from the wall pixel set on the lines connecting the current node to the four nearest nodes. and the length of the connecting line .

[0042] In this embodiment, in step S5 above, the pixel density is calculated based on the number of pixels and the connection length. A comprehensive judgment is made on the density and pixel coverage along the path according to a preset wall determination criterion. In response to the determination result indicating the existence of a wall, a wall segment is generated between the corresponding two nodes. The output set of wall segments includes: Calculate feature pixel density ; The criterion for determining whether a wall segment is generated is as follows: if the number and density of feature pixels in a specific direction satisfy the following formula, then the segment is determined to be a solid wall segment: This embodiment is preferred. =0.25, =15, =0.8.

[0043] Specifically, when density >0.25 and number of pixels When the value is >15, a wall segment is generated between the start and end nodes; or, when When the value is greater than 0.8, wall segments are generated directly regardless of the number of pixels. For example... Figure 5 The wall lines (bright yellow) are automatically drawn as shown. Figure 6 The wall lines are shown.

[0044] In this embodiment, step S6 above involves obtaining door and window elements from the axis data, determining the arrangement direction based on the diagonal coordinates, correcting the horizontal coordinate to the nearest vertical axis for vertical arrangement, and correcting the vertical coordinate to the nearest horizontal axis for horizontal arrangement; merging the wall segments and the corrected door and window segments into structured data includes: To correct the original coordinates of the door and window components ( To address the issue of deviation from the axis, a minimum absolute difference search algorithm is employed. When the doors and windows are determined to be vertically arranged, the original X-coordinate is aligned to the nearest longitudinal axis, i.e., the set of vertical axes. Similarly, when the doors and windows are determined to be horizontally arranged, the original Y-coordinate is aligned to the nearest transverse axis, i.e., the set of horizontal axes. Finally, the corrected start and end point coordinates of the doors and windows are output. Figure 4 Insert doors and windows as shown (windows: green, doors: blue).

[0045] in, This represents the corrected horizontal coordinate of the doors and windows. It is the new horizontal coordinate value obtained by aligning the original horizontal coordinates of the doors and windows to the nearest vertical axis using the minimum absolute difference search algorithm.

[0046] Specifically, read feature data of type window or door from the raw JSON; The arrangement direction of the doors and windows is determined based on the coordinates of their diagonal points, and the coordinates are corrected accordingly: if the arrangement is vertical, the minimum absolute difference search algorithm is used to find the value in the set of vertical axes that is closest to the original X coordinate as the new X coordinate; if the arrangement is horizontal, the ordinate of the axis with the smallest absolute difference from the original Y coordinate is found in the set of horizontal axes as the new Y coordinate.

[0047] Assemble the wall segments generated in step S5 and the door and window segments obtained after coordinate correction into a standard JSON format, append and update it to the JSON file in the export path, completing the automated conversion. Figure 7 The CAD drawing results are shown.

[0048] Example 3: The above is an illustrative scheme of an automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion according to this embodiment. It should be noted that the technical solution of an automatic extraction system for walls and doors / windows in architectural drawings based on pixel feature and axis fusion is based on the same concept as the above-described automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion. Details not described in detail in the technical solution of the automatic extraction system for walls and doors / windows in architectural drawings based on pixel feature and axis fusion in this embodiment can be found in the description of the above-described automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion.

[0049] This embodiment also provides an automatic extraction system for walls and doors / windows in architectural drawings based on pixel feature and axis fusion, including: The axis set construction module is used to acquire raster architectural drawings and axis data, and to construct horizontal axis sets and vertical axis sets based on the direction of the axis endpoints; The wall pixel extraction module is used to extract black pixels based on color thresholds or coordinate data, and to perform spatial distance filtering and connectivity verification using horizontal and vertical axis sets to generate a set of wall pixel points. The grid intersection generation module is used to orthogonally combine the horizontal and vertical axes to generate a global grid intersection array; The ray pixel statistics module is used to traverse each node in the grid intersection array, search for the nearest neighbor node in four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. The wall segment determination module is used to calculate the pixel density based on the number of pixels and the length of the connection. It makes a comprehensive judgment on the density and the pixel coverage on the path according to the preset wall determination criteria. In response to the judgment result that a wall exists, it generates a wall segment between the corresponding two nodes and outputs a set of wall segments. The door and window alignment output module is used to obtain door and window elements from the axis data, determine the arrangement direction based on the coordinates of the diagonal points, and in response to vertical arrangement, correct the horizontal coordinate to the nearest vertical axis; in response to horizontal arrangement, correct the vertical coordinate to the nearest horizontal axis; and merge the wall line segments with the corrected door and window line segments to output structured data.

[0050] This embodiment also provides a computer device applicable to a method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion, including: The system includes a memory and a processor. The memory stores computer-executable instructions, and the processor executes these instructions to implement the automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion, as proposed in the above embodiments.

[0051] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements an automatic extraction method for walls and doors / windows in architectural drawings based on pixel feature and axis fusion as proposed in the above embodiment.

[0052] The storage medium proposed in this embodiment belongs to the same inventive concept as the automatic extraction method of walls and doors and windows in architectural drawings based on pixel feature and axis fusion proposed in the above embodiment. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.

[0053] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion, characterized in that, include: Acquire raster architectural drawings and axis data, and construct horizontal and vertical axis sets based on the direction of the axis endpoints; Black pixels are extracted based on color thresholds or coordinate data, and spatial distance filtering and connectivity verification are performed using horizontal and vertical axis sets to generate a set of wall pixels. By orthogonally combining the horizontal and vertical axes, a global grid intersection array is generated; Traverse each node in the grid intersection array, search for the nearest neighbor node in four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. Pixel density is calculated based on the number of pixels and the length of the connection. The density and the pixel coverage on the path are comprehensively judged according to the preset wall determination criteria. In response to the determination result that a wall exists, a wall line segment is generated between the corresponding two nodes, and a set of wall line segments is output. Obtain door and window elements from axis data, determine the layout direction based on the coordinates of the diagonal points, respond to the vertical layout, and correct the horizontal coordinate to the nearest vertical axis. In response to horizontal arrangement, the vertical coordinate is corrected to the nearest horizontal axis; The wall segments and the corrected door and window segments are merged and output as structured data.

2. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 1, characterized in that, The acquisition of raster architectural drawings and axis data, and the construction of horizontal and vertical axis sets based on the direction of the axis endpoints, includes: Obtain metadata of the raster building plan and the corresponding axis diagram; Extract the start and end coordinates of each axis from the axis map metadata, and calculate the absolute value of the difference between the start and end points in the horizontal axis direction and the absolute value of the difference in the vertical axis direction. In response to the absolute value of the difference on the horizontal axis being greater than the absolute value of the difference on the vertical axis, the axis is determined to be horizontal, and the vertical coordinate of the axis is stored in the set of horizontal axes. Conversely, if the direction is not vertical, the x-coordinate of the axis is stored in the vertical axis set.

3. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 2, characterized in that... The process of extracting black pixels based on color thresholds or coordinate data, using horizontal and vertical axis sets for spatial distance filtering and connectivity verification, and generating a set of wall pixel points includes: The raster image is converted to a color space, a color threshold is set, and black pixels with values ​​of each channel below the color threshold are extracted from the image to form a set of black pixels. The spatial position of the black pixel set is constrained by the established set of horizontal and vertical axes. Black pixels whose distance from any axis is less than the preset tolerance are retained as candidate points for the wall. Perform a four-neighbor connectivity check on the candidate points on the wall, remove isolated points, and obtain the final set of wall pixels.

4. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 3, characterized in that... For each node in the traversal of the grid intersection array, the nearest neighbor node is searched in four orthogonal directions, and the number of wall pixels and the length of the connection between nodes are counted, including: Using each node in the global grid intersection array as the target node, rays are emitted in four directions, namely the positive and negative directions of two mutually perpendicular axes, and the nearest other node to the target node is searched in each direction.

5. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 4, characterized in that... The process of traversing each node in the grid intersection array, searching for the nearest neighbor node in four orthogonal directions, and counting the number of wall pixels and the length of the connection between nodes also includes: Obtain the straight-line path between the target node and the nearest node in each direction, count the number of pixels on the path that belong to the set of wall pixels, and use this as the number of wall pixels in the corresponding direction. Also calculate the length of the path, which is used as the length of the connection in the corresponding direction.

6. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 5, characterized in that... The pixel density is calculated based on the number of pixels and the connection length. A comprehensive judgment is made on the density and pixel coverage along the path according to a preset wall determination criterion. In response to the determination result indicating the existence of a wall, a wall segment is generated between the corresponding two nodes, and a set of wall segments is output, including: For each direction, the ratio of the number of wall pixels to the length of the connecting line is calculated as the pixel density; In response to a pixel density exceeding a first density threshold and the number of wall pixels exceeding a quantity threshold, or a pixel density exceeding a second density threshold higher than the first density threshold, it is determined that there is a solid wall segment between two nodes in the corresponding direction, and a wall segment is generated between the two nodes. Summarize all generated wall segments and output a set of wall segments.

7. The method for automatically extracting walls and doors / windows from architectural drawings based on pixel feature and axis fusion as described in claim 6, characterized in that... The door and window elements are obtained from the axis data, and the arrangement direction is determined based on the coordinates of the diagonal points. In response to the vertical arrangement, the horizontal coordinate is corrected to the nearest vertical axis. In response to horizontal arrangement, the vertical coordinate is corrected to the nearest horizontal axis; The wall segments and the corrected door and window segments are merged and output as structured data, including: Obtain door and window data, parse the diagonal coordinates, and determine the layout direction of doors and windows based on the comparison of the horizontal and vertical spans of the diagonal coordinates. When the arrangement direction is vertical, the horizontal coordinates of the doors and windows are replaced with the horizontal coordinates of the axes in the set of vertical axes that are closest to the original horizontal coordinates; When the arrangement direction is horizontal, the vertical coordinates of the doors and windows are replaced with the vertical coordinates of the axes in the set of horizontal axes that are closest to the original vertical coordinates; Combine the generated wall segments with the door and window segments after coordinate correction into structured data in a standard format and output it.

8. An automatic extraction system for walls and doors / windows in architectural drawings based on pixel feature and axis fusion, using the method described in any one of claims 1 to 7, characterized in that, include: The axis set construction module is used to acquire raster architectural drawings and axis data, and to construct horizontal axis sets and vertical axis sets based on the direction of the axis endpoints; The wall pixel extraction module is used to extract black pixels based on color thresholds or coordinate data, and to perform spatial distance filtering and connectivity verification using horizontal and vertical axis sets to generate a set of wall pixel points. The grid intersection generation module is used to orthogonally combine the horizontal and vertical axes to generate a global grid intersection array; The ray pixel statistics module is used to traverse each node in the grid intersection array, search for the nearest neighbor node in four orthogonal directions, and count the number of wall pixels and the length of the connection between nodes. The wall segment determination module is used to calculate the pixel density based on the number of pixels and the length of the connection. It makes a comprehensive judgment on the density and the pixel coverage on the path according to the preset wall determination criteria. In response to the judgment result that a wall exists, it generates a wall segment between the corresponding two nodes and outputs a set of wall segments. The door and window alignment output module is used to obtain door and window elements from the axis data, determine the arrangement direction based on the coordinates of the diagonal points, and in response to the vertical arrangement, correct the horizontal coordinate to the nearest vertical axis. In response to horizontal arrangement, the vertical coordinate is corrected to the nearest horizontal axis; The wall segments and the corrected door and window segments are merged and output as structured data.

9. A computer device, characterized in that, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, It stores computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 7.