Method and device for identifying and vectorizing house type image, medium and product

By performing grayscale processing and binarized edge detection on the floor plan, the characteristics of the wall and opening areas are identified, and automatic vectorization is realized, solving the time-consuming and labor-intensive problem of floor plan vectorization in the existing technology, improving efficiency and accuracy sex.

CN119229467APending Publication Date: 2024-12-31CHINESE ACAD OF SURVEYING & MAPPING
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411319948.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, the vectorization process of floor plans relies on manual operations, which is time-consuming and labor-intensive. The accuracy of raster floor plans recognition and vectorization is low, and it takes a long time to meet the needs of users for three-dimensional data.

Method used

By graying the floor plan to be processed, a binary algorithm and edge detection algorithm are used to identify the wall structure and opening areas, and combining window and door features, the automatic vectorized floor plan identification and conversion is realized.

Benefits of technology

It improves the vectorization efficiency of floor plan, saves a lot of labor costs, and realizes accurate identification and vectorization of raster floor plan, meeting the needs of three-dimensional data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119229467A_ABST
    Figure CN119229467A_ABST
Patent Text Reader

Abstract

The invention discloses a house type image recognition and vectorization method and device, a medium and a product, and relates to the technical field of computer vision and image processing.The method comprises the steps that graying processing is conducted on a to-be-processed house type image, then a binarization algorithm and an edge detection algorithm are adopted to recognize a wall structure, and a recognized wall structure house type image is obtained; and then the position of the wall opening area and the position of the door and window structure in the identified wall structure house type image are identified, and the vectorized house type image is obtained based on the positions, so that automatic vectorization of the house type image is realized, the vectorization efficiency of the house type image is improved, and a large amount of labor cost is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer vision and image processing, and in particular to a method, device, medium and product for identifying and vectorizing floor plan. Background Art

[0002] In the home decoration industry, people often come into contact with a variety of floor plans. Existing methods for vectorizing floor plans often use manual comparison and drawing to obtain vector floor plans. The process of manually extracting vectorized data involves a large number of interactive operations, which is time-consuming and laborious. Summary of the invention

[0003] The purpose of this application is to provide a method, device, medium and product for identifying and vectorizing floor plans, which can automatically vectorize floor plans based on image recognition, improve the vectorization efficiency of floor plans, and save a lot of manpower costs.

[0004] To achieve the above objectives, this application provides the following solutions:

[0005] In a first aspect, the present application provides a method for identifying and vectorizing a floor plan, comprising:

[0006] Get the floor plan to be processed;

[0007] Grayscale the floor plan to be processed to obtain a floor plan grayscale image;

[0008] Using a binarization algorithm and an edge detection algorithm to identify the position of the wall structure in the grayscale image of the apartment type, to obtain an identified wall structure apartment type image;

[0009] According to the position of the wall structure in the floor plan for identifying the wall structure, the length of the target line segment and the length threshold range, the position of the wall opening area is identified to obtain the floor plan for identifying the wall opening area, wherein the target line segment refers to the shortest intersecting line segment between the baseline of each isolated wall segment and other isolated wall segments other than itself, each isolated wall segment refers to a suspended wall segment in the wall structure, each isolated wall segment is composed of a plurality of connected first line segments, each of the first line segments has a preset width, the target symmetry center line of each first line segment is the baseline, and the target symmetry center line refers to the symmetry center line of the first line segment in the same extension direction as the first line segment;

[0010] According to the position of the wall opening area in the floor plan of the identified wall opening area, the window features and the door features, the position of the window structure and the position of the door structure are identified to obtain an identified door and window floor plan, wherein the window features are represented by second line segments that meet a first preset condition, the first preset condition being that the number of the second line segments is a preset number, the second line segments are parallel to each other, and the two endpoints of each of the second line segments are connected to the first line segment, and the door features are represented by a target graphic, the target graphic comprising a third line segment and an arc, the third line segment and the arc are both connected to the first line segment, and the third line segment is connected to the arc;

[0011] According to the identified door and window type diagram, a vectorized floor plan is obtained.

[0012] In a second aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned method for recognizing and vectorizing floor plan.

[0013] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned method for recognizing and vectorizing floor plan.

[0014] In a fourth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned method for recognizing and vectorizing floor plan.

