CN115205418B - Household graph reconstruction method and device, electronic equipment and storage medium - Google Patents

Household graph reconstruction method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115205418B
CN115205418B CN202211118460.5A CN202211118460A CN115205418B CN 115205418 B CN115205418 B CN 115205418B CN 202211118460 A CN202211118460 A CN 202211118460A CN 115205418 B CN115205418 B CN 115205418B
Authority
CN
China
Prior art keywords
house type
reconstructed
dimensional
constituent elements
window
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211118460.5A
Other languages
Chinese (zh)
Other versions
CN115205418A (en
Inventor
向海明
梁超
文韬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Zhizhu Perfect Home Technology Co ltd
Original Assignee
Wuhan Zhizhu Perfect Home Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Zhizhu Perfect Home Technology Co ltd filed Critical Wuhan Zhizhu Perfect Home Technology Co ltd
Priority to CN202211118460.5A priority Critical patent/CN115205418B/en
Publication of CN115205418A publication Critical patent/CN115205418A/en
Application granted granted Critical
Publication of CN115205418B publication Critical patent/CN115205418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Abstract

The application provides a house type graph reconstruction method and device, electronic equipment and a storage medium. The house type graph reconstruction method comprises the steps of obtaining a two-dimensional house type graph to be reconstructed; identifying the constituent elements of the two-dimensional house type graph to be reconstructed, and segmenting the constituent elements of the two-dimensional house type graph to be reconstructed according to an identification result, wherein the constituent elements at least comprise doors, windows, walls and rooms; respectively carrying out optimization processing on the constituent elements of the two-dimensional floor plan to be reconstructed, wherein the optimization processing at least comprises one of the following steps: smoothing, gap filling and hole eliminating; and reconstructing the house type graph based on the optimized constituent elements of the two-dimensional house type graph to be reconstructed to obtain the target house type graph. The method and the device are used for solving the problem of how to improve the house type graph reconstruction effect.

Description

Home graph reconstruction method and device, electronic equipment and storage medium
Technical Field
The present application relates to image reconstruction technologies, and in particular, to a house type graph reconstruction method and apparatus, an electronic device, and a storage medium.
Background
In the field of home decoration, before a designer designs a home decoration for a home decoration, an original home decoration graph (a rasterized home decoration graph, which is also a two-dimensional home decoration graph) needs to be obtained, and a vectorized home decoration graph, that is, a three-dimensional home decoration graph, required by the home decoration is reconstructed based on the original home decoration graph.
The house identification technology of the CVPR2021 is generally used for reconstructing the house pattern at present. When the house identification technology is used for identifying and segmenting the constituent elements of the original floor plan, inaccurate segmentation results are easy to appear, and the subsequent reconstruction process is influenced. If the house type graph obtained through reconstruction is inaccurate, the house type graph can affect the house decoration design effect, and a large amount of labor cost and time cost can be wasted.
Therefore, how to improve the reconstruction effect of the house pattern still needs to be considered.
Disclosure of Invention
The application provides a house type graph reconstruction method and device, electronic equipment and a storage medium, which are used for solving the problem of how to improve the house type graph reconstruction effect.
In one aspect, the present application provides a house type graph reconstructing method, including:
acquiring a two-dimensional indoor graph to be reconstructed;
identifying the constituent elements of the two-dimensional house type graph to be reconstructed, and segmenting the constituent elements of the two-dimensional house type graph to be reconstructed according to an identification result, wherein the constituent elements at least comprise doors, windows, walls and rooms;
respectively carrying out optimization processing on the constituent elements of the two-dimensional floor plan to be reconstructed, wherein the optimization processing at least comprises one of the following steps: smoothing, filling gaps and eliminating holes;
and reconstructing the house type diagram based on the constituent elements of the two-dimensional house type diagram to be reconstructed after the optimization processing to obtain a target house type diagram.
In one embodiment, the reconstructing the house type diagram based on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed to obtain a target house type diagram includes:
vectorizing the optimized constituent elements of the two-dimensional house type diagram to be reconstructed respectively to obtain at least vectorized graphs, room outlines, wall body center lines and wall body thicknesses of doors and windows;
and reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after vectorization processing to obtain the target house type graph.
In one embodiment, the reconstructing the house type graph based on the constituent elements of the vectorized two-dimensional house type graph to be reconstructed includes:
acquiring the identification area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed after vectorization, and determining the real area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed according to the identification result;
calculating a reconstruction scale according to the identification area and the real area of each room;
and reconstructing the house type diagram based on the reconstruction scale and the constituent elements of the two-dimensional house type diagram to be reconstructed after the vectorization processing to obtain the target house type diagram.
In one embodiment, the determining the real areas of the rooms in the constituent elements of the two-dimensional floor plan to be reconstructed according to the identification result includes:
and acquiring the real area of each room in the constituent elements of the two-dimensional floor plan to be reconstructed according to the identification result by adopting an optical character identification method, wherein the real area of each room is marked on the two-dimensional floor plan to be reconstructed.
In one embodiment, the performing vectorization processing on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed respectively to obtain at least vectorized graphics of doors and windows, a room profile, a wall centerline, and a wall thickness includes:
performing rectangle fitting on the door and window of the two-dimensional house type graph to be reconstructed after the optimization processing to obtain a vectorization graph of the door and window;
vectorizing the optimized room of the two-dimensional house type graph to be reconstructed to obtain a room outline;
vectorizing the optimized wall body of the two-dimensional house type graph to be reconstructed to obtain the centerline of the wall body and the thickness of the wall body.
In one embodiment, the performing rectangle fitting on the door and window of the two-dimensional house type diagram to be reconstructed after the optimization processing to obtain the vectorization graph of the door and window includes:
acquiring an initial fitting pixel image of each door and an initial fitting pixel image of each window in the two-dimensional indoor type graph to be reconstructed after optimization;
respectively performing rectangle fitting on the initial fitting pixel image of each door and the initial fitting pixel image of each window to respectively obtain the length, the width and the central point position of each door and the length, the width and the central point position of each window;
and obtaining the vectorization graph of the doors and the windows according to the length, the width and the center point position of each door and the length, the width and the center point position of each window.
In one embodiment, the performing rectangle fitting on the initially fitted pixel image of each gate and the initially fitted pixel image of each window respectively to obtain the length, the width, and the center point position of each gate respectively, and the length, the width, and the center point position of each window includes:
carrying out principal component analysis algorithm processing on pixel coordinates of each pixel point in an initial fitting pixel image of any gate in a two-dimensional data mode to obtain the position, the length and the width of a central point of a rectangle during rectangle fitting, wherein the position, the length and the width of the central point are the length, the width and the position of the central point of any gate;
and carrying out principal component analysis algorithm processing on the pixel coordinate of each pixel point in the initial fitting pixel image of any window in a two-dimensional data mode to obtain the position, the length and the width of the central point of the rectangle during rectangle fitting, which are the length, the width and the central point of any window.
In another aspect, the present application provides a house type diagram reconstruction apparatus, including:
the acquisition module is used for acquiring a two-dimensional floor plan to be reconstructed;
the processing module is used for identifying the constituent elements of the two-dimensional house type diagram to be reconstructed and dividing the constituent elements of the two-dimensional house type diagram to be reconstructed according to an identification result, wherein the constituent elements at least comprise doors and windows, walls and rooms;
the processing module is further configured to perform at least optimization processing on constituent elements of the two-dimensional floor plan to be reconstructed, where the optimization processing at least includes one of: smoothing, filling gaps and eliminating holes;
and the reconstruction module is used for reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after the optimization processing to obtain the target house type graph.
In another aspect, the present application provides an electronic device comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the house pattern reconstruction method according to the first aspect.
In another aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the instructions are executed, the instructions cause a computer to execute the method for reconstructing a house pattern according to the first aspect.
In another aspect, the present application provides a computer program product comprising a computer program which, when executed by a processor, implements the method for house map reconstruction as described in the first aspect.
An embodiment of the present application provides a house type graph reconstruction method, which mainly includes obtaining a two-dimensional house type graph to be reconstructed, identifying constituent elements of the two-dimensional house type graph to be reconstructed, and performing at least one of optimization processing on the constituent elements of the two-dimensional house type graph to be reconstructed: smoothing, filling gaps and eliminating holes. The purpose of optimization processing is to improve inaccurate areas in house type graph recognition and segmentation, and therefore the effect of house type graph reconstruction can be improved by reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after optimization processing.
In addition, the house type graph reconstruction method provided by the embodiment of the application also reduces redundant steps, improves the speed of house type graph reconstruction, avoids the problem of inaccurate house type graph reconstruction caused by some complicated steps, and further improves the effect of house type graph reconstruction.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic view of an application scenario of the house type map reconstruction method provided in the present application;
fig. 2 is a schematic flowchart of a house type diagram reconstructing method according to an embodiment of the present application;
fig. 3 is a schematic view of vectorization of a door/window pixel map according to an embodiment of the present application;
fig. 4 is a schematic diagram of room vectorization provided in an embodiment of the present application;
fig. 5 is a schematic view of wall vectorization provided in an embodiment of the present application;
FIG. 6 is a schematic illustration of a calculation of a reconstruction scale provided by an embodiment of the present application;
fig. 7 is a flowchart illustrating a house type diagram reconstructing method according to an embodiment of the present application;
fig. 8 is a schematic diagram of a house layout reconstruction apparatus according to an embodiment of the present application;
fig. 9 is a schematic diagram of an electronic device provided in an embodiment of the present application.
Specific embodiments of the present disclosure have been shown by way of example in the drawings and will be described in more detail below. The drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or as implying that the number of indicated technical features is indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
The terms used in the present application are explained first:
vectorization: vectorization refers to a process of converting a pixel image into a vector graphic.
OCR: OCR stands for Optical Character Recognition, commonly called Optical Character Recognition. This is a general method of character recognition.
Structural elements: the structural elements in the house-type diagram refer to important constituent elements such as walls, doors and windows.
PCA algorithm: principal Component Analysis, a Principal Component Analysis algorithm, is a traditional machine learning algorithm and is commonly used for dimensionality reduction and data visualization. Using the PCA algorithm for two-dimensional data, the results of the calculations can be made geometrically meaningful.
In the field of home decoration, before a designer designs a home decoration for a home decoration, the designer needs to obtain an original home decoration graph (a rasterized home decoration graph, which is also a two-dimensional home decoration graph), and then reconstruct a vectorized home decoration graph, that is, a three-dimensional home decoration graph, based on the original home decoration graph.
The technology used in the reconstruction of the house pattern is generally the house identification technology of the CVPR 2021. When the house identification technology is used for identifying and segmenting the constituent elements of the original floor plan, inaccurate segmentation results are easy to appear, and the subsequent reconstruction process is influenced. In particular, the house recognition technology of CVPR2021 is prone to produce inaccurate segmentation results when performing semantic segmentation steps, thereby affecting the subsequent reconstruction process. If the reconstructed house type graph is inaccurate, the house type graph design effect is influenced, and a large amount of labor cost and time cost are wasted.
Based on the above, the application provides a house type graph reconstruction method, a house type graph reconstruction device, an electronic device and a storage medium. The house type graph reconstruction method mainly comprises the steps of obtaining a two-dimensional house type graph to be reconstructed, identifying constituent elements of the two-dimensional house type graph to be reconstructed, and respectively performing at least one of optimization processing on the constituent elements of the two-dimensional house type graph to be reconstructed: smoothing, filling gaps and eliminating holes. The optimization aims to improve inaccurate areas in the identification and segmentation of the house type graph, and therefore the reconstruction effect of the house type graph can be improved by reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after the optimization.
The house type graph reconstruction method is applied to electronic equipment such as a computer, a server and the like. Fig. 1 is an application schematic diagram of the house type graph reconstruction method provided by the present application, in which the electronic device acquires a two-dimensional house type graph to be reconstructed, identifies constituent elements of the two-dimensional house type graph to be reconstructed, and segments the constituent elements of the two-dimensional house type graph to be reconstructed (the constituent elements at least include doors, windows, walls, and rooms). Most importantly, at least one optimization process is respectively carried out on the constituent elements of the two-dimensional floor plan to be reconstructed, and the optimization process at least comprises one of the following processes: smoothing, filling gaps and eliminating holes. And finally, reconstructing the house type diagram based on the constituent elements of the two-dimensional house type diagram to be reconstructed after the optimization processing to obtain the target house type diagram.
Referring to fig. 2, an embodiment of the present application provides a house pattern reconstruction method, including:
and S210, acquiring a two-dimensional indoor graph to be reconstructed.
The two-dimensional house type graph to be reconstructed can be understood as an original house type graph, and before the house decoration design is carried out, the two-dimensional house type graph needs to be reconstructed into a three-dimensional house type graph so as to carry out the house decoration design.
And S220, identifying the constituent elements of the two-dimensional house type diagram to be reconstructed, and segmenting the constituent elements of the two-dimensional house type diagram to be reconstructed according to the identification result, wherein the constituent elements at least comprise doors, windows, walls and rooms.
In an optional embodiment, a deep segmentation neural network is adopted to identify and segment the constituent elements of the two-dimensional house type diagram to be reconstructed, that is, the two-dimensional house type diagram to be reconstructed is input to the deep segmentation network, so as to obtain the constituent elements of the two-dimensional house type diagram to be reconstructed. The constituent elements at least include doors and windows, walls and rooms.
Or other methods or neural networks may be adopted to identify and segment the constituent elements of the two-dimensional house type diagram to be reconstructed, which is not limited in this embodiment.
Although the deep segmentation neural network is excellent in performing the semantic segmentation task, noise included in the segmentation result cannot be ignored. These noises may be embodied as: burrs are arranged on the edge of the wall body, the boundary of the house is not closed, the room exceeds the outer wall, a plurality of room types coexist and the like. The undesirable patterns from these noises can be fatal in the subsequent vectorization step. Therefore, after the constituent elements of the two-dimensional floor plan to be reconstructed are determined, optimization processing needs to be performed on the constituent elements, and the purpose of the optimization processing is to obtain a semantic segmentation result conforming to a common principle and enhance the robustness of the whole process.
S230, respectively performing optimization processing on the constituent elements of the two-dimensional floor plan to be reconstructed, wherein the optimization processing at least comprises one of the following steps: smoothing, filling gaps and eliminating holes.
Specifically, firstly, corrosion operation and expansion operation in morphology are adopted to carry out optimization processing on the boundary of the room in the floor plan to be reconstructed, and then the area where the room is located is processed on the basis. It should be noted that the boundary of the room is composed of structural elements such as doors, windows, and walls. The boundary of a desired room is continuous and smooth, and a closed area can be enclosed, so that the defects such as burrs, gaps, holes and the like contained in the boundary of the room need to be optimized. For example, at least the boundaries of the room in the house type diagram to be reconstructed are smoothed, gap-filling and hole-eliminating, so that the reconstructed house type diagram is closer to the desired ideal house type diagram. When the boundary of a room in the to-be-reconstructed house type diagram is optimized by adopting the corrosion operation and the expansion operation in morphology, the essential is to perform convolution on the grating diagram (namely the to-be-reconstructed two-dimensional house type diagram), so that certain areas in the to-be-reconstructed two-dimensional mutual diagram are reduced or enlarged, and the effects of smoothing the outline, filling the gap and eliminating the hole can be achieved by continuously executing the corrosion operation and the expansion operation.
After the optimization processing of the house boundary is completed, the two-dimensional indoor graph to be reconstructed is clearly divided into two parts, namely the outside of the room and the inside of the room. At this time, for the outside of the room, the room pixels beyond the outer wall of the room can be ignored, and for the inside of the room, it is specified that only one room type is allowed to exist in each closed area (without considering the special case of an open kitchen), and when the pixels of a plurality of room types coexist, the current room type is represented by the category with the largest number in the area, and the other categories are discarded.
And S240, reconstructing the house type graph based on the optimized constituent elements of the two-dimensional house type graph to be reconstructed to obtain the target house type graph.
After the constituent elements of the two-dimensional house type image to be reconstructed are optimized and the room type is determined, vectorization processing is carried out on the constituent elements of the two-dimensional house type image to be reconstructed respectively so as to obtain at least vectorization images of doors and windows, room outlines, wall body center lines, wall body thickness and other information. And then reconstructing the house type diagram based on the constituent elements of the two-dimensional house type diagram to be reconstructed after vectorization processing to obtain the target house type diagram.
The vectorization processing of the constituent elements of the two-dimensional floor plan to be reconstructed is described below.
In an optional embodiment, vectorization processing is performed on the door and window of the two-dimensional house type diagram to be reconstructed after the optimization processing. Based on the observation that the width of the door and window is generally equal to the thickness of the wall where the door and window is located, rectangular fitting can be performed on the door and window of the two-dimensional house type graph to be reconstructed after optimization, namely the pixel graph of the door and window is fitted in a rectangular manner, so that the vectorized graph of the door and window is obtained.
Specifically, an initial fitting pixel image of each gate and an initial fitting pixel image of each window in the two-dimensional floor plan to be reconstructed after optimization processing are obtained first. And respectively performing rectangle fitting on the initial fitting pixel image of each door and the initial fitting pixel image of each window to respectively obtain the length, the width and the central point position of each door and the length, the width and the central point position of each window.
For example, principal Component Analysis (PCA) algorithm processing is performed on the pixel coordinates of each pixel point in the initially fitted pixel image of any gate in the form of two-dimensional data, and the position, length, and width of the center point of the rectangle when the rectangle is fitted are obtained as the length, width, and center point position of the any gate. And carrying out principal component analysis algorithm processing on the pixel coordinates of each pixel point in the initial fitting pixel image of any window in a two-dimensional data mode, and obtaining the position, the length and the width of the central point of the rectangle as the length, the width and the position of the central point of any window when the rectangle is fitted. And similarly, the initial fitting pixel image of any window refers to the pixel image of the two-dimensional indoor type graph to be reconstructed after the optimization processing of any window.
Referring to fig. 3, taking the rectangular fitting of the initial fitting pixel image of any gate as an example, the initial fitting pixel image of any gate is obtained first (shown in fig. 3 (a)). And (3) regarding the coordinates of all pixel points in the initial fitting pixel image A of any one gate as a group of two-dimensional data, and finding the extending direction w of the long edge of the fitting rectangle through a principal component analysis algorithm. Then, the central point (,) of the rectangle is quickly found through an approximate solution of a principal component analysis algorithm, and the rotation angle is determined according to the extending direction w of the long edge. After the pixel pattern a is projectively transformed in the w direction, the length l and width s of the rectangle can be further obtained, and a fitting rectangle shown in (b) of fig. 3 is obtained. A rectangle fit is performed for each door and each window as shown in fig. 3 and described in this example, resulting in the length, width and center point position for each door and the length, width and center point position for each window.
And finishing the rectangular fitting of the doors and the windows according to the length, the width and the central point position of each door and the length, the width and the central point position of each window to obtain the vectorization graph of the doors and the windows.
In an optional embodiment, vectorization processing is performed on the room of the two-dimensional floor plan to be reconstructed after the optimization processing, so as to obtain a room contour. The program code used by the method for vectorizing the room of the two-dimensional house type graph to be reconstructed can be selected according to actual needs. Referring to fig. 4, the initial state of the room contour extraction is the state shown in (a) of fig. 4, and when the vectorization processing is performed, the number of vertices is reduced, and the state of the room contour extraction is the state shown in (b) of fig. 4.
In an optional embodiment, vectorization processing is performed on the optimized wall body of the two-dimensional house type graph to be reconstructed, so as to obtain a wall body centerline and a wall body thickness. In the vectorization processing method for the wall body of the two-dimensional house type graph to be reconstructed, the program code used when the centerline of the wall body is optimized can be selected according to actual needs. It should be noted that, when performing vectorization processing on a wall, the number of node coordinates needs to be reduced, and node coordinates need to be optimized. As shown in fig. 5, the initial state during the wall vectorization processing is (a) in fig. 5, the state after the node number reduction is shown in (b) in fig. 5, and then the optimized wall centerline is obtained and the more accurate wall thickness is obtained as shown in (c) in fig. 5 after the node coordinate optimization is performed (for correcting the node coordinate, so that the wall is closer to the ideal wall).
And after obtaining the vectorized constituent elements of the two-dimensional house type graph to be reconstructed, reconstructing the house type graph based on the vectorized constituent elements of the two-dimensional house type graph to be reconstructed to obtain the target house type graph. When the two-dimensional house type graph to be reconstructed is reconstructed based on the vectorized constituent elements of the two-dimensional house type graph, a reconstruction scale needs to be calculated.
In an optional embodiment, the identification areas of the rooms in the constituent elements of the two-dimensional floor plan to be reconstructed after the vectorization processing are obtained. And determining the real area of each room in the constituent elements of the two-dimensional floor plan to be reconstructed according to the identification result after the constituent elements of the two-dimensional floor plan to be reconstructed are identified. For example, an optical character recognition method is adopted to obtain the real area of each room in the constituent elements of the two-dimensional house type diagram to be reconstructed of the recognition result, wherein the real area of each room is marked on the two-dimensional house type diagram to be reconstructed. And then, calculating a reconstruction scale according to the identification area and the real area of each room, and reconstructing the house type diagram based on the reconstruction scale and the constituent elements of the vectorized two-dimensional house type diagram to be reconstructed to obtain the target house type diagram.
Referring to fig. 6, a house type diagram is taken as an example to briefly illustrate the reconstruction of the house type diagram, and the segmentation and vectorization shown in fig. 6 are as described above, i.e., the constituent elements of the two-dimensional house type diagram to be reconstructed are identified, and the constituent elements of the two-dimensional house type diagram to be reconstructed are segmented according to the identification result, until the vectorization processes the constituent elements of the two-dimensional house type diagram to be reconstructed. If 6, acquiring the real area of each room marked in the two-dimensional floor type graph to be reconstructed based on OCR (optical character recognition), wherein the area of the living room is 18.7m 2 The area of the toilet is 3.8m 2 . And acquiring identification areas of all rooms in the vectorized and processed component elements of the two-dimensional indoor graph to be reconstructed, wherein the areas of the living rooms are 3876pixels and the areas of the toilets are 792pixels. Then 18.7m according to the real area of the living room 2 And an identification area 3876pixels, or 3.8m from the real area of the toilet 2 And an identified area 792pixels, a reconstruction scale of 69.4min/pixel can be calculated.
It should be noted that, compared with the method for identifying the length of the house type graph to determine the reconstruction scale by using the line detection technology in the conventional method, the method for identifying the area of the room in the house type graph to determine the reconstruction scale provided by the embodiment does not need to additionally pass through the line detection step, eliminates the redundant steps, is simple and direct, and further enables the determined reconstruction scale to be more accurate.
Acquiring the real area of each room marked in the two-dimensional house type graph to be reconstructed based on OCR,
for convenience of understanding, the overall flow of the house type diagram reconstruction method provided by the embodiment described in steps S210 to S240 is described with reference to fig. 7, and as shown in fig. 7, the target house type diagram obtained by final reconstruction includes the category, wall thickness, door and window, room boundary, and the like of each room.
In summary, the present embodiment provides a house type diagram reconstructing method, which mainly includes obtaining a two-dimensional house type diagram to be reconstructed, identifying constituent elements of the two-dimensional house type diagram to be reconstructed, and performing at least one of optimization processing on the constituent elements of the two-dimensional house type diagram to be reconstructed: smoothing, filling gaps and eliminating holes. The optimization aims to improve inaccurate areas in the identification and segmentation of the house type graph, and therefore the reconstruction effect of the house type graph can be improved by reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after the optimization.
In addition, the house type graph reconstruction method provided by the embodiment also reduces redundant steps, improves the speed of house type graph reconstruction, avoids the problem of inaccurate house type graph reconstruction caused by some complicated steps, and further improves the effect of house type graph reconstruction.
Referring to fig. 8, an embodiment of the present application further provides a house layout reconstructing apparatus 10, including:
the obtaining module 11 is configured to obtain a two-dimensional floor plan to be reconstructed.
And the processing module 12 is configured to identify constituent elements of the two-dimensional house type diagram to be reconstructed, and segment the constituent elements of the two-dimensional house type diagram to be reconstructed according to the identification result, where the constituent elements at least include doors, windows, walls, and rooms.
The processing module 12 is further configured to perform at least optimization processing on the constituent elements of the two-dimensional house type graph to be reconstructed, where the optimization processing at least includes one of the following: smoothing, filling gaps and eliminating holes.
And the reconstruction module 13 is configured to perform house type diagram reconstruction based on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed, so as to obtain a target house type diagram.
The reconstruction module 13 is specifically configured to perform vectorization processing on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed, so as to obtain at least a vectorization graph of a door and a window, a room outline, a wall centerline and a wall thickness; and reconstructing the house type graph based on the constituent elements of the two-dimensional house type graph to be reconstructed after vectorization processing to obtain the target house type graph.
The reconstruction module 13 is specifically configured to obtain an identification area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed after the vectorization processing, and determine a real area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed according to the identification result; calculating a reconstruction scale according to the identification area and the real area of each room; and reconstructing the house type diagram based on the reconstruction scale and the constituent elements of the vectorized two-dimensional house type diagram to be reconstructed to obtain the target house type diagram.
The reconstruction module 13 is specifically configured to obtain, by using an optical character recognition method, a real area of each room in constituent elements of the two-dimensional house type diagram to be reconstructed of the recognition result, where the real area of each room is marked on the two-dimensional house type diagram to be reconstructed.
The processing module 12 is specifically configured to perform rectangular fitting on the door and window of the two-dimensional house type diagram to be reconstructed after the optimization processing, so as to obtain a vectorization graph of the door and window; vectorizing the optimized room of the two-dimensional indoor graph to be reconstructed to obtain a room outline; vectorizing the optimized wall body of the two-dimensional house type graph to be reconstructed to obtain the centerline and the thickness of the wall body.
The processing module 12 is specifically configured to obtain an initial fit pixel image of each gate and an initial fit pixel image of each window in the two-dimensional floor plan to be reconstructed after optimization processing; respectively performing rectangle fitting on the initial fitting pixel image of each door and the initial fitting pixel image of each window to respectively obtain the length, the width and the central point position of each door and the length, the width and the central point position of each window; and obtaining the vectorization graph of the doors and the windows according to the length, the width and the center point position of each door and the length, the width and the center point position of each window.
The processing module 12 is specifically configured to perform principal component analysis algorithm processing on the pixel coordinates of each pixel point in the initial fitting pixel image of any one gate in the form of two-dimensional data, and obtain the position, length, and width of the center point of the rectangle when the rectangle is fitted as the length, width, and center point position of the any one gate; and (3) carrying out principal component analysis algorithm processing on the pixel coordinate of each pixel point in the initial fitting pixel image of any window in a two-dimensional data mode, and obtaining the position, the length and the width of the center point of the rectangle when the rectangle is fitted as the length, the width and the position of the center point of the any window.
Referring to fig. 9, an embodiment of the present application further provides an electronic device 20, which includes a processor 21 and a memory 22 communicatively connected to the processor 21. The memory 22 stores computer executable instructions, and the processor 21 executes the computer executable instructions stored in the memory 11 to implement the house map reconstruction method as provided in any one of the above embodiments.
The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when executed, the instructions cause a processor to execute the instructions to implement the house pattern reconstruction method provided by any one of the above embodiments.
The present application further provides a computer program product comprising a computer program, which when executed by a processor, implements the method for reconstructing a house layout as provided in any one of the above embodiments.
The computer-readable storage medium may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a magnetic Random Access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical Disc, or a Compact Disc Read-Only Memory (CD-ROM). And may be various electronic devices such as mobile phones, computers, tablet devices, personal digital assistants, etc., including one or any combination of the above memories.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one of 8230, and" comprising 8230does not exclude the presence of additional like elements in a process, method, article, or apparatus comprising the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method described in the embodiments of the present application.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (7)

1. A house type graph reconstruction method is characterized by comprising the following steps:
acquiring a two-dimensional floor plan to be reconstructed;
identifying the constituent elements of the two-dimensional house type diagram to be reconstructed, and segmenting the constituent elements of the two-dimensional house type diagram to be reconstructed according to an identification result, wherein the constituent elements at least comprise doors, windows, walls and rooms;
respectively carrying out optimization processing on the constituent elements of the two-dimensional floor plan to be reconstructed, wherein the optimization processing at least comprises one of the following steps: smoothing, gap filling and hole eliminating;
reconstructing the house type diagram based on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed to obtain a target house type diagram;
the method for reconstructing the house type diagram based on the constituent elements of the two-dimensional house type diagram to be reconstructed after the optimization processing to obtain the target house type diagram comprises the following steps:
vectorizing the optimized constituent elements of the two-dimensional house type diagram to be reconstructed respectively to obtain at least vectorized graphs, room outlines, wall body center lines and wall body thicknesses of doors and windows;
reconstructing the house type diagram based on the constituent elements of the vectorized two-dimensional house type diagram to be reconstructed to obtain the target house type diagram;
the vectorization processing is respectively carried out on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed so as to at least obtain the vectorization graphs, the room outlines, the wall body center lines and the wall body thickness of the doors and the windows comprises the following steps:
performing rectangular fitting on the door and window of the two-dimensional house type image to be reconstructed after the optimization processing to obtain a vectorization image of the door and window;
vectorizing the optimized room of the two-dimensional house type graph to be reconstructed to obtain a room outline;
vectorizing the optimized wall body of the two-dimensional house type graph to be reconstructed to obtain a wall body center line and wall body thickness;
the rectangular fitting is carried out on the door and window of the two-dimensional house type graph to be reconstructed after the optimization processing, so as to obtain the vectorization graph of the door and window, and the method comprises the following steps:
acquiring an initial fitting pixel image of each door and an initial fitting pixel image of each window in the two-dimensional indoor type graph to be reconstructed after optimization;
respectively performing rectangle fitting on the initial fitting pixel image of each door and the initial fitting pixel image of each window to respectively obtain the length, the width and the central point position of each door and the length, the width and the central point position of each window;
and obtaining the vectorization graph of the doors and the windows according to the length, the width and the center point position of each door and the length, the width and the center point position of each window.
2. The method according to claim 1, wherein the reconstructing the house type diagram based on the vectorized constituent elements of the two-dimensional house type diagram to be reconstructed includes:
acquiring the identification area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed after vectorization, and determining the real area of each room in the constituent elements of the two-dimensional indoor type graph to be reconstructed according to the identification result;
calculating a reconstruction scale according to the identification area and the real area of each room;
and reconstructing the house type diagram based on the reconstruction scale and the constituent elements of the two-dimensional house type diagram to be reconstructed after the vectorization processing to obtain the target house type diagram.
3. The method according to claim 2, wherein the determining the real area of each room in the constituent elements of the two-dimensional floor plan to be reconstructed according to the recognition result comprises:
and acquiring the real area of each room in the constituent elements of the two-dimensional floor plan to be reconstructed according to the identification result by adopting an optical character identification method, wherein the real area of each room is marked on the two-dimensional floor plan to be reconstructed.
4. The method of claim 1, wherein the performing a rectangle fit on the initially fitted pixel image of each gate and the initially fitted pixel image of each window to obtain a length, a width, and a center point position of each gate, respectively, and the length, the width, and the center point position of each window comprises:
carrying out principal component analysis algorithm processing on pixel coordinates of each pixel point in the initial fitting pixel image of any gate in a two-dimensional data mode to obtain the position, the length and the width of a central point of a rectangle during rectangle fitting, wherein the position, the length and the width of the central point are the length, the width and the position of the central point of any gate;
and carrying out principal component analysis algorithm processing on the pixel coordinate of each pixel point in the initial fitting pixel image of any window in a two-dimensional data mode to obtain the position, the length and the width of the central point of the rectangle during rectangle fitting, which are the length, the width and the central point of any window.
5. A house type graph reconstructing apparatus, comprising:
the acquisition module is used for acquiring a two-dimensional floor plan to be reconstructed;
the processing module is used for identifying the constituent elements of the two-dimensional house type diagram to be reconstructed and segmenting the constituent elements of the two-dimensional house type diagram to be reconstructed according to an identification result, wherein the constituent elements at least comprise doors, windows, walls and rooms;
the processing module is further configured to perform at least optimization processing on the constituent elements of the two-dimensional floor plan to be reconstructed, where the optimization processing at least includes one of the following: smoothing, filling gaps and eliminating holes;
the reconstruction module is used for reconstructing the house type diagram based on the constituent elements of the two-dimensional house type diagram to be reconstructed after the optimization processing to obtain a target house type diagram;
the reconstruction module is further used for respectively carrying out vectorization processing on the optimized constituent elements of the two-dimensional house type diagram to be reconstructed so as to at least obtain vectorization graphs, room outlines, wall body center lines and wall body thicknesses of doors and windows; reconstructing the house type diagram based on the constituent elements of the vectorized two-dimensional house type diagram to be reconstructed to obtain the target house type diagram;
the reconstruction module is further used for performing rectangular fitting on the door and window of the two-dimensional house type image to be reconstructed after the optimization processing so as to obtain a vectorization image of the door and window; vectorizing the optimized room of the two-dimensional house type graph to be reconstructed to obtain a room outline; vectorizing the optimized wall body of the two-dimensional house type graph to be reconstructed to obtain a wall body central line and wall body thickness;
the reconstruction module is further used for acquiring an initial fitting pixel image of each door and an initial fitting pixel image of each window in the two-dimensional house type image to be reconstructed after optimization processing; respectively performing rectangle fitting on the initial fitting pixel image of each door and the initial fitting pixel image of each window to respectively obtain the length, the width and the central point position of each door and the length, the width and the central point position of each window; and obtaining the vectorization graph of the doors and the windows according to the length, the width and the center point position of each door and the length, the width and the center point position of each window.
6. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the house pattern reconstruction method of any one of claims 1 to 4.
7. A computer-readable storage medium having stored therein computer-executable instructions that, when executed, cause a computer to perform the method of house pattern reconstruction as claimed in any one of claims 1-4.
CN202211118460.5A 2022-09-15 2022-09-15 Household graph reconstruction method and device, electronic equipment and storage medium Active CN115205418B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211118460.5A CN115205418B (en) 2022-09-15 2022-09-15 Household graph reconstruction method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211118460.5A CN115205418B (en) 2022-09-15 2022-09-15 Household graph reconstruction method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115205418A CN115205418A (en) 2022-10-18
CN115205418B true CN115205418B (en) 2022-12-13

Family

ID=83573345

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211118460.5A Active CN115205418B (en) 2022-09-15 2022-09-15 Household graph reconstruction method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115205418B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115544631B (en) * 2022-11-09 2023-06-16 山东建筑大学 Rapid extraction method for wall midline of high-rise residential building construction drawing

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279787A (en) * 2015-04-03 2016-01-27 北京明兰网络科技有限公司 Method for generating three-dimensional (3D) building model based on photographed house type image identification
CN107122528A (en) * 2017-04-13 2017-09-01 广州乐家数字科技有限公司 A kind of floor plan parametrization can edit modeling method again
CN108717726A (en) * 2018-05-11 2018-10-30 北京家印互动科技有限公司 Three-dimensional house type model generating method and device
CN111611643A (en) * 2020-05-27 2020-09-01 电子科技大学中山学院 Family type vectorization data obtaining method and device, electronic equipment and storage medium
CN111612890A (en) * 2020-05-21 2020-09-01 广东三维家信息科技有限公司 Method and device for automatically generating three-dimensional model from two-dimensional house type diagram and electronic equipment
CN112116613A (en) * 2020-09-25 2020-12-22 贝壳技术有限公司 Model training method, image segmentation method, image vectorization method and system thereof
WO2021196515A1 (en) * 2020-04-03 2021-10-07 深圳大学 House type graph generation method and apparatus, and computer device and storage medium
CN114092491A (en) * 2021-11-17 2022-02-25 华南师范大学 Building house type semantic segmentation map vectorization method and device
CN114494636A (en) * 2021-12-29 2022-05-13 杭州群核信息技术有限公司 Method and device for automatically constructing house type based on picture and computer equipment
CN115049628A (en) * 2022-06-28 2022-09-13 广州市圆方计算机软件工程有限公司 Method and system for automatically generating house type structure

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105279787A (en) * 2015-04-03 2016-01-27 北京明兰网络科技有限公司 Method for generating three-dimensional (3D) building model based on photographed house type image identification
CN107122528A (en) * 2017-04-13 2017-09-01 广州乐家数字科技有限公司 A kind of floor plan parametrization can edit modeling method again
CN108717726A (en) * 2018-05-11 2018-10-30 北京家印互动科技有限公司 Three-dimensional house type model generating method and device
WO2021196515A1 (en) * 2020-04-03 2021-10-07 深圳大学 House type graph generation method and apparatus, and computer device and storage medium
CN111612890A (en) * 2020-05-21 2020-09-01 广东三维家信息科技有限公司 Method and device for automatically generating three-dimensional model from two-dimensional house type diagram and electronic equipment
CN111611643A (en) * 2020-05-27 2020-09-01 电子科技大学中山学院 Family type vectorization data obtaining method and device, electronic equipment and storage medium
CN112116613A (en) * 2020-09-25 2020-12-22 贝壳技术有限公司 Model training method, image segmentation method, image vectorization method and system thereof
CN114092491A (en) * 2021-11-17 2022-02-25 华南师范大学 Building house type semantic segmentation map vectorization method and device
CN114494636A (en) * 2021-12-29 2022-05-13 杭州群核信息技术有限公司 Method and device for automatically constructing house type based on picture and computer equipment
CN115049628A (en) * 2022-06-28 2022-09-13 广州市圆方计算机软件工程有限公司 Method and system for automatically generating house type structure

Also Published As

Publication number Publication date
CN115205418A (en) 2022-10-18

Similar Documents

Publication Publication Date Title
CN113112443B (en) Method and device for segmenting ultrasonic image focus and computer equipment
Dal Poz et al. Automated extraction of road network from medium-and high-resolution images
Awrangjeb et al. An improved curvature scale-space corner detector and a robust corner matching approach for transformed image identification
Stein Fractal image models and object detection
US20170039723A1 (en) Image Object Segmentation Using Examples
CN108305260B (en) Method, device and equipment for detecting angular points in image
CN115205418B (en) Household graph reconstruction method and device, electronic equipment and storage medium
CN111611643A (en) Family type vectorization data obtaining method and device, electronic equipment and storage medium
CN112348817B (en) Parking space identification method and device, vehicle-mounted terminal and storage medium
CN112348836A (en) Method and device for automatically extracting building outline
CN110807780A (en) Image processing method and device
CN111260564A (en) Image processing method and device and computer storage medium
Hu et al. Surface segmentation for polycube construction based on generalized centroidal Voronoi tessellation
CN113962959A (en) Three-dimensional image processing method, three-dimensional image processing device, computer equipment and storage medium
Ravanbakhsh et al. Road junction extraction from high‐resolution aerial imagery
Kamejima Invariant features associated with a conditional distribution induced by self-similar patterns
CN114943659A (en) Map area segmentation method and related device
CN113822006A (en) Method, apparatus and computer-readable storage medium for analyzing integrated circuit layout
CN113239785A (en) Method, system, storage medium and electronic device for automatically identifying house type based on convolutional neural network
CN112102178A (en) Point cloud feature-preserving denoising method and device, electronic equipment and storage medium
CN114937023A (en) Defect identification method and device for pressure-bearing equipment
CN113610971A (en) Fine-grained three-dimensional model construction method and device and electronic equipment
CN108121690A (en) Font processing method and device
CN113496215A (en) Method and device for detecting human face of living body and electronic equipment
Pujol et al. On searching for an optimal threshold for morphological image segmentation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant