A method and device for vectorizing semantic segmentation graphs of building types

By dividing the semantic segmentation diagram into three parts: doors, windows, rooms and exterior walls, it solves the problems of inaccurate identification and insufficient noise point processing capabilities during semantic segmentation and vectorization of floor plan diagrams in the prior art, and achieves a higher Vectorization accuracy and effective identification of oblique floor plan.

CN114092491BActive Publication Date: 2025-02-18SOUTH CHINA NORMAL UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111362348.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-17
Publication Date
2025-02-18
Estimated Expiration
2041-11-17

AI Technical Summary

Technical Problem

When semantic segmentation and vectorization of building floor plans, the prior art has problems of inaccurate identification and insufficient noise point processing capabilities, especially when dealing with floor plans with oblique edges.

Method used

By dividing the semantic segmentation diagram into three parts: doors, windows, rooms and exterior walls, they are separately identified, and multiple sub-graphs are used for coordinate information extraction and edge detection, which improves the noise point processing capability and vectorization accuracy.

Benefits of technology

Improve the processing ability and vectorization accuracy of noise points, and can effectively identify the oblique edges in the floor plan. The test results show that the accuracy of the recognition of regular-shaped floor plan reaches 89%, and the accuracy of the recognition of oblique edge floor plan reaches 82%. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114092491B_ABST
    Figure CN114092491B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for vectorizing a semantic segmentation map of a building type. The method and device for vectorizing a semantic segmentation map of a building type described in the present invention include: obtaining a floor plan to be vectorized; performing semantic segmentation recognition on the floor plan to obtain a semantic segmentation map; copying the semantic segmentation map to obtain multiple sub-maps; for each of the sub-maps, extracting coordinate information of area types corresponding to color blocks of different colors; the area types include at least one of the following: doors and windows, rooms, and exterior walls; and saving the extracted coordinate information. The method and device for vectorizing a semantic segmentation map of a building type described in the present invention divides the semantic segmentation map into three parts for separate recognition, thereby solving the problem that the semantic segmentation map is easily disturbed by noise points during the vectorization recognition process, and the recognition of different types of pixel points is confused, thereby improving the processing capability for noise points and the vectorization accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition and image processing, and in particular to a method for vectorizing a semantic segmentation graph of a building type. Background Art

[0002] Floor plans are usually generated using special drawing tools (such as AutoCAD, HomeStyler, etc.) to help people quickly identify the structure of a house when buying or decorating it. The information in a two-dimensional floor plan is not as intuitive as that in a three-dimensional floor plan. Three-dimensional reconstruction of a two-dimensional floor plan requires vectorized information of the two-dimensional floor plan. Therefore, identifying the two-dimensional floor plan and obtaining the corresponding vectorized file becomes an important issue.

[0003] There are usually two methods for vectorizing floor plans. One is to identify the wall connection points of the floor plan and obtain the coordinate information of the room corners. However, this method has disadvantages. If some corners of the room are not identified, the identified floor plan structure will change. Another method is to first identify the semantic segmentation map of the floor plan and then perform a vectorization algorithm on the semantic segmentation map. However, the model identified by the current semantic segmentation model does not have good accuracy. Vectorization requires more accurate information, so the vectorization algorithm needs to have a certain robustness. In addition, the existing vectorization algorithm can usually identify floor plans with rectangular layouts, but it often does not work well for floor plans with beveled edges. Summary of the invention

[0004] Based on this, the purpose of the present invention is to provide a method and device for vectorizing a semantic segmentation map of a building type, which divides the semantic segmentation map into three parts for separate identification, namely doors and windows, rooms, and exterior walls, thereby improving the processing capability and vectorization accuracy of noise points.

[0005] In a first aspect, the present invention provides a method for vectorizing a semantic segmentation graph of a building type, the method comprising the following steps:

[0006] Get the floor plan to be vectorized;

[0007] Performing semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes blocks of different colors, each block of each color corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls;

[0008] Copying the semantic segmentation map to obtain multiple sub-maps;

