A CAD data management method to assist architectural design
By using pixel clustering and merging based on binary images in architectural design, the problem of inaccurate part area division in CAD drawings is solved, enabling fast and accurate positioning and efficient analysis.
Patent Information
- Application Number
- CN202510792616.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-06-13
AI Technical Summary
Existing technologies make it difficult to accurately divide the areas where different parts are located in CAD drawings during architectural design, which makes it impossible to quickly and accurately locate them during subsequent analysis.
By clustering pixels based on binary images, and using merging probability values and inductive stopping characterization values to determine the merging process of adjacent initial clusters, the connected components corresponding to different parts in CAD drawings are obtained.
It improves the accuracy of the region division results for different parts, reduces the impact of redundancy, achieves fast and accurate part positioning, and improves analysis efficiency.
Smart Images

Figure CN120635515B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic digital data processing technology, and more specifically to a CAD data management method for assisting architectural design. Background Technology
[0002] CAD technology plays a vital role in modern design and engineering, and is widely used in various fields, including engineering, architecture, manufacturing, and animation, improving design efficiency. In architectural design, identifying certain structural components in CAD drawings can help learners better understand these components, evaluate their performance, structure, manufacturability, and other characteristics, facilitating subsequent design, modification, or manufacturing work.
[0003] Currently, when analyzing the structure of a component in a device, it is usually necessary to open the entire device's CAD drawing to locate the component. This can result in a lot of redundancy. Existing methods generally use the k-means clustering algorithm to cluster the pixels in the drawing. When analyzing a specific component, the corresponding region is found from the clustering results. However, this method requires setting the k value in advance. An inappropriate k value will directly affect the segmentation results, making it impossible to accurately locate the components in the CAD drawing. Therefore, how to accurately segment the regions where different components of the device are located in the CAD drawing to ensure that the corresponding positions of different components can be quickly and accurately obtained later is an urgent problem to be solved. Summary of the Invention
[0004] To address the problem that existing methods struggle to accurately delineate the areas containing different parts in CAD drawings for architectural design, the present invention aims to provide a CAD data management method to assist in architectural design. The specific technical solution adopted is as follows:
[0005] This invention provides a CAD data management method to assist in architectural design, the method comprising the following steps:
[0006] Obtain binary images of CAD drawings used in architectural design;
[0007] Based on the pixel values of the pixels in the binary image, the pixels in the binary image are clustered to obtain no less than two initial clusters; according to the relative distance between each pair of adjacent initial clusters, the difference in the number of pixels contained, the difference in morphological features, and the difference in area, the merging probability value of each pair of adjacent initial clusters is obtained; according to the morphological features of each initial cluster after merging with its adjacent initial clusters, the distribution of the number of pixels, and the corresponding merging probability value, the inductive stopping characterization value of each initial cluster with respect to its adjacent initial clusters is calculated.
[0008] Based on the merging probability value and the inductive stopping characterization value, it is determined whether to merge adjacent initial clusters. If so, the corresponding adjacent initial clusters are merged to obtain the connected components corresponding to different parts in the CAD drawing.
[0009] Preferably, the step of obtaining the merging probability value of each pair of adjacent initial clusters based on the relative distance between each pair of adjacent initial clusters, the difference in the number of pixels contained therein, the difference in morphological features, and the difference in area includes:
[0010] For the g-th initial cluster: obtain the area of the minimum circumcircle of the g-th initial cluster; based on the area of the minimum circumcircle of the g-th initial cluster, the area of the g-th initial cluster, and the length of the edge line of the g-th initial cluster, obtain the isoperimeter area ratio of the g-th initial cluster.
[0011] For the g-th initial cluster and its neighboring a-th initial cluster: obtain the distance between the g-th initial cluster and its neighboring a-th initial cluster; based on the distance between the g-th initial cluster and its neighboring a-th initial cluster, the difference in the number of pixels contained in the g-th initial cluster and its neighboring a-th initial cluster, and the difference in the isoperimeter area ratio between the g-th initial cluster and its neighboring a-th initial cluster, obtain the merging probability value of the g-th initial cluster and its neighboring a-th initial cluster.
[0012] Preferably, the isoperimeter area ratio of the g-th initial cluster is obtained based on the area of the smallest circumcircle of the g-th initial cluster, the area of the g-th initial cluster, and the length of the edge line of the g-th initial cluster, including:
[0013] The difference between the area of the smallest circumcircle of the g-th initial cluster and the area of the g-th initial cluster is denoted as the area difference corresponding to the g-th initial cluster.
[0014] The ratio of the length of the edge line of the g-th initial cluster to the area difference corresponding to the g-th initial cluster is determined as the perimeter area ratio of the g-th initial cluster.
[0015] Preferably, the probability of merging the g-th initial cluster and its neighboring a-th initial cluster is calculated using the following formula:
[0016]
[0017] in, Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster. Let g be the distance between the g-th initial cluster and its neighboring a-th initial cluster. Let g be the number of pixels contained in the g-th initial cluster. Let be the number of pixels contained in the a-th initial cluster that is adjacent to the g-th initial cluster. The ratio of the perimeter areas of the g-th initial cluster is given by [the value of the ... The ratio of the perimeter area of the a-th initial cluster adjacent to the g-th initial cluster. To determine the absolute value sign, exp() represents an exponential function with the natural constant as the base, and E is a preset adjustment parameter, which is greater than 0.
[0018] Preferably, the step of calculating the inductive stopping characterization value of each initial cluster relative to its neighboring initial clusters based on the morphological features, pixel distribution, and corresponding merging probability values of each initial cluster after merging with its neighboring initial clusters includes:
[0019] For the g-th initial cluster and its neighboring a-th initial cluster:
[0020] The region obtained by merging the g-th initial cluster and its adjacent a-th initial cluster is denoted as the region to be analyzed. The PCA analysis method is used to process the region to be analyzed to obtain the maximum principal component direction vector and the minimum principal component direction vector corresponding to the region to be analyzed.
[0021] Convex hull detection is performed on the region to be analyzed to obtain the corresponding convex polygon, and the interior angle of the convex polygon is obtained; the angle characterization value is determined based on the interior angle of the convex polygon.
[0022] The ratio of the number of pixels in the region to be analyzed to the total number of pixels in the binary image is taken as the proportion of the region to be analyzed.
[0023] Based on the proportion of the number corresponding to the region to be analyzed, the probability value of merging the g-th initial cluster and its adjacent a-th initial cluster, the angle characterization value, the magnitude of the direction vector of the largest principal component and the magnitude of the direction vector of the smallest principal component corresponding to the region to be analyzed, the inductive stopping characterization value of the g-th initial cluster to its adjacent a-th initial cluster is obtained.
[0024] Preferably, the inductive stopping characterization value of the g-th initial cluster relative to its neighboring a-th initial cluster is calculated using the following formula:
[0025]
[0026] in, Let be the inductive stopping characterization value of the g-th initial cluster relative to its neighboring a-th initial cluster. G represents the number of pixels in the region to be analyzed, and G represents the total number of pixels in the binary image. Let be the magnitude of the direction vector of the minimum principal component corresponding to the region to be analyzed. Let be the magnitude of the direction vector of the largest principal component corresponding to the region to be analyzed. Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster, and K be the number of interior angles of the convex polygon. Let k be the interior angle of the convex polygon. Let be the cosine of the k-th interior angle of the convex polygon, and sigmoid() is the normalization function.
[0027] Preferably, determining the angle representation value based on the interior angle of the convex polygon includes:
[0028] The difference between the constant 1 and the cosine value of each interior angle is taken as the first characteristic value corresponding to each interior angle, and the average value of the first characteristic values corresponding to all interior angles is recorded as the angle characterization value.
[0029] Preferably, the step of determining whether to merge adjacent initial clusters based on the merging probability value and the inductive stopping characterization value, and if so, merging the corresponding adjacent initial clusters to obtain the connected components corresponding to different parts in the CAD drawing, includes:
[0030] If two adjacent initial clusters meet the preset conditions, the corresponding adjacent initial clusters are merged to obtain no less than two new clusters; if two adjacent new clusters meet the preset conditions again, the corresponding two adjacent new clusters are merged, and so on, until the preset conditions are no longer met. The final merged connected components are used as the connected components corresponding to different parts in the CAD drawing.
[0031] The preset conditions are: the merging probability value is greater than the merging threshold, and the induction stopping characteristic value is less than the induction stopping threshold.
[0032] Preferably, obtaining the distance between the g-th initial cluster and its neighboring a-th initial cluster includes:
[0033] The intersection of the two diagonals of the minimum bounding rectangle of each initial cluster is taken as the center point of each initial cluster.
[0034] The Euclidean distance between the center point of the g-th initial cluster and the center point of the a-th initial cluster adjacent to it is taken as the distance between the g-th initial cluster and the a-th initial cluster adjacent to it.
[0035] Preferably, the step of clustering the pixels in the binary image based on the pixel values to obtain at least two initial clusters includes:
[0036] Based on the pixel values of the pixels in the binary image, an iterative self-organizing clustering algorithm is used to cluster all pixels in the binary image to obtain no less than two initial clusters.
[0037] The present invention has at least the following beneficial effects:
[0038] This invention addresses the challenge of quickly and accurately locating different parts in CAD drawings of equipment used in architectural design, where the drawings are often large and difficult to analyze quickly. The invention first clusters all pixels in the binary image of the CAD drawing based on their pixel values, obtaining multiple initial clusters. Generally, parts serving a specific function tend to cluster within a certain area and have similar structural forms. This invention obtains a merging probability value based on the relative distance between adjacent initial clusters, differences in the number of pixels they contain, differences in morphological characteristics, and differences in area. The morphological similarity of the initial clusters was analyzed. Based on the morphological characteristics, pixel distribution, and merging probability values of each initial cluster and its neighboring initial clusters, the corresponding inductive stopping characterization values were obtained. Then, by combining the merging probability values and the inductive stopping characterization values, the adjacent initial clusters were merged to obtain the connected components corresponding to different parts. This improved the accuracy of the region division results for different parts. As a result, when analyzing local parts of equipment, the CAD structural position of the part can be quickly located, reducing the redundant influence of other irrelevant structures. This ensures that the regions where different parts are located in CAD drawings in architectural design can be located quickly and accurately, thus improving the analysis efficiency. Attached Figure Description
[0039] To more clearly illustrate the technical solutions and advantages 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, 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.
[0040] Figure 1 A flowchart illustrating a CAD data management method for assisting architectural design, provided as an embodiment of the present invention. Detailed Implementation
[0041] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of a CAD data management method for assisting architectural design, in conjunction with the accompanying drawings and preferred embodiments, is provided below.
[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0043] The following description, in conjunction with the accompanying drawings, details a specific scheme for a CAD data management method for assisting architectural design provided by the present invention.
[0044] An example of a CAD data management method to assist architectural design:
[0045] The specific scenario addressed in this embodiment is as follows: When analyzing one or more parts of equipment in CAD drawings of architectural design, it is difficult to quickly and accurately locate different parts in CAD drawings because CAD drawings are often large in size. This embodiment will cluster and merge the pixels in the CAD drawings of architectural design to divide the overall CAD structure into multiple functional part categories, so as to ensure that architectural component design manufacturers or enterprise projects can quickly and accurately locate one or more parts of equipment in the CAD drawings of architectural design when analyzing them.
[0046] This embodiment proposes a CAD data management method to assist in architectural design, such as... Figure 1 As shown, a CAD data management method for assisting architectural design in this embodiment includes the following steps:
[0047] Step S1: Obtain CAD drawing images from the architectural design and perform preprocessing.
[0048] This embodiment first uses CAD drawings of the equipment provided by the building component design manufacturer or enterprise project. The acquired CAD image is then binarized. In the binarized image, the pixel value of lines representing the equipment structure is 255, i.e., white, while the pixel value of other background pixels is 0. This binarized image is recorded as the binary image of the CAD drawing in the architectural design. Image binarization is existing technology and will not be elaborated further here.
[0049] Thus, this embodiment has obtained a binary image of the CAD drawings in the architectural design.
[0050] Step S2: Based on the pixel values of the pixels in the binary image, cluster the pixels in the binary image to obtain no less than two initial clusters; according to the relative distance between each two adjacent initial clusters, the difference in the number of pixels contained, the difference in morphological features, and the difference in area, obtain the merging probability value of each two adjacent initial clusters; according to the morphological features of each initial cluster after merging with its adjacent initial clusters, the distribution of the number of pixels, and the corresponding merging probability value, calculate the inductive stopping characterization value of each initial cluster for its adjacent initial clusters.
[0051] Based on the pixel values of pixels in the binary image of CAD drawings used in architectural design, the Iterative Self-Organizing Clustering (ISODATA) algorithm is employed to cluster all pixels in the binary image of the CAD drawings, resulting in multiple clusters. Compared to direct clustering, ISODATA has the ability to automatically determine the number of clusters without pre-setting the number of cluster centers. It can dynamically merge and split cluster centers during the iteration process to adapt to the complexity and non-uniformity of the data. Furthermore, ISODATA can adapt to the distribution of the data, allowing the cluster centers to better represent the characteristics of the data, which helps improve the accuracy of the clustering results. Ultimately, multiple clusters are obtained in the binary image of the CAD drawings, and these clusters are recorded as the initial clusters. The Iterative Self-Organizing Clustering algorithm is existing technology and will not be elaborated upon further here.
[0052] The purpose of this embodiment is to classify the CAD structures of the same part in the equipment into one category. The multiple initial clusters obtained here represent the collection of all part structures. Next, it is necessary to analyze the distribution characteristics and morphological characteristics of the initial clusters to obtain the merging probability value and induction stopping characterization value of the initial clusters, and then merge the initial clusters.
[0053] Since this embodiment aims to classify the CAD structures of the same part of building equipment into one category, it analyzes the distribution characteristics of the initial clusters in the binary image. Generally, parts serving a specific function are concentrated in a certain area and their structural forms are relatively similar. Therefore, the relative distance between the initial clusters is calculated. The closer two initial clusters are, the more likely they are to be the same functional structure and can be classified into one category. Simultaneously, considering the morphological similarity of the initial clusters, if the distribution patterns of two initial clusters are more similar, they can also be classified into one category. Based on this, this embodiment will obtain the merging probability value of each pair of adjacent initial clusters according to the relative distance between them, the difference in the number of pixels they contain, the difference in morphological features, and the difference in area.
[0054] Specifically, for the g-th initial cluster: obtain the area of the smallest circumcircle of the g-th initial cluster; record the difference between the area of the smallest circumcircle of the g-th initial cluster and the area of the g-th initial cluster as the area difference corresponding to the g-th initial cluster; determine the isocircumferential area ratio of the g-th initial cluster as the ratio of the length of the edge line of the g-th initial cluster to the area difference corresponding to the g-th initial cluster. For the g-th initial cluster and its adjacent a-th initial cluster: obtain the distance between the g-th initial cluster and its adjacent a-th initial cluster; based on the distance between the g-th initial cluster and its adjacent a-th initial cluster, the difference in the number of pixels contained in the g-th initial cluster and its adjacent a-th initial cluster, and the difference in the isocircumferential area ratio of the g-th initial cluster and its adjacent a-th initial cluster, obtain the merging probability value of the g-th initial cluster and its adjacent a-th initial cluster. The specific formulas for calculating the isoperimeter area ratio of the g-th initial cluster and the merging probability value between the g-th initial cluster and its neighboring a-th initial cluster are as follows:
[0055]
[0056]
[0057] in, Let g be the length of the edge line of the g-th initial cluster. Let be the area of the minimum circumcircle of the g-th initial cluster. Let g be the area of the g-th initial cluster. Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster. Let g be the distance between the g-th initial cluster and its neighboring a-th initial cluster. Let g be the number of pixels contained in the g-th initial cluster. Let be the number of pixels contained in the a-th initial cluster that is adjacent to the g-th initial cluster. The ratio of the perimeter areas of the g-th initial cluster is given by [the value of the ... E represents the ratio of the perimeter area of the a-th initial cluster adjacent to the g-th initial cluster, where E is a preset adjustment parameter and is greater than 0. To take the absolute value sign, exp() represents an exponential function with the natural constant as the base.
[0058] The specific process for obtaining the distance between the g-th initial cluster and its neighboring a-th initial cluster is as follows: the intersection of the two diagonals of the minimum bounding rectangle of each initial cluster is taken as the center point of each initial cluster; the Euclidean distance between the center point of the g-th initial cluster and the center point of its neighboring a-th initial cluster is taken as the distance between the g-th initial cluster and its neighboring a-th initial cluster.
[0059] The area difference corresponding to the g-th initial cluster is used to reflect the area difference between the minimum circumcircle of the g-th initial cluster and the g-th initial cluster. The isoperimeter area ratio is used to characterize the morphological characteristics of the initial cluster. The smaller the area difference between the minimum circumcircle of the g-th initial cluster and the g-th initial cluster, and the larger the length of the edge line of the g-th initial cluster, the larger the isoperimeter area ratio of the g-th initial cluster. The formula for calculating the merging probability value is used to measure the morphological similarity between the g-th initial cluster and its neighboring a-th initial cluster. The preset adjustment parameter is introduced in the formula to prevent the denominator from being 0. In this embodiment, the preset adjustment parameter is 0.01. In specific applications, the implementer can set it according to the specific situation. This reflects the similarity between the g-th initial cluster and its neighboring a-th initial cluster in terms of both location and the number of pixels they contain. The closer the g-th initial cluster and its neighboring a-th initial cluster are in terms of location and the more similar the number of pixels they contain, the more likely the structures represented by these two initial clusters are the same parts of the device. Therefore, the greater the probability of them being classified into the same category, the greater the probability of merging the g-th initial cluster and its neighboring a-th initial cluster.
[0060] Since the merging probability value only performs similarity analysis on the initial clusters, if a merging threshold is set, and the relationship between the merging threshold and the calculated merging probability value is used to determine whether to merge adjacent initial clusters and obtain the final merging result, the overall morphological change characteristics during the dynamic classification process are ignored. Therefore, this embodiment will combine the above merging probability value and the morphological change characteristics of the regions formed by the categories during the classification process to determine the classification stopping condition.
[0061] Since CAD drawings are used for subsequent equipment manufacturing, the CAD structures of functional components composed of multiple parts are generally relatively regular geometric shapes. Building equipment has a more precise structure, composed of many different functional components. Therefore, the CAD structural drawings of functional components composed of multiple parts differ significantly in area from the overall equipment CAD structural drawing. Based on this, this embodiment will analyze the initial cluster classification process using the above characteristics. When incorporating an initial cluster into a category, it is necessary to determine whether the regions formed by all clusters in this category in the binary image are regular. If they are still regular shapes, it means that stopping is not necessary. Simultaneously, the area ratio of this category's region in the binary image is compared. The larger the area ratio of this category's region, the greater the likelihood of stopping the classification. Based on this, this embodiment will calculate the classification stopping characteristic value of each initial cluster for its neighboring initial clusters based on the morphological characteristics, pixel distribution, and corresponding merging probability value after merging each initial cluster with its neighboring initial clusters.
[0062] Specifically, for the g-th initial cluster and its neighboring a-th initial cluster:
[0063] The region obtained by merging the g-th initial cluster and its adjacent a-th initial cluster is denoted as the region to be analyzed. Principal Component Analysis (PCA) is used to process the region to be analyzed to obtain the maximum and minimum principal component direction vectors corresponding to the region to be analyzed. PCA is a prior art and will not be elaborated further here. Convex hull detection is performed on the region to be analyzed to obtain the corresponding convex polygons, and the interior angles of the convex polygons are obtained. The difference between the constant 1 and the cosine value of each interior angle is used as the first feature value corresponding to each interior angle, and the average value of the first feature values corresponding to all interior angles is recorded as the angle characterization value. Convex hull detection is a prior art and will not be elaborated further here. The ratio of the number of pixels in the region to be analyzed to the total number of pixels in the binary image is taken as the proportion of the region to be analyzed. Based on the proportion of the region to be analyzed, the merging probability value of the g-th initial cluster and its neighboring a-th initial cluster, the angle representation value, and the magnitudes of the maximum and minimum principal component direction vectors corresponding to the region to be analyzed, the inductive stopping representation value of the g-th initial cluster to its neighboring a-th initial cluster is obtained. The specific formula for calculating the inductive stopping representation value of the g-th initial cluster to its neighboring a-th initial cluster is as follows:
[0064]
[0065] in, Let be the inductive stopping characterization value of the g-th initial cluster relative to its neighboring a-th initial cluster. G represents the number of pixels in the region to be analyzed, and G represents the total number of pixels in the binary image. Let be the magnitude of the direction vector of the minimum principal component corresponding to the region to be analyzed. Let be the magnitude of the direction vector of the largest principal component corresponding to the region to be analyzed. Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster, and K be the number of interior angles of the convex polygon. Let k be the interior angle of the convex polygon. Let be the cosine of the k-th interior angle of the convex polygon, and sigmoid() is the normalization function.
[0066] This indicates the proportion of the quantity corresponding to the area to be analyzed. In CAD drawings, the larger the proportion of a certain functional component structure to the area of the entire equipment structure, the greater the possibility of stopping the induction. This represents the first eigenvalue corresponding to the k-th interior angle of a convex polygon. Represents the angle value. The angular characterization value and the degree of morphological shift of the region formed by merging the g-th initial cluster and its adjacent a-th initial cluster are used to measure the regularity of the region to be analyzed. If the degree of morphological shift of the region to be analyzed is smaller and the convexity is larger, it means that the shape of the region to be analyzed is more regular, and the induction stop characterization value is smaller.
[0067] Using the above method, it is possible to obtain the merging probability value of each two adjacent initial clusters and the inductive stopping characterization value of each initial cluster to its adjacent initial clusters.
[0068] Step S3: Based on the merging probability value and the inductive stopping characterization value, determine whether to merge adjacent initial clusters. If so, merge the corresponding adjacent initial clusters to obtain the connected components corresponding to different parts in the CAD drawing.
[0069] In this embodiment, the merging probability value of each pair of adjacent initial clusters and the inductive stopping characterization value of each initial cluster to its adjacent initial clusters have been obtained. Next, it will be determined whether to merge the adjacent initial clusters based on the merging probability value and the inductive stopping characterization value.
[0070] Specifically, if two adjacent initial clusters meet a preset condition, the corresponding adjacent initial clusters are merged to obtain at least two new clusters. Further, if two adjacent new clusters again meet the preset condition, the corresponding two adjacent new clusters are merged, and so on, until the preset condition is no longer met. The final merged connected component is then used as the connected component corresponding to different parts in the CAD drawing. The preset condition is: the merging probability value is greater than the merging threshold, and the induction stopping characteristic value is less than the induction stopping threshold. That is, if the merging probability value of two adjacent initial clusters is greater than the merging threshold, and the corresponding induction stopping characteristic value is less than the induction stopping threshold, then the corresponding two adjacent initial clusters are merged. Merging process: If the merging probability value of two adjacent initial clusters is less than the merging threshold, or the corresponding inductive stopping characterization value is greater than or equal to the inductive stopping threshold, then the two adjacent initial clusters are not merged. Each connected component after merging is recorded as a new cluster, thus obtaining multiple new clusters. The merging probability value of each pair of adjacent new clusters and the inductive stopping characterization value of each new cluster relative to its adjacent new clusters are calculated again. If two adjacent new clusters meet the preset conditions, then the corresponding adjacent new clusters are merged. This process is repeated until each connected component obtained after merging is used as the connected component corresponding to a part in the CAD drawing, that is, the connected components corresponding to different parts of the equipment are obtained. In this embodiment, the merging threshold is 0.85 and the inductive stopping threshold is 0.8. In specific applications, the implementer can set these values according to the specific situation.
[0071] The above processing divides the CAD drawings in the architectural design into multiple connected components. Each connected component represents a similar functional part of the equipment in the CAD drawing. The division results are then mapped onto the equipment's CAD drawing to obtain multiple blocks with similar functional structures. This method of dividing CAD drawings through clustering, compared to grid-based partitioning, considers the structural similarity of the building equipment itself, making the partitioning results more characteristic. Finally, an index is created based on the partitioning results, and the divided CAD drawings are stored in the manufacturer's data center for subsequent quick and accurate location of one or more parts of the equipment.
[0072] This embodiment addresses the challenge of quickly and accurately locating different parts in CAD drawings of equipment used in architectural design, where these drawings are often large and difficult to analyze quickly. Therefore, this embodiment first clusters all pixels in the binary image of the CAD drawing to obtain multiple initial clusters. Generally, parts serving a specific function are concentrated in a certain area and have similar structural forms. This embodiment obtains corresponding clusters based on the relative distance between each pair of adjacent initial clusters, the difference in the number of pixels they contain, the difference in morphological features, and the difference in area. The merging probability value, which analyzes the morphological similarity of the initial clusters, and the morphological characteristics, pixel distribution, and merging probability value of each initial cluster after merging with its neighboring initial clusters, are used to obtain the corresponding inductive stopping characterization value. Then, the merging probability value and the inductive stopping characterization value are combined to merge adjacent initial clusters to obtain the connected components corresponding to different parts. This allows for the rapid location of the CAD structure of a part when analyzing local parts of a device, reducing the redundant influence of other irrelevant structures, ensuring that different parts in CAD drawings of architectural designs can be located quickly and accurately, and improving analysis efficiency.
[0073] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A CAD data management method for assisting architectural design, characterized in that, The method includes the following steps: Obtain binary images of CAD drawings used in architectural design; Based on the pixel values of the pixels in the binary image, the pixels in the binary image are clustered to obtain no less than two initial clusters; according to the relative distance between each pair of adjacent initial clusters, the difference in the number of pixels contained, the difference in morphological features, and the difference in area, the merging probability value of each pair of adjacent initial clusters is obtained; according to the morphological features of each initial cluster after merging with its adjacent initial clusters, the distribution of the number of pixels, and the corresponding merging probability value, the inductive stopping characterization value of each initial cluster with respect to its adjacent initial clusters is calculated. Based on the merging probability value and the inductive stopping characterization value, it is determined whether to merge adjacent initial clusters. If so, the corresponding adjacent initial clusters are merged to obtain the connected components corresponding to different parts in the CAD drawing. The method of obtaining the merging probability value of each pair of adjacent initial clusters based on the relative distance between each pair of adjacent initial clusters, the difference in the number of pixels contained therein, the difference in morphological features, and the difference in area includes: For the g-th initial cluster: obtain the area of the minimum circumcircle of the g-th initial cluster; based on the area of the minimum circumcircle of the g-th initial cluster, the area of the g-th initial cluster, and the length of the edge line of the g-th initial cluster, obtain the isoperimeter area ratio of the g-th initial cluster. For the g-th initial cluster and its neighboring a-th initial cluster: obtain the distance between the g-th initial cluster and its neighboring a-th initial cluster; based on the distance between the g-th initial cluster and its neighboring a-th initial cluster, the difference in the number of pixels contained in the g-th initial cluster and its neighboring a-th initial cluster, and the difference in the isoperimeter area ratio between the g-th initial cluster and its neighboring a-th initial cluster, obtain the merging probability value of the g-th initial cluster and its neighboring a-th initial cluster; The step of clustering pixels in the binary image based on their pixel values to obtain at least two initial clusters includes: Based on the pixel values of the pixels in the binary image, an iterative self-organizing clustering algorithm is used to cluster all pixels in the binary image to obtain no less than two initial clusters.
2. The CAD data management method for assisting architectural design according to claim 1, characterized in that, Based on the area of the minimum circumcircle of the g-th initial cluster, the area of the g-th initial cluster, and the length of the edge line of the g-th initial cluster, the isoperimeter area ratio of the g-th initial cluster is obtained, including: The difference between the area of the smallest circumcircle of the g-th initial cluster and the area of the g-th initial cluster is denoted as the area difference corresponding to the g-th initial cluster. The ratio of the length of the edge line of the g-th initial cluster to the area difference corresponding to the g-th initial cluster is determined as the perimeter area ratio of the g-th initial cluster.
3. The CAD data management method for assisting architectural design according to claim 2, characterized in that, The probability of merging the g-th initial cluster and its neighboring a-th initial cluster is calculated using the following formula: in, Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster. Let g be the distance between the g-th initial cluster and its neighboring a-th initial cluster. Let g be the number of pixels contained in the g-th initial cluster. Let be the number of pixels contained in the a-th initial cluster that is adjacent to the g-th initial cluster. The ratio of the perimeter areas of the g-th initial cluster is given by [the value of the ... The ratio of the perimeter area of the a-th initial cluster adjacent to the g-th initial cluster. To determine the absolute value sign, exp() represents an exponential function with the natural constant as the base, and E is a preset adjustment parameter, which is greater than 0.
4. The CAD data management method for assisting architectural design according to claim 1, characterized in that, The step involves calculating the inductive stopping value of each initial cluster relative to its neighboring initial clusters based on the morphological characteristics, pixel distribution, and corresponding merging probability values of each initial cluster after merging with its neighboring initial clusters, including: For the g-th initial cluster and its neighboring a-th initial cluster: The region obtained by merging the g-th initial cluster and its adjacent a-th initial cluster is denoted as the region to be analyzed. The PCA analysis method is used to process the region to be analyzed to obtain the maximum principal component direction vector and the minimum principal component direction vector corresponding to the region to be analyzed. Convex hull detection is performed on the region to be analyzed to obtain the corresponding convex polygon, and the interior angle of the convex polygon is obtained; the angle characterization value is determined based on the interior angle of the convex polygon. The ratio of the number of pixels in the region to be analyzed to the total number of pixels in the binary image is taken as the proportion of the region to be analyzed. Based on the proportion of the number corresponding to the region to be analyzed, the probability value of merging the g-th initial cluster and its adjacent a-th initial cluster, the angle characterization value, the magnitude of the direction vector of the largest principal component and the magnitude of the direction vector of the smallest principal component corresponding to the region to be analyzed, the inductive stopping characterization value of the g-th initial cluster to its adjacent a-th initial cluster is obtained.
5. The CAD data management method for assisting architectural design according to claim 4, characterized in that, The inductive stopping characterization of the g-th initial cluster relative to its neighboring a-th initial cluster is calculated using the following formula: in, Let be the inductive stopping characterization value of the g-th initial cluster relative to its neighboring a-th initial cluster. G represents the number of pixels in the region to be analyzed, and G represents the total number of pixels in the binary image. Let be the magnitude of the direction vector of the minimum principal component corresponding to the region to be analyzed. Let be the magnitude of the direction vector of the largest principal component corresponding to the region to be analyzed. Let be the probability value of merging the g-th initial cluster with its neighboring a-th initial cluster, and K be the number of interior angles of the convex polygon. Let k be the interior angle of the convex polygon. Let be the cosine of the k-th interior angle of the convex polygon, and sigmoid() is the normalization function.
6. The CAD data management method for assisting architectural design according to claim 4, characterized in that, Determining the angle representation value based on the interior angle of the convex polygon includes: The difference between the constant 1 and the cosine value of each interior angle is taken as the first characteristic value corresponding to each interior angle, and the average value of the first characteristic values corresponding to all interior angles is recorded as the angle characterization value.
7. The CAD data management method for assisting architectural design according to claim 1, characterized in that, The step of determining whether to merge adjacent initial clusters based on the merging probability value and the inductive stopping characterization value, and if so, merging the corresponding adjacent initial clusters to obtain the connected components corresponding to different parts in the CAD drawing, includes: If two adjacent initial clusters meet the preset conditions, the corresponding adjacent initial clusters are merged to obtain no less than two new clusters; if two adjacent new clusters meet the preset conditions again, the corresponding two adjacent new clusters are merged, and so on, until the preset conditions are no longer met. The final merged connected components are used as the connected components corresponding to different parts in the CAD drawing. The preset conditions are: the merging probability value is greater than the merging threshold, and the induction stopping characteristic value is less than the induction stopping threshold.
8. The CAD data management method for assisting architectural design according to claim 1, characterized in that, Obtain the distance between the g-th initial cluster and its neighboring a-th initial cluster, including: The intersection of the two diagonals of the minimum bounding rectangle of each initial cluster is taken as the center point of each initial cluster. The Euclidean distance between the center point of the g-th initial cluster and the center point of the a-th initial cluster adjacent to it is taken as the distance between the g-th initial cluster and the a-th initial cluster adjacent to it.
Citation Information
Patent Citations
Pixel data processing method and device and electronic equipment
CN113553454A
Intelligent picture frame drawing method and system based on computer vision and pixel clustering
CN119004643A