[0015] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0016] The present application provides a method, device, medium and product for identifying and vectorizing floor plans. The method first performs grayscale processing on the floor plan to be processed, then uses a binarization algorithm and an edge detection algorithm to identify the wall structure to obtain an identified wall structure floor plan, then identifies the position of the wall opening area and the position of the door and window structure in the identified wall structure floor plan, and obtains a vectorized floor plan based on this, thereby realizing automatic vectorization of the floor plan, improving the vectorization efficiency of the floor plan, and saving a lot of labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is an application environment diagram of a floor plan recognition and vectorization method in Example 1 of the present application;

[0019] Figure 2 A schematic diagram of a flow chart of a method for identifying and vectorizing a floor plan provided in Example 1 of the present application;

[0020] Figure 3 The grating floor plan to be processed in Example 1 of the present application;

[0021] Figure 4 It is the grayscale image of the apartment type in Example 1 of the present application;

[0022] Figure 5 The floor plan with the wall structure identified in Example 1 of the present application;

[0023] Figure 6 The binarized floor plan obtained after being processed by the region growing algorithm and the binarization algorithm in Example 1 of the present application;

[0024] Figure 7 This is a schematic diagram of the isolated hanging section of the wall in Example 1 of the present application;

[0025] Figure 8 The floor plan with the wall opening area identified in Example 1 of the present application;

[0026] Fig. 9 A schematic diagram of the baseline in Example 1 of the present application;

[0027] Fig.10 A schematic diagram of the search area in Example 1 of the present application;

[0028] Fig.11 The vectorized floor plan in Example 1 of the present application;

[0029] Fig.12 A schematic diagram of the structure of a computer device provided in Example 2 of the present application. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0031] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0032] Example 1

[0033] The method for recognizing and vectorizing a floor plan provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, or placed on the cloud or other servers. The terminal 102 can send the floor plan to be processed to the server 104. After the server 104 receives the floor plan to be processed, the floor plan to be processed is grayed to obtain a floor plan grayscale map; the position of the wall structure in the floor plan grayscale map is identified by using a binarization algorithm and an edge detection algorithm to obtain an identified wall structure floor plan; according to the position of the wall structure in the identified wall structure floor plan, the length of the target line segment and the length threshold range, the position of the wall opening area is identified to obtain an identified wall opening area floor plan; according to the position of the wall opening area in the identified wall opening area floor plan, the window features and the door features, the position of the window structure and the position of the door structure are identified to obtain an identified door and window type map; according to the identified door and window type map, a vectorized floor plan is obtained. The server 104 may feed back the obtained vectorized floor plan to the terminal 102. In addition, in some embodiments, the floor plan recognition and vectorization method may also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 may directly process the floor plan to be processed using the user floor plan recognition and vectorization method, or the server 104 may obtain the floor plan to be processed from the data storage system and process it using the user floor plan recognition and vectorization method.

[0034] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, etc. The portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.

[0035] In an exemplary embodiment, a method for identifying and vectorizing a floor plan is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate the method, which includes the following steps 201 to 206. Among them:

[0036] Step 201, obtaining the floor plan to be processed.

[0037] Step 202, grayscale the floor plan to be processed to obtain a floor plan grayscale map.

[0038] Step 203, using a binarization algorithm and an edge detection algorithm to identify the position of the wall structure in the apartment grayscale image, to obtain an identified wall structure apartment image.

[0039] Step 204, according to the position of the wall structure in the floor plan for identifying the wall structure, the length of the target line segment and the length threshold range, the position of the wall opening area is identified to obtain the floor plan for identifying the wall opening area, wherein the target line segment refers to the shortest intersecting line segment between the baseline of each isolated wall segment and other isolated wall segments other than itself, each isolated wall segment refers to a wall segment suspended in the wall structure, each of the isolated wall segments is composed of a plurality of connected first line segments, each of the first line segments has a preset width, the target symmetry center line of each of the first line segments is the baseline, and the target symmetry center line refers to the symmetry center line of the first line segment in the same extension direction as the first line segment.

[0040] Step 205, according to the position of the wall opening area in the floor plan of the identified wall opening area, the window features and the door features, the position of the window structure and the position of the door structure are identified to obtain an identified door and window floor plan, wherein the window feature is represented by a second line segment that meets a first preset condition, the first preset condition is that the number of the second line segments is a preset number, the second line segments are parallel to each other, and the two endpoints of each of the second line segments are connected to the first line segment, the door feature is represented by a target graphic, the target graphic includes a third line segment and an arc, the third line segment and the arc are both connected to the first line segment, and the third line segment is connected to the arc.