[0009] For each of the sub-images, respectively extracting coordinate information of the region types corresponding to the color blocks of different colors;

[0010] The extracted coordinate information is saved.

[0011] Furthermore, when the area type is a door or window, extracting coordinate information for the sub-image includes the following steps:

[0012] Traverse each pixel in the sub-image to obtain the color of each pixel;

[0013] For all pixel points whose colors are not the preset door and window colors, the colors of the pixel points are changed to the background color to obtain a first door and window sub-image;

[0014] Performing edge detection on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window;

[0015] According to the outline and edge point coordinates of the door and window, the length, width and center point coordinates of the door and window are obtained;

[0016] The door and window coordinate information is saved, wherein the door and window coordinate information includes at least one of the following: edge point coordinates and center point coordinates.

[0017] Furthermore, after edge detection is performed on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window, the method further includes:

[0018] Traverse each of the door and window outlines to obtain the point with the smallest sum of the absolute values ​​of the coordinates, that is, the upper left corner of a door and window, align the coordinates of the lower left corner, the lower right corner, and the upper right corner with the X and Y axis points of the coordinates of the upper left corner, and obtain the four corner points of each door and window;

[0019] If the outline point of a door or window is less than 1 point, the point of the door or window will be deleted;

[0020] If a door or window has more than 4 outline points, the 4 coordinate points with the largest Euclidean distance between coordinates are taken as the edge points of the door or window.

[0021] Further, when the area type is a room, extracting coordinate information for the sub-image includes the following steps:

[0022] Performing color block recognition on the sub-image to obtain the color of each color block;

[0023] For each preset room type, for all color blocks whose colors are not the colors corresponding to the preset room type, the colors of the color blocks are changed to the background color to obtain a first room sub-image; wherein the room types to be identified include at least one of the following: bedroom, kitchen, balcony, living room, corridor;

[0024] Perform edge detection on the first room sub-image to obtain room coordinate information of each room of the preset room type, wherein the room coordinate information includes at least one of the following: room outline, room edge point coordinates, and room area;

[0025] The room coordinate information is saved.

[0026] Furthermore, after edge detection is performed on the first room sub-image to obtain room coordinate information of each room of the preset room type, the following steps are also included:

[0027] Traverse each of the room outlines to obtain the point with the smallest sum of the absolute values ​​of the coordinates, that is, the upper left corner point of a room;

[0028] Align the coordinates of the other edge points of the room with the X, Y axis points of the coordinates of the upper left corner point to obtain the edge points of each room.

[0029] Further, when the area type is an exterior wall, extracting coordinate information for the sub-image includes the following steps:

[0030] Traverse each pixel in the sub-image to obtain the color of each pixel;

[0031] For all pixel points whose colors are not the preset exterior wall colors, the colors of the pixel points are changed to the background color to obtain a first exterior wall sub-image;

[0032] Performing edge detection on the first exterior wall sub-image to obtain the outline and edge point coordinates of the exterior wall;

[0033] The external wall coordinate information is saved, wherein the external wall coordinate information includes at least one of the following: an external wall outline, external wall edge point coordinates, and a room area enclosed by the external wall.

[0034] Furthermore, after edge detection is performed on the first exterior wall sub-image to obtain the outline and edge point coordinates of each exterior wall, the method further includes:

[0035] Traverse each of the outer wall contours to obtain a point with the smallest sum of absolute coordinate values, that is, an upper left corner point of an outer wall;

[0036] Align the coordinates of the other edge points of the exterior wall with the X and Y axis points of the coordinates of the upper left corner point to obtain each exterior wall edge point.

[0037] Furthermore, when there is a slant edge in the semantic segmentation map, the detection method further includes:

[0038] When a room has a hypotenuse, the coordinates of each point on the hypotenuse are traversed, and the coordinate information of the first and last points of the hypotenuse is obtained according to the coordinate value of each point;

