Floor plane graph construction method based on indoor three-dimensional point cloud
By using image processing and dynamic erosion technology based on 3D point clouds, an indoor floor plan is generated, solving the problem of automatically constructing indoor floor plans in existing technologies. This achieves accurate room segmentation and edge detection, adapting to different indoor environments.
Patent Information
- Application Number
- CN202511666940.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-01-23
AI Technical Summary
Existing technologies struggle to automate and accurately construct indoor floor plans, especially when dealing with holes and occlusions in 3D point cloud data. This leads to difficulties in automatically dividing rooms, topological breaks, and challenges in closing spatial units.
A binary image is generated using a 3D point cloud-based method, the lintel region is extracted, the boundary integrity is restored, room growth seeds are extracted using dynamic erosion, and an interior floor plan is generated using a wavefront algorithm. Image processing techniques are combined to enhance edge detection and morphological operations, and the number of erosions is dynamically adjusted to adapt to different sizes.
It enables automated and accurate construction of indoor floor plans, ensuring the accuracy of room edges, enhancing the universality and stability of the method, and adapting to different indoor environments.
Smart Images

Figure CN121392017A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of cartography, and particularly relates to a method for constructing an indoor floor plan by point cloud. BACKGROUND
[0002] Indoor plan construction is a technology for identifying and reconstructing the two-dimensional layout structure of indoor space from architectural drawings, point cloud data, images and other data, and provides an effective data basis for indoor navigation, analysis and modeling. However, due to the topological complexity and structural diversity of indoor scenes, automatic implementation of indoor room segmentation to form an indoor plan is still a problem to be solved.
[0003] Indoor floor plan construction technology is mainly divided into two categories: CAD-based drawing and image-based analysis. Traditional CAD drawing relies on manual measurement and drawing, which can achieve millimeter-level precision, but is time-consuming and labor-intensive and difficult to adapt to large-scale scenes. The fully automatic method based on images realizes rapid construction through rasterization processing, but is limited by image resolution and perspective distortion, and the construction results often have problems such as wall misplacement or blurred boundaries. In recent years, three-dimensional laser point cloud technology has become a research hotspot due to its high precision and strong realism, but the opening and closing state of doors and windows varies in actual scanning, resulting in problems such as holes and occlusions in point cloud data, making automatic room segmentation face challenges such as topological structure rupture and difficulty in closing spatial units. These all pose great difficulties for automatic floor plan construction based on three-dimensional point cloud. SUMMARY
[0004] In order to solve the above technical problems, the present application provides a floor plan construction method based on indoor three-dimensional point cloud, which takes indoor three-dimensional point cloud data containing noise and occlusion as input data, and can simply and effectively realize the construction of floor plan.
[0005] The technical solution adopted by the present application is:
[0006] A floor plan construction method based on indoor three-dimensional point cloud, comprising the following steps:
[0007] Step 1: input the three-dimensional point cloud of the floor, and generate an indoor binary image based on the point cloud distribution in the horizontal direction , In the binary image, the pixel value of the point cloud is 255, and the pixel value of the non-point cloud is 0.
[0008] Step 2: extract the indoor door header region and generate a wall line pixel image , and have the same size and resolution, In the wall line pixel image, the pixel value of the door header region is 0, and the pixel value of the other pixels is 255; combined with and This results in an improved binary image. , Each room is a closed, independent area;
[0009] Step 3: Repair the binary image using image processing methods. To obtain a binary image with complete boundaries, the boundary integrity is determined. ;
[0010] Step 4, targeting The growth seeds in each room are extracted through dynamic corrosion.
[0011] Step 5, in Based on this, using the growth seeds of each room as growth points, room areas of different colors are generated to obtain an interior floor plan.
[0012] Furthermore, the specific method of step 1 is as follows:
[0013] Step 1.1, convert the 3D point cloud Projecting onto a two-dimensional plane, ignoring the height information along the Z-axis and retaining only the horizontal coordinates, yields a two-dimensional point cloud. ;in, Representing a 3D point cloud One of the points, The number of points Representing a two-dimensional point cloud One of the points;
[0014] Step 1.2, convert the 2D point cloud Points in Convert to pixel coordinates :
[0015]
[0016] in, for The minimum value of the point in the X-axis and Y-axis directions. The preset image resolution, Indicates rounding down;
[0017] Step 1.3: Generate a binary image corresponding to the entire floor area. , The resolution is ,Will The pixel in question is assigned a white value to indicate a passable area, while other pixels are assigned a black value to indicate impassable areas.
[0018] Furthermore, the specific method for step 2 is as follows:
[0019] Step 2.1: Construct a height histogram based on the 3D point cloud and extract the height of the indoor scene;
[0020] Step 2.2: Define the XY 2D region in the 3D point cloud where the maximum height is more than 30cm lower than the height of the indoor scene as the lintel region, and generate a wall line pixel map. ;
[0021] Step 2.3: An improved binary image is formed through pixel subtraction. , Each pixel The value can be obtained in the following ways:
[0022]
[0023] in, This is the wall line weighting coefficient. The value range is 0.7 to 1.
[0024] Furthermore, step 3 is performed as follows:
[0025] Step 3.1: Extract edges based on the Canny edge detection method. The edge region in the image; apply Laplacian sharpening to the edge region, then combine the sharpened edge region with... Linear overlay is used to enhance edge contrast;
[0026] Step 3.2, calculate the result after processing in step 3.1. The Euclidean distance from each non-zero pixel to its nearest zero pixel is calculated. All Euclidean distances are normalized to obtain normalized values in the range of 0 to 1. This is derived from the values processed in step 3.1. Filter out non-zero pixels corresponding to normalized values less than 0.1 or greater than 0.9 to eliminate noise interference;
[0027] Step 3.3, processing the result from step 3.2 Perform morphological opening operations to remove isolated noise points;
[0028] Step 3.4, processing the result from step 3.3 Morphological closing operations are performed to connect the broken boundaries, generating continuous, topologically complete boundaries without holes, thus obtaining a binary image with complete boundaries. .
[0029] Furthermore, step 4 is specifically implemented as follows:
[0030] Step 4.1, based on the binary image Geometric features, calculate the maximum number of iterations ;
[0031]
[0032] in, and They are respectively Height and width, This indicates taking the minimum value. These are the upper and lower limits of the number of corrosion cycles, respectively. The value range is 70 to 100. The value range is 15 to 25. The calculation method is as follows:
[0033]
[0034] Step 4.2, for Perform the erosion operation, eroding 1 pixel in each iteration;
[0035] Step 4.3, detect edges. Each region separated after erosion; for each region, construct a contour tree structure based on the containment relationships between contours, where if a contour... If there is no parent contour that contains it, then The main outline, if an outline is directly... If it is contained, then the outline is Holes;
[0036] Step 4.4, Traverse Calculate the principal contour of each of the separated regions after erosion. area :
[0037]
[0038] in, Main outline The area of the enclosed region, express The collection of all holes, R represents the area of the region enclosed by hole k, and R is the preset image resolution;
[0039] Step 4.5, based on the area of the main outline of each region. Select the main outlines that meet the following requirements:
[0040]
[0041] and
[0042]
[0043] and
[0044]
[0045] wherein, represents the maximum area of all rooms in the floor, represents the minimum area of all rooms in the floor;
[0046] The main profile screened is the growth seed of the room;
[0047] Step 4.6, repeating steps 4.2 to 4.5 until all non-zero pixels of , or are eroded.
[0048] Further, the specific way of step 5 is:
[0049] Step 5.1, assigning a unique RGB color to each growth seed;
[0050] Step 5.2, taking the growth seed as the initial wavefront set, checking the 8-neighborhood of the current wavefront set, if a white pixel is found, marking the white pixel into the color of the current wavefront set and adding it to the next wavefront set; repeating this diffusion process, starting from the initial wavefront set, expanding layer by layer outward, until all the white pixels that can be connected are marked, completing the construction of the indoor floor plan.
[0051] Compared with the prior art, the beneficial effects of the present application are:
[0052] 1. The present application is a simple and effective method for constructing a floor plan. The floor plan of a building has been a research hotspot for a long time and is the technical cornerstone of indoor navigation, analysis and application. In the existing method for constructing an indoor floor plan, the CAD drawing method relies on manual operation, and the image analysis method is limited by the acquisition equipment and has low precision. The present application automatically realizes the construction of an indoor floor plan through three-dimensional laser measurement point cloud, which has important significance. Figure One
[0053] 2. The present application discovers that the area from the top of the door frame to the ceiling is far away from the ground activity interference, and the point cloud structure is complete and can clearly reflect the continuous trend of the wall. Based on this, the present application proposes the concept of the wall cornice area, and through the processing of this area, the edge accuracy of the room can be ensured.
[0054] 3. The present application proposes a dynamic morphological room segmentation method, which can dynamically adjust the erosion times according to the map size in actual application, thereby enhancing the universality and stability of the method of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0055] Figure 1 A schematic diagram of the original three-dimensional point cloud input in the embodiment of the present application;
[0056] Figure 2 A schematic diagram of the lintel region in the embodiment of the present application;
[0057] Figure 3 A floor plan output in the embodiment of the present application;
[0058] Figure 4 A schematic diagram of the principle of the embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to facilitate those skilled in the art to understand and implement the present application, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application.
[0060] A floor plan construction method based on indoor three-dimensional point cloud, as shown in Figure 4 , comprising the following steps:
[0061] Step 1, input the three-dimensional point cloud of the floor as shown in Figure 1 , generate an indoor binary image based on the point cloud distribution in the horizontal direction , The pixel value of the point cloud in the image is 255, and the pixel value of the point cloud is 0; The specific way is as follows:
[0062] Step 1.1, project the three-dimensional point cloud to a two-dimensional plane, ignore the height information (Z axis), and retain the horizontal coordinates to obtain a two-dimensional point cloud ;
[0063] Step 1.2, convert the projected two-dimensional point to pixel coordinates. Assuming that the image resolution is , the image origin is at , and the calculation method of the pixel coordinates is;
[0064]
[0065] wherein, is the minimum value of the point cloud in the horizontal and vertical directions, indicates rounding down.
[0066] Step 1.3, rasterize according to the pixel coordinates to generate a binary image . If the grid contains a point, it indicates a passable region (white, 255); otherwise, it is a non-passable region (black, 0).
[0067] Step 2, extract the indoor lintel region, as shown inFigure 2 As shown, the lintel region is projected to the binary image, the connectivity of the closed room is closed, and an improved binary image is formed; the specific method is as follows:
[0068] Step 2.1, construct a height histogram to extract the indoor scene height;
[0069] Step 2.2, set the region below the indoor scene height by 30 cm as the lintel region, and generate a wall line grid map , so as to highlight the regular boundary features.
[0070] Step 2.3, form an improved binary image by subtraction of the grid pixels :
[0071]
[0072] Wherein, α is the wall line weight coefficient, the value range is 0.7-1, and the coefficient is used to suppress the influence of the structured wall line.
[0073] Step 3, use the image edge enhancement and distance transformation method to repair the boundary integrity of the binary image, and the specific method is as follows:
[0074] Step 3.1, based on the Canny edge detection method, extract the edge region of the grid; the edge region is subjected to Laplacian sharpening, and then superimposed with linear, so as to enhance the edge contrast;
[0075] Wherein, the convolution kernel formula of Laplacian sharpening is as follows:
[0076]
[0077] Step 3.2, calculate the Euclidean distance of each non-zero pixel in to its nearest obstacle (zero pixel), and normalize all Euclidean distances, filter out the edge pixels with too close (<0.1) or too far (>0.9) distance to the region center, and keep the effective boundary located in the moderate position of the room main area, so as to exclude noise interference;
[0078] Step 3.3, perform morphological opening operation to remove isolated noise points;
[0079] Step 3.4, perform morphological closing operation to connect the broken boundary, finally generate a continuous, non-hole topological complete boundary, and obtain the indoor grid map with complete boundary .
[0080] Step 4, extract the indoor room seed through dynamic corrosion, and the specific method is as follows:
[0081] Step 4.1: Calculate the maximum number of iterations based on the image's geometric features. ;
[0082]
[0083] in, and Images Height and width, These are the upper and lower limits of the number of corrosion cycles, respectively. The value range is 70 to 100. The value range is 15 to 25. The calculation method is as follows:
[0084]
[0085] Step 4.2, if the number of erosions is less than Then for Perform the erosion operation, eroding one grid cell (i.e., pixel) in each iteration;
[0086] Step 4.3, detect edges. Each region separated after erosion; for each region, a contour tree structure is constructed using a two-layer contour retrieval mode, wherein if a contour If there is no parent contour that contains it, then The main outline, if an outline is directly... If it is contained, then the outline is Holes;
[0087] Step 4.4, Traverse Calculate the principal contour of each of the separated regions after erosion. area :
[0088]
[0089] in, Main outline The area of the enclosed region, express The collection of all holes, R represents the area of the region enclosed by hole k, and R is the preset image resolution;
[0090] Step 4.5: Select the main outline that meets the following requirements; this main outline is the room growth seed:
[0091]
[0092] and
[0093]
[0094] and
[0095]
[0096] where the last formula can effectively avoid the false segmentation of indoor vertical columns.
[0097] Step 4.6, repeat steps 4.2-4.5 until the number of erosion reaches , or All non-zero grids are eroded.
[0098] Step 5, generate an indoor floor plan based on the indoor room seed by a wave front algorithm; the specific way is as follows:
[0099] Step 5.1, each growth seed is assigned a unique RGB color;
[0100] Step 5.2, take the room growth seed as the growth point, diffuse the color label to the unmarked white free space pixel according to the 8-neighborhood rule containing the diagonal direction adjacent pixel, and use the flood filling strategy to expand outward layer by layer from the initial wave front set. In each iteration, check the 8-neighborhood of the current wave front pixel, and if an unmarked white pixel is found, mark it as the current wave front color and add it to the next wave front set. This process will continue until all connected white regions are labeled, and the floor plan construction is completed, as shown in Figure 3 .
[0101] In summary, the method first forms an indoor binary image based on the three-dimensional point cloud according to the horizontal direction of the point cloud distribution; then extracts the indoor door header region, projects the door header region to the binary image, and closes the connectivity of the room to form an improved binary image; then uses image edge enhancement and distance transformation to repair the boundary integrity of the binary image; secondly, extract the indoor room seed through dynamic erosion; finally, complete the indoor floor plan reconstruction through the wave front algorithm.
[0102] The present application analyzes the vertical space features, finds that the area from the door frame to the ceiling (door header area) is far away from the ground activity interference, and the point cloud structure is complete and can clearly reflect the continuous trend of the wall. Therefore, the present application proposes a wall door header area, which can ensure the edge accuracy of the room.
[0103] In addition, the present application also proposes a dynamically changing morphological room segmentation method, which can dynamically adjust the number of erosions according to the map size, thereby enhancing the universality and stability of the method.
[0104] The application can better process point cloud data in a complex indoor environment and meet the needs of various indoor environments.
[0105] The above-described specific embodiments further illustrate the purpose, technical solutions and beneficial effects of the application. It should be understood that the above-described specific embodiments are only for the specific embodiments of the application and are not intended to limit the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the application should be included in the protection scope of the application.
Claims
1. A method for constructing floor plans based on indoor 3D point clouds, characterized in that, Includes the following steps: Step 1: Input the 3D point cloud of the floor. Based on the horizontal point cloud distribution, generate an indoor binary image. , The pixel value for a point cloud is 255, and the pixel value for a non-point cloud is 0. Step 2: Extract the interior door lintel area and generate a pixel map of the wall lines. , and They are the same size and resolution. The pixel value corresponding to the central lintel area is 0, while the value of other pixels is 255; combined with and This results in an improved binary image. , Each room is a closed, independent area; Step 3: Repair the binary image using image processing methods. To obtain a binary image with complete boundaries, the boundary integrity is determined. ; Step 4, targeting The growth seeds in each room are extracted through dynamic corrosion. Step 5, in Based on this, using the growth seeds of each room as growth points, room areas of different colors are generated to obtain an interior floor plan.
2. The method for constructing a floor plan based on indoor 3D point clouds according to claim 1, characterized in that, The specific method for step 1 is as follows: Step 1.1, convert the 3D point cloud Projecting onto a two-dimensional plane, ignoring the height information along the Z-axis and retaining only the horizontal coordinates, yields a two-dimensional point cloud. ;in, Representing a 3D point cloud One of the points, The number of points Representing a two-dimensional point cloud One of the points; Step 1.2, convert the 2D point cloud Points in Convert to pixel coordinates : in, for The minimum value of the point in the X-axis and Y-axis directions. The preset image resolution, Indicates rounding down; Step 1.3: Generate a binary image corresponding to the entire floor area. , The resolution is ,Will The pixel in question is assigned a white value to indicate a passable area, while other pixels are assigned a black value to indicate impassable areas.
3. The method for constructing a floor plan based on indoor 3D point clouds according to claim 1, characterized in that, The specific method for step 2 is as follows: Step 2.1: Construct a height histogram based on the 3D point cloud and extract the height of the indoor scene; Step 2.2: Define the XY 2D region in the 3D point cloud where the maximum height is more than 30cm lower than the height of the indoor scene as the lintel region, and generate a wall line pixel map. ; Step 2.3: An improved binary image is formed through pixel subtraction. , Each pixel The value can be obtained in the following ways: in, This is the wall line weighting coefficient. The value range is 0.7 to 1.
4. The method for constructing a floor plan based on indoor 3D point clouds according to claim 1, characterized in that, The specific method for step 3 is as follows: Step 3.1: Extract edges based on the Canny edge detection method. The edge region in the image; apply Laplacian sharpening to the edge region, then combine the sharpened edge region with... Linear overlay is used to enhance edge contrast; Step 3.2, calculate the result after processing in step 3.
1. The Euclidean distance from each non-zero pixel to its nearest zero pixel is calculated. All Euclidean distances are normalized to obtain normalized values in the range of 0 to 1. This is derived from the values processed in step 3.
1. Filter out non-zero pixels corresponding to normalized values less than 0.1 or greater than 0.9 to eliminate noise interference; Step 3.3, processing the result from step 3.2 Perform morphological opening operations to remove isolated noise points; Step 3.4, processing the result from step 3.3 Morphological closing operations are performed to connect the broken boundaries, generating continuous, topologically complete boundaries without holes, thus obtaining a binary image with complete boundaries. .
5. The method for constructing a floor plan based on indoor 3D point clouds according to claim 1, characterized in that, The specific method for step 4 is as follows: Step 4.1, based on the binary image Geometric features, calculate the maximum number of iterations ; in, and They are respectively Height and width, This indicates taking the minimum value. These are the upper and lower limits of the number of corrosion cycles, respectively. The value range is 70 to 100. The value range is 15 to 25. The calculation method is as follows: Step 4.2, for Perform the erosion operation, eroding 1 pixel in each iteration; Step 4.3, detect edges. Each region separated after erosion; for each region, construct a contour tree structure based on the containment relationships between contours, where if a contour... If there is no parent contour that contains it, then The main outline, if an outline is directly... If it is contained, then the outline is Holes; Step 4.4, Traverse Calculate the principal contour of each of the separated regions after erosion. area : in, Main outline The area of the enclosed region, express The collection of all holes, R represents the area of the region enclosed by hole k, and R is the preset image resolution; Step 4.5, based on the area of the main outline of each region. Select the main outlines that meet the following requirements: and and in, This represents the maximum area of all rooms on the floor. This represents the minimum area of all rooms on a floor. The selected main outline is the growth seed for the room; Step 4.6, repeat steps 4.2 to 4.5 until the erosion count reaches the target. ,or All non-zero pixels have been eroded.
6. The method for constructing a floor plan based on indoor 3D point clouds according to claim 1, characterized in that, The specific method for step 5 is as follows: Step 5.1: Assign a unique RGB color to each growing seed; Step 5.2: Using the growth seed as the initial wavefront set, check the 8-neighborhood of the current wavefront set. If a white pixel is found, mark the white pixel with the color of the current wavefront set and add it to the next wavefront set. Repeat this diffusion process, expanding outwards layer by layer from the initial wavefront set until all connectable white pixels have been marked, thus completing the construction of the interior floor plan.