[0041] Step 206, obtaining a vectorized floor plan based on the identified door and window type diagram.

[0042] By implementing the above steps 201 to 206, automatic vectorization of the floor plan is realized, the vectorization efficiency of the floor plan is improved, and a large amount of labor costs are saved.

[0043] In the field of home decoration, the floor plans that people can easily obtain are usually raster floor plans. At present, the methods of raster floor plan recognition and vectorization are mainly divided into two categories: one is to first vectorize the scanned image, and then analyze and identify the building component symbols in the vector map; the other is to directly identify the building components of the raster image and then obtain vectorized data. Floor plans based on raster images are greatly affected by low-level processing processes, such as segmentation and vectorization. The accuracy of existing vectorization algorithms is low, and the vectorization process is time-consuming and labor-intensive, and often requires manual interaction. As a result, the rules introduced by existing algorithms in the symbol recognition stage are relatively simple, which affects the symbol recognition effect. In addition, due to the flexibility and diversity of the component symbol representation method, the accuracy and completeness of component symbol recognition is also a big bottleneck, and the recognition results are difficult to be satisfactory.

[0044] The traditional method of manually extracting vectorized data of floor plans can no longer meet the current user demand for three-dimensional floor plan data, and there is relatively little research in the field of architectural floor plans. Therefore, studying the rapid recognition of raster floor plans and obtaining the corresponding floor plan vectorized data based on two-dimensional architectural floor plans is a very challenging scientific problem.

[0045] In order to overcome the defects of the above-mentioned raster floor plan recognition and vectorization process, the present embodiment sets the floor plan to be processed in the above-mentioned floor plan recognition and vectorization method as the raster floor plan to be processed, so as to make those skilled in the art more clear about the specific processing flow of the floor plan recognition and vectorization method for processing the raster floor plan (such as Figure 2 As shown), the following combination Figure 2-Figure 11 Provide specific explanation.

[0046] (1) The processed raster floor plan is grayed out to obtain a floor plan grayscale image.