[0039] When a room has multiple oblique edges, the multiple oblique edge points are classified, and the DBScan clustering algorithm is used to classify the multiple oblique edges into multiple sets, and then the oblique edge points are determined to obtain the boundary points of the room.

[0040] In a second aspect, the present invention further provides a device for vectorizing a semantic segmentation graph of a building type, the device comprising:

[0041] An image acquisition module, used to acquire the floor plan to be vectorized;

[0042] A semantic segmentation module, configured to perform semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes blocks of different colors, each block of each color corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls;

[0043] An image copying module, which copies the semantic segmentation map to obtain multiple sub-maps;

[0044] A coordinate information extraction module, used to extract coordinate information of area types corresponding to color blocks of different colors for each of the sub-images;

[0045] The coordinate information saving module is used to save the extracted coordinate information.

[0046] The present invention provides a method and device for vectorizing semantic segmentation maps of building types, which divide the semantic segmentation map into three parts for identification, namely doors and windows, rooms, and exterior walls, thereby improving the processing capability and vectorization accuracy of noise points. Compared with the prior art, the method can pass the recognition test of semantic segmentation maps of building types, and can effectively and conveniently process the bevels in building types. In a random test of more than 100 regular building types, 89% of the building types with regular shapes can be accurately identified, and the remaining building types will result in missing doors and windows or missing rooms in the identification results due to noise points. For the identification of building types with bevels, 82% of the figures can be accurately identified.

[0047] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a flow chart of a method for vectorizing a semantic segmentation graph of a building type provided by the present invention;

[0049] Figure 2 An original floor plan used in an embodiment;

[0050] Figure 3 is a semantic segmentation map corresponding to the original floor plan in one embodiment;

[0051] Figure 4 A schematic diagram of the structure of a building type semantic segmentation map vectorization device provided by the present invention. DETAILED DESCRIPTION

[0052] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

[0053] It should be clear that 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 the embodiments of the present application.

[0054] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0055] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.

[0056] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0057] In view of the problems in the background technology, in the first aspect, the present invention provides a method for vectorizing a semantic segmentation graph of a building type, such as Figure 1 As shown, the method comprises the following steps:

[0058] S01: Obtain the floor plan to be vectorized.

[0059] S02: Perform semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes color blocks of different colors, and each color block corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls.

[0060] Semantic segmentation is a classification at the pixel level. Pixels belonging to the same category are classified into one category. Therefore, semantic segmentation understands images at the pixel level. Figure 2 and Figure 3 As shown, Figure 3 yes Figure 2 The semantic segmentation map obtained after semantic segmentation of the original floor plan, in which rooms, doors, windows, and walls are distinguished by different colors, and different types of rooms are also distinguished by different colors.

[0061] Preferably, a deep convolutional neural network algorithm is used to automatically recognize the semantics of the floor plan to obtain a semantic segmentation map of the floor plan, which specifically includes:

[0062] The Mask R-CNN algorithm is used to train the model based on the training samples to obtain the semantic recognition model of the floor plan;

[0063] The floor plan is input into the floor plan semantic recognition model to obtain a semantic segmentation map.

[0064] The Mask R-CNN algorithm is an algorithm that outputs high-quality instance segmentation masks while effectively detecting targets. It extends the Fast R-CNN algorithm by adding a branch for predicting segmentation masks on each region of interest in parallel with the existing branches for classification and bounding box regression, making its training simpler and easier to generalize to other tasks. The Mask R-CNN algorithm is a branch technology of target detection. Currently, target detection technology is widely used in the fields of face detection, vehicle detection, pedestrian detection, etc.

[0065] S03: Copy the semantic segmentation map to obtain a plurality of sub-maps.

[0066] S04: For each of the sub-images, respectively extract coordinate information of the region types corresponding to the color blocks of different colors.

[0067] In a specific embodiment, the original semantic segmentation map needs to be copied to obtain at least three sub-maps, and the coordinate information of doors and windows, rooms, and exterior walls is extracted respectively.

