Building indoor area prediction method, device, computer equipment and storage medium
By processing building point cloud data, extracting horizontal and vertical planes, filtering out non-indoor area point clouds, and converting them into indoor area region images, the problems of low efficiency and low accuracy in existing technologies are solved, achieving efficient and accurate indoor area measurement.
Patent Information
- Application Number
- CN202110341266.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-30
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2041-03-30
AI Technical Summary
In existing technologies, the measurement of building interior area is inefficient and inaccurate, and usually relies on manual measurement with a measuring tape, which results in heavy workload and large errors.
By acquiring point cloud data of each room in the building, stitching them together to form a house point cloud, preprocessing is performed to extract the horizontal and vertical planes of the point cloud, filtering out point clouds that are not indoor areas, converting them into indoor area region images, and finally determining the indoor area.
It improves the efficiency and accuracy of building interior area measurement, reduces manual workload, and enables more accurate area calculation.
Smart Images

Figure CN115147476B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for predicting indoor area of a building. Background Art
[0002] Indoor area is also called the usable area of a house, which refers to the sum of the net areas directly used for production or living in each floor plan of the building. Therefore, in order to accurately measure the indoor area that can be used by users, it is usually necessary to determine the indoor area of the building.
[0003] However, due to the special regulations on indoor areas, the indoor area is usually determined manually using a tape measure, which is not only labor-intensive but also has low accuracy. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for predicting indoor area of a building that can improve efficiency and accuracy in response to the above technical problems.
[0005] A method for predicting indoor area of a building, the method comprising:
[0006] Obtaining the collected point clouds of each room, and stitching the point clouds to obtain a house point cloud;
[0007] Preprocessing the house point cloud to extract the point cloud horizontal plane and the point cloud vertical plane;
[0008] Based on the point cloud horizontal plane and the point cloud vertical plane, the point cloud corresponding to the non-indoor area is located and filtered out to obtain the actual indoor area point cloud;
[0009] The actual indoor area point cloud is converted into an indoor area region image, and the indoor area is determined according to the indoor area region image.
[0010] In one embodiment, the preprocessing of the house point cloud to extract the point cloud horizontal plane and the point cloud vertical plane includes:
[0011] Performing plane fitting on the house point cloud to determine the maximum wall surface;
[0012] Rotate the house point cloud to a position where the largest wall is parallel to the first coordinate plane, and the ground and the ceiling are parallel to the second coordinate plane, and translate the rotated house point cloud to a position where the Z value is 0; the Z value is the value of the vertical axis in the spatial coordinate axis;
[0013] Determine the normal vector corresponding to each point cloud in the house point cloud after translation;
[0014] A point cloud horizontal plane and a point cloud vertical plane are extracted based on the normal vectors.
[0015] In one embodiment, the determining of the normal vector corresponding to each point cloud in the house point cloud after translation includes:
[0016] Obtaining a preset radius, where the preset radius is determined according to the density of the house point cloud;
[0017] Using all points of each point cloud in the house point cloud within the preset radius, respectively fit the local planes corresponding to each point cloud in the house point cloud;
[0018] The normal vector of the local plane is calculated as the normal vector of the corresponding point cloud.
[0019] In one embodiment, the step of extracting a point cloud horizontal plane and a point cloud vertical plane based on each of the normal vectors includes:
[0020] According to whether each normal vector is parallel to the Z axis, each point cloud in the house point cloud is divided into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis; the Z axis is the vertical axis in the spatial coordinate axis;
[0021] Clustering, segmenting and classifying the first point cloud to obtain a ground point cloud plane and a non-ground point cloud plane;
[0022] Determine a first indoor area reference image according to the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane;
[0023] Filtering point clouds outside the first indoor area reference image from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud;
[0024] A point cloud horizontal plane is extracted according to the updated first point cloud, and a point cloud vertical plane is extracted according to the updated second point cloud.
[0025] In one embodiment, extracting a point cloud horizontal plane according to the updated first point cloud, and extracting a point cloud vertical plane according to the updated second point cloud, comprises:
[0026] Clustering and segmenting the updated first point cloud, classifying the segmented point cloud planes using the geometric dimensions of the horizontal plane, and obtaining a point cloud horizontal plane; the point cloud horizontal plane includes a ceiling;
[0027] Extracting the point cloud fitting cylinder point cloud under the ceiling from the updated second point cloud, and filtering the fitted cylinder point cloud from the updated second point cloud;
[0028] Determining a wall normal vector of the updated second point cloud according to an appearance frequency of a normal vector corresponding to the updated second point cloud after filtering out the cylindrical point cloud;
[0029] Preliminarily classifying the updated second point cloud according to the category of the wall normal vector;
[0030] The various point clouds after the initial classification are clustered and segmented respectively, and the geometric dimensions of the vertical plane are used to classify the various point cloud planes after the segmentation to obtain the point cloud vertical plane.
[0031] In one of the embodiments, determining the first indoor area reference image according to the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane includes:
[0032] Performing a closing operation on the horizontal plane projection image of the non-ground point cloud plane to calculate the largest connected domain;
[0033] An intersection of the horizontal plane projection image of the ground point cloud plane, the horizontal plane projection image of the non-ground point cloud plane, and the connected domain is determined as a first indoor area reference image.
[0034] In one embodiment, the point cloud vertical surface includes a wall surface;
[0035] The method of locating and filtering point clouds corresponding to non-indoor areas based on the point cloud horizontal plane and the point cloud vertical plane to obtain the actual indoor area point cloud includes:
[0036] Calculate the door opening rectangular frame for the wall surface, determine the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and whose projections overlap with each other as the door opening, and filter out the point cloud corresponding to the door opening;
[0037] The parallel walls are projected onto each other, and the point clouds corresponding to the overlapping areas of the projections are filtered out.
[0038] In one embodiment, calculating the door opening rectangular frame for the wall surface includes:
[0039] Projecting the point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall;
[0040] After smoothing the edges of the projected wall, the maximum inscribed rectangle is calculated;
[0041] The maximum inscribed rectangle whose size meets the size of the door opening is used as the door opening rectangular frame corresponding to the door opening.
[0042] In one embodiment, converting the actual indoor area point cloud into an indoor area region image, and determining the indoor area according to the indoor area region image includes:
[0043] Projecting the point cloud corresponding to the vertical plane of the point cloud onto the horizontal plane for straight line fitting to obtain a fitting line segment;
[0044] Performing horizontal projection on the actual indoor area point cloud to obtain a second indoor area reference image;
[0045] Segmenting the second indoor area reference image using the fitting line segments, determining the indoor area according to the uniformity of the point clouds of each area after segmentation, and obtaining an indoor area region image;
[0046] Replacing the coordinates of the vertices in the indoor area region image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range;
[0047] The indoor area is calculated according to the coordinates of the continuous vertices in the indoor area region image.
[0048] In one embodiment, the calculating the indoor area according to the coordinates of the continuous vertices in the indoor area region image includes:
[0049] Take any point among the continuous vertices as the reference, and form a directed triangle with two adjacent points in the counterclockwise direction;
[0050] Calculating the directed area of the directed triangle according to the coordinates of the three vertices of the directed triangle;
[0051] The directed areas of the directed triangles are superimposed to obtain the indoor area.
[0052] In one embodiment, before replacing the coordinates of the vertices in the indoor area region image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range, the method further includes:
[0053] When it is determined that there is a window hole according to the positioning of the horizontal plane of the point cloud and the vertical plane of the point cloud, and the window hole is a bay window, polygon fitting is performed on the bay window area and the second indoor area reference image to obtain a final indoor area image.
[0054] In one embodiment, the point cloud horizontal plane includes the top surface of the window opening and the floor of the window opening; the point cloud vertical plane includes the side surface of the opening; and locating and determining the floating window according to the point cloud horizontal plane and the point cloud vertical plane includes:
[0055] Combining the top surface of the window hole, the floor surface of the window hole and the side surface of the hole opening to obtain a window hole;
[0056] Whether the window opening is a bay window is determined according to the size of the window opening.
[0057] A device for predicting indoor area of a building, comprising:
[0058] A splicing module is used to obtain the collected point clouds of each room and splice the point clouds to obtain a house point cloud;
[0059] An extraction module, used for preprocessing the house point cloud to extract a point cloud horizontal plane and a point cloud vertical plane;
[0060] A filtering module, used for locating and filtering point clouds corresponding to non-indoor areas based on the horizontal plane of the point cloud and the vertical plane of the point cloud to obtain a point cloud of the actual indoor area;
[0061] The determination module is used to convert the actual indoor area point cloud into an indoor area region image, and determine the indoor area according to the indoor area region image.
[0062] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above-mentioned building indoor area prediction methods when executing the computer program.
[0063] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any of the above-mentioned building indoor area prediction methods.
[0064] The above-mentioned building indoor area prediction method, device, computer equipment and storage medium obtain the collected point clouds of each room, splice the point clouds to obtain the house point cloud; pre-process the house point cloud, extract the point cloud horizontal plane and point cloud vertical plane; locate and filter the point cloud corresponding to the non-indoor area based on the point cloud horizontal plane and point cloud vertical plane, and obtain the actual indoor area point cloud; convert the actual indoor area point cloud into an indoor area area image, and determine the indoor area according to the indoor area area image. This method collects point cloud data of a building house, determines the indoor area of the building by processing the point cloud data, and reduces a lot of tedious manual workload compared to manual measurement with a tape measure, which not only improves efficiency but also improves accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 An application environment diagram for predicting indoor area of a building in one embodiment;
[0066] Figure 2 A schematic diagram of a process for predicting indoor area of a building in one embodiment;
[0067] Figure 3 A schematic diagram of a process for preprocessing a house point cloud and extracting a point cloud horizontal plane and a point cloud vertical plane in an embodiment;
[0068] Figure 4 It is a schematic diagram of an image of taking the intersection of the non-ground maximum connected domain and all horizontal planes in one embodiment;
[0069] Figure 5 is a schematic diagram of a rectangular frame of a door opening in one embodiment;
[0070] Figure 6 is a schematic diagram of an indoor area reference image projected onto a horizontal plane in one embodiment;
[0071] Figure 7 It is a schematic diagram of an image in which a fitting line segment is used to segment an indoor area in one embodiment;
[0072] Figure 8 A schematic diagram of an indoor area image in one embodiment;
[0073] Fig. 9 is a structural block diagram of a device for predicting indoor area of a building in one embodiment;
[0074] Fig.10 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0075] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0076] The building indoor area prediction method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network, and the terminal 102 or the server 104 can independently implement the building indoor area prediction method. Taking the server 104 as an example, the server 104 obtains the collected point clouds of each room, splices the point clouds to obtain the house point cloud; the server 104 pre-processes the house point cloud, extracts the point cloud horizontal plane and the point cloud vertical plane; the server 104 locates and filters the point cloud corresponding to the non-indoor area based on the point cloud horizontal plane and the point cloud vertical plane, and obtains the actual indoor area point cloud; the server 104 converts the actual indoor area point cloud into an indoor area area image, and determines the indoor area according to the indoor area area image. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.
[0077] In one embodiment, Figure 2 As shown in the figure, a method for predicting the indoor area of a building is provided. Figure 1 The server in the example is used to illustrate the following steps:
[0078] Step S202, obtaining the collected point clouds of each room, and stitching the point clouds to obtain the house point cloud.
[0079] Among them, the point cloud is a set of point data obtained by a measuring instrument, and the house point cloud is a set of point cloud data of a house obtained by a measuring instrument.
[0080] Specifically, the server obtains the point cloud data of each room collected by the laser radar, and then splices the point cloud data of each room to obtain the house point clouds of the houses corresponding to these rooms.
[0081] Step S204, pre-processing the house point cloud to extract the point cloud horizontal plane and the point cloud vertical plane.
[0082] The horizontal plane of the point cloud refers to the point cloud data on the horizontal plane, and the vertical plane of the point cloud refers to the point cloud data on the vertical plane.
[0083] Specifically, after performing preprocessing such as rotation and translation on the house point cloud, the server calculates the normal vector corresponding to each point cloud in the house point cloud, and extracts the horizontal plane and the vertical plane of the point cloud from the house point cloud based on each normal vector.
[0084] Step S206: locate and filter the point clouds corresponding to the non-indoor areas based on the horizontal plane of the point cloud and the vertical plane of the point cloud to obtain the point clouds of the actual indoor area.
[0085] Among them, since many areas in the house cannot be calculated as indoor areas, the point cloud corresponding to the non-indoor area refers to the point cloud that does not belong to the indoor area, such as walls, window openings, and door openings.
[0086] Specifically, the server locates the point clouds that do not belong to the calculated indoor area in the house point cloud through the point cloud horizontal plane and the point cloud vertical plane. Then, the point clouds corresponding to the non-indoor area are filtered out, and the remaining point clouds are the actual indoor area point clouds.
[0087] Step S208: converting the actual indoor area point cloud into an indoor area region image, and determining the indoor area according to the indoor area region image.
[0088] Specifically, the server converts the obtained actual indoor area point cloud into an indoor area region image by projection, and then calculates the indoor area region image to obtain the indoor area.
[0089] The above-mentioned building indoor area prediction method obtains the collected point clouds of each room, splices the point clouds to obtain the house point cloud; pre-processes the house point cloud, extracts the point cloud horizontal plane and point cloud vertical plane; locates and filters the point cloud corresponding to the non-indoor area based on the point cloud horizontal plane and point cloud vertical plane, obtains the actual indoor area point cloud; converts the actual indoor area point cloud into an indoor area area image, and determines the indoor area according to the indoor area area image. This method collects point cloud data of a building house, determines the indoor area of the building by processing the point cloud data, and reduces a lot of tedious manual workload compared to manual measurement with a tape measure, which not only improves efficiency but also improves accuracy.
[0090] In one embodiment, Figure 3 As shown, step S204 includes:
[0091] Step S302: performing plane fitting on the house point cloud to determine the largest wall surface.
[0092] Specifically, a plane fitting is performed on the point cloud of the entire house, and the surface whose normal vector is parallel to the horizontal plane is extracted from the fitted plane. Then, the surface with the most point clouds is selected as the largest wall surface.
[0093] Step S304, rotating the house point cloud to a position where the largest wall is parallel to the first coordinate plane, and the ground and ceiling are parallel to the second coordinate plane, and translating the rotated house point cloud to a position where the Z value is 0.
[0094] Specifically, the house point cloud is rotated based on the maximum wall surface so that the maximum wall surface is parallel to the first coordinate plane in the spatial coordinate system, while the ground and ceiling in the house point cloud are parallel to the second coordinate plane. The rotation can be specifically achieved by calculating the rotation matrix. Then, the entire rotated house point cloud is translated to the position where the Z value = 0. The Z value is the value of the vertical axis (Z axis) in the spatial coordinate axis. That is, the house point cloud is translated to a position where the ground height is 0. Among them, the spatial coordinate system of this embodiment is a three-dimensional XYZ coordinate axis, and O represents the origin of the three-dimensional coordinate axis. The first coordinate plane is the XOZ plane, and the second coordinate plane is the XOY plane.
[0095] Step S306, determining the normal vector corresponding to each point cloud in the translated house point cloud.
[0096] Specifically, after the house point cloud completes rotation and translation, the server calculates the normal vector of each point cloud in the house point cloud, and subsequently extracts the point cloud horizontal plane and the point cloud vertical plane according to the normal vector of each point cloud.
[0097] In one embodiment, step S306 includes: obtaining a preset radius, where the preset radius is determined according to the density of the house point cloud; fitting the local planes corresponding to the point clouds in the house point cloud respectively using all points in the house point cloud within the preset radius; and calculating the normal vector of the local plane as the normal vector of the corresponding point cloud.
[0098] Specifically, for each point cloud in the house point cloud, find all the points within its radius r. The radius r is a parameter that needs to be adjusted according to the density of the actual point cloud, so the radius r is determined by the density of the point cloud. Then, each point cloud is fitted with a local plane according to all the points within its own radius r, and the normal vector of the local plane is calculated as the normal vector of the point cloud.
[0099] Step S308: extracting the point cloud horizontal plane and the point cloud vertical plane based on each normal vector.
[0100] Specifically, the server first roughly estimates the indoor area reference image based on the normal vectors of each point cloud, filters out the point cloud outside the indoor area reference image to complete the point cloud noise reduction, and then extracts the horizontal plane and vertical plane of the point cloud.
[0101] In one embodiment, step S308 includes: dividing each point cloud in the house point cloud into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis according to whether each normal vector is parallel to the Z axis; clustering, segmenting and classifying the first point cloud to obtain a ground point cloud plane and a non-ground point cloud plane; determining a first indoor area reference image according to a horizontal plane projection image of the ground point cloud plane and a horizontal plane projection image of the non-ground point cloud plane; filtering point clouds outside the first indoor area reference image from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud; extracting a point cloud horizontal plane according to the updated first point cloud, and extracting a point cloud vertical plane according to the updated second point cloud.
[0102] Specifically, according to the normal vectors of each point cloud in the house point cloud, the point cloud is divided into a first point cloud cloud_z whose normal vector is parallel to the Z axis and a second point cloud cloud_v whose normal vector is not parallel to the Z axis. The first point cloud cloud_z is clustered, segmented and classified to be divided into two types of point clouds: ground point cloud plane and non-ground point cloud plane. Then, the point clouds corresponding to the ground point cloud plane and the non-ground point cloud plane are projected horizontally to obtain the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane. Then, the first indoor area reference image is determined according to the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane, and the first indoor area reference image roughly shows the outline of the indoor area. Finally, according to the outline of the first indoor area reference image, the point clouds outside the outline are filtered out from the first point cloud cloud_z and the second point cloud cloud_v to obtain the updated first point cloud cloud_z and the second point cloud cloud_v, that is, the updated first point cloud and the updated second point cloud are obtained. The updated first point cloud cloud_z + the second point cloud cloud_v is the denoised point cloud. Then, the horizontal plane of the point cloud is extracted based on the updated first point cloud, and the vertical plane of the point cloud is extracted based on the updated second point cloud.
[0103] In one embodiment, the first indoor area reference image is specifically obtained by performing a closing operation on the horizontal plane projection image of the non-ground point cloud plane and then calculating the largest connected domain therein. The intersection of the horizontal plane projection image of the ground point cloud plane and the connected domain is determined as the first indoor area reference image. Figure 4 , that is, take the intersection of the maximum connected domain after the non-ground closed operation and all horizontal plane projection images, and the result is the indoor area, that is, the first indoor area reference image.
[0104] In one embodiment, a point cloud horizontal plane is extracted based on an updated first point cloud, and a point cloud vertical plane is extracted based on an updated second point cloud, including: clustering and segmenting the updated first point cloud, and classifying the segmented point cloud planes using the geometric dimensions of the horizontal plane to obtain a point cloud horizontal plane; the point cloud horizontal plane includes a ceiling; extracting a cylindrical point cloud fit from the point cloud below the ceiling from the updated second point cloud, and filtering the fitted cylindrical point cloud from the updated second point cloud; determining a wall normal vector of the updated second point cloud based on the frequency of occurrence of a normal vector corresponding to the updated second point cloud after filtering out the cylindrical point cloud; performing a preliminary classification on the updated second point cloud based on the category of the wall normal vector; clustering and segmenting each type of point cloud after the preliminary classification, and classifying each type of segmented point cloud planes using the geometric dimensions of the vertical plane to obtain a point cloud vertical plane.
[0105] The geometric dimensions refer to the geometric information of the horizontal plane, including the length, width and height of the plane, the coordinates of the vertices of the bounding box, the coordinates of the center point, and the coordinates of the vertices of the circumscribed polygon, etc.
[0106] Specifically, the process of extracting the point cloud horizontal plane according to the updated first point cloud is as follows: first, cluster and segment the updated first point cloud cloud_z again to obtain the segmented segmentation plane. Then, the segmentation plane is classified according to the geometric dimensions of the plane to obtain the point cloud horizontal plane. The point cloud horizontal plane includes the ground, ceiling, window hole top surface, window hole ground surface, and beam bottom surface. For example, when the segmentation plane is classified according to the geometric dimensions, the plane with a width greater than 0.5 meters and a highest point height close to 0 meters is usually the ground, so the segmentation plane that meets the geometric dimensions belongs to the ground. Similarly, the width of the ceiling is greater than 0.5 meters, the length is greater than 1.5 meters, and the lowest point height is close to H1. The width of the top surface of the bay window is greater than 0.4 meters, the length is greater than 1.0 meters, the height is greater than 1.5 meters, and less than H1-0.1. The width of the bottom surface of the window hole is greater than 0.06 meters, the length is greater than 0.7 meters, and the height is less than 1.5 meters and greater than 0.4 meters. And the lowest point height of the potential beam bottom surface is higher than 2.5 meters. Among them, H1 is the height of the ceiling. After dividing the space in units of 2 cm in the vertical direction, the number of point clouds is counted. The height above 1.5 meters and with the most points is the height of the ceiling, and the height below 1.5 meters and with the most points is the height of the floor. In addition, in addition to these classifications using geometric dimensions, it is also necessary to calculate the ratio of the overlapping area of the horizontal projection of each dividing plane and the horizontal projection of the ground to the plane area. If the ratio is low, preferably less than 0.1, it is regarded as the top and bottom surfaces of the window opening and bay window. It should be understood that the geometric dimensions given in this embodiment are in line with the geometric dimensions of general residential units, and special units can be adapted by adjusting parameters according to actual conditions.
[0107] The process of extracting the point cloud horizontal plane according to the updated second point cloud is specifically as follows: using the point cloud horizontal plane ceiling, extract the point cloud located under the ceiling from the updated second point cloud cloud_v. Fit the extracted point clouds with cylindrical point clouds, so as to filter out the cylindrical point clouds close to the size of the water pipe or the circular cylinder, thereby removing the point clouds corresponding to the water pipe or the circular cylinder. Then, calculate the normal vectors corresponding to each point cloud in the updated second point cloud after filtering out the cylindrical point clouds. According to the frequency of occurrence of each normal vector, the normal vector with a relatively high frequency of occurrence is determined as the normal vector of the wall, that is, the wall normal vector. Among them, the normal vector in this embodiment is also calculated by fitting the local plane with a radius r. The normal vector with a frequency of occurrence exceeding 10% of the total number of point clouds can be considered to have a high frequency of occurrence. Finally, the updated second point cloud cloud_v is classified according to the category of the wall normal vector, and the point clouds with close normal vectors are divided into one category, including three categories such as the Z direction, the X direction and the Y direction. The classified point clouds are clustered and segmented separately, and the segmented planes are classified using the set size of the vertical plane to obtain the vertical planes of the point cloud. The vertical planes of the point cloud include: wall planes, opening side planes, and beam side planes. For example, a wall plane is a plane with a length greater than 0.8 meters, a height greater than 1.5 meters, and a lower edge less than 0.2 meters, or a length greater than 1.2 meters and a height greater than 0.45 meters. The height of the beam side plane is greater than 0.08 meters, the lower edge is higher than 2 meters, and the width of the opening side plane is greater than 0.06 meters, and the upper edge is higher than 1.8 meters. In addition, the opening side plane can be a combination of all the bay window top surfaces, bay window bottom surfaces, and potential beam bottom surfaces. If the opening can be formed, these surfaces can be identified as the sides of the opening. If not, the bay window top surface is regarded as the ceiling, and the potential beam bottom surface is regarded as the beam bottom surface.
[0108] In one embodiment, step S206 includes: calculating the door opening rectangular frame on the wall, determining the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and has overlapping projections as the door opening, and filtering out the point cloud corresponding to the door opening; projecting the parallel walls onto each other, and filtering out the point cloud corresponding to the overlapping projection area.
[0109] Specifically, since the usable space area of the suite does not include the area of the walls and door openings, it is necessary to filter out the corresponding point clouds of the walls and door openings to avoid confusion with the usable space area of the suite and affect the calculation of the indoor area. The door opening is calculated by calculating the door opening rectangular frame on the wall. When there are two door opening rectangular frames with size differences that meet the threshold, that is, the sizes are close and parallel to each other and the projections overlap, the positions corresponding to the two door opening rectangular frames are the positions of the door openings, and the point cloud corresponding to the door opening position is filtered out. The schematic diagram of the door opening rectangular frame is shown as follows: Figure 5As shown in the figure. For the wall, two parallel walls are projected onto each other to obtain the overlapping area after projection, and the point cloud corresponding to the area is filtered out. The point cloud after removing the point cloud corresponding to the door opening and the wall point cloud is the reference point cloud for all indoor areas.
[0110] In one embodiment, a rectangular frame of a door opening is calculated for a wall, including: projecting a point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall; smoothing the edges of the projected wall and calculating a maximum inscribed rectangle; and using the maximum inscribed rectangle whose size satisfies the size of the door opening as a rectangular frame corresponding to the door opening.
[0111] Specifically, to calculate the rectangular frame of the door opening, the point cloud corresponding to the wall is first projected onto a horizontal plane that is parallel to the wall to obtain the projected wall. Then, after smoothing the edge of the projected wall, its maximum inscribed rectangle is calculated. If the maximum inscribed rectangle that satisfies the size of the door opening is obtained, it is determined as the rectangular frame corresponding to the door opening.
[0112] In one embodiment, step S208 includes: projecting the point cloud corresponding to the vertical plane of the point cloud to the horizontal plane for straight line fitting to obtain a fitting line segment; horizontally projecting the actual indoor area point cloud to obtain a second indoor area reference image; segmenting the second indoor area reference image using the fitting line segment, determining the indoor area according to the uniformity of the point clouds in each area after segmentation, and obtaining an indoor area regional image; replacing the coordinates of the vertices in the indoor area regional image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; and calculating the indoor area according to the coordinates of continuous vertices in the indoor area regional image.
[0113] Specifically, the extracted point cloud vertical plane is projected into the horizontal plane for straight line fitting to obtain fitting line segments, which can be one or more fitting line segments. In addition, for relatively wide walls, segment fitting is performed according to the corresponding threshold to obtain multiple fitting line segments. For example, a 2-meter-wide wall is segmented according to the threshold of 5 mm. At the same time, the actual indoor area point cloud is horizontally projected to obtain a second indoor area reference image, such as Figure 6 As shown, a schematic diagram of an indoor area reference image projected onto a horizontal plane is provided. Since the actual indoor area point cloud is already the most accurate reference point cloud of the indoor area after processing, the second indoor area reference image is more accurate than the first indoor area reference image.
[0114] Then, the fitting line segment obtained by fitting is extended, and the projected second indoor area reference image is segmented by extension. The segmentation diagram is referenced as follows: Figure 7 , Figure 7The gray line shown is the fitting line segment used as the segmentation line, and the white area is a segmented area after segmentation. After the segmentation is completed, the number and distribution of point clouds projected in each segmented area are used to determine whether the area is an indoor area. If the point cloud is evenly distributed, it represents an indoor area, that is, the area of the use space in the suite, and it is marked as indoor, otherwise it is marked as outdoor. All the areas marked as indoor constitute the indoor area area image.
[0115] After obtaining the indoor area regional image, the coordinates of all vertices in the indoor area regional image are replaced with the coordinates of the wall intersection of the wall closest to the vertex within a preset range. Among them, the preset range is preferably 2 cm in this embodiment, and the intersection is the intersection of the wall and the wall. That is, the coordinates of the vertex are replaced with the coordinates of the intersection of the nearest wall within 2 cm, so that the coordinates on the image coordinate system are changed to the actual coordinates in the point cloud coordinate system by replacement, thereby ensuring the accuracy of subsequent calculations. After completing the coordinate replacement, the indoor area is calculated using the coordinates of continuous vertices.
[0116] In addition, since the area calculation stipulates that the area of areas with different clear heights needs to be multiplied by different coefficients, for example, the area with a clear height of 1.2-2.1m is calculated as half of the area. Therefore, when determining to project the actual indoor area point cloud to obtain the second indoor area reference image, the point cloud within a certain height range is intercepted from the actual indoor area point cloud and then projected, for example, the point cloud of 2.1m-5m is intercepted and horizontally projected to obtain the second indoor area reference image.
[0117] In one embodiment, the indoor area is calculated based on the coordinates of continuous vertices in the indoor area region image, including: taking any point among the continuous vertices as a reference, forming a directed triangle with two adjacent points in a counterclockwise direction; calculating the directed area of the directed triangle based on the coordinates of the three vertices of the directed triangle; and superimposing the directed areas of each directed triangle to obtain the indoor area.
[0118] Specifically, assuming that an area in the indoor area image is a square, a point is randomly selected from the four vertices of the square as a reference, and two points adjacent to the reference point in the counterclockwise direction form a directed triangle. Then, the directed area of the directed triangle is calculated according to the vertices of the directed triangle. After obtaining multiple directed triangles that can overlap with the indoor area of the indoor area image after merging through this method, the directed areas of all directed triangles are superimposed to obtain the indoor area.
[0119] In one embodiment, before replacing the coordinates of the vertex in the indoor area region image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range, it also includes: when it is determined that there is a window hole based on the point cloud horizontal plane and the point cloud vertical plane positioning, and the window hole is a bay window, polygon fitting is performed on the bay window area and the corresponding indoor area in the second indoor area reference image to obtain the final indoor area region image.
[0120] Specifically, since there may be bay windows in the room, and bay windows usually need to be counted as half of the indoor area, therefore, the horizontal plane of the point cloud and the vertical plane of the point cloud are used to locate whether there is a bay window in the house. If it is determined that there is a bay window, the determined bay window area is polygonally fitted with the second indoor area reference image to obtain the indoor area area image after fitting the bay window area, which is the final indoor area area image.
[0121] In addition, the indoor area image can also be drawn into a drawing to facilitate surveying and mapping personnel to measure, edit and save documents, etc. Figure 8 As shown, a schematic diagram of an indoor area image is provided, wherein the white dots are the intersection points of the fitted line segments, i.e., the vertices in the indoor area image, the area where k is located is the bay window area, the gray area is the indoor area with a net height of 2.1-5.0m, and the white line segments are the horizontal projection points of the point cloud. The number after k is the area coefficient of the bay window, and the coefficient in this embodiment is 0. The number after "area:" is the bay window area in square meters. The "room:" in the upper left corner of the image indicates the area of the usable space in the suite, and the "wall:" indicates the area of the indoor wall.
[0122] In one embodiment, the bay window is located and determined based on the horizontal plane and the vertical plane of the point cloud, including: combining the top surface of the window hole, the floor surface of the window hole and the side surface of the window opening to obtain the window hole; and determining whether the window hole is a bay window based on the size of the window hole.
[0123] Specifically, the determination of the floating window is obtained by combining the top surface of the window hole in the horizontal plane of the point cloud, the ground of the window hole, and the side surface of the hole in the vertical plane of the point cloud. The window hole may correspond to an ordinary window or a floating window, so it is determined whether the size of the window hole meets the size of the floating window. If the size of the window hole meets the size of the floating window, it is determined to be a floating window.
[0124] It should be understood that although Figure 2-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-3At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0125] In one embodiment, Fig. 9 As shown, a device for predicting indoor area of a building is provided, comprising: a splicing module 902, an extraction module 904, a filtering module 906 and a determination module 908, wherein:
[0126] The stitching module 902 is used to obtain the collected point clouds of each room and stitch the point clouds to obtain the house point cloud.
[0127] The extraction module 904 is used to pre-process the house point cloud and extract the horizontal plane of the point cloud and the vertical plane of the point cloud.
[0128] The filtering module 906 is used to locate and filter out the point cloud corresponding to the non-indoor area based on the horizontal plane of the point cloud and the vertical plane of the point cloud to obtain the point cloud of the actual indoor area.
[0129] The determination module 908 is used to convert the actual indoor area point cloud into an indoor area region image, and determine the indoor area according to the indoor area region image.
[0130] In one embodiment, the extraction module 904 is also used to perform plane fitting on the house point cloud to determine the maximum wall; rotate the house point cloud to a position where the maximum wall is parallel to the first coordinate plane and the ground and ceiling are parallel to the second coordinate plane, and translate the rotated house point cloud to a position where the Z value is 0; the Z value is the value of the vertical axis in the spatial coordinate axis; determine the normal vector corresponding to each point cloud in the house point cloud after translation; and extract the point cloud horizontal plane and the point cloud vertical plane based on each normal vector.
[0131] In one embodiment, the extraction module 904 is also used to obtain a preset radius, which is determined according to the density of the house point cloud; using all points of each point cloud in the house point cloud within the preset radius, respectively fit the local planes corresponding to each point cloud in the house point cloud; calculate the normal vector of the local plane as the normal vector of the corresponding point cloud.
[0132] In one embodiment, the extraction module 904 is also used to divide each point cloud in the house point cloud into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis according to whether each normal vector is parallel to the Z axis; the Z axis is the vertical axis in the spatial coordinate axis; clustering, segmenting and classifying the first point cloud to obtain a ground point cloud plane and a non-ground point cloud plane; determining a first indoor area reference image based on a horizontal plane projection image of the ground point cloud plane and a horizontal plane projection image of the non-ground point cloud plane; filtering out point clouds outside the first indoor area reference image from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud; extracting a point cloud horizontal plane based on the updated first point cloud, and extracting a point cloud vertical plane based on the updated second point cloud.
[0133] In one embodiment, the extraction module 904 is also used to cluster and segment the updated first point cloud, and classify the segmented point cloud planes using the geometric dimensions of the horizontal plane to obtain the point cloud horizontal plane; the point cloud horizontal plane includes the ceiling; the point cloud under the ceiling is extracted from the updated second point cloud to fit the cylindrical point cloud, and the fitted cylindrical point cloud is filtered out from the updated second point cloud; the wall normal vector of the updated second point cloud is determined based on the frequency of occurrence of the normal vector corresponding to the updated second point cloud after filtering out the cylindrical point cloud; the updated second point cloud is initially classified according to the category of the wall normal vector; the various types of point clouds after the initial classification are clustered and segmented, and the various types of segmented point cloud planes are classified based on the geometric dimensions of the vertical plane to obtain the point cloud vertical plane.
[0134] In one embodiment, the extraction module 904 is also used to perform a closing operation on the horizontal plane projection image of the non-ground point cloud plane to calculate the largest connected domain; and determine the intersection of the horizontal plane projection image of the ground point cloud plane, the horizontal plane projection image of the non-ground point cloud plane, and the connected domain as the first indoor area reference image.
[0135] In one embodiment, the filtering module 906 is also used to calculate the door opening rectangular frame for the wall, determine the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and has overlapping projections as the door opening, and filter out the point cloud corresponding to the door opening; project the parallel walls onto each other, and filter out the point cloud corresponding to the overlapping projection area.
[0136] In one embodiment, the filtering module 906 is also used to project the point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall; after smoothing the edges of the projected wall, the maximum inscribed rectangle is calculated; and the maximum inscribed rectangle whose size meets the size of the door opening is used as the rectangular frame corresponding to the door opening.
[0137] In one embodiment, the determination module 908 is also used to project the point cloud corresponding to the vertical plane of the point cloud to the horizontal plane for straight line fitting to obtain a fitting line segment; horizontally project the actual indoor area point cloud to obtain a second indoor area reference image; use the fitting line segment to segment the second indoor area reference image, determine the indoor area according to the uniformity of the point clouds in each area after segmentation, and obtain an indoor area regional image; replace the coordinates of the vertices in the indoor area regional image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; calculate the indoor area according to the coordinates of continuous vertices in the indoor area regional image.
[0138] In one embodiment, the determination module 908 is also used to form a directed triangle with two adjacent points in a counterclockwise direction based on any point among the continuous vertices; calculate the directed area of the directed triangle according to the coordinates of the three vertices of the directed triangle; and superimpose the directed areas of each directed triangle to obtain the indoor area.
[0139] In one embodiment, the determination module 908 is also used to perform polygon fitting on the bay window area with the corresponding indoor area in the second indoor area reference image to obtain the final indoor area image when it is determined that there is a window hole based on the horizontal plane and vertical plane positioning of the point cloud, and the window hole is a bay window.
[0140] In one embodiment, the determination module 908 is further used to combine the top surface of the window hole, the floor surface of the window hole and the side surface of the opening to obtain the window hole; and determine whether the window hole is a bay window according to the size of the window hole.
[0141] The specific definition of the building indoor area prediction device can be found in the definition of the building indoor area prediction method mentioned above, which will not be repeated here. Each module in the above-mentioned building indoor area prediction device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0142] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.10As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store point cloud data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting the indoor area of a building is implemented.
[0143] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0145] Obtain the collected point clouds of each room and stitch the point clouds together to get the house point cloud;
[0146] Preprocess the house point cloud and extract the horizontal plane and vertical plane of the point cloud;
[0147] Based on the horizontal and vertical planes of the point cloud, the point cloud corresponding to the non-indoor area is located and filtered out to obtain the actual indoor area point cloud;
[0148] The actual indoor area point cloud is converted into an indoor area region image, and the indoor area is determined according to the indoor area region image.
[0149] In one embodiment, when the processor executes the computer program, the following steps are also implemented: plane fitting is performed on the house point cloud to determine the maximum wall; the house point cloud is rotated to a position where the maximum wall is parallel to the first coordinate plane and the ground and ceiling are parallel to the second coordinate plane, and the rotated house point cloud is translated to a position where the Z value is 0; the Z value is the value of the vertical axis in the spatial coordinate axis; the normal vector corresponding to each point cloud in the house point cloud after translation is determined; and the point cloud horizontal plane and the point cloud vertical plane are extracted based on each normal vector.
[0150] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a preset radius, where the preset radius is determined based on the density of the house point cloud; using all points of each point cloud in the house point cloud within the preset radius to fit the local planes corresponding to each point cloud in the house point cloud; and calculating the normal vector of the local plane as the normal vector of the corresponding point cloud.
[0151] In one embodiment, the processor further implements the following steps when executing the computer program: according to whether each normal vector is parallel to the Z axis, each point cloud in the house point cloud is divided into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis; the Z axis is the vertical axis in the spatial coordinate axis; the first point cloud is clustered, segmented and classified to obtain a ground point cloud plane and a non-ground point cloud plane; a first indoor area reference image is determined based on a horizontal plane projection image of the ground point cloud plane and a horizontal plane projection image of the non-ground point cloud plane; point clouds located outside the first indoor area reference image are filtered out from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud; a point cloud horizontal plane is extracted based on the updated first point cloud, and a point cloud vertical plane is extracted based on the updated second point cloud.
[0152] In one embodiment, the processor further implements the following steps when executing the computer program: clustering and segmenting the updated first point cloud, classifying the segmented point cloud planes using the geometric dimensions of the horizontal plane to obtain the point cloud horizontal plane; the point cloud horizontal plane includes the ceiling; extracting the point cloud fitting cylinder point cloud under the ceiling from the updated second point cloud, and filtering the fitted cylinder point cloud from the updated second point cloud; determining the wall normal vector of the updated second point cloud based on the frequency of occurrence of the normal vector corresponding to the updated second point cloud after filtering out the cylinder point cloud; performing an initial classification on the updated second point cloud based on the category of the wall normal vector; clustering and segmenting each type of point cloud after the initial classification, and classifying each type of segmented point cloud planes using the geometric dimensions of the vertical plane to obtain the point cloud vertical plane.
[0153] In one embodiment, when the processor executes the computer program, the following steps are also implemented: performing a closing operation on the horizontal plane projection image of the non-ground point cloud plane to calculate the largest connected domain; and determining the intersection of the horizontal plane projection image of the ground point cloud plane, the horizontal plane projection image of the non-ground point cloud plane, and the connected domain as the first indoor area reference image.
[0154] In one embodiment, when the processor executes the computer program, the following steps are also implemented: calculating the door opening rectangular frame for the wall, determining the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and whose projections overlap as the door opening, and filtering out the point cloud corresponding to the door opening; projecting the parallel walls onto each other, and filtering out the point cloud corresponding to the overlapping projection area.
[0155] In one embodiment, when the processor executes the computer program, the following steps are also implemented: projecting the point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall; smoothing the edges of the projected wall and calculating the maximum inscribed rectangle; using the maximum inscribed rectangle whose size meets the size of the door opening as the rectangular frame corresponding to the door opening.
[0156] In one embodiment, the processor further implements the following steps when executing the computer program: projecting the point cloud corresponding to the vertical plane of the point cloud to the horizontal plane for straight line fitting to obtain fitting line segments; horizontally projecting the actual indoor area point cloud to obtain a second indoor area reference image; segmenting the second indoor area reference image using the fitting line segments, determining the indoor area according to the uniformity of the point clouds in each area after segmentation, and obtaining an indoor area regional image; replacing the coordinates of the vertices in the indoor area regional image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; and calculating the indoor area according to the coordinates of continuous vertices in the indoor area regional image.
[0157] In one embodiment, when the processor executes the computer program, the following steps are also implemented: taking any point among the continuous vertices as a reference, forming a directed triangle with two adjacent points in a counterclockwise direction; calculating the directed area of the directed triangle according to the coordinates of the three vertices of the directed triangle; and superimposing the directed areas of each directed triangle to obtain the indoor area.
[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when it is determined that there is a window hole based on the horizontal plane of the point cloud and the vertical plane of the point cloud, and the window hole is a bay window, polygon fitting is performed on the bay window area and the corresponding indoor area in the second indoor area reference image to obtain a final indoor area image.
[0159] In one embodiment, when the processor executes the computer program, the following steps are also implemented: combining the top surface of the window hole, the floor surface of the window hole and the side surface of the opening to obtain the window hole; and determining whether the window hole is a bay window according to the size of the window hole.
[0160] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0161] Obtain the collected point clouds of each room and stitch the point clouds together to get the house point cloud;
[0162] Preprocess the house point cloud and extract the horizontal plane and vertical plane of the point cloud;
[0163] Based on the horizontal and vertical planes of the point cloud, the point cloud corresponding to the non-indoor area is located and filtered out to obtain the actual indoor area point cloud;
[0164] The actual indoor area point cloud is converted into an indoor area region image, and the indoor area is determined according to the indoor area region image.
[0165] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: plane fitting is performed on the house point cloud to determine the maximum wall; the house point cloud is rotated to a position where the maximum wall is parallel to the first coordinate plane and the ground and ceiling are parallel to the second coordinate plane, and the rotated house point cloud is translated to a position where the Z value is 0; the Z value is the value of the vertical axis in the spatial coordinate axis; the normal vector corresponding to each point cloud in the house point cloud after translation is determined; and the point cloud horizontal plane and the point cloud vertical plane are extracted based on each normal vector.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a preset radius, where the preset radius is determined based on the density of the house point cloud; using all points of each point cloud in the house point cloud within the preset radius to fit the local planes corresponding to each point cloud in the house point cloud; and calculating the normal vector of the local plane as the normal vector of the corresponding point cloud.
[0167] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: according to whether each normal vector is parallel to the Z axis, each point cloud in the house point cloud is divided into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis; the Z axis is the vertical axis in the spatial coordinate axis; the first point cloud is clustered, segmented and classified to obtain a ground point cloud plane and a non-ground point cloud plane; a first indoor area reference image is determined based on a horizontal plane projection image of the ground point cloud plane and a horizontal plane projection image of the non-ground point cloud plane; point clouds located outside the first indoor area reference image are filtered out from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud; a point cloud horizontal plane is extracted based on the updated first point cloud, and a point cloud vertical plane is extracted based on the updated second point cloud.
[0168] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: clustering and segmenting the updated first point cloud, and classifying the segmented point cloud planes using the geometric dimensions of the horizontal plane to obtain the point cloud horizontal plane; the point cloud horizontal plane includes the ceiling; extracting the point cloud under the ceiling from the updated second point cloud to fit the cylindrical point cloud, and filtering the fitted cylindrical point cloud from the updated second point cloud; determining the wall normal vector of the updated second point cloud based on the frequency of occurrence of the normal vector corresponding to the updated second point cloud after filtering the cylindrical point cloud; performing an initial classification on the updated second point cloud based on the category of the wall normal vector; clustering and segmenting each type of point cloud after the initial classification, and classifying each type of segmented point cloud planes using the geometric dimensions of the vertical plane to obtain the point cloud vertical plane.
[0169] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: performing a closing operation on the horizontal plane projection image of the non-ground point cloud plane to calculate the largest connected domain; and determining the intersection of the horizontal plane projection image of the ground point cloud plane, the horizontal plane projection image of the non-ground point cloud plane, and the connected domain as the first indoor area reference image.
[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: calculating the door opening rectangular frame for the wall, determining the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and whose projections overlap with each other as the door opening, and filtering out the point cloud corresponding to the door opening; projecting the parallel walls onto each other, and filtering out the point cloud corresponding to the projection overlap area.
[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: projecting the point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall; smoothing the edges of the projected wall and calculating the maximum inscribed rectangle; using the maximum inscribed rectangle whose size meets the size of the door opening as the rectangular frame corresponding to the door opening.
[0172] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: projecting the point cloud corresponding to the vertical plane of the point cloud to the horizontal plane for straight line fitting to obtain a fitting line segment; horizontally projecting the actual indoor area point cloud to obtain a second indoor area reference image; using the fitting line segment to segment the second indoor area reference image, determining the indoor area according to the uniformity of the point clouds in each area after segmentation, and obtaining an indoor area regional image; replacing the coordinates of the vertices in the indoor area regional image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; and calculating the indoor area according to the coordinates of continuous vertices in the indoor area regional image.
[0173] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: taking any point among the continuous vertices as a reference, forming a directed triangle with two adjacent points in a counterclockwise direction; calculating the directed area of the directed triangle according to the coordinates of the three vertices of the directed triangle; and superimposing the directed areas of each directed triangle to obtain the indoor area.
[0174] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when it is determined that there is a window hole based on the horizontal plane of the point cloud and the vertical plane of the point cloud, and the window hole is a bay window, polygon fitting is performed on the bay window area and the corresponding indoor area in the second indoor area reference image to obtain the final indoor area image.
[0175] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: combining the top surface of the window hole, the floor surface of the window hole and the side surface of the opening to obtain the window hole; and determining whether the window hole is a bay window according to the size of the window hole.
[0176] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0177] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0178] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for predicting indoor area of a building, characterized in that: The method comprises: Obtaining the collected point clouds of each room, and stitching the point clouds to obtain a house point cloud; Preprocessing the house point cloud to extract a point cloud horizontal plane and a point cloud vertical plane; the point cloud vertical plane includes a wall surface; Calculate the door opening rectangular frame for the wall surface, determine the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and whose projections overlap with each other as the door opening, and filter out the point cloud corresponding to the door opening; Project the parallel walls onto each other, filter out the point clouds corresponding to the overlapping areas of the projections, and obtain the point clouds of the actual indoor area; Projecting the point cloud corresponding to the vertical plane of the point cloud onto the horizontal plane for straight line fitting to obtain a fitting line segment; Performing horizontal projection on the actual indoor area point cloud to obtain a second indoor area reference image; Segmenting the second indoor area reference image using the fitting line segments, determining the indoor area according to the uniformity of the point clouds of each area after segmentation, and obtaining an indoor area region image; Replacing the coordinates of the vertices in the indoor area region image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; The indoor area is calculated according to the coordinates of the continuous vertices in the indoor area region image.
2. The method according to claim 1, characterized in that The preprocessing of the house point cloud to extract the point cloud horizontal plane and the point cloud vertical plane includes: Performing plane fitting on the house point cloud to determine the maximum wall surface; Rotate the house point cloud to a position where the largest wall is parallel to the first coordinate plane, and the ground and the ceiling are parallel to the second coordinate plane, and translate the rotated house point cloud to a position where the Z value is 0; the Z value is the value of the vertical axis in the spatial coordinate axis; Determine the normal vector corresponding to each point cloud in the house point cloud after translation; A point cloud horizontal plane and a point cloud vertical plane are extracted based on the normal vectors.
3. The method according to claim 2, characterized in that The determining of the normal vector corresponding to each point cloud in the house point cloud after translation includes: Obtaining a preset radius, where the preset radius is determined according to the density of the house point cloud; Using all points of each point cloud in the house point cloud within the preset radius, respectively fit the local planes corresponding to each point cloud in the house point cloud; The normal vector of the local plane is calculated as the normal vector of the corresponding point cloud.
4. The method according to claim 2, characterized in that: The step of extracting the point cloud horizontal plane and the point cloud vertical plane based on each of the normal vectors comprises: According to whether each normal vector is parallel to the Z axis, each point cloud in the house point cloud is divided into a first point cloud parallel to the Z axis and a second point cloud not parallel to the Z axis; the Z axis is the vertical axis in the spatial coordinate axis; Clustering, segmenting and classifying the first point cloud to obtain a ground point cloud plane and a non-ground point cloud plane; Determine a first indoor area reference image according to the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane; Filtering point clouds outside the first indoor area reference image from the first point cloud and the second point cloud to obtain an updated first point cloud and an updated second point cloud; A point cloud horizontal plane is extracted according to the updated first point cloud, and a point cloud vertical plane is extracted according to the updated second point cloud.
5. The method according to claim 4, characterized in that The step of extracting a point cloud horizontal plane according to the updated first point cloud and extracting a point cloud vertical plane according to the updated second point cloud comprises: Clustering and segmenting the updated first point cloud, classifying the segmented point cloud planes using the geometric dimensions of the horizontal plane, and obtaining a point cloud horizontal plane; the point cloud horizontal plane includes a ceiling; Extracting the point cloud fitting cylinder point cloud under the ceiling from the updated second point cloud, and filtering the fitted cylinder point cloud from the updated second point cloud; Determining a wall normal vector of the updated second point cloud according to an appearance frequency of a normal vector corresponding to the updated second point cloud after filtering out the cylindrical point cloud; Preliminarily classifying the updated second point cloud according to the category of the wall normal vector; The various point clouds after the initial classification are clustered and segmented respectively, and the geometric dimensions of the vertical plane are used to classify the various point cloud planes after the segmentation to obtain the point cloud vertical plane.
6. The method according to claim 4, characterized in that The determining of the first indoor area reference image according to the horizontal plane projection image of the ground point cloud plane and the horizontal plane projection image of the non-ground point cloud plane includes: Performing a closing operation on the horizontal plane projection image of the non-ground point cloud plane to calculate the largest connected domain; An intersection of the horizontal plane projection image of the ground point cloud plane, the horizontal plane projection image of the non-ground point cloud plane, and the connected domain is determined as a first indoor area reference image.
7. The method according to claim 1, characterized in that Calculating the door opening rectangular frame for the wall surface includes: Projecting the point cloud corresponding to the wall onto a horizontal plane parallel to the wall to obtain a projected wall; After smoothing the edges of the projected wall, the maximum inscribed rectangle is calculated; The maximum inscribed rectangle whose size meets the size of the door opening is used as the door opening rectangular frame corresponding to the door opening.
8. The method according to claim 1, characterized in that The step of calculating the indoor area according to the coordinates of continuous vertices in the indoor area region image comprises: Take any point among the continuous vertices as the reference, and form a directed triangle with two adjacent points in the counterclockwise direction; Calculating the directed area of the directed triangle according to the coordinates of the three vertices of the directed triangle; The directed areas of the directed triangles are superimposed to obtain the indoor area.
9. The method according to claim 1, characterized in that: Before replacing the coordinates of the vertices in the indoor area region image with the coordinates of the wall intersection points of the walls closest to the vertices within a preset range, the method further includes: When it is determined that there is a window hole according to the positioning of the horizontal plane of the point cloud and the vertical plane of the point cloud, and the window hole is a bay window, polygon fitting is performed on the bay window area and the second indoor area reference image to obtain a final indoor area image.
10. The method according to claim 9, characterized in that The point cloud horizontal plane includes the top surface of the window opening and the ground surface of the window opening; the point cloud vertical plane includes the side surface of the opening; and the floating window is located and determined according to the point cloud horizontal plane and the point cloud vertical plane, including: Combining the top surface of the window hole, the floor surface of the window hole and the side surface of the hole opening to obtain a window hole; Whether the window opening is a bay window is determined according to the size of the window opening.
11. The method according to claim 2, characterized in that The performing plane fitting on the house point cloud to determine the maximum wall surface includes: Performing plane fitting on the house point cloud, and extracting a surface whose normal vector is parallel to the horizontal plane from the fitted plane; The surface with the most point clouds is determined as the largest wall surface.
12. A device for predicting indoor area of a building, characterized in that: The device comprises: A splicing module is used to obtain the collected point clouds of each room and splice the point clouds to obtain a house point cloud; An extraction module, used for preprocessing the house point cloud to extract the point cloud horizontal plane and the point cloud vertical plane; the point cloud vertical plane includes the wall surface; A filtering module is used to calculate the door opening rectangular frame for the wall surface, determine the position corresponding to the door opening rectangular frame whose size difference meets the threshold, is parallel to each other and whose projections overlap with each other as the door opening, and filter out the point cloud corresponding to the door opening; mutually project the parallel walls, filter out the point cloud corresponding to the projection overlap area, and obtain the actual indoor area point cloud; A determination module is used to project the point cloud corresponding to the vertical plane of the point cloud to the horizontal plane for straight line fitting to obtain a fitting line segment; horizontally project the actual indoor area point cloud to obtain a second indoor area reference image; use the fitting line segment to segment the second indoor area reference image, determine the indoor area according to the uniformity of the point clouds of each area after segmentation, and obtain an indoor area area image; replace the coordinates of the vertices in the indoor area area image with the coordinates of the wall intersection point of the wall closest to the vertex within a preset range; calculate the indoor area according to the coordinates of continuous vertices in the indoor area area image.
13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method and system for automatically generating indoor three-dimensional model from point cloud by considering semanteme
CN111915730A
Augmenting image data based on related 3D point cloud data
WO2012040709A2