[0047] Since the colors of raster floor plans drawn by different software are different, in order to ensure the consistency and accuracy of subsequent processing, it is necessary to process all input raster floor plans to be processed (such as Figure 3 As shown in the figure, grayscale processing is uniformly performed to obtain a grayscale image of the house type, such as Figure 4 In this way, the color differences caused by different drawing software can be eliminated, making all floor plans consistent in color.

[0048] (2) Binarize the grayscale image of the house type according to the binarization threshold range, convert it into a binary image, and complete the recognition and extraction of the wall area (the wall area is the wall line with a certain width).

[0049] (2-1) Grayscale of apartment type Figure 2 The process of valuing.

[0050] Research has found that the method for determining the binarization threshold is usually as follows: first, the grayscale value of the global image is counted based on the grayscale map of the apartment type; second, a grayscale distribution statistical histogram (grayscale value-number of pixels) is drawn based on a number of grayscale values ​​and the number of pixels; then, the peak grayscale is determined based on the grayscale distribution statistical histogram, where the peak grayscale refers to the grayscale value corresponding to the column whose number of pixels is greater than the pixel threshold; then the flatness of these peak grayscales is calculated, and the peak grayscale with the highest flatness is selected as the grayscale of the wall structure, and the binarization thresholds are set in turn.

[0051] Because the wall colors in the floor plans drawn by different software may be different, some walls are represented by a fixed value (such as 255 black), but some walls are represented by grayscale ranges from 240 to 255 (that is, the walls have multiple grayscale values). When binarizing, most people consider that the walls have only one color. In the above method, since the grayscale of the wall structure is a fixed value, using only one peak grayscale to identify the wall may miss some walls.

[0052] In order to solve this problem, this embodiment proposes an improved method. Specifically, this embodiment first selects a grayscale domain that can represent the wall lines, and this grayscale domain covers the grayscale range of the wall lines. Then, this grayscale domain is used as the binarization threshold range to perform binarization processing on the grayscale image of the house type. Through this method, the wall area can be identified more accurately, thereby avoiding the problem of information loss caused by a single grayscale peak.

[0053] The specific steps of the improved method in this embodiment include:

[0054] (2-1-1) Draw a grayscale distribution statistical histogram based on all the pixels in the grayscale image of the apartment type and the grayscale values ​​corresponding to the pixels.

[0055] (2-1-2) Selecting the grayscale value corresponding to the target column in the grayscale distribution statistical histogram as the peak grayscale, wherein the target column refers to a column in the grayscale distribution statistical histogram in which the number of pixel points corresponding to the column is greater than a quantity threshold.

[0056] (2-1-3) Calculate the straightness of the peak grayscale and the straightness of the neighborhood grayscale of the peak grayscale respectively, and obtain the peak grayscale straightness and the neighborhood grayscale straightness, wherein the neighborhood grayscale refers to the grayscale value corresponding to the column adjacent to the target column.

[0057] (2-1-4) Calculate the absolute value of the difference between the peak grayscale flatness and the neighborhood grayscale flatness.

[0058] (2-1-5) Select the peak grayscale whose absolute value is less than the difference threshold as the target grayscale value.

[0059] (2-1-6) Determine the grayscale domain based on all the target grayscale values.

[0060] (2-1-7) The grayscale domain is used as a binarization threshold range.

[0061] (2-1-8) Binarizing the grayscale image of the floor plan according to the binarization threshold range to obtain a binarized floor plan.

[0062] (2-2) The process of identifying wall areas using binary floor plans.

[0063] The edge detection algorithm is used to identify the position (i.e. coordinates) of the wall endpoints and the position of the wall inflection points in the binary apartment. According to the positions of all the identified wall endpoints and the positions of the wall inflection points, the position of the wall structure is determined to complete the identification and extraction of the wall line. The identified wall structure is as follows: Figure 5 As shown, the wall endpoints and wall inflection points refer to pixel points where the pixel gradient change amplitude is greater than the change amplitude threshold.

[0064] (3) Identify the maximum outer contour line based on the grayscale image of the house type.

[0065] (3-1) The grayscale image of the floor plan is processed using a region growing algorithm and a binarization algorithm to obtain a binarized floor plan.

[0066] This embodiment uses a seed filling algorithm as a region growing algorithm to process the grayscale image of the house type. The specific processing process includes:

[0067] (3-1-1) Select a pixel point in the grayscale image of the house type as a seed point.

[0068] (3-1-2) A region growing algorithm is used to identify pixel points that are in the same connected domain as the seed point, and grayscale images of the identified pixel area and the unidentified area are obtained, wherein the connected domain refers to an area that can be connected in the grayscale image of the house type, and the connected domain is an area composed of a target pixel set, and the target pixel set is a pixel set composed of pixels with the same characteristics or the same attributes.

[0069] like Figure 4 As shown, the bedroom is connected to the living room, the living room is connected to the kitchen, so the kitchen and the bedroom are also connected. All the rooms in this grayscale image are connected, and the set of these connected places is called a connected domain.

[0070] (3-1-3) Binarize the grayscale images of the identified pixel area and the unidentified area to obtain a binary floor plan, such as Figure 6 shown.

[0071] The identified pixel area (i.e., all pixels inside the connected domain) is set to a white background, and the unidentified area (i.e., the boundary of the connected domain and the pixels outside the boundary) is set to a black background.

[0072] (3-2) The edge detection algorithm is used to process the binary floor plan, identify the position of the maximum outer contour line, and obtain the floor plan with the identified outer contour line.

[0073] In order to obtain the outer contour line of the floor plan, it is also necessary to perform contour detection on the binary image. The FindContours function is used to identify the position information of the pixel points whose pixel gradient change amplitude is greater than the amplitude threshold in the binary image, and the coordinate array of the contour inflection point is obtained. Then, the DrawContours function is used to output the maximum outer contour line drawn by the coordinate array of the contour inflection point.

[0074] (4) Eliminate interference information.

[0075] The binary floor plan used to identify the wall structure in step (2) is matched with the binary floor plan used to identify the outer contour line in step (3), and external interference information such as text descriptions, dimension annotations, scales, etc. of both are eliminated according to the position of the wall structure and the position of the maximum outer contour line.

[0076] It should be noted that the order of the steps of identifying the maximum outer contour line and removing interference information in the present embodiment is not limited, and it can be performed before identifying the wall opening area (such as Figure 2 As shown), after obtaining the vectorized floor plan after identifying the wall structure, identifying the wall opening area, and identifying the doors and windows, the steps of identifying the maximum outer contour line and removing the interference information may be performed.

[0077] (5) Identify the wall opening area.

[0078] (5-1) Determine all the isolated wall segments in the wall structure after identification. The isolated wall segment refers to the wall segment that is suspended in the wall structure after identification. The isolated wall segment is composed of several connected line segments, such as Figure 7 As shown, each wall segment enclosed by a rectangular frame is an isolated wall segment.

[0079] (5-1) Traverse all the isolated wall segments, take any isolated wall segment as an example, retrieve the isolated wall segment that intersects with its baseline and is closest to it, and determine whether the length of its intersecting line segment is within a certain threshold range, such as Figure 7 As shown, if yes, then the position of the intersecting line segment is the position of the wall opening area, such as Figure 8 shown.

[0080] like Fig. 9As shown, for any isolated wall segment, the number of its baselines is the same as the number of line segments composed of the isolated wall segment. Since the wall line is a line segment with width, each baseline is the symmetric center line of the corresponding line segment, and the extension direction of the baseline is the same as the extension direction of the corresponding line segment.

[0081] (6) Identify and extract door and window structures.

[0082] (6-1) Window structure identification process:

[0083] At the position of the identified wall opening area, the position of the window structure is identified based on the window features, wherein the window features are represented by second line segments that meet a first preset condition, the first preset condition being that the number of the second line segments is a preset number, the second line segments are parallel to each other, and both endpoints of each of the second line segments are connected to the first line segment.

[0084] Since the features of the window are relatively obvious (rectangular area, composed of 3 to 5 parallel lines and connected to the wall lines), the position of the wall opening area is judged whether it contains window features. If it does, the position of the wall opening area is identified as the position of the window structure.

[0085] (6-2) Window structure identification process:

[0086] The position of the door structure is identified based on the position of the identified wall opening area and the door features, wherein the target graphic includes a third line segment and an arc, the third line segment and the arc are both connected to the first line segment, and the third line segment is connected to the arc.

[0087] Unlike window structure recognition, it is reasonable to limit the window retrieval area to the wall opening area. However, according to the door characteristics (usually expressed as a figure composed of a quarter arc and a line segment, and both ends of the arc and the line segment are connected to the wall line), the door is often located on the non-wall end of the wall opening area. The area occupied by the door is much larger than the wall opening area. Therefore, when searching for the door, it is necessary to expand a certain range to both sides of the non-wall end to search the door body.

[0088] Therefore, the location of the door structure is identified based on the location of the identified wall opening area and the door features, including:

[0089] (6-2-1) Along both sides of the non-wall end of the identified wall opening area, gradually expand a certain range to obtain a search area.

[0090] (6-2-2) When the height of the current search area (i.e., the door body to be searched area) is within the height threshold range and the third line segment can be retrieved in the current search area (e.g., Fig.10As shown), stop expanding, and determine whether the arc can be retrieved in the current search area.

[0091] (6-2-3) If the arc can be retrieved in the current search area and the area ratio is within the threshold range, the position of the door structure is determined based on the retrieved third line segment and the arc, wherein the area ratio refers to the ratio between a first area and a second area, the first area refers to the area of ​​the area between the arc and the non-wall end of the identified wall opening area, and the second area refers to the area of ​​the current search area.

[0092] The arc divides the search area into two parts. When the area ratio of the first area to the second area is within the range of (0.5, π / 4), it is considered that a gate structure exists.

[0093] (6-2-4) If the arc can be found in the current search area and the area ratio is not within the threshold range, it is considered that there is no gate structure in the current search area.

[0094] (6-2-5) If the arc cannot be found in the currently expanded search area, it is considered that there is no gate structure in the currently expanded search area.

[0095] (6-2-6) When the height of the current search area exceeds the height threshold range and the third line segment is still not found in the current search area, it is considered that there is no gate structure in the current expanded search area.

[0096] The height of the search area is the height of the door. When the height of the search area exceeds a certain range and the third line segment is still not found, it is considered that there is no door structure. The final recognition result of the door structure is as follows: Fig.11 shown.

[0097] (7) Vectorization of raster floor plan.

[0098] Generate a vectorized floor plan based on the identified wall area, window structure, and door structure locations, such as Fig.11 shown.

[0099] The above process of this embodiment involves the identification and extraction of the main structural elements in the raster floor plan, and converting them into vectorized data. It can automatically and efficiently identify the structural components on the floor plan, and can use a large number of floor plan images to establish a vector floor plan database, saving a lot of manpower costs.

[0100] Compared with the prior art, the method for identifying and vectorizing floor plans provided in this embodiment can process the more mainstream floor plan types (such as raster floor plans) among the current floor plans, thereby ensuring the universality of the method; the method of accumulating pixel values ​​of wall contours can ensure the integrity of wall extraction; this embodiment can automatically identify building components better, reduce the degree of manual intervention, greatly reduce workload, and improve work efficiency; the raster floor plan after automatic identification and vectorization can be used as the data basis for three-dimensional reconstruction.

[0101] The present application also provides an application scenario, which applies the above-mentioned floor plan recognition and vectorization method. Specifically: The floor plan recognition and vectorization method provided in this embodiment can be applied in architectural design and renovation scenarios. The architectural design and renovation scenario includes a floor plan acquisition link, an image processing link, and a design optimization link. The floor plan recognition and vectorization method provided in this embodiment belongs to the core technology in the image processing link.

[0102] Example 2

[0103] This embodiment provides a computer device, which may be a server or a terminal. Its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store all data in the method for identifying and vectorizing the floor plan. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the method for identifying and vectorizing the floor plan provided in Example 1 is implemented.

[0104] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0105] Example 3