[0068] The information that needs to be identified for doors and windows includes: the center point coordinate information of the doors and windows, and the length and width of the doors and windows.

[0069] The information that needs to be identified about a room includes: room type, room area, and coordinate information of the room's edge points.

[0070] The information that needs to be identified about the exterior wall includes: coordinate information of the exterior wall edge points.

[0071] S05: Save the extracted coordinate information.

[0072] In a specific embodiment, all coordinate information is written into a JSON file to provide a JSON file for reconstructing the graph in the next step.

[0073] During the vectorization recognition process, the semantic segmentation map is easily disturbed by noise points, and the recognition of different types of pixels is confused, which affects the vectorization accuracy. Therefore, it is necessary to separate the semantic segmentation map for recognition. By dividing it into multiple sub-maps for recognition, the processing ability of noise points will be improved, which will achieve an effect of improving accuracy.

[0074] In a preferred embodiment, when the area type is a door or window, extracting coordinate information for the sub-image includes the following steps:

[0075] S0411: Traverse each pixel in the sub-image to obtain the color of each pixel.

[0076] S0412: For all pixel points whose colors are not the preset door and window colors, the colors of the pixel points are changed to the background color to obtain a first door and window sub-image.

[0077] S0413: Perform edge detection on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window.

[0078] In a preferred embodiment, the Canny edge detection algorithm is used, which includes the following four steps:

[0079] 1. Gaussian filtering

[0080] The main purpose of filtering is to reduce noise, and general image processing algorithms need to perform noise reduction first. Gaussian filtering mainly makes the image smooth (blurred), but it may also increase the width of the edge.

[0081] 2. Calculate the gradient value and gradient direction

[0082] The edge is a collection of pixels in an image with a large change in grayscale value. The middle of a black edge and a white edge is an edge, and its grayscale value changes the most. In an image, the gradient is used to represent the degree and direction of the change in grayscale value.

[0083] 3. Filter non-maximum values

[0084] During the Gaussian filtering process, the edge may be magnified. This step uses a rule to filter out points that are not edges, so that the width of the edge is as close to 1 pixel as possible: if a pixel belongs to an edge, then the gradient value of this pixel in the gradient direction is the largest. Otherwise, it is not an edge and the grayscale value is set to 0.

[0085] 4. Use upper and lower thresholds to detect edges

[0086] Set two thresholds, maxVal and minVal. Anything greater than maxVal is detected as an edge, and anything less than minVal is detected as a non-edge. For a pixel in the middle, if it is adjacent to a pixel that is determined to be an edge, it is considered an edge; otherwise, it is considered a non-edge.

[0087] S0414: Obtain the length, width and center point coordinates of the door and window according to the outline and edge point coordinates of the door and window.

[0088] S0415: Save the door and window coordinate information, wherein the door and window coordinate information includes at least one of the following: edge point coordinates and center point coordinates.

[0089] Preferably, after the canny edge detection obtains the door and window outlines and edge point coordinates, a step of correcting the edge points is also included, specifically including:

[0090] Traverse each door and window outline to get the point with the smallest sum of absolute coordinates, that is, the upper left corner of a door and window. Align the coordinates of the lower left corner, lower right corner, and upper right corner with the X and Y axis points of the coordinates of the upper left corner to get the four corner points of each door and window.

[0091] The specific alignment method is: let the X-axis coordinate of the lower left corner be equal to the X-axis coordinate of the upper left corner, the Y-axis coordinate of the upper right corner be equal to the Y-axis coordinate of the upper left corner, the X-axis coordinate of the lower right corner be equal to the X-axis coordinate of the upper right corner, and the Y-axis coordinate of the lower right corner be equal to the Y-axis coordinate of the lower left corner;

[0092] If the outline point of a door or window is less than 1 point, the point of the door or window will be deleted;

[0093] If a door or window has more than 4 outline points, the 4 coordinate points with the largest Euclidean distance between coordinates are taken as the edge points of the door or window.

