A method, device, system, medium and product for automatically determining the physical size of a building
Patent Information
- Application Number
- CN202611090201.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-22
- Publication Date
- 2026-10-27
AI Technical Summary
这种方式效率极低,一个标准层测量需2-3人工作1-2天
本发明建筑物理尺寸自动确定方法及系统,利用全景图的等距投影特性,建立像素位置到角度位置的精确映射,从全景图中检测可与内置的建筑标准尺寸字典匹配一致的标准参照物,解决尺寸标定问题,从而通过已知标准参照物的物理尺寸与像素尺寸建立比例关系,然后通过代数运算还原任意物体的实际物理尺寸,该方式建立了一条从像素坐标、角度坐标到实际物理尺寸的完整计算链路,无需多角度拍摄和复杂摄影测量处理,能够实现从2D到3D的尺寸还原,高效便捷地确定多个特测构件的物理尺寸,解决普通2D图像存在透视变形而无法直接获取3D尺寸的问题,能够快速确定目标空间中待测构件的尺寸,极大地提高了测量效率。
Smart Images

Figure CN122982033A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the fields of computer vision and building structure measurement technology, and relates to a method, device, system, medium and product for automatically determining the physical dimensions of a building. Background Technology
[0002] In construction and cost auditing of building projects, obtaining structural dimensional data is fundamental for quantity calculation and quality inspection. Currently, the following methods are mainly used: 1) Manual on-site measurement: This involves measuring each item using tools such as measuring tapes and laser rangefinders. This method is extremely inefficient, requiring 2-3 people to work for 1-2 days to measure one standard floor. Furthermore, the measurement data is recorded manually, resulting in fragmented data that is prone to errors and loss. Additionally, there are safety risks associated with personnel measuring at heights near edges.
[0003] 2) Point cloud measurement based on 3D laser scanning: This method has high measurement accuracy, but the equipment is expensive, the operation is complicated, and it requires professional personnel. The data processing is complicated and the data processing cycle is long, making it unsuitable for daily construction management.
[0004] 3) Measurement based on ordinary photos: Single photos have perspective distortion and cannot be directly measured. It is necessary to place a calibration object and perform feature point matching and 3D reconstruction using multiple photos from different angles. The operation is complicated and the accuracy is greatly affected by the photo quality and shooting angle.
[0005] 4) Unmanned aerial vehicle (UAV) oblique photography: suitable for large-scale surveying, but not suitable for indoor / underground spaces.
[0006] Therefore, there is an urgent need for a method to automatically determine the physical dimensions of a building, which can solve the problems of low measurement efficiency, poor data integrity, risks of working at heights, lack of data traceability, and high equipment costs.
[0007] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0008] To address the shortcomings of existing technologies, this invention discloses a method, apparatus, system, medium, and product for automatically determining the physical dimensions of a building.
[0009] The technical solutions adopted in the embodiments of the present invention are as follows: A method for automatically determining the physical dimensions of a building, comprising the following steps: S1. Panoramic Image Acquisition and Preprocessing: Deploy panoramic acquisition equipment in the target building space to capture panoramic images of the target building space, record acquisition position parameters, perform stitching optimization and distortion correction on the panoramic images to obtain a corrected panoramic image, as well as multiple perspective sub-views obtained by decomposing the panoramic image according to a preset step size. S2. Analyze the spatial structure of the image based on the panoramic view: Based on the equidistant cylindrical projection model of the panoramic image, establish the mapping relationship between pixel coordinates and spherical angle coordinates; Edge detection and structure line extraction are performed on the panoramic image. Through the Manhattan world hypothesis and vanishing point analysis, the extracted line segments are classified into three orthogonal directions to reconstruct the camera pose. Start adaptive map viewing, perform edge detection and contour analysis in each perspective subview, filter closed contours, match the detected closed contours with the built-in architectural standard dimension dictionary, add the successfully matched closed contours to the standard reference list, and add the contours that do not match but meet the rectangular closure condition to the candidate reference list. S3. Automatic Detection of Reference Objects and Establishment of Scale: Detect standard reference objects with known physical dimensions in the panoramic image, and calculate the scale based on the detected standard reference objects by extracting pixel dimensions and corresponding standard physical dimensions. S4. Automatic measurement of the dimensions of the components to be measured: Based on the scale calculated in step S3 and the pixel span of the components to be measured in the panoramic image, the dimensions of all components to be measured are converted. S5. Multi-reference cross-validation and error correction: For the size of each component to be measured, the values are converted using at least two independent standard references and the average value is taken as the measured value of the component to be measured. The preset system error coefficient is used to compensate for the systematic deviation of the panoramic measurement and the confidence level of each measurement value is output. S6. Generate a dimension data report.
[0010] A further technical solution is that, in step S1, the collected location parameters include GPS coordinates, the installation height of the panoramic acquisition device, and the angle between the main lens orientation of the panoramic acquisition device and due north.
[0011] A further technical solution is that, in step S2, the standard reference list includes standard reference objects such as doors and windows and their standard dimensions, and the candidate reference list includes the number of walls, the included angle between adjacent covers, and the image coordinate range of each wall.
[0012] An automatic system for determining the physical dimensions of a building, comprising: The acquisition layer includes panoramic image acquisition devices deployed in the target building space; The geometric algorithm layer includes an image spatial structure analysis module, a reference object detection module, a scale calculation module, a size conversion module, a multi-reference object fusion module, and a system error correction module; wherein... The image spatial structure analysis module establishes a mapping relationship between pixel coordinates and spherical angle coordinates based on the panoramic image, performs edge detection and structure line extraction on the panoramic image, reconstructs the spatial layout through vanishing point analysis and Manhattan world hypothesis constraints, and establishes multiple panoramic perspective sub-views. The reference object detection module scans closed contours in the multiple panoramic perspective sub-views, matches them with preset architectural standard dimensions, and automatically establishes a standard reference object list and a candidate reference object list. The scale calculation module extracts the pixel size of all standard reference objects detected in the panoramic image, combines them with their standard physical size, calculates the horizontal and vertical scales corresponding to each standard reference object, and uses the weighted fusion as the automatic detection scale of the reference object. The size conversion module uses the reference object to automatically detect the scale and the pixel span of all components to be measured in the panoramic image, and calculates the converted size of all components to be measured as the measured value of the size of the components to be measured. The system error correction module obtains the system error correction coefficient through offline calibration, uses the system error coefficient to compensate for the systematic deviation of the panoramic measurement, and outputs the confidence level of each measurement value.
[0013] The beneficial effects of the embodiments of the present invention are as follows: This invention relates to an automatic method and system for determining building physical dimensions. It utilizes the equidistant projection characteristics of panoramic images to establish a precise mapping from pixel positions to angular positions. It detects standard reference objects in the panoramic image that match a built-in dictionary of standard building dimensions, solving the dimension calibration problem. By establishing a proportional relationship between the physical dimensions of the known standard reference objects and the pixel dimensions, and then using algebraic operations to reconstruct the actual physical dimensions of any object, this method establishes a complete calculation link from pixel coordinates and angular coordinates to actual physical dimensions. It eliminates the need for multi-angle photography and complex photogrammetry processing, enabling dimension reconstruction from 2D to 3D. This method efficiently and conveniently determines the physical dimensions of multiple specially measured components, solving the problem that perspective distortion in ordinary 2D images prevents direct acquisition of 3D dimensions. It can quickly determine the dimensions of components to be measured in the target space, greatly improving measurement efficiency. Attached Figure Description
[0014] Figure 1 This is a flowchart of the automatic determination method for building physical dimensions proposed in Embodiment 1 of the present invention.
[0015] Figure 2This is a schematic diagram of how the panoramic view is decomposed into 8 perspective sub-views in 45-degree increments in Embodiment 1 of the present invention.
[0016] Figure 3 This is a schematic diagram of the unfolded equidistant cylindrical projection diagram when establishing the mapping relationship between image pixels and spherical angles in Embodiment 1 of the present invention.
[0017] Figure 4 This is a schematic diagram of the structure of the automatic determination system for building physical dimensions proposed in Embodiment 3 of the present invention.
[0018] Figure 5 This is a schematic diagram illustrating the restoration of the entrance and exit dimensions in a real-world example of a bare-bones house, as proposed in Embodiment 3 of the present invention. Detailed Implementation
[0019] The specific embodiments of the present invention will now be described with reference to the accompanying drawings.
[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the device proposed by this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of this invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, only for the purpose of conveniently and clearly illustrating the embodiments of this invention. Please refer to the accompanying drawings to make the objectives, features, and advantages of this invention more apparent and understandable. It should be understood that the structures, proportions, sizes, etc., depicted in the accompanying drawings are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the implementation conditions of this invention. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportional relationships, or adjustments to the size, without affecting the effects and objectives achieved by this invention, should still fall within the scope of the technical content disclosed in this invention.
[0021] Table 1 Definitions of Some Terms
[0022] Example 1 (Method) Figure 1 This is a flowchart of the method for automatically determining the physical dimensions of a building according to Embodiment 1 of the present invention. Figure 1 As shown, the automatic determination method for building physical dimensions in this embodiment includes steps S1 to S6.
[0023] S1. Panoramic image acquisition and preprocessing.
[0024] A panoramic acquisition device is deployed in the target building space to capture panoramic images of the space and record the acquisition location parameters. The panoramic images are then stitched, optimized, and distortion corrected to output a corrected panoramic image.
[0025] In this embodiment, the panoramic image is an equirectangular projection, which is equivalent to unfolding a 360-degree × 180-degree panoramic view into a 2D image. Each column in the panoramic image corresponds to longitude (0-360 degrees), and each row corresponds to latitude (0-180 degrees). Each pixel in the panoramic image / panoramic picture has a definite angular position.
[0026] Figure 2 This is a schematic diagram illustrating how, in Embodiment 1 of the present invention, a panoramic image is decomposed into eight perspective sub-views at 45-degree increments. For example... Figure 2 As shown, the segmentation parameters for the 8 perspective subviews are: number = 8, step size = 45 degrees, field of view = 90 degrees, resolution = 1024x1024px. The adjacent overlap area = 90-45=45 degrees, used for geometric consistency constraints. The 8 views cover 360 degrees with no blind spots.
[0027] This embodiment, through its design, ensures measurement accuracy for large-span spaces (such as a 42-square-meter high-ceilinged living room). Specifically, for living room walls with large spans, direct measurement from a panoramic view can introduce errors due to edge distortion. This invention transforms panoramic measurement into multiple local perspective measurements by dividing the view into sub-views from multiple field angles, effectively avoiding the effects of distortion. Furthermore, it utilizes overlapping areas between sub-views for geometric consistency constraints, ensuring the accuracy of reconstructing complex structures (such as the supporting structure of a high-ceilinged space).
[0028] S2. Analyze the spatial structure of the image based on the panoramic image.
[0029] Figure 3 This is a schematic diagram showing the unfolded equidistant cylindrical projection of the image pixels and spherical angle mapping relationship established in Embodiment 1 of the present invention. Figure 3 As shown, firstly, pixel coordinates are established based on the equidistant cylindrical projection model of the panoramic image. Angular coordinates of the sphere Mapping relationship: ; ; in, These are the x and y coordinates of the pixels, respectively. , These are the width and height of the image, respectively. , These are longitude and latitude, respectively.
[0030] Then, edge detection and structure line extraction (LSD line segment detection algorithm) are performed on the panoramic image to correct all line segments in the panoramic image. Through the Manhattan world hypothesis and vanishing point analysis, each line segment is assigned to a triorthogonal direction to reconstruct the camera pose.
[0031] Simultaneously, adaptive image traversal is initiated: In this embodiment, adaptive image traversal refers to the process of decomposing the panoramic image into multiple perspective sub-views according to a preset angle step size, and then sequentially performing edge detection and contour analysis in each perspective sub-view. The step size and the number of sub-views are adaptively determined by the system based on the panoramic image resolution and scene complexity. Specifically, edge detection and contour analysis are performed in each perspective sub-view to filter closed contours. The detected closed contours are matched against a built-in architectural standard dimension dictionary to automatically create a reference object list. Successfully matched closed contours are automatically added to the standard reference object list, while contours that do not match but meet the rectangular closure condition are added to the candidate reference object list. Elongated contours are preferred for closed contours, corresponding to objects such as doors and windows, but are not limited to rectangular closed contours; they can also be triangular, corresponding to set square objects, or other irregular closed contours. Specifically, closed contours can be extracted using edge detection algorithms, vertex sequences can be obtained through polygon approximation, and then pixel dimensions are converted to actual dimensions based on camera calibration parameters. Geometric parameters such as length, width, and aspect ratio are calculated, and the position and tilt angle are recorded to generate a structured dimension description vector. Then, the standard building dimension dictionary is traversed, the error rate between the outline dimension and the dictionary value is calculated, and a successful match is made within the preset tolerance range. The successfully matched closed outline is then used as the standard reference.
[0032] The reference list includes a standard reference list, containing elements such as doors and windows and their dimensions, and a candidate reference list, containing elements such as walls, including the number of walls, the angle between adjacent walls, and the image coordinate range of each wall. Preferably, the same reference discovered from multiple perspectives is cross-validated, a weighted average is taken, and the coordinate range of each wall in the image is determined by combining the Manhattan world hypothesis.
[0033] S3. Automatic detection of reference objects and establishment of scale.
[0034] In the panoramic view, detect standard reference objects with known physical dimensions, such as door frames, window frames, floor tile joints, standard components, and type 86 switch panels.
[0035] Extract pixel dimensions (width) from the detected reference object , (height), combined with its standard physical dimensions (width) , (High), calculate the scale.
[0036] Horizontal scale: ; Vertical scale: ; Outliers (deviation > 0.05) were removed after independent calculation of multiple references. 15%), weighted fusion.
[0037] When the horizontal and vertical consistency is greater than or equal to 90%, use the average scale; otherwise, use a separate axis. Specifically, calculate the horizontal and vertical consistency using the following formula. :
[0038] in, This is the weighted and merged horizontal scale. The vertical scale is the weighted and merged result; Determine the horizontal and vertical consistency Is it greater than or equal to 90%? If so, then calculate ( () / 2 serves as the unified scale for subsequent conversions in both horizontal and vertical directions; otherwise, then These will be used as the scales for the horizontal and vertical directions respectively during subsequent conversions.
[0039] S4. Automatic measurement of the dimensions of the component to be measured.
[0040] Using the scale calculated in step S3, perform dimensional conversions for all components to be measured. For example: Wall width = horizontal pixel span Horizontal scale; Wall height = vertical pixel span Vertical scale; Column / beam cross section = contour pixel difference Vertical scale; Room area: Calculate the area of each vertex of the ground polygon in the image using the Gaussian area formula (also known as the shoelace formula). Then, the area of the ground polygon is calculated by proportional conversion:
[0041] in,( ) represents the pixel coordinates of each vertex of the ground polygon in the image.
[0042] S5. Multi-reference cross-validation and error correction.
[0043] For the dimensions of each component to be measured, the values are calculated separately using at least two independent standard references, and the average is taken. Then, a systematic error correction coefficient can be obtained through offline calibration. This systematic error coefficient is used to compensate for the systematic bias of the panoramic measurement, and the confidence level (high / medium / low) of each measurement value is output.
[0044] S6. Generate a dimension data report.
[0045] The dimensional data report includes a list of component dimensions and confidence level markings.
[0046] This embodiment utilizes the equidistant projection characteristics of panoramic images to establish a precise mapping from pixel positions to angular positions, establishes a complete calculation link of pixel coordinates, angular coordinates, and actual physical dimensions, establishes a proportional relationship between the physical dimensions of known reference objects and pixel dimensions, and uses known building components (doors, windows) within the panoramic image as standard reference objects to solve the size calibration problem. Finally, the actual physical dimensions of any object are restored through algebraic operations.
[0047] Furthermore, in step S1, the collected location parameters include: GPS coordinates (latitude and longitude), camera mounting height (m), and magnetic north declination (the angle between the camera's main lens orientation and true north, in degrees, used to correlate the panoramic orientation with the axis numbers on the architectural drawings). The magnetic north declination can be obtained through a mobile phone magnetometer or panoramic stitching orientation information. If it is not available, the default center of the image is true north, marked [Default Orientation].
[0048] Different devices can be used to acquire panoramic images, and the stitching process differs accordingly. (a) Dedicated panoramic cameras (Insta360 X4, etc.) automatically stitch the images in-camera, requiring no user operation; (b) Automatic stitching in mobile panorama mode; (c) For non-panoramic devices (ordinary cameras taking pictures one by one), users need to stitch the images together themselves using PTGui / Hugin; The panoramic isometric cylindrical projection image is divided into multiple perspective sub-views at angular intervals (e.g., 45° step size, 90° field of view, 1024×1024 resolution). Each sub-view approximates a pinhole camera projection. Structural lines are detected and dimensions are calculated on each sub-view, and then global optimization and fusion are performed using geometric consistency constraints on overlapping areas of the sub-views. This method effectively avoids the adverse effects of panoramic image edge distortion on measurements and achieves accurate measurements using a traditional perspective projection model. This embodiment preferably features automatic detection of seams, and reference objects crossing the seams are repaired based on unilateral data and symmetry.
[0049] Furthermore, in step S2, establishing the pixel-angle mapping relationship involves converting 2D pixel coordinates into angular coordinates in 3D space. This embodiment, through this design, can convert the pixel distance between any two pixels into a difference in latitude and longitude angles. Then, combine the physical dimensions of the reference object and the camera height. The actual dimensions of the component are calculated using trigonometric geometry.
[0050] Furthermore, in step S3, when the standard reference object includes a pre-set irregular geometric tool such as a set square, L-shaped ruler, or T-shaped ruler, since the tool contains a known ratio of right angles to known side lengths, the irregular ruler, when used as a standard reference object, also includes the oblique side / hypotenuse. This embodiment, through this design, allows standard tools to be actively placed into the target scene to establish a multi-directional scale, which is then verified against geometric truth values.
[0051] That is, when the standard reference includes the hypotenuse, the scale also includes: Diagonal scale: ; in, Extract the hypotenuse length of the pixel size for the standard reference object. The standard physical dimension of the hypotenuse corresponding to the standard reference object. These are the standard physical dimensions of the hypotenuse corresponding to the standard reference object.
[0052] Furthermore, in step S4, an adaptive measurement algorithm library for multiple component types is established. For different component types such as beams, columns, slabs, and walls, the optimal measurement algorithm is automatically matched to improve the measurement accuracy of various components.
[0053] Specifically, the geometric measurement algorithms for various components are as follows: Wall: The Manhattan hypothesis defines the boundaries: width = horizontal pixel span × horizontal scale, height = vertical pixel span × vertical scale. Area = Gaussian area formula.
[0054] Column: Detect the vertical edges on both sides, calculate the longitude difference dtheta using the panoramic projection formula, and combine this with the camera height H: Column width = 2H x tan(dtheta / 2). Column height is calculated from the latitude difference.
[0055] Beam body: The horizontal line segment at the bottom of the beam, and the beam height is calculated using the latitude difference and H.
[0056] Slab thickness: A single drawing cannot directly measure the slab thickness in the horizontal plane; multiple layers of photos are required. When the floor height is known, slab thickness = floor height - height of upper and lower beams.
[0057] Doors and windows: The adaptive map scanning method scans the rectangular outline in 8 sub-views, matches it with the Chinese standard size library (door width 700-1500mm / height 2100-3000mm, window height 600-1800mm), and automatically identifies and calls the corresponding algorithm.
[0058] Furthermore, in step S5, a precision assurance mechanism is introduced through multi-view fusion and cross-validation with reference objects. That is, the same component is cross-measured in multiple panoramic images, and outliers are eliminated by weighted averaging; multiple reference objects are used to cross-validate the scale to ensure measurement accuracy.
[0059] Specifically, the measurement values of the same component under test are calculated using at least two independent standard references, and the consistency of each measurement value is judged.
[0060] Table 2 Confidence Level Classification
[0061] Furthermore, such as Figure 1 As shown, the automatic determination method for building physical dimensions in this embodiment further includes a semantic analysis step: The AI visual language model is invoked to perform semantic recognition on each perspective subview generated in step S2, and the following qualitative descriptions are output: space type label; component type label; reference object type label.
[0062] The qualitative description output by the AI visual language model is only used to add semantic annotations to the size data report in step S6. It does not participate in the automatic detection of reference objects in step S3, the size conversion in step S4, or the cross-validation calculation in step S5.
[0063] Example 2 (Device) This embodiment proposes an automatic building physical dimension determination device that executes the automatic building physical dimension determination method described in Embodiment 1. The device includes: Panoramic Image Acquisition and Preprocessing Module: Used to acquire panoramic images of the target building space and perform stitching optimization and distortion correction to obtain a corrected panoramic image, as well as multiple perspective sub-views obtained by decomposing the panoramic image according to a preset step size. The spatial structure analysis module is used to establish the mapping relationship between pixel coordinates and spherical angle coordinates based on the isometric cylindrical projection model of the panoramic image; it is used to perform edge detection and structural line extraction on the panoramic image, and to classify the extracted line segments into three orthogonal directions and reconstruct the camera pose through the Manhattan world hypothesis and vanishing point analysis; it is used to start adaptive map patrol, perform edge detection and contour analysis in each perspective sub-view, filter closed contours, match the detected closed contours with the built-in architectural standard size dictionary, add the successfully matched closed contours to the standard reference list, and add the unmatched contours that meet the rectangular closure conditions to the candidate reference list. The reference object detection and scale establishment module is used to detect standard reference objects with known physical dimensions in panoramic images, and to extract pixel dimensions and corresponding standard physical dimensions based on the detected reference objects to calculate scales in multiple directions. The size conversion module is used to perform size conversion for all components under test based on the scale and the pixel span of the component under test in the panoramic image; The cross-validation module is used to calculate the size of each component under test using at least two independent standard references, and then take the average value as the measured value of the component. It uses a preset system error coefficient to compensate for the systematic deviation of the panoramic measurement and outputs the confidence level of each measurement value. The report generation module is used to generate size data reports.
[0064] Example 3 (System) Figure 4 This is a structural schematic diagram of the automatic building physical dimension determination system proposed in Embodiment 3 of the present invention. Figure 4 As shown, the system of this embodiment executes the method described in Embodiment 1. The system includes: The acquisition layer includes panoramic image acquisition equipment deployed in the target building space.
[0065] The geometric algorithm layer includes a distortion correction module, a structure line detection module (LSD algorithm), a vanishing point analysis module, a reference object detection module, a scale calculation module, a size conversion module, a multi-reference object fusion module, and a system error correction module.
[0066] Furthermore, the system also includes: The AI semantic assistance layer is configured with an AI visual language model. This model performs semantic recognition on each perspective sub-view generated by the geometric algorithm layer, outputting the following qualitative descriptions: space type label; component type label; and reference object type label. The output of this layer serves as reference information for human operators and as background information for the results report.
[0067] The fusion output layer combines the precise dimensional data from the geometric algorithm layer with the qualitative description from the AI semantic assistance layer to generate a complete dimensional report (including dimensional values, confidence levels, space names, component types, etc.). In other words, the qualitative description output by the AI visual language model is used as semantic annotation added to the dimensional data report.
[0068] Furthermore, the system in this embodiment of the invention introduces a cross-device compatibility and adaptive calibration mechanism, aiming to be compatible with various devices such as dedicated panoramic cameras (Insta360 X4), mobile phone panoramic modes, and mobile phone video keyframes. The adaptive calibration process is as follows: Before the image enters the geometric algorithm layer, the system automatically reads the input image parameters, including EXIF metadata (the shooting parameters written by the camera): Equipment Model (Make / Model field): Determines the optical model type (fisheye / pinhole / panoramic); Equivalent focal length (FocalLengthIn35mmFilm field): Calculates the horizontal field of view and determines the pixel-angle mapping ratio reference, which is automatically written by the camera without manual measurement; Image resolution (ImageWidth / ImageLength): Substitute into the panoramic projection formula theta=u / W 360 degrees, phi = v / H 180 degrees; Lens distortion parameters (if any): Distortion correction preprocessing.
[0069] Automatic matching: Equivalent focal length <10mm and aspect ratio = 2:1, panoramic equidistant cylindrical projection, using standard formula; If EXIF information is missing, the default focal length parameters (currently the most common panoramic camera parameters) will be used, and the output will be labeled [calibration parameters are default values]. All digital photos include EXIF information.
[0070] It should be noted that in this embodiment, the AI module only performs spatial type labeling (e.g., [living room][kitchen]) and visualization enhancement on the output results of the geometric algorithm layer, and does not participate in any dimensional measurement or calculation process. Its qualitative description does not participate in the generation of any dimensional values, ensuring the anti-interference capability of the measurement results. When the AI service is unavailable (network interruption / API arrears / model update, etc.), the system automatically reverts to the pure geometric solution, and the core measurement functions are completely unaffected. That is, when the AI model cannot be called normally due to network failure, API unavailability, model version change, etc., the system automatically skips the AI semantic analysis step. The dimensional data report generated in step S6 only contains the dimensional data and confidence level obtained based on the pure geometric algorithm in steps S3-S5, affecting the execution and accuracy of the core measurement functions. The core measurement functions implemented in this embodiment, such as panoramic distortion correction, automatic reference object detection, scale establishment, size conversion, and cross-validation, do not depend on the availability of the AI model. The geometric algorithm layer of this invention can independently complete the deterministic conversion from panoramic pixels to physical dimensions. Even in an offline state where the AI layer is unavailable, the system can still achieve high-precision measurement based on the equidistant cylindrical projection model.
[0071] Example 4 (System Error Correction) This embodiment proposes three calibration schemes for obtaining the system error correction coefficients described in Embodiment 1. Specifically, using... This represents the system error correction coefficient.
[0072] Option 1. Calibration Method Preset system error coefficient Obtained through the following calibration method: In a standard test scenario, at least three calibration references with known precise physical dimensions are set up, and the side length of each calibration reference is accurate to ±1mm. A panoramic image is taken at the same position using the same panoramic camera as the one used in the formal measurement. Calculate the ratio of the actual size of each calibration reference object to the panoramic measurement size; The arithmetic mean of the ratios is taken as the system error correction coefficient. .
[0073] Option 2. Dynamic Determination Method The system error coefficients are dynamically determined in the following way: In the formal measurement scenario, at least two standard reference objects detected in step S3 are used to calculate their respective horizontal and vertical scales, and the relative deviation between the scales is used as the basis for estimating the system error coefficient. When horizontal and vertical consistency At 90%, take When consistency is between 80% and 90%, take... When consistency is between 70% and 80%, take... .
[0074] Option 3. Set the range of coefficient values. Experiments have verified that, for indoor scenes (shooting distance 1-10 meters), the systematic error coefficient... The value range is 0.85-0.98; for outdoor scenes (shooting distance 10-50 meters), the system error coefficient is... The value range is 0.80-0.95.
[0075] Example 5 (Actual Measurement) Figure 5 This is a schematic diagram illustrating the restoration of the entrance and exit dimensions in a pre-built house, based on actual measurements in Embodiment 5 of the present invention. Figure 5 As shown, this embodiment takes the measurement of the entrance door of unfinished room 301 as an example. It employs the method proposed in Embodiment 1, the device proposed in Embodiment 2, or the system proposed in Embodiment 3 to measure the entrance door of unfinished room 301. The method in this embodiment does not utilize AI semantic analysis; it relies solely on the pure geometric algorithms in steps S1-S5 to complete the distortion correction of the panoramic image, structural line extraction, automatic reference object detection, scale establishment, size conversion, and cross-validation. This embodiment can run in an offline environment without a network connection, completing the entire process of building size measurement using the panoramic image. All calculations are deterministic and reproducible.
[0076] Step 1: Equipment deployment and filming.
[0077] Using an Insta360 X4 panoramic camera, set up in the center of the unfinished building, at a height of 1.5m. Take a 7680×3840 pixel panoramic image (panoramic isometric cylindrical projection), ensuring that at least one standard architectural element of known size is present in the image: a door / window.
[0078] Step 2: Panoramic image distortion correction.
[0079] By using OpenCV's remap function and the pre-calibrated intrinsic parameters of the panoramic camera, distortion correction is performed on the panoramic image to eliminate the influence of radial and tangential distortion of the fisheye lens on the measurement.
[0080] Step 3: Structural line detection, spatial layout reconstruction, and adaptive map exploration.
[0081] The LSD line segment detection algorithm is used to extract all line segments from the corrected panoramic image. Based on the Manhattan world assumption, the line segments are classified into three orthogonal directions to reconstruct the camera pose. At the same time, the adaptive image traversal module is activated: the panoramic image is decomposed into 8 perspective subviews at 45° steps, and edge detection and contour analysis are performed in each subview to select rectangular closed regions.
[0082] The detected rectangular pixel dimensions are matched with the built-in dictionary of Chinese building standard dimensions (door width 700 / 800 / 900 / 1000 / 1200 / 1500mm, door height 2100 / 2200 / 2400 / 2700 / 3000mm, window height 600 / 900 / 1200 / 1500 / 1800mm) to automatically create a list of candidate reference objects and a preliminary scale.
[0083] Table 3 Dictionary of Chinese Building Standard Dimensions
[0084] Cross-validation of the same reference object found from multiple perspectives, taking a weighted average, and combining the Manhattan world hypothesis to determine the coordinate range of each wall in the image.
[0085] Step 4: Reference object detection and scale establishment.
[0086] Detecting standard components such as door frames in images: Determine the pixel size of the reference object using two vertical edges in the horizontal direction (left and right edges of the door frame) and two horizontal edges in the vertical direction (top and bottom edges of the door frame).
[0087] Establish a proportional relationship between pixel size and known physical dimensions (Chinese building module: entrance door height 2100mm, width 900mm; interior door height 2000mm, width 800mm) and calculate the pixel scale. If there are multiple reference objects, calculate independently and remove outliers with a deviation from the median >15%, then perform weighted fusion.
[0088] Step 5: Automatic conversion of whole house dimensions.
[0089] Use the map scale to convert all the components to be measured on the entire map. Priority order of map scale sources: (a) Standard building dimensions automatically matched by adaptive map observation; (b) User-inputted known size reference (highest accuracy); (c) Weighted fusion of multiple reference objects.
[0090] Wall width = horizontal pixel span from left to right × horizontal scale (scale_x). Wall height = vertical pixel span from top to bottom × vertical scale (scale_y).
[0091] Width and height should be converted separately using the corresponding axis scales, and should not be mixed.
[0092] Room area = area of the floor polygon (the line connecting the bottom endpoints of each wall) calculated using the Gaussian area formula.
[0093] Door and window dimensions = direct output as a reference.
[0094] Step 6: Error correction and confidence level labeling.
[0095] For each dimension, indicate the confidence level: high (verified by more than 2 reference objects, with horizontal and vertical consistency ≥90%), medium (with 1 reference object, or consistency 80-90%), and low (without reference objects, estimated only based on building modules).
[0096] A preset system error correction coefficient is introduced (the measured difference between the horizontal and vertical systems of the entrance and exit of the unfinished house is about 7.6-7.8%, which has been written into the calibration parameters).
[0097] A preset system error correction coefficient (obtained through calibration, with a typical value of approximately 0.89) is introduced to compensate for the systematic deviations in panoramic measurements.
[0098] Furthermore, the specific process of step 3 is as follows: Step 3.1, Line Segment Detection (LSD): Input a 7680x3840 panoramic image; Execute the LSD algorithm to output 666 line segments (227 horizontally and 439 vertically), including the four sides of the door frame: left (1417,17)-(1417,2145), right (2618,17)-(2618,2145), top (1417,17)-(2618,17), and bottom (1417,2145)-(2618,2145).
[0099] Step 3.2, Vanishing Point Analysis (RANSAC): Based on the Manhattan world hypothesis, 666 line segments are categorized into three orthogonal directions, and three principal vanishing points and camera pose are output: X direction 227, Y direction 439, Z direction 0 (in the horizontal plane), and the camera deflection angle is approximately -3 degrees (negligible).
[0100] Step 3.3, Manhattan Constraint: Extract the corner of the wall and door from the intersection of the line segments, correct the included angle to 90 degrees, and output: the width of the entrance and exit outline in pixels = 2618-1417=1201px, the height = 2145-17=2128px.
[0101] Step 3.4, Establishing the scale: Input pixel size 1201x2128, actual measured size 1.22mx2.34m.
[0102] Horizontal scale = 1.22 / 1201 = 1.016 mm / px; Vertical scale = 2.34 / 2128 = 1.100 mm / px.
[0103] The horizontal and vertical difference is 7.6-7.8%, which is caused by the distortion of the two-lens stitching and the latitudinal stretching (when the spherical image is forced to unfold into a plane, the arc length of the high latitude is forcibly straightened). Therefore, a split-axis scale is used.
[0104] Step 3.5: Complete the algebraic conversion: Actual size = pixel span x corresponding scale bar.
[0105] Verification: Door width = 1201 x 1.016 = 1220 mm = 1.22 m (consistent with the measuring tape); Door height = 2128 x 1.100 = 2341 mm, approximately 2.34 m, deviation < 0.1%.
[0106] Overall accuracy ±3-5% (when the reference is reliable).
[0107] The method in this embodiment designs a panoramic projection geometric model and coordinate mapping relationship, ensuring that even without depth information, only a standard reference object (such as the 1.22m wide entrance door measured in the report) is needed to deduce the physical dimensions of any visible component in the entire house through trigonometric relationships. The room height, window sill height (approximately 0.9m), and other data calculated by the method of this invention are highly consistent with the results of manual measurement and AI semantic estimation, and the measurement accuracy is stable. Moreover, the entire method is a deterministic calculation, with the same input producing the same output. The mathematical upper limit of accuracy is determined by the pixel resolution, and the accuracy is controllable, which can improve the robustness and accuracy of building component dimension measurement in complex construction environments (concrete base, construction trace interference) of unfinished houses.
[0108] Table 4 Summary of Verification Results of Panoramic Measurement of Unfinished Building (301)
[0109] Furthermore, in step 6, a preset systematic error correction coefficient is introduced to compensate for the systematic deviations in the panoramic measurement. This correction coefficient is obtained through offline calibration, and the calibration method is as follows: In a standard testing environment, the actual dimensions of N (N ≥ 10) standard reference objects are accurately measured using a measuring tape. Using the method of this embodiment, the panoramic measurement dimensions of each reference object are calculated; Calculate the ratio for each reference object. Actual size / panoramic measurement size; Take all The arithmetic mean is used as the system error correction coefficient.
[0110] After multiple calibration experiments, the typical value of this coefficient in this embodiment is 0.89.
[0111] Furthermore, after step 6 is completed, step 7 can be added: comparison and verification with the results of manual measurement using a measuring tape.
[0112] Table 5. Quantitative Comparison of Several Measurement Methods
[0113] Furthermore, in the actual test case, the system automatically detects the outer frame of the entrance / exit as the anchor point. The AI semantic assistance layer can be configured to add a confirmation function in this step, that is, to confirm the component type of "entrance / exit". Subsequently, the geometric algorithm layer extracts its four key pixel coordinates and establishes the horizontal (1.016mm / px) and vertical (1.100mm / px) split axis scales.
[0114] Example 6 (AI) This embodiment adds an AI visual model as a semantic auxiliary layer, based on embodiment three.
[0115] The AI vision model is configured to perform semantic analysis on the panoramic image and output space type labels (e.g., living room / kitchen / corridor), component type labels (e.g., load-bearing wall / partition / chimney), and size rationality checks (e.g., the size is too high / too low / reasonable).
[0116] It should be noted that the output of the AI vision model in the embodiments of the present invention does not need to participate in any calculation process of size values; all size values are still generated by the pure geometric algorithm of Embodiment 1.
[0117] The output of the AI vision model is only used as: Assistance prompts for user operators (e.g., "Reference door frame detected, confirm?"). Background information in the final report (e.g., the space is a kitchen, a chimney is expected, manual verification is recommended).
[0118] When the AI service is unavailable, the system automatically reverts to the offline mode of Implementation Example 3, without affecting the core measurement functions.
[0119] Example 7 (Manual) This embodiment is suitable for scenarios with the highest accuracy requirements (such as final settlement and audit review). Based on embodiment three, the user manually marks the four corner pixel coordinates of the reference object in the panoramic image, replacing the automatic detection step. The accuracy of the manually marked coordinates is usually within ±1-2 pixels. Combined with the actual measurement of the reference object size with a measuring tape, the accuracy of the whole house size measurement can be improved to ±3-5% (verified by actual measurement of a bare house 301).
[0120] The manual annotation process is as follows: Users can open panoramic or flat screenshots in image viewing software that has pixel coordinate display capabilities; Move the mouse to the four corners of a reference object (such as a door frame) and record the X and Y pixel coordinates displayed in the bottom status bar; Input the coordinates of the four corners into the system, and the system will automatically create a scale and convert the dimensions of the whole house.
[0121] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in Embodiment 1.
[0122] Another embodiment of the present invention provides a computer program product including computer program instructions that, when executed by a processor, implement the steps of the method as described in Embodiment 1.
[0123] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0124] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A method for automatically determining the physical dimensions of a building, characterized in that, Including the following steps: S1. Panoramic Image Acquisition and Preprocessing: Deploy panoramic acquisition equipment in the target building space to capture panoramic images of the target building space, record acquisition position parameters, perform stitching optimization and distortion correction on the panoramic images to obtain a corrected panoramic image, as well as multiple perspective sub-views obtained by decomposing the panoramic image according to a preset step size. S2. Analyze the spatial structure of the image based on the panoramic view: Based on the equidistant cylindrical projection model of the panoramic image, establish the mapping relationship between pixel coordinates and spherical angle coordinates; Edge detection and structure line extraction are performed on the panoramic image. Through the Manhattan world hypothesis and vanishing point analysis, the extracted line segments are classified into three orthogonal directions to reconstruct the camera pose. Start adaptive map viewing, perform edge detection and contour analysis in each perspective subview, filter closed contours, match the detected closed contours with the built-in architectural standard dimension dictionary, add the successfully matched closed contours to the standard reference list, and add the contours that do not match but meet the rectangular closure condition to the candidate reference list. S3. Automatic Detection of Reference Objects and Establishment of Scale: Detect standard reference objects with known physical dimensions in the panoramic image, and calculate the scale in multiple directions based on the detected standard reference objects, extracting pixel dimensions and corresponding standard physical dimensions. S4. Automatic measurement of the dimensions of the components to be measured: Based on the scale calculated in step S3 and the pixel span of the components to be measured in the panoramic image, the dimensions of all components to be measured are converted. S5. Multi-reference cross-validation and error correction: For the size of each component to be measured, the values are converted using at least two independent standard references and the average value is taken as the measured value of the component to be measured. The preset system error coefficient is used to compensate for the systematic deviation of the panoramic measurement and the confidence level of each measurement value is output. S6. Generate a dimension data report.
2. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that: In step S1, the collected location parameters include GPS coordinates, the installation height of the panoramic acquisition device, and the angle between the main lens of the panoramic acquisition device and true north.
3. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that: In step S2, the list of standard reference objects includes standard reference objects and their standard dimensions. The standard reference objects include doors, windows or preset irregular geometric tools. The list of candidate reference objects includes the number of walls, the included angle between adjacent covers, and the image coordinate range of each wall.
4. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that, In step S3, the scale includes: Horizontal scale: ; Vertical scale: ; in, , The width and height of the pixels are extracted from the detected standard reference object, respectively. , These are the standard physical dimensions of the width and height corresponding to the standard reference object, respectively. Multiple standard references are used to independently calculate the initial horizontal and vertical scales, then outliers are removed and the scales are weighted and merged. Calculate horizontal and vertical consistency : in, This is the weighted and merged horizontal scale. The vertical scale is the weighted and merged result; Determine the horizontal and vertical consistency Is it greater than or equal to 90%? If so, then calculate ( () / 2 serves as the unified scale for subsequent conversions in both horizontal and vertical directions; otherwise, then These will be used as the scales for the horizontal and vertical directions respectively during subsequent conversions.
5. The method for automatically determining the physical dimensions of a building as described in claim 4, characterized in that, In step S3, when the standard reference includes a hypotenuse, the scale also includes: Diagonal scale: ; in, Extract the hypotenuse length of the pixel size for the standard reference object. The standard physical dimension of the hypotenuse corresponding to the standard reference object. These are the standard physical dimensions of the hypotenuse corresponding to the standard reference object.
6. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that, In step S4, the dimensions of the walls, rooms, columns, and beams are calculated according to the following formula: Wall width = horizontal pixel span Horizontal scale; Wall height = vertical pixel span Vertical scale; Column cross section = contour pixel difference Vertical scale; Beam cross section = contour pixel difference Vertical scale; Calculate the room area using the Gaussian area formula.
7. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that, In step S5, the preset system error correction coefficient is obtained in the following way: In a standard test scenario, at least three calibration references with known precise physical dimensions are set up, and the side length of each calibration reference is accurate to ±1mm. A panoramic image is taken at the same position using the same panoramic camera as the one used in the formal measurement. Calculate the ratio of the actual size of each calibration reference object to the panoramic measurement size; The arithmetic mean of the ratios is taken as the system error correction coefficient. .
8. The method for automatically determining the physical dimensions of a building as described in claim 1, characterized in that: The method for automatically determining the physical dimensions of a building also includes the following steps: The AI visual language model is invoked to perform semantic recognition on each perspective sub-view generated in step S2, and the following qualitative descriptions are output: space type label; component type label; reference object type label; The qualitative description output by the AI visual language model is used as semantic annotation added to the size data report in step S6.
9. A device for automatically determining the physical dimensions of a building, characterized in that, include: Panoramic Image Acquisition and Preprocessing Module: Used to acquire panoramic images of the target building space and perform stitching optimization and distortion correction to obtain a corrected panoramic image, as well as multiple perspective sub-views obtained by decomposing the panoramic image according to a preset step size. The spatial structure analysis module is used to establish the mapping relationship between pixel coordinates and spherical angle coordinates based on the equidistant cylindrical projection model of the panoramic image. Used for edge detection and structure line extraction of panoramic images, the extracted line segments are classified into three orthogonal directions and the camera pose is reconstructed through Manhattan world hypothesis and vanishing point analysis. Used to initiate adaptive map viewing, edge detection and contour analysis are performed in each perspective subview, closed contours are filtered, the detected closed contours are matched with the built-in architectural standard dimension dictionary, the closed contours that are successfully matched are added to the standard reference list, and the contours that are not successfully matched but meet the rectangular closure condition are added to the candidate reference list. The reference object detection and scale establishment module is used to detect standard reference objects with known physical dimensions in panoramic images, and to extract pixel dimensions and corresponding standard physical dimensions based on the detected reference objects to calculate scales in multiple directions. The size conversion module is used to perform size conversion for all components under test based on the scale and the pixel span of the component under test in the panoramic image; The cross-validation module is used to calculate the size of each component under test using at least two independent standard references, and then take the average value as the measured value of the component. It uses a preset system error coefficient to compensate for the systematic deviation of the panoramic measurement and outputs the confidence level of each measurement value. The report generation module is used to generate size data reports.
10. An automatic system for determining the physical dimensions of a building, characterized in that, include: The acquisition layer includes panoramic image acquisition devices deployed in the target building space; The geometric algorithm layer includes an image spatial structure analysis module, a reference object detection module, a scale calculation module, a size conversion module, a multi-reference object fusion module, and a system error correction module; wherein... The image spatial structure analysis module establishes a mapping relationship between pixel coordinates and spherical angle coordinates based on the panoramic image, performs edge detection and structure line extraction on the panoramic image, reconstructs the spatial layout through vanishing point analysis and Manhattan world hypothesis constraints, and establishes multiple panoramic perspective sub-views. The reference object detection module scans closed contours in the multiple panoramic perspective sub-views, matches them with preset architectural standard dimensions, and automatically establishes a standard reference object list and a candidate reference object list. The scale calculation module extracts the pixel size of all standard reference objects detected in the panoramic image, combines them with their standard physical size, calculates the horizontal and vertical scales corresponding to each standard reference object, and uses the weighted fusion as the automatic detection scale of the reference object. The size conversion module uses the reference object to automatically detect the scale and the pixel span of all components to be measured in the panoramic image, and calculates the converted size of all components to be measured as the measured value of the size of the components to be measured. The system error correction module obtains the system error correction coefficient through offline calibration, uses the system error coefficient to compensate for the systematic deviation of the panoramic measurement, and outputs the confidence level of each measurement value.
11. The automatic building physical dimension determination system as described in claim 10, characterized in that, The system also includes: The AI semantic assistance layer is configured with an AI visual language model. The AI visual language model is called to perform semantic recognition on each perspective sub-view generated in the geometric algorithm layer, and outputs the following qualitative descriptions: space type label; component type label; reference object type label; The fusion output layer combines the precise dimensional data from the geometric algorithm layer with the qualitative description from the AI semantic assistance layer to generate a complete dimensional report.
12. The automatic building physical dimension determination system as described in claim 10, characterized in that, The geometric algorithm layer also includes: The manual annotation module is configured to open the panoramic image in image viewing software with pixel coordinate display function, manually select multiple reference points of the standard reference object and input the coordinates of each reference point, and then automatically generate a manual annotation scale. The manual annotation scale participates in the size calculation of the component to be measured and has a higher priority than the scale generated by the reference object detection module.
13. A computer-readable storage medium, characterized in that: It stores a computer program thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 8.
14. A computer program product, characterized in that: It includes computer program instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 8.