[0106] This embodiment provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method for recognizing and vectorizing the floor plan provided in Embodiment 1 is implemented.

[0107] Example 4

[0108] This embodiment provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the method for recognizing and vectorizing the floor plan provided in Embodiment 1 is implemented.

[0109] Example 5

[0110] This embodiment provides a computer program product, including a computer program, which, when executed by a processor, implements the floor plan recognition and vectorization method provided in Embodiment 1.

[0111] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0112] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0113] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0115] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for identifying and vectorizing a floor plan, characterized in that: The floor plan recognition and vectorization method includes: Get the floor plan to be processed; Grayscale the floor plan to be processed to obtain a floor plan grayscale image; Using a binarization algorithm and an edge detection algorithm to identify the position of the wall structure in the grayscale image of the apartment type, to obtain an identified wall structure apartment type image; According to the position of the wall structure in the floor plan for identifying the wall structure, the length of the target line segment and the length threshold range, the position of the wall opening area is identified to obtain the floor plan for identifying the wall opening area, wherein the target line segment refers to the shortest intersecting line segment between the baseline of each isolated wall segment and other isolated wall segments other than itself, each isolated wall segment refers to a suspended wall segment in the wall structure, each isolated wall segment is composed of a plurality of connected first line segments, each of the first line segments has a preset width, the target symmetry center line of each first line segment is the baseline, and the target symmetry center line refers to the symmetry center line of the first line segment in the same extension direction as the first line segment; According to the position of the wall opening area in the floor plan of the identified wall opening area, the window features and the door features, the position of the window structure and the position of the door structure are identified to obtain an identified door and window floor plan, wherein the window features are represented by second line segments that meet a first preset condition, the first preset condition being that the number of the second line segments is a preset number, the second line segments are parallel to each other, and the two endpoints of each of the second line segments are connected to the first line segment, and the door features are represented by a target graphic, the target graphic comprising a third line segment and an arc, the third line segment and the arc are both connected to the first line segment, and the third line segment is connected to the arc; According to the identified door and window type diagram, a vectorized floor plan is obtained.