[0094] In another preferred embodiment, the rooms are divided into four types: bedroom, kitchen, balcony, and corridor, which correspond to different colors in the semantic segmentation map. For each room type, extracting coordinate information for the sub-map includes the following steps:

[0095] S0421: Perform color block recognition on the sub-image to obtain the color of each color block.

[0096] S0422: For each preset room type, for all color blocks whose colors are not the colors corresponding to the preset room type, change the colors of the color blocks to the background color to obtain a first room sub-image; wherein the room types to be identified include at least one of the following: bedroom, kitchen, balcony, living room, corridor.

[0097] S0423: Perform edge detection on the first room sub-image to obtain room coordinate information of each room of the preset room type, wherein the room coordinate information includes at least one of the following: room outline, room edge point coordinates, and room area.

[0098] S0424: Save the room coordinate information.

[0099] Preferably, the Canny edge detection algorithm is also used for room edge detection, and after the Canny edge detection algorithm, the room coordinates are corrected, similar to the steps of door and window edge point correction, including:

[0100] Traverse each of the room outlines to obtain the point with the smallest sum of the absolute values ​​of the coordinates, that is, the upper left corner point of a room;

[0101] Align the coordinates of the other edge points of the room with the X, Y axis points of the coordinates of the upper left corner point to obtain the edge points of each room.

[0102] The specific alignment is:

[0103] Traverse the remaining edge coordinate points of the room. If there is a point that is within 5 pixels of the X-axis coordinate of the upper left corner, return it to the X-axis coordinate of the upper left corner, and the same goes for the Y-axis. After traversing the upper left corner, the next room coordinate point is traversed, and the remaining room coordinate points are traversed.

[0104] In another preferred embodiment, when the area type is an exterior wall, extracting coordinate information for the sub-image includes the following steps:

[0105] S0431: Traverse each pixel point in the sub-image to obtain the color of each pixel point.

[0106] S0432: For all pixel points whose colors are not the preset exterior wall colors, the colors of the pixel points are changed to the background color to obtain a first exterior wall sub-image.

[0107] S0433: Perform edge detection on the first exterior wall sub-image to obtain the outline and edge point coordinates of the exterior wall.

[0108] S0434: Save the exterior wall coordinate information, wherein the exterior wall coordinate information includes at least one of the following: exterior wall outline, exterior wall edge point coordinates, and room area enclosed by the exterior wall.

[0109] Preferably, the Canny edge detection algorithm is also used for the external wall edge detection, and after the Canny edge detection algorithm, the external wall coordinates are corrected, similar to the steps of correcting the external wall edge points, including:

[0110] Traverse each of the outer wall contours to obtain a point with the smallest sum of absolute coordinate values, that is, an upper left corner point of an outer wall;

[0111] Align the coordinates of the other edge points of the exterior wall with the X and Y axis points of the coordinates of the upper left corner point to obtain each exterior wall edge point.

[0112] The specific alignment is:

[0113] Traverse the remaining edge coordinate points of the outer wall. If any of these points is within 5 pixels of the X-axis coordinate of the upper left corner, return it to the X-axis coordinate of the upper left corner. The same is true for the Y-axis. After traversing the upper left corner, the next room coordinate point is traversed, and the remaining room coordinate points are traversed.

[0114] In another preferred embodiment, when there are oblique edges in the semantic segmentation map, the detection method further includes:

[0115] S06: When a room has a hypotenuse, the coordinates of each point on the hypotenuse are traversed, and the coordinate information of the first and last points of the hypotenuse is obtained according to the coordinate value of each point.

[0116] S07: When a room has multiple oblique edges, the multiple oblique edge points are classified, and the DBScan clustering algorithm is used to classify the multiple oblique edges into multiple sets, and then the oblique edge point determination is performed to obtain the boundary points of the room.

