Room three-side two-line intelligent measurement method and system
By acquiring and processing three-dimensional point cloud data, accurate measurement of the three sides and two lines of the building is solved, and the problem of inability to measure related data in the existing technology is solved, and the accuracy and quality of construction is improved.
Patent Information
- Application Number
- CN202411885451.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, the three sides and two lines can only be marked in the digital model, and the relevant data cannot be measured, resulting in possible deviations and quality problems during construction.
By obtaining the three-dimensional point cloud data of the room, pre-processing and extracting the wall point cloud data, detecting the location and type of the hole, expanding the hole boundary to obtain measurement data, and achieving accurate measurement of the three sides and two lines.
Accurate measurement of building door openings, skirting lines and yin and yang corner lines is achieved, the accuracy and quality of construction is improved, deviations in construction and errors in acceptance are reduced, and building production efficiency is improved.
Smart Images

Figure CN120070549A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an intelligent measurement method and system for two lines on three sides of a room. Background Art
[0002] In the field of building informatization, point cloud technology, as a high-precision spatial data acquisition and processing technology, is widely used in building measurement, modeling, and construction guidance. The identification of doors and windows, skirting boards, and internal and external corners is an important basic link in building structure analysis and model generation.
[0003] 3D laser scanners suitable for indoor environment scanning mostly adopt ToF (Time-of-flight) ranging technology, and the most commonly used one is LiDAR (light detection and ranging). It is an optical remote sensing technology that calculates the distance of an object by measuring the time difference between the transmitted and received pulse signals.
[0004] The so-called actual measurement means a method of applying measurement tools to test and measure on-site and truly reflect the product quality data. According to relevant quality acceptance standards, the measurement and control of engineering quality data errors are within the range allowed by the national housing construction standards.
[0005] In the building field, the three sides refer to the door and window openings. Specifically, these sides include:
[0006] Upper side: The top edge of the door and window opening.
[0007] Lower side: The bottom edge of the door and window opening.
[0008] Two side edges: Refer to the left and right side edges of the door and window opening.
[0009] These three side lines define the size and shape of the door and window opening, which is crucial for the installation of doors and windows and the cutting of walls. Correctly measuring the lengths and relative positions of these side lines can ensure that the door and window frame can be accurately embedded in the wall and avoid deviations during construction.
[0010] Functions of the three sides:
[0011] Size confirmation: Ensure that the size of the door and window is consistent with the design drawing and avoid improper installation of the door and window.
[0012] Structure positioning: Accurately measure the three sides of the opening to ensure the correct intersection position of the door and window and the wall, and avoid asymmetry or skew.
[0013] Construction accuracy: It has an important impact on wall cutting and the installation of door and window frames, and ensures that the door and window openings of the wall are cut smoothly.
[0014] The two lines refer to the skirting board and the internal and external corner lines. The "two lines" mean the lines of the skirting board and the internal and external corners.
[0015] Skirting board:
[0016] The skirting board is a decorative line installed between the bottom of the wall and the ground. It not only has a decorative function but also protects the wall from water stains, dirt, or impacts. The position and height of the skirting board are very crucial. When measuring, it is necessary to ensure that it is parallel to the ground and consistent with the bottom of the wall.
[0017] Internal and external corner lines:
[0018] The angle formed when the internal corners of two walls intersect, that is, the internal intersection line of the two walls. Generally, the internal and external corners are at a 90° right angle, commonly found at the intersection of two walls in a room. The position and angle of these lines ensure the flatness and symmetry at the junction of the walls, avoiding the generation of irregular or asymmetric angles.
[0019] Function of the skirting board: Ensure that the height and position of the skirting board are correct, making the transition between the wall and the ground more natural, and it can play a decorative and protective role.
[0020] Function of the internal and external corners: Measure the accuracy of the internal and external corners, ensure that the angles at the junction of the walls are correct, and avoid problems such as cracks and gaps, which affect the construction effect.
[0021] In the prior art, the three sides and two lines can only be marked in the digital model and cannot measure relevant data. Summary of the Invention
[0022] The technical problem to be solved by the present invention is to overcome the defect that in the prior art, the three sides and two lines can only be marked in the digital model and cannot measure relevant data, and provide a method for measuring and displaying the three sides and two lines of a room, which is convenient for obtaining and measuring the door openings, skirting boards, and yin-yang lines of a building, easy to view, convenient for construction workers to rectify and accept, and improve the intelligent measurement method and system for the three sides and two lines of a room in building production efficiency.
[0023] The present invention solves the above technical problem through the following technical solutions:
[0024] An intelligent measurement method for the three sides and two lines of a room, characterized in that the intelligent measurement method for the three sides and two lines of a room includes:
[0025] Obtain the three-dimensional point cloud data of a room;
[0026] Preprocess the three-dimensional point cloud data;
[0027] Extract the wall point cloud data from the preprocessed three-dimensional point cloud data;
[0028] Detect the positions and types of holes in the wall point cloud data;
[0029] Expand the boundaries of the holes according to the hole types to obtain the hole point cloud data with a preset size around the holes;
[0030] Measure the hole point cloud data to obtain the measurement data of the hole positions in the room.
[0031] Preferably, the extraction of the wall point cloud data from the preprocessed three-dimensional point cloud data includes:
[0032] Calculate the centroid of the three-dimensional point cloud data;
[0033] Calculate the covariance matrix of the point cloud relative to the centroid;
[0034] By performing eigenvalue decomposition on the covariance matrix, obtain three eigenvalues and the corresponding eigenvectors;
[0035] Use the eigenvalues and eigenvectors to obtain the normal vector of the three-dimensional point cloud data;
[0036] Calculate the plane equation of the wall through the centroid and the normal vector.
[0037] Preferably, the intelligent measurement method for the three sides and two lines of the room includes:
[0038] Check whether the normal vector is already parallel to the Y-axis of the world coordinate system. If not, calculate the rotation axis and the rotation angle, and calculate the rotation matrix using the rotation axis and the rotation angle;
[0039] Rotate each point cloud in the three-dimensional point cloud data using the rotation matrix to obtain the wall point cloud data.
[0040] Preferably, the formula for calculating the centroid of the three-dimensional point cloud data is:
[0041]
[0042] Wherein, is the X-axis coordinate of the i-th point in the three-dimensional point cloud data, n is the number of the three-dimensional point cloud data, is the Y-axis coordinate of the i-th point in the three-dimensional point cloud data, is the Z-axis coordinate of the i-th point in the three-dimensional point cloud data, and the coordinates of the centroid are ;
[0043] The covariance matrix is:
[0044]
[0045] Wherein, S is the covariance matrix, is the coordinate of the i-th point in the three-dimensional point cloud data, is the offset of the i-th point from the centroid;
[0046] By perform eigenvalue decomposition on the covariance matrix, where is the identity matrix, are the solved eigenvalues.
[0047] Preferably, the formula for calculating the rotation axis is:
[0048]
[0049] where N is the normal vector and its coordinates are , Y is the Y-axis and its expression is ;
[0050] Calculate the rotation angle using the dot product of the normal vector and the Y-axis. The formula for calculating the rotation angle is:
[0051]
[0052] where is the rotation angle, is the magnitude of the normal vector, is the magnitude of the Y-axis;
[0053] Calculate the rotation angle The formula is:
[0054]
[0055] where a, b, and c are the components of the normal vector on the X, Y, and Z axes respectively;
[0056] Use the rotation axis, rotation angle, and the Rodrigues rotation formula to calculate the rotation matrix. The calculation formula for the rotation matrix is:
[0057]
[0058] where is the identity matrix, is the rotation axis of the skew-symmetric matrix, The formula for
[0059]
[0060] where are the rotation axis coordinates.
[0061] Preferably, the intelligent measurement method for three sides and two lines of the room includes:
[0062] Detect the coordinates of the bottommost point cloud in the wall point cloud data;
[0063] Obtain the skirting board boundary based on the coordinates of the bottommost point cloud and the preset height of the skirting board;
[0064] Find all the skirting board point cloud coordinates within the skirting board boundary in the wall surface point cloud data.
[0065] Preferably, the intelligent measurement method for three sides and two lines of a room includes:
[0066] Extract the intersection point cloud data of the three-dimensional point cloud data;
[0067] Calculate the intersection point cloud of the internal and external corners based on vectors;
[0068] Divide the intersection point cloud of the internal and external corners into several segments according to a preset length;
[0069] Measure and draw each segment of the intersection point cloud of the internal and external corners.
[0070] Preferably, the calculation of the intersection point cloud of the internal and external corners based on vectors includes:
[0071] For a target three-dimensional point cloud data, obtain the vector of the target three-dimensional point cloud data;
[0072] Use the angle between the vector and the normal vector to determine whether the target three-dimensional point cloud data is intersection point cloud data;
[0073] Among them, the formula for calculating the angle between the vector and the normal vector is:
[0074]
[0075] Among them, is the angle between the vector and the normal vector, is the said vector, is the normal vector, and the formula for obtaining the vector is:
[0076]
[0077] Among them, is the coordinate of the target three-dimensional point cloud data, is the reference point coordinate.
[0078] Preferably, the intelligent measurement method for three sides and two lines of a room includes:
[0079] Set the parameters of the output viewing angle of the intersection point cloud of the internal and external corners;
[0080] Calculate the actual drawing area;
[0081] Draw grid lines;
[0082] Draw the point cloud data and labels.
[0083] The present invention also provides an intelligent measurement system for three sides and two lines of a room, characterized in that the intelligent measurement system for three sides and two lines of the room is used to implement the intelligent measurement method for three sides and two lines of the room as described above.
[0084] On the basis of conforming to the common knowledge in the art, the above preferred conditions can be combined arbitrarily to obtain various preferred embodiments of the present invention.
[0085] The positive and progressive effects of the present invention are as follows:
[0086] The present invention provides a measurement and display method for three sides and two lines of a room, which is convenient for obtaining and measuring building door openings, skirting boards, and yin-yang lines, facilitating viewing, convenient for construction personnel to rectify and accept, and improving building production efficiency.
[0087] Based on the lidar scan point cloud data, the present application combines advanced algorithm models to complete the accurate extraction and visual display of key building structures (doors and windows, skirting boards, and internal and external corners). At the same time, the generation of three-view drawings provides an effective basis for building design and construction rectification. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 It is a flowchart of the intelligent measurement method for three sides and two lines of a room according to Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0089] The present invention will be further described below by way of examples, but the present invention is not limited to the scope of the described examples.
[0090] Embodiment 1
[0091] This embodiment provides an intelligent measurement system for three sides and two lines of a room, and the intelligent measurement system for three sides and two lines of the room includes a collection module, an operation module, and an output module.
[0092] The collection module may be a lidar, which is used in this embodiment to obtain the three-dimensional point cloud data of a room.
[0093] The operation module is used for:
[0094] Preprocessing the three-dimensional point cloud data;
[0095] Data collection includes: using a lidar scanner to perform multi-point scanning on indoor or outdoor scenes to obtain high-density point cloud data. The scanning device provides millimeter-level accuracy to ensure the integrity and accuracy of the data, and the scanning results are saved in a standardized point cloud format (such as.pts).
[0096] Data preprocessing includes: denoising processing, filtering processing, and smoothing processing.
[0097] Extract the wall point cloud data from the preprocessed three-dimensional point cloud data;
[0098] Detect the positions and types of holes in the wall point cloud data;
[0099] Expand the boundaries of the holes according to the hole types to obtain the hole point cloud data with a preset size around the holes;
[0100] Measure the hole point cloud data to obtain the measurement data of the hole positions in the room.
[0101] The output module is used to display the measurement data and the display screen generated according to the measurement data, such as the contour map of the wall.
[0102] Specifically, the operation module is used for:
[0103] Calculate the centroid of the three-dimensional point cloud data;
[0104] Calculate the covariance matrix of the point cloud relative to the centroid;
[0105] By performing eigenvalue decomposition on the covariance matrix, obtain three eigenvalues and the corresponding eigenvectors;
[0106] Use the eigenvalues and eigenvectors to obtain the normal vector of the three-dimensional point cloud data;
[0107] Calculate the plane equation of the wall through the centroid and the normal vector.
[0108] The formula for calculating the centroid of the three-dimensional point cloud data is:
[0109]
[0110] Where, is the X-axis coordinate of the i-th point in the three-dimensional point cloud data, n is the number of the three-dimensional point cloud data, is the Y-axis coordinate of the i-th point in the three-dimensional point cloud data, is the Z-axis coordinate of the i-th point in the three-dimensional point cloud data, and the coordinates of the centroid are ;
[0111] The covariance matrix is:
[0112]
[0113] Where, S is the covariance matrix, is the coordinate of the i-th point in the three-dimensional point cloud data, is the offset of the i-th point from the centroid;
[0114] By perform eigenvalue decomposition on the covariance matrix, where, is the identity matrix, is the solved eigenvalue.
[0115] The data processing flow of the intelligent measurement system for three sides and two lines of the room in this embodiment is as follows:
[0116] Fitting the plane equation
[0117] Calculating the centroid: First, calculate the centroid (center point) of all points in the point cloud. The centroid is the average value of all point coordinates.
[0118] Calculating the covariance matrix: Calculate the covariance matrix of the point cloud relative to the centroid, which represents the distribution of the point cloud in each direction.
[0119] Eigenvalue decomposition: By performing eigenvalue decomposition on the covariance matrix, three eigenvalues and corresponding eigenvectors are obtained. The normal vector is the eigenvector corresponding to the smallest eigenvalue of the covariance matrix.
[0120] Calculating the covariance matrix: Calculate the covariance matrix of the point cloud relative to the centroid, which represents the distribution of the point cloud in each direction.
[0121] Finding the plane equation: Calculate the plane equation through the centroid and the normal vector. The normal vector of the plane equation is the eigenvector corresponding to the smallest eigenvalue obtained just now, and the constant term can be calculated through the centroid.
[0122] Furthermore, the operation module is used for:
[0123] Checking whether the normal vector is already parallel to the Y-axis of the world coordinate system. If not, calculate the rotation axis and the rotation angle, and calculate the rotation matrix using the rotation axis and the rotation angle;
[0124] Rotating each point cloud in the three-dimensional point cloud data using the rotation matrix to obtain the wall point cloud data.
[0125] The formula for calculating the rotation axis is:
[0126]
[0127] where N is the normal vector and the coordinates are , Y is the Y-axis and the expression is ;
[0128] Calculating the rotation angle using the dot product of the angle between the normal vector and the Y-axis. The formula for calculating the rotation angle is:
[0129]
[0130] where is the rotation angle, is the modulus of the normal vector, is the modulus of the Y-axis;
[0131] Calculating the rotation angle The formula is as follows:
[0132]
[0133] Where a, b, and c are the components of the normal vector on the X, Y, and Z axes respectively;
[0134] Using the rotation axis, rotation angle, and the Rodrigues rotation formula to calculate the rotation matrix. The calculation formula of the rotation matrix is:
[0135]
[0136] Where, is the identity matrix, is the rotation axis of the skew-symmetric matrix, The formula of is:
[0137]
[0138] Where, is the rotation axis coordinate.
[0139] The processing data flow of the intelligent measurement system for three sides and two lines of the room in this embodiment further includes:
[0140] Judging whether rotation is needed: Check whether the normal vector is already parallel to the Y-axis of the world coordinate system. If it is already parallel, the rotation matrix is the identity matrix and no rotation is needed.
[0141] Calculating the rotation axis: If rotation is needed, calculate the rotation axis. The rotation axis is the cross product of the normal vector and the Y-axis.
[0142] Judging whether rotation is needed to check whether the normal vector N is parallel to the Y-axis Y=(0,1,0). If it is parallel, the rotation matrix is the identity matrix, and then calculate the rotation axis , where is the rotation matrix, and is the normal vector The cross product with the Y-axis, and the cross product result is: .
[0143] Calculating the rotation angle: Calculate the rotation angle through the dot product of the angle θ between the normal vector N and the Y-axis. The rotation angle θ is the angle between the normal vector and the Y-axis, and can be calculated through their dot product:
[0144]
[0145] Where is the dot product of the normal vector and the Y-axis, and the normal vector are the components of the normal vector on the x, y, and z axes respectively, and the Y-axis , the Y-axis represents the vertically upward direction. In a three-dimensional coordinate system, therefore, the dot product result , and its value is the component of the normal vector in the Y-axis direction. is the magnitude of the normal vector. is the magnitude of the Y-axis (unit vector).
[0146] where the unit of θ is radians, and it can be converted to degrees by θ * 180 / π.
[0147] Generate the rotation matrix: Use the rotation axis and the rotation angle, and apply Rodrigues' rotation formula to calculate the rotation matrix.
[0148] When using Rodrigues' rotation formula to calculate the rotation matrix, the skew-symmetric matrix (cross product matrix) of the rotation axis is a very crucial part. It is used to represent the cross product operation between the vector and the rotation axis. Given a rotation axis vector, it is a 3D vector representing the direction of the rotation axis. To use Rodrigues' rotation formula to calculate the rotation matrix, the skew-symmetric matrix of this vector needs to be constructed , where are the rotation axis coordinates. Represent the three coordinate values of the rotation axis, respectively along the directions of the X, Y, and Z axes.
[0149] Apply the rotation matrix: Apply the rotation matrix to each point in the point cloud data to obtain the rotated point cloud coordinates.
[0150] Save the data to files: Save the original point cloud data to a file (such as input_points.txt). Save the rotated point cloud data to another file (such as processed_points.txt).
[0151] Classification and expansion area of holes:
[0152] Classification of holes: According to the spatial distribution in the point cloud, determine which areas are "holes", that is, the parts where the point cloud data is missing in the area. Then, classify them according to the characteristics such as the size and shape of the holes.
[0153] Calculation of the expansion area: Expand the boundary of each hole, for example, expand the boundary inward and outward by a certain distance (such as expand by 20mm and 220mm). Then check which points fall within these expanded areas.
[0154] Save the point cloud in the expansion area: Save the point cloud data in the expansion area to a new file (such as points_in_20_to_220mm_XXX.txt).
[0155] The operation module is used for:
[0156] Detect the coordinates of the bottommost point cloud in the wall point cloud data.
[0157] Obtain the skirting board boundary based on the coordinates of the bottommost point cloud and the preset skirting board height.
[0158] Find all the skirting board point cloud coordinates within the skirting board boundary in the wall point cloud data.
[0159] Obtain the area of the skirting board. Specifically, starting from the lowest point, search upward for the highest point ground point cloud. The preset skirting board height starting from a preset distance above the highest point ground point cloud is considered the skirting board boundary, and the skirting board is measured and visualized. Specifically:
[0160] 1. Optimize the wall data
[0161] Optimize the wall data by removing the points at the top and bottom, and only retain the middle part. This step is to reduce unnecessary data and calculations, and ensure that only the effective area of the wall is focused on during processing.
[0162] 2. Traverse all walls
[0163] For each wall, obtain all its point cloud data. It is necessary to ensure that the index is within the valid range to prevent accessing non-existent data.
[0164] 3. Calculate the bottom of the wall
[0165] For all the points on the wall, find the point with the minimum Z value, which represents the position of the bottommost part of the wall.
[0166] 4. Calculate the height of the skirting board area
[0167] Calculate the upper and lower boundaries of the skirting board area based on the height of the bottom of the wall and the preset minimum / maximum height range of the skirting board.
[0168] 5. Filter the point cloud in the skirting board area
[0169] Traverse all the points on the wall and judge whether the Z value of these points falls within the Z range of the skirting board area. If so, these points belong to the skirting board area, and extract these points for subsequent processing.
[0170] 6. Save the skirting board point cloud data
[0171] Save the point cloud data of the filtered skirting board area to a file for subsequent use or analysis. When saving, a file name can be generated to distinguish the data of different walls.
[0172] The operation module is used for:
[0173] Extract the intersection point cloud data of the three-dimensional point cloud data;
[0174] Calculate the point cloud at the intersection of internal and external corners based on vector calculation;
[0175] Divide the point cloud at the intersection of internal and external corners into several segments according to a preset length;
[0176] Measure and draw each segment of the point cloud at the intersection of internal and external corners.
[0177] Furthermore, the operation module is used for:
[0178] For a target three-dimensional point cloud data, obtain the vector of the target three-dimensional point cloud data;
[0179] Use the angle between the vector and the normal vector to determine whether the target three-dimensional point cloud data is intersection point cloud data;
[0180] Among them, the formula for calculating the angle between the vector and the normal vector is:
[0181]
[0182] Among them, is the angle between the vector and the normal vector, is the said vector, is the normal vector, and the formula for obtaining the said vector is:
[0183]
[0184] Among them, is the target three-dimensional point cloud data coordinates of the point, is the reference point coordinates.
[0185] The operation module is used for:
[0186] Set the parameters of the output view angle of the point cloud at the intersection of internal and external corners;
[0187] Calculate the actual drawing area;
[0188] Draw grid lines;
[0189] Draw the point cloud data and labels.
[0190] Generation steps of the internal and external corner line area and the three views:
[0191] 1. Initialize and clean the data structure
[0192] Clear and reduce the data structure that stores the wall intersection distances in the memory, ensure that the data structure is empty and release unnecessary memory space.
[0193] 2. Define the storage location of the intersection points
[0194] Prepare two data structures to store intersection information: one for storing bottom intersections (intersection_points) and the other for storing top intersections (top_intersection_points).
[0195] 3. Create an output folder
[0196] Create a folder for storing output data according to the given path. If the folder already exists, skip this step.
[0197] 4. Traverse the wall angle data
[0198] Loop through the wall angles and structural information, determine each pair of walls through indexing, and calculate the relevant intersection positions.
[0199] 5. Calculate the intersection coordinates
[0200] Calculate the intersections between each pair of walls through angles, wall geometry information, and other relevant parameters. The calculation of intersections includes bottom and top intersections.
[0201] Extract angles: Based on the vector-based method, the internal and external corners are usually obtained by calculating the angle between two vectors. In three-dimensional space, assuming there are two vectors, their included angle can be calculated by the following formula:
[0202]
[0203] The magnitude of a vector represents the size of the vector. It is equal to the square root of the sum of the squares of each component. The calculation of the magnitude reflects the length of the vector. For a unit vector (a vector with a length of 1), its magnitude is 1.
[0204] Calculate the angle with the normal
[0205] If you want to calculate the angle between a point P and the surface normal N, you first need to know the direction of the normal N and the vector V between the point P and a certain reference point (such as a point on the plane or the centroid). The reference point can be a mass point.
[0206] 6. Segment the point cloud data For the spatial region between each pair of intersections, divide the point cloud data into multiple segments according to the given segmentation rules (such as a 10mm Z-axis interval). The coordinates and attributes of each segment will be processed according to the segmentation logic.
[0207] 7. Save and output the results Save the processed point cloud data, intersection coordinates, and the calculation results of each segment to the specified directory. The file name is dynamically generated according to the index of the wall.
[0208] 8. Process the point cloud data for each segment For the point cloud data of each segment, further analysis or drawing operations are performed according to requirements. Each segment of data will be used to generate images from different perspectives (top view, front view, left view).
[0209] 9. Set the parameters for the viewing perspective
[0210] Before starting to draw, it is first necessary to define the parameters related to the three-dimensional coordinate system transformation, including the scaling factors (scale_x, scale_y, scale_z) and offsets (nom_x, nom_y, nom_z). These parameters ensure that we can map the three-dimensional point cloud onto a two-dimensional plane.
[0211] Scaling factors:
[0212] scale_x: Used to scale the X-axis data so that the horizontal distribution in the two-dimensional image is appropriate.
[0213] scale_y: Used to scale the Y-axis data so that the vertical distribution in the two-dimensional image is appropriate.
[0214] scale_z: Used to scale the Z-axis data, which is usually related to the height (Z-axis) and affects the depth perception of the image.
[0215] Offsets:
[0216] nom_x, nom_y, nom_z: Used to determine the offsets of the mapped point cloud coordinates so that the point cloud can be centered or translated as required in the view.
[0217] 10. Calculate the actual drawing area
[0218] According to the width and height of the view, calculate the actual drawing area and set an appropriate padding. This step ensures that the drawing does not exceed the canvas boundary.
[0219] actual_width and actual_height calculate the actual drawable area.
[0220] mid_x_topView, mid_y_topView, mid_x_frontView, mid_y_frontView, mid_x_leftView, mid_y_leftView calculate the midpoint positions of each view.
[0221] 11. Draw grid lines
[0222] Grid drawing for the top view (XY plane)
[0223] Grid line spacing: Use scale_x and scale_y to determine the grid line spacing.
[0224] Horizontal and vertical grid lines: Draw vertical and horizontal lines, traverse the generated grid lines, calculate the spacing of each grid, and then use cv::line() to draw the grid lines.
[0225] step_top_x: The horizontal step of the grid line.
[0226] step_top_y: The vertical step of the grid line.
[0227] Front view (XZ plane) grid drawing
[0228] Grid line spacing: Use scale_x and scale_z to calculate the step of the grid line.
[0229] Horizontal and vertical grid lines: Draw vertical and horizontal lines, and draw the grid by calculating the step in the same way.
[0230] Left view (YZ plane) grid drawing
[0231] Grid line spacing: Use scale_y and scale_z to calculate the step of the grid line.
[0232] Horizontal and vertical grid lines: Similarly, draw vertical and horizontal lines to ensure the correct mapping relationship between the grids of each view and the actual point cloud.
[0233] 12. Draw point cloud data
[0234] For each perspective, the point cloud data will be mapped to a two-dimensional plane according to its coordinate system.
[0235] Top view
[0236] Coordinate transformation: The x and y coordinates in the three-dimensional coordinates need to be directly mapped to the x and y planes of the top view.
[0237] Drawing: After mapping the point cloud data to the plane coordinates through the mapping formula (point.x * scale_x + nom_x, point.y * scale_y + nom_y), use cv::circle() to draw on the image.
[0238] Front view
[0239] Coordinate transformation: The x and z coordinates in the three-dimensional coordinates need to be directly mapped to the x and z planes of the front view.
[0240] Drawing: After mapping the point cloud data to the planar coordinates through the mapping formula (point.x * scale_x + nom_x, point.z * scale_z + nom_z), it is drawn on the image using cv::circle().
[0241] Left view
[0242] Coordinate transformation: The y and z coordinates in the three-dimensional coordinates need to be directly mapped to the y and z planes of the left view.
[0243] Drawing: After mapping the point cloud data to the planar coordinates through the mapping formula (point.y * scale_y + nom_y, point.z * scale_z + nom_z), it is drawn on the image using cv::circle().
[0244] 13. Drawing labels
[0245] Label position: The label is added beside or above the grid line through the cv::putText() function. A label is drawn at a certain step (for example, every 10 grids) to indicate the number of the grid.
[0246] Label content: The label content is usually the coordinate value or index related to the grid.
[0247] 14. Transformation and scaling between viewpoints
[0248] During the process of transforming coordinates, it is necessary to ensure that the coordinate systems of each viewpoint are independent of each other, but can be reasonably mapped through the scaling factor and offset. This ensures that the point cloud data between different viewpoints can be correctly displayed on their respective planes.
[0249] See Figure 1 , using the above intelligent measurement system for three sides and two lines of a room, this embodiment also provides an intelligent measurement method for three sides and two lines of a room, including:
[0250] Step 100: Obtain the three-dimensional point cloud data of a room;
[0251] Step 101: Preprocess the three-dimensional point cloud data;
[0252] Step 102: Extract the wall point cloud data from the preprocessed three-dimensional point cloud data;
[0253] Step 103: Detect the void positions and void types in the wall point cloud data;
[0254] Step 104: Expand the boundary of the cavity according to the cavity type to obtain the cavity point cloud data with a preset size around the cavity;
[0255] Step 105: Measure the cavity point cloud data to obtain the measurement data of the cavity position in the room.
[0256] Step 102 specifically includes:
[0257] Step 1021: Calculate the centroid of the three-dimensional point cloud data;
[0258] Step 1022: Calculate the covariance matrix of the point cloud relative to the centroid;
[0259] Step 1023: Through eigenvalue decomposition of the covariance matrix, obtain three eigenvalues and the corresponding eigenvectors;
[0260] Step 1024: Use the eigenvalues and eigenvectors to obtain the normal vector of the three-dimensional point cloud data;
[0261] Step 1025: Calculate the plane equation of the wall through the centroid and the normal vector.
[0262] The intelligent measurement method for three sides and two lines of the room includes:
[0263] Check whether the normal vector is already parallel to the Y-axis of the world coordinate system. If not, calculate the rotation axis and the rotation angle, and calculate the rotation matrix using the rotation axis and the rotation angle;
[0264] Rotate each point cloud in the three-dimensional point cloud data using the rotation matrix to obtain the wall point cloud data.
[0265] The formula for calculating the centroid of the three-dimensional point cloud data is:
[0266]
[0267] Among them, is the X-axis coordinate of the i-th point in the three-dimensional point cloud data, n is the number of the three-dimensional point cloud data, is the Y-axis coordinate of the i-th point in the three-dimensional point cloud data, is the Z-axis coordinate of the i-th point in the three-dimensional point cloud data, and the coordinates of the centroid are ;
[0268] The covariance matrix is:
[0269]
[0270] Among them, S is the covariance matrix, is the coordinate of the i-th point in the three-dimensional point cloud data, is the offset of the i-th point from the centroid;
[0271] By performing eigenvalue decomposition on the covariance matrix, where is the identity matrix, are the solved eigenvalues.
[0272] The formula for calculating the rotation axis is:
[0273]
[0274] where N is the normal vector with coordinates , and Y is the Y-axis with the expression ;
[0275] Calculating the rotation angle using the dot product of the normal vector and the Y-axis. The formula for calculating the rotation angle is:
[0276]
[0277] where is the rotation angle, is the modulus of the normal vector, is the modulus of the Y-axis;
[0278] The formula for calculating the rotation angle is:
[0279]
[0280] where a, b, and c are the components of the normal vector on the X, Y, and Z axes respectively;
[0281] Calculating the rotation matrix using the rotation axis, rotation angle, and the Rodrigues rotation formula. The calculation formula for the rotation matrix is:
[0282]
[0283] where is the identity matrix, is the rotation axis 's skew-symmetric matrix, 's formula is:
[0284]
[0285] where are the rotation axis coordinates.
[0286] The intelligent measurement method for three sides and two lines of the room includes:
[0287] Detecting the coordinates of the bottommost point cloud in the wall point cloud data;
[0288] Obtaining the skirting board boundary according to the coordinates of the bottommost point cloud and the preset skirting board height;
[0289] Find all the skirting board point cloud coordinates within the boundary of the skirting board in the wall surface point cloud data.
[0290] The intelligent measurement method for three sides and two lines of a room includes:
[0291] Extract the intersection point cloud data of the three-dimensional point cloud data;
[0292] Calculate the intersection point cloud of the internal and external corners based on vector calculation;
[0293] Divide the intersection point cloud of the internal and external corners into several segments according to a preset length;
[0294] Measure and draw each segment of the intersection point cloud of the internal and external corners.
[0295] The calculation of the intersection point cloud of the internal and external corners based on vector includes:
[0296] For a target three-dimensional point cloud data, obtain the vector of the target three-dimensional point cloud data;
[0297] Use the angle between the vector and the normal vector to determine whether the target three-dimensional point cloud data is intersection point cloud data;
[0298] Among them, the formula for calculating the angle between the vector and the normal vector is:
[0299]
[0300] Among them, is the angle between the vector and the normal vector, is the said vector, is the normal vector, and the formula for obtaining the vector is:
[0301]
[0302] Among them, is the coordinate of the target three-dimensional point cloud data, is the reference point coordinate.
[0303] The intelligent measurement method for three sides and two lines of a room includes:
[0304] Set the parameters of the output perspective of the intersection point cloud of the internal and external corners;
[0305] Calculate the actual drawing area;
[0306] Draw grid lines;
[0307] Draw the point cloud data and labels.
[0308] Although the specific embodiments of the present invention have been described above, those skilled in the art should understand that these are only examples, and the protection scope of the present invention is defined by the appended claims. Without departing from the principle and essence of the present invention, those skilled in the art can make various changes or modifications to these embodiments, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A three-side and two-line intelligent measurement method for a room, characterized in that: The room three-side two-line intelligent measurement method comprises: Get the 3D point cloud data of a room; Preprocessing the three-dimensional point cloud data; Extracting wall point cloud data from preprocessed three-dimensional point cloud data; Detect the location and type of holes in the wall point cloud data; Expand the boundary of the hole according to the hole type to obtain hole point cloud data of a preset size around the hole; The cavity point cloud data is measured to obtain measurement data of the cavity position in the room.
2. The room three-side two-line intelligent measurement method according to claim 1, characterized in that: The step of extracting the wall point cloud data from the pre-processed three-dimensional point cloud data comprises: Calculate the centroid of 3D point cloud data; Calculate the covariance matrix of the point cloud with respect to the centroid; By performing eigenvalue decomposition on the covariance matrix, three eigenvalues and corresponding eigenvectors are obtained; Use eigenvalues and eigenvectors to obtain the normal vector of 3D point cloud data; The plane equation of the wall is calculated using the centroid and the normal vector.
3. The room three-side two-line intelligent measurement method according to claim 2, characterized in that: The room three-side two-line intelligent measurement method comprises: Check whether the normal vector is parallel to the Y axis of the world coordinate system. If not, calculate the rotation axis and the rotation angle, and use the rotation axis and the rotation angle to calculate the rotation matrix. Each point cloud in the three-dimensional point cloud data is rotated using a rotation matrix to obtain wall point cloud data.
4. The room three-side two-line intelligent measurement method according to claim 3, characterized in that: The formula for calculating the centroid of 3D point cloud data is:
5. Among them, is the X-axis coordinate of the i-th point in the 3D point cloud data, n is the number of 3D point cloud data, is the Y-axis coordinate of the i-th point in the 3D point cloud data, is the Z-axis coordinate of the i-th point in the three-dimensional point cloud data, and the coordinate of the centroid is ; The covariance matrix is:
6. Among them, S is the covariance matrix, is the coordinate of the i-th point in the 3D point cloud data, is the offset between the i-th point and the center of mass; pass Perform eigenvalue decomposition on the covariance matrix, where is the identity matrix, is the solved eigenvalue.
7. The room three-side two-line intelligent measurement method according to claim 4, characterized in that: The formula for calculating the rotation axis is:
8. Among them, N is the normal vector and the coordinates are , Y is the Y axis and the expression is ; The rotation angle is calculated using the dot product of the normal vector and the angle between the Y axis. The formula for calculating the rotation angle is:
9. Among them, is the rotation angle, is the magnitude of the normal vector, is the modulus of the Y axis; Calculate the rotation angle The formula is:
10. Among them, a, b, and c are the components of the normal vector on the X, Y, and Z axes respectively; The rotation matrix is calculated using the rotation axis, the rotation angle and the Rodrigues rotation formula. The calculation formula of the rotation matrix is:
11. Among them, is the identity matrix, The rotation axis The antisymmetric matrix of The formula is:
12. Among them, is the rotation axis coordinate.
13. The room three-side two-line intelligent measurement method according to claim 1, characterized in that: The room three-side two-line intelligent measurement method comprises: Detect the bottom point cloud coordinates in the wall point cloud data; Get the skirting line boundary according to the bottom point cloud coordinates and the preset skirting line height; Find all the baseboard point cloud coordinates within the baseboard boundary in the wall point cloud data.
14. The room three-side two-line intelligent measurement method according to claim 1, characterized in that: The room three-side two-line intelligent measurement method comprises: Extracting intersection point cloud data of the three-dimensional point cloud data; Calculate the point cloud of the intersection of Yin and Yang angles based on vectors; Divide the point cloud of the intersection of the yin and yang corners into several segments according to the preset length; Measure and draw the point cloud of each intersection of the Yin-Yang corners.
15. The room three-side two-line intelligent measurement method according to claim 7, characterized in that: The method of calculating the intersection point cloud of the yin-yang angles based on vectors includes: For a target three-dimensional point cloud data, obtain the vector of the target three-dimensional point cloud data; Use the angle between the vector and the normal vector to determine whether the target 3D point cloud data is intersection point cloud data; The formula for calculating the angle between the vector and the normal vector is:
16. Among them, is the angle between the vector and the normal vector, is the vector, is the normal vector, and the formula for obtaining the vector is:
17. Among them, is the coordinate of the target 3D point cloud data, is the reference point coordinate.
18. The room three-side two-line intelligent measurement method according to claim 8, characterized in that: The room three-side two-line intelligent measurement method comprises: Set the parameters of the output viewing angle of the point cloud at the intersection of the Yin-Yang corners; Calculate the actual drawing area; Draw the grid lines; Draw point cloud data and labels.
19. A room three-side two-line intelligent measurement system, characterized in that: The room three-side two-line intelligent measurement system is used to implement the room three-side two-line intelligent measurement method as described in any one of claims 1 to 9.