2. The method for identifying and vectorizing a floor plan according to claim 1, characterized in that: The method for identifying and vectorizing the floor plan also includes: Eliminating interference information in the vectorized floor plan specifically includes: Using a region growing algorithm and a binarization algorithm to process the grayscale image of the apartment type, to obtain a second binarized apartment type image; The second binarized floor plan is processed by using an edge detection algorithm to identify the position of the maximum outer contour line, thereby obtaining an outer contour line identified floor plan; Merging the vectorized floor plan with the identified outer contour floor plan to obtain a fused floor plan; According to the position of the wall structure and the position of the maximum outer contour line in the fused floor plan, interference information is eliminated.

3. The method for identifying and vectorizing a floor plan according to claim 2, characterized in that: The grayscale image of the floor plan is processed by using a region growing algorithm and a binarization algorithm to obtain a second binarized floor plan, which specifically includes: Select a pixel point in the grayscale image of the house type as a seed point; A region growing algorithm is used to identify pixel points that are in the same connected domain as the seed point, and a grayscale image of an identified pixel region and an unidentified region is obtained, wherein the connected domain refers to a region that can be connected in the grayscale image of the house type, and the connected domain is a region composed of a target pixel set, and the target pixel set is a pixel set composed of pixels with the same characteristics or the same attributes; The grayscale images of the identified pixel area and the unidentified area are binarized to obtain a second binarized floor plan.