[0117] If there is a bevel in the floor plan, since the bevel in the RGB image is in the shape of a trapezoid connected one by one, canny edge detection is used to obtain the coordinates of the contour and edge points. When removing redundant points, the first and last points of a bevel cannot be obtained, so it is necessary to judge the points in a bevel. The first and last points need to meet the two conditions of minimum or maximum of the X and Y axes. Finally, the coordinate information of the bevel is obtained. If multiple bevels appear in a room at the same time, it is necessary to classify the multiple bevel points. Preferably, the DBScan clustering algorithm is used. According to the distance judgment, the two bevels are respectively classified into two sets, and then the bevel edge points are judged to obtain the boundary points of the final room.

[0118] Corresponding to the aforementioned method for vectorizing a semantic segmentation map of a building type, the present invention also provides a device for vectorizing a semantic segmentation map of a building type, such as Figure 4 As shown, the device 400 includes:

[0119] An image acquisition module 401 is used to acquire a floor plan to be vectorized;

[0120] The semantic segmentation module 402 is used to perform semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes blocks of different colors, each block of each color corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls;

[0121] An image copying module 403 copies the semantic segmentation image to obtain multiple sub-images;

[0122] A coordinate information extraction module 404 is used to extract coordinate information of the area type corresponding to the color blocks of different colors for each of the sub-images;

[0123] The coordinate information saving module 405 is used to save the extracted coordinate information.

[0124] The present invention provides a method and device for vectorizing a semantic segmentation map of a building type, which divides the semantic segmentation map into three parts for identification respectively, thereby solving the problem that the semantic segmentation map is easily disturbed by noise points during the vectorization identification process, and the identification of different types of pixel points is confused, thereby improving the processing capability and vectorization accuracy of noise points. Compared with the prior art, the method for vectorizing a semantic segmentation map of a building type provided by the present invention has good robustness, and can pass the recognition test of the semantic segmentation map of the type, and can effectively and conveniently process the bevels in the type map. In a random test of more than 100 regular type maps, 89% of the regular-shaped type maps can be accurately identified, and the remaining type maps will cause the identification results to show missing doors and windows, or missing rooms due to noise points. For the identification of the beveled edge type maps, 82% of the maps can be accurately identified.

[0125] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A method for vectorizing a semantic segmentation graph of a building type, characterized in that: The following steps are involved: Get the floor plan to be vectorized; Performing semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes blocks of different colors, each block of each color corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls; Copying the semantic segmentation map to obtain multiple sub-maps; For each of the sub-images, respectively extract the coordinate information of the area type corresponding to the color blocks of different colors, and each of the sub-images only contains the coordinate information of one area type; when the area type is doors and windows, traverse each pixel point in the sub-image to obtain the color of each pixel point; for all pixel points whose colors are not the preset door and window colors, change the color of the pixel points to the background color to obtain the first door and window sub-image; perform edge detection on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window; obtain the length, width and center point coordinates of the door and window according to the outline and edge point coordinates of the door and window; save the door and window coordinate information, wherein the door and window coordinate information includes at least one of the following: edge point coordinates, center point coordinates; The extracted coordinate information is saved.

2. A method for vectorizing a semantic segmentation graph of a building type according to claim 1, characterized in that: After edge detection is performed on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window, the method further includes: Traverse each of the door and window outlines to obtain the point with the smallest sum of the absolute values ​​of the coordinates, that is, the upper left corner of a door and window, align the coordinates of the lower left corner, the lower right corner, and the upper right corner with the X and Y axis points of the coordinates of the upper left corner, and obtain the four corner points of each door and window; If the outline point of a door or window is less than 1 point, the point of the door or window will be deleted; If a door or window has more than 4 outline points, the 4 coordinate points with the largest Euclidean distance between coordinates are taken as the edge points of the door or window.

3. A method for vectorizing a semantic segmentation graph of a building type according to claim 1, characterized in that: When the area type is a room, extracting coordinate information for the sub-image includes the following steps: Performing color block recognition on the sub-image to obtain the color of each color block; For each preset room type, for all color blocks whose colors are not the colors corresponding to the preset room type, the colors of the color blocks are changed to the background color to obtain a first room sub-image; wherein the room types to be identified include at least one of the following: bedroom, kitchen, balcony, living room, corridor; Perform edge detection on the first room sub-image to obtain room coordinate information of each room of the preset room type, wherein the room coordinate information includes at least one of the following: room outline, room edge point coordinates, and room area; The room coordinate information is saved.