4. The method for identifying and vectorizing a floor plan according to claim 2, characterized in that: The second binarized floor plan is processed by using an edge detection algorithm to identify the position of the maximum outer contour line to obtain an outer contour line floor plan, which specifically includes: Using an edge detection algorithm to identify the position of the contour inflection point in the second binarized floor plan, wherein the contour inflection point refers to a pixel point where the pixel gradient change amplitude is greater than a change amplitude threshold; According to the positions of all identified contour turning points, the position of the maximum outer contour line is determined, and the identified outer contour line floor plan is obtained accordingly.

5. The method for identifying and vectorizing a floor plan according to claim 1, characterized in that: The position of the wall structure in the grayscale image of the apartment is identified by using a binarization algorithm and an edge detection algorithm to obtain an identified wall structure apartment image, specifically including: Using a binarization algorithm to process the grayscale image of the floor plan to obtain a first binarized floor plan; Using an edge detection algorithm to identify the position of the wall structure in the first binarized floor plan to obtain an identified wall structure floor plan; The adopting a binarization algorithm to process the grayscale image of the floor plan to obtain a first binarized floor plan specifically includes: Draw a grayscale distribution statistical histogram based on all the pixels and the grayscale values ​​corresponding to the pixels in the apartment grayscale image; Selecting the grayscale value corresponding to the target column in the grayscale distribution statistical histogram as the peak grayscale, wherein the target column refers to a column in the grayscale distribution statistical histogram whose number of pixel points corresponding to the column is greater than a quantity threshold; Calculate the straightness of the peak grayscale and the straightness of the neighborhood grayscale of the peak grayscale respectively, to obtain the peak grayscale straightness and the neighborhood grayscale straightness, wherein the neighborhood grayscale refers to the grayscale value corresponding to the cylinder adjacent to the target cylinder; Calculating the absolute value of the difference between the peak grayscale flatness and the neighborhood grayscale flatness; Select the peak grayscale whose absolute value is less than the difference threshold as the target grayscale value; Determine a grayscale domain according to all the target grayscale values; Using the grayscale domain as a binarization threshold range; The apartment grayscale image is binarized according to the binarization threshold range to obtain a first binarized apartment image.

6. The method for identifying and vectorizing a floor plan according to claim 1, characterized in that: The specific process of identifying the location of the wall opening area includes: Determine whether the length of the target line segment is within the length threshold range; If the length of the target line segment is within the length threshold range, the position of the target line segment is used as the position of the wall opening area.

7. The method for identifying and vectorizing a floor plan according to claim 1, characterized in that: The specific identification process of the door structure location includes: Along the two sides of the non-wall end of the identified wall opening area, gradually expand a certain range to obtain a search area; When the height of the current search area is within the height threshold range and the third line segment can be retrieved in the current search area, stop expanding and determine whether the arc can be retrieved in the current search area; If the arc can be retrieved in the current search area and the area ratio is within the threshold range, the position of the door structure is determined according to the retrieved third line segment and the arc, wherein the area ratio refers to the ratio between a first area and a second area, the first area refers to the area of ​​the area between the arc and the non-wall end of the identified wall opening area, and the second area refers to the area of ​​the current search area; If the arc can be found in the current search area and the area ratio is not within the threshold range, it is considered that there is no gate structure in the current search area; If the arc cannot be found in the currently expanded search area, it is considered that there is no gate structure in the currently expanded search area; When the height of the current search area exceeds the height threshold range and the third line segment is still not found in the current search area, it is considered that there is no gate structure in the current expanded search area.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method for recognizing and vectorizing a floor plan according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for recognizing and vectorizing the floor plan described in any one of claims 1 to 7 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for recognizing and vectorizing the floor plan described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • House type identification and three-dimensional reconstruction method and system based on grating image

    CN120279394A

  • Real estate surveying and mapping rapid vectorization method based on deep learning

    CN120318361A

  • House plan vectorization method and device, storage medium and electronic device

    CN121744458A

  • A method and apparatus for vectorizing floor plans, a storage medium, and an electronic device.

    CN121744458B