4. A method for vectorizing a semantic segmentation graph of a building type according to claim 3, characterized in that: After edge detection is performed on the first room sub-image to obtain room coordinate information of each room of the preset room type, the following steps are also included: Traverse each of the room outlines to obtain the point with the smallest sum of the absolute values ​​of the coordinates, that is, the upper left corner point of a room; Align the coordinates of the other edge points of the room with the X, Y axis points of the coordinates of the upper left corner point to obtain the edge points of each room.

5. The method for vectorizing a semantic segmentation graph of a building type according to claim 1, characterized in that: When the area type is an exterior wall, extracting coordinate information for the sub-image includes the following steps: Traverse each pixel in the sub-image to obtain the color of each pixel; For all pixel points whose colors are not the preset exterior wall colors, the colors of the pixel points are changed to the background color to obtain a first exterior wall sub-image; Performing edge detection on the first exterior wall sub-image to obtain the outline and edge point coordinates of the exterior wall; The external wall coordinate information is saved, wherein the external wall coordinate information includes at least one of the following: an external wall outline, external wall edge point coordinates, and a room area enclosed by the external wall.

6. A method for vectorizing a semantic segmentation graph of a building type according to claim 5, characterized in that: After edge detection is performed on the first exterior wall sub-image to obtain the outline and edge point coordinates of each exterior wall, the method further includes: Traverse each of the outer wall contours to obtain a point with the smallest sum of absolute coordinate values, that is, an upper left corner point of an outer wall; Align the coordinates of the other edge points of the exterior wall with the X and Y axis points of the coordinates of the upper left corner point to obtain each exterior wall edge point.

7. A method for vectorizing a semantic segmentation graph of a building type according to any one of claims 1 to 6, characterized in that: When there are oblique edges in the semantic segmentation map, the method further includes: When a room has a hypotenuse, the coordinates of each point on the hypotenuse are traversed, and the coordinate information of the first and last points of the hypotenuse is obtained according to the coordinate value of each point; When a room has multiple oblique edges, the multiple oblique edge points are classified, and the DBScan clustering algorithm is used to classify the multiple oblique edges into multiple sets, and then the oblique edge points are determined to obtain the boundary points of the room.

8. A device for vectorizing semantic segmentation graphs of building types, characterized in that: include: An image acquisition module, used to acquire the floor plan to be vectorized; A semantic segmentation module, configured to perform semantic segmentation and recognition on the floor plan to obtain a semantic segmentation map, wherein the semantic segmentation map includes blocks of different colors, each block of each color corresponds to an area type in the floor plan; the area type includes at least one of the following: doors and windows, rooms, and exterior walls; An image copying module, which copies the semantic segmentation map to obtain multiple sub-maps; A coordinate information extraction module is used to extract the coordinate information of the area type corresponding to the color blocks of different colors for each of the sub-images, and each of the sub-images only contains the coordinate information of one area type; when the area type is doors and windows, each pixel point in the sub-image is traversed to obtain the color of each pixel point; for all pixel points whose colors are not the preset door and window colors, the color of the pixel points is changed to the background color to obtain the first door and window sub-image; edge detection is performed on the first door and window sub-image to obtain the outline and edge point coordinates of each door and window; according to the outline and edge point coordinates of the door and window, the length, width and center point coordinates of the door and window are obtained; the door and window coordinate information is saved, wherein the door and window coordinate information includes at least one of the following: edge point coordinates, center point coordinates; The coordinate information saving module is used to save the extracted coordinate information.

Citation Information

Patent Citations

  • Color segmentation based regulatory plan drawing automatic vectorization method and system

    CN105741273A

  • Method and system for automatically generating residence house type planar graph

    CN110633553A