A method and device for measuring the volume of material piles in a construction scenario

By combining a binocular camera system with the AtlasNet network architecture, a 3D model with true physical scale is generated, solving the problems of efficiency and accuracy in measuring the volume of material piles at construction sites. It is suitable for monitoring material piles in both static and dynamic scenarios.

CN121259077BActive Publication Date: 2026-03-06XIAMEN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511821111.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-06
Estimated Expiration
2045-12-05

AI Technical Summary

Technical Problem

Existing technologies for measuring the volume of material piles at construction sites suffer from problems such as high equipment costs, complex operation, long data acquisition cycles, and poor adaptability to complex environments, making it difficult to achieve efficient and accurate volume measurement.

Method used

Two identical cameras are used as a binocular camera system for single-target calibration and stereo calibration, generating left and right view pairs. The disparity is estimated by cross-cost aggregation algorithm, and the point cloud is fused with the AtlasNet network architecture to generate a complete 3D model with realistic physical scale.

Benefits of technology

It achieves geometric completion of occluded areas, maintains the accuracy of volume calculation, reduces equipment costs, improves measurement efficiency, and is applicable to material pile monitoring in both static and dynamic scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121259077B_ABST
    Figure CN121259077B_ABST
Patent Text Reader

Abstract

This invention provides a method and apparatus for measuring the volume of a material pile in a construction scenario, relating to the fields of computer vision and building engineering technology. The invention acquires binocular image data and generates left and right view pairs through epipolar correction; then, it uses a cross-cost aggregation algorithm to estimate disparity in the corrected binocular image data to generate a disparity map; it performs back-projection reconstruction on the disparity map, extracts color information and confidence values, and generates a binocular point cloud image, then segments and extracts the scaled point cloud; next, it inputs the binocular point cloud image into an AtlasNet network architecture to generate a scale-free point cloud; it aligns and restores the scale of the scale-free point cloud, and finally fuses the restored point cloud with the scaled point cloud to calculate the fused height value and the volume of the material pile. This invention generates a complete 3D model with realistic physical scale by jointly registering and fusing scale-free and scaled point clouds, achieving high-precision material pile volume calculation and significantly improving measurement accuracy and efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and architectural engineering technology, and more specifically, to a method, apparatus, equipment, and medium for measuring the volume of material piles in construction scenarios. Background Technology

[0002] In the fields of construction and project management, accurate measurement of the volume of material piles at construction sites is a crucial step in achieving rational resource utilization, cost control, and construction progress management. Traditional volume measurement methods mainly include manual surveying, total station measurement, and laser scanning. While these methods offer high measurement accuracy, they generally suffer from high equipment costs, complex operation, long data acquisition cycles, and poor adaptability to complex construction environments, making it difficult to meet the rapid measurement needs of large-scale or dynamic scenarios.

[0003] With the development of computer vision and 3D reconstruction technologies, vision-based volume calculation methods have gradually gained attention. Binocular stereo vision uses two cameras to acquire left and right views of the same scene and generates 3D point clouds based on parallax calculations. This allows for the direct acquisition of information with true physical scale, enabling the measurement of the visible surface of a material pile. However, due to limitations imposed by viewpoint occlusion and scene complexity, the point clouds generated by binocular stereo vision typically only cover the visible surface and cannot fully reflect the overall geometry of the material pile, thus affecting the accuracy of volume estimation. On the other hand, deep learning-based single-view or multi-view 3D reconstruction methods can recover the complete 3D structure of an object from RGB images and effectively fill in invisible or occluded areas. These methods can generate structurally complete 3D models, but due to the lack of absolute scale constraints, their output point clouds only have relative proportions and cannot be directly used for material pile volume calculations.

[0004] Existing technologies have many shortcomings in measuring the volume of material stockpiles, which makes it difficult to achieve efficient and accurate measurement of material stockpiles on construction sites.

[0005] In view of the above, this application is hereby submitted. Summary of the Invention

[0006] The present invention aims to provide a method and device for measuring the volume of material piles in construction scenarios, in order to solve at least one of the above problems. By jointly registering and fusing binocular stereo vision point clouds with absolute scale but incomplete with geometrically complete but scale-free deep learning point clouds, a three-dimensional model that is both complete and has real physical scale is generated, thereby achieving high-precision calculation of the volume of material piles.

[0007] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:

[0008] A method for measuring the volume of material stockpiles in a construction scenario, comprising:

[0009] S1 uses two identical cameras as a binocular camera system to perform single-target calibration and stereo calibration to acquire binocular image data of the construction site, including the material pile area, and performs epipolar correction to generate left and right view pairs.

[0010] S2, based on the left and right view pairs and the parameters related to the binocular camera system, a disparity estimation is performed on the corrected binocular image data using a cross-cost aggregation algorithm to generate a disparity map;

[0011] S3, perform back projection reconstruction on the disparity map, extract the color information and confidence value corresponding to the pixels, generate a binocular point cloud image, and then segment the binocular point cloud image to extract the independent three-dimensional point cloud data of the material pile, i.e., the scaled point cloud.

[0012] S4, the binocular point cloud image is input into the AtlasNet network architecture, and after feature extraction, feature enhancement and fusion mapping, a dense three-dimensional point cloud is generated, i.e. a scale-free point cloud;

[0013] S5, perform unified alignment and scale restoration between the scaleless point cloud and the scaled point cloud to obtain the scale-restored point cloud;

[0014] S6. The scale-restored point cloud and the scaled point cloud are assigned to grid cells for fusion, the fused height value is calculated, and the material pile volume is calculated based on this.

[0015] Preferably, S1 specifically comprises:

[0016] The two cameras were calibrated using a checkerboard calibration board for single-target and stereo calibration.

[0017] Among them, single-target positioning is used to obtain the intrinsic parameter matrix and distortion coefficients of each camera, and to establish the mapping relationship between pixel coordinates and camera coordinate system. Its mathematical model is as follows:

[0018] ;

[0019] in, These are the pixel coordinates; These are the coordinates of a 3D point in the camera coordinate system. Focal length is measured in pixels; These are the principal point coordinates, i.e., the coordinates of the intersection point of the camera's optical axis and the image plane; K is the intrinsic parameter matrix. This is the Z-axis coordinate in the camera coordinate system, i.e., the depth value;

[0020] The pixel coordinates are corrected using a lens distortion model, and the correction formula is as follows:

[0021] ;

[0022] ;

[0023] in, The coordinates are after correction; These are the coordinates of the distorted pixels; The distortion coefficient; This represents the radial distance from the pixel to the optical center. ;

[0024] Stereo calibration is used to calculate the rotation matrix R and translation vector t between the two cameras, representing the transformation of the coordinate system between the two cameras, and to determine the extrinsic parameters of the binocular camera system. The formula is as follows:

[0025] ;

[0026] in, , These are the coordinates of the same point in the left and right camera coordinate systems; For rotation matrix, It is a translation vector;

[0027] And any pair of corresponding points between the two cameras , The following relationship must be satisfied:

[0028] ;

[0029] ;

[0030] in, Let T be the essential matrix, and T be the transpose symbol.

[0031] After completing the stereo calibration, the translation vector is used. The baseline length of the binocular camera system was calculated. The formula for calculating depth is:

[0032] ;

[0033] Then, epipolar correction is performed on the images from both cameras to ensure that corresponding pixels are in the same row, thus obtaining a left and right view pair.

[0034] Preferably, S2 specifically comprises:

[0035] First, the matching cost is calculated on a local window. A matching cost function is constructed for multiple disparity candidate values ​​of each pixel in the epipolar-corrected binocular image, with the following formula:

[0036] ;

[0037] in, For pixels In disparity candidate values The overall matching cost; These are the weighting coefficients; The cost of Hamming distance based on Census transform; The normalized cross-correlation cost is used to enhance robustness to brightness inhomogeneity;

[0038] Subsequently, cross-adaptive support domain aggregation is used to smooth the matching cost, resulting in the aggregated cost volume. The formula is:

[0039] ;

[0040] in, To support domain Pixels in; For adaptive weights; For pixels In disparity candidate values The overall matching cost;

[0041] Based on the aggregated cost body, the disparity is calculated using the minimum cost criterion to obtain the discrete disparity result, as shown in the formula:

[0042] ;

[0043] in, This is the result of discrete disparity; The cost body after aggregation;

[0044] Finally, a disparity map is constructed based on the discrete disparity results. Post-processing operations are performed on the disparity map, including: first, removing isolated noise points from the disparity map through median filtering; then, performing left-right consistency detection on the median-filtered result; when the difference between the left and right matching disparities of a pixel is greater than the set disparity threshold, the pixel is marked as an invalid pixel to eliminate occluded areas and obvious mismatched points.

[0045] Preferably, the method further includes: based on the disparity map, performing sub-pixel-level refinement and optimization of the disparity result of each pixel using a local plane fitting method to generate a complete disparity map, specifically:

[0046] At a certain pixel point Within the neighborhood of the center, sub-pixel-level refinement is performed by fitting the local plane with the neighborhood disparity value, using the following formula:

[0047] ;

[0048] in, Represents the pixels in the neighborhood disparity value; , , These represent the parameters of the local plane, used to determine the tilt and offset of the local plane;

[0049] Then, the plane parameters are solved by least squares, and the value of the plane at the center position is taken as the sub-pixel disparity;

[0050] After sub-pixel refinement, a layered filling strategy is applied to invalid pixels. Specifically, for small holes with an area smaller than a set threshold, a fast filling method based on distance transform is used to fill them, obtaining the filling disparity of the pixels within the hole. The formula is:

[0051] ;

[0052] in, Pixels inside the hole Fill parallax; It is the effective pixel of the neighborhood. Parallax; For pixels arrive The distance; It is the set of valid pixels in the neighborhood;

[0053] For the remaining large holes, edge-preserving interpolation is performed using joint bilateral filtering guided by the left view to obtain the interpolated disparity of pixels within the large holes. The formula is as follows:

[0054] ;

[0055] in, Pixels inside large holes Interpolated parallax; For pixels arrive Spatial weights are used to measure the spatial distance between pixels; For pixels arrive The grayscale weight is used to measure the grayscale similarity of pixels in the left view;

[0056] based on and Generate a complete disparity map .

[0057] Preferably, S3 specifically comprises:

[0058] Based on the complete disparity map, a 3D point cloud is generated according to the back projection relationship of the pinhole imaging model, that is: firstly, the effective pixel is calculated. The depth value is calculated using the following formula:

[0059] ;

[0060] in, Effective pixels The depth value; B is the focal length; B is the baseline length. For a complete disparity map;

[0061] Next, based on the camera imaging geometry, the pixel coordinates are... Convert to 3D coordinates in camera coordinate system The formula is:

[0062] ;

[0063] in, , Principal point coordinates, i.e., the coordinates of the intersection of the camera's optical axis and the image plane;

[0064] Three-dimensional points are generated for pixels with disparity values ​​greater than 0 in the complete disparity map to obtain a binocular point cloud image containing spatial three-dimensional coordinates;

[0065] Extract color information corresponding to pixels from the left view and bind it to spatial coordinates to form a color point cloud dataset to ensure subsequent color fusion and visualization effects;

[0066] A confidence evaluation mechanism is introduced to calculate the confidence value of each pixel to filter out reliable pixels, thereby obtaining a stereo point cloud image containing confidence attributes; the specific process is as follows:

[0067] When the confidence value is lower than the set threshold, the pixel is deemed an unreliable match and is marked as a low-quality point during the point cloud image generation process, thus excluding the pixel. The confidence value of a pixel is determined by a combination of the left-right consistency flag and the uniqueness index of the matching cost, and the calculation formula is as follows:

[0068] ;

[0069] in, This represents the confidence level value. This is a left-right consistency indicator; 1 indicates that the pixel disparity of the matching left and right views is consistent, and 0 indicates inconsistency. The uniqueness index of matching cost is used to reflect the degree of difference between the optimal matching cost and the second-best matching cost of a pixel. The greater the difference, the stronger the uniqueness and the more reliable the matching. As weight;

[0070] This allows us to obtain a complete binocular point cloud image containing spatial three-dimensional coordinates, color information, and confidence attributes.

[0071] The complete binocular point cloud image is segmented to extract the point cloud subset corresponding to the material pile area, thus obtaining independent 3D point cloud data of the material pile, i.e., scaled point cloud. .

[0072] Preferably, the AtlasNet network architecture is an improved AtlasNet network architecture, including an encoder, a view fusion module, and a decoder;

[0073] The encoder uses two ResNet-18 modules with shared weights as the feature extraction backbone. Convolutional feature extraction is performed on the left and right view pairs respectively, and the final fully connected classification layer of the ResNet-18 is removed. After global average pooling, global feature vectors are obtained. and ;

[0074] The view fusion module employs a cross-attention mechanism to fuse the global feature vectors of the left and right view pairs. and The fusion process is as follows:

[0075] Global feature vector of the left view The global feature vector of the right view, used as the query vector. Using the key vector and value vector, cross-attention is calculated to obtain the enhanced features from the left view perspective;

[0076] by As a query vector Using the key and value as key vectors and value vectors, cross attention is calculated to obtain the enhanced features from the right view perspective;

[0077] The enhanced features from the left and right views are concatenated and then dimensionality-reduced using a fully connected layer to obtain a fused feature vector from the two views. ;

[0078] The decoder consists of multiple fully connected layer MLPs, each MLP fusing feature vectors. Mapping to a surface region in a 3D point cloud space, the formula is:

[0079] ;

[0080] in, Three-dimensional coordinates; This represents the confidence level value. For two-dimensional parametric points, This is the fusion feature vector of the two views;

[0081] When generating a dense 3D point cloud, N two-dimensional parameterized points are uniformly sampled within a unit square. For each two-dimensional parameterized point, each corresponding MLP generates a set of 3D points. All MLPs generate M×N 3D points, forming a dense 3D point cloud, i.e., a scale-free point cloud. Where M is the number of MLPs;

[0082] Confidence value of each two-dimensional parameterized point The output is estimated by MLP and constrained to the range [0,1].

[0083] Preferably, it also includes, during the training of the AtlasNet network architecture, a confidence value... The supervisory signal is divided into two parts:

[0084] For local regions, confidence-based supervision based on local reconstruction consistency is adopted, and an exponential function is used to map them to the target confidence level. The formula is:

[0085] ;

[0086] in, This is the adjustment coefficient; The Chamfer distance error is the distance between the point and its local neighborhood.

[0087] Low confidence levels are assigned to sparse regions or isolated points to reflect their poor reconstruction reliability.

[0088] Preferably, in step S5, a two-stage registration strategy of coarse registration and fine registration is adopted to uniformly align and restore the scale of the scale-free point cloud and the scaled point cloud, specifically as follows:

[0089] For the scaled point cloud With the scale-free point cloud Preprocessing is performed; wherein, the preprocessing includes voxel downsampling and removal of obvious outliers;

[0090] The coarse registration strategy is as follows: For the preprocessed... and Calculate a fast point feature histogram to characterize the local geometric features of the points and generate a high-dimensional feature descriptor; then, based on the high-dimensional feature descriptor, perform matching in the feature space to establish an initial correspondence between two point clouds;

[0091] Based on the initial correspondence between two point clouds, a random sampling consensus algorithm is used to robustly estimate the similarity transformation matrix and obtain the initial parameters. The random sampling consensus algorithm generates transformation hypotheses through multiple random samplings and obtains the initial parameters by maximizing the number of interior points. The initial parameters include an initial scale factor, an initial rotation matrix, and an initial translation vector.

[0092] The fine registration strategy is as follows: based on the initial parameters, an iterative similarity transformation method is used to refine the scale and pose on the basis of coarse registration, so as to... Convert to Point clouds at the same scale This refers to the point cloud after scale restoration; the formula for the similarity transformation method is:

[0093] ;

[0094] in, After scaling and pose transformation, and Points of the same scale; Scale factor; It is a rotation matrix; It is a translation vector;

[0095] During the training iteration, based on the current estimate , , Using the similarity transformation method to Transform into In point clouds and Establish nearest neighbor relationships between them, and filter out incorrect matches by using the nearest neighbor and distance threshold;

[0096] based on and To establish an effective correspondence between points, re-estimate the similarity transformation and update the parameters until the parameter changes converge. During the iteration process, prioritize point pairs with high confidence for initial iterations, then gradually relax the matching threshold to achieve... and The scale uniformity and pose alignment.

[0097] Preferably, S6 specifically includes:

[0098] First, all point cloud data are assigned to the corresponding grid cells according to their x and y axis coordinates;

[0099] For each grid cell, based on height Its corresponding confidence level Calculate the height-weighted sum and weight The formula is:

[0100] , ;

[0101] Where k represents the k-th grid cell; For network cell coordinates;

[0102] Then calculate the initial weighted average height. The formula is:

[0103] ;

[0104] When fusing point clouds, for point clouds that simultaneously have scale... Point cloud after scale restoration Within the grid cells, calculate the consistency difference of the weighted average height of the two. ;like If the data is less than a preset threshold, it is determined that the data is consistent, and highly weighted fusion is performed according to a preset source confidence level. The highly weighted fusion formula is as follows:

[0105] ;

[0106] in, This is the height value after fusion; , They are respectively Confidence level and height; , They are respectively Confidence level and height;

[0107] like If the value exceeds a preset threshold, then the point cloud is determined. There is a significant error; scaled point clouds are adopted. height To enhance the model's robustness to completion errors, the formula is as follows:

[0108] ;

[0109] For only exist or The data cells are filled directly using their height values, using the following formula:

[0110] ;

[0111] If there are missing units or data gaps after fusion, interpolation, two-dimensional morphological dilation, or deep learning models are used to fill them.

[0112] Based on the filled height map, a ground model is fitted using a random sampling consensus algorithm, with the following formula:

[0113] ;

[0114] in, For the ground model in the grid cells The height value at that location; , , These are the parameters of the ground model, used to describe the tilt and offset of the ground;

[0115] For each grid cell, calculate the difference between the material pile height and the ground height using the following formula:

[0116] ;

[0117] in, For grid cells The height difference of the material pile relative to the ground; For the merged heightmap in the grid cells The height of the location;

[0118] Integrating the height differences of all grid cells yields the total volume of the material pile, using the following formula:

[0119] ;

[0120] in, This refers to the total volume of the material pile. This represents the side length of a single grid cell.

[0121] The present invention also provides a material stockpile volume measuring device for construction scenarios, comprising:

[0122] The binocular image acquisition unit is used to acquire binocular image data of the construction site, including the material pile area, by using two identical cameras as a binocular camera system for single-target calibration and stereo calibration, and to perform epipolar correction to generate left and right view pairs.

[0123] The disparity map generation unit is used to estimate the disparity of the corrected binocular image data based on the parameters related to the binocular camera system from the left and right views, and to generate a disparity map.

[0124] A scaled point cloud unit is used to back-project and reconstruct the disparity map, extract the color information and confidence value corresponding to the pixels, generate a binocular point cloud image, and then segment the binocular point cloud image to extract the independent three-dimensional point cloud data of the material pile, i.e., the scaled point cloud.

[0125] The scale-free point cloud unit is used to input the binocular point cloud image into the AtlasNet network architecture, and generate a dense three-dimensional point cloud, i.e., a scale-free point cloud, after feature extraction, feature enhancement and fusion mapping.

[0126] The scale restoration unit is used to uniformly align and restore the scale of the scale-free point cloud and the scaled point cloud to obtain a scale-restored point cloud.

[0127] The volume calculation unit is used to allocate the scale-restored point cloud and the scaled point cloud to grid cells for fusion, calculate the fused height value, and calculate the material pile volume based on this.

[0128] The present invention also provides a material pile volume measurement device for construction scenarios, including a processor and a memory. The memory stores a computer program, which can be executed by the processor to realize the material pile volume measurement method for construction scenarios as described above.

[0129] The present invention also provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor of the device on which the computer-readable storage medium is located, implement the material pile volume measurement method in a construction scenario as described above.

[0130] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0131] This invention generates a complete 3D model with realistic physical scale by jointly registering and fusing binocular stereo vision point clouds with absolute scale but incomplete (i.e., scaled point clouds) with geometrically complete but scaleless deep learning point clouds (i.e., scaleless point clouds). This achieves geometric completion of occluded areas while maintaining the accuracy of volume calculation.

[0132] This invention requires only two fixed ordinary cameras as a binocular stereo vision system, eliminating the need for expensive LiDAR or drone equipment, significantly reducing equipment procurement and maintenance costs, while enabling rapid deployment and data acquisition, thus improving on-site measurement efficiency.

[0133] This invention employs a two-stage (coarse registration + fine registration) strategy, combined with confidence screening, which can effectively handle initial pose deviations and some noise points, achieving robust and fast convergence of point cloud alignment and fusion.

[0134] The 3D point cloud model generated by this invention can be directly used for volume calculation, color point cloud visualization, or triangular mesh reconstruction. It can also be integrated with BIM, project progress monitoring, or digital twin systems to achieve end-to-end automated measurement processes, reduce manual intervention, and improve the value for engineering application.

[0135] This invention is not only applicable to static material pile measurement, but can also be combined with dynamic scene monitoring to realize digital twins of material piles at construction sites and track volume changes, providing data support for real-time progress management and resource allocation. Attached Figure Description

[0136] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.

[0137] Figure 1 This is a schematic diagram of a method for measuring the volume of a material pile in a construction scenario, as provided in Example 1.

[0138] Figure 2 This is a schematic diagram of a material pile volume measuring device for a construction scenario, provided in Embodiment 2.

[0139] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Detailed Implementation

[0140] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0141] Example 1

[0142] Embodiment 1 of the present invention provides a method for measuring the volume of a material pile in a construction scenario, which can be implemented by a material pile volume measuring device in a construction scenario (hereinafter referred to as the measuring device), specifically, executed by one or more processors within the measuring device.

[0143] In this embodiment, the measuring device may be an electronic device equipped with a processor, which carries a computer program for measuring the volume of material piles in the construction scenario and the computer program can be executed, such as a computer, smartphone, smart tablet, workstation, etc., which are not limited here.

[0144] Existing technical solutions mainly include four forms: traditional manual measurement, multi-view LiDAR / UAV measurement, binocular stereo vision, and deep learning reconstruction.

[0145] (1) Traditional manual measurement relies on on-site personnel to use tools such as tape measures, measuring wheels or total stations to measure the base dimensions and heights of several sections of the material pile point by point, and calculate the volume based on geometric approximation models or integration methods. This method is mainly based on manual sampling, which is convenient for quick on-site recording, but the number of measurement points is limited and the operation is greatly affected by human factors, making it difficult to fully reflect the true shape and detailed structure of the material pile, resulting in low measurement efficiency.

[0146] (2) Multi-view LiDAR / UAV measurement: Using a ground or air platform carrying a lidar or camera, the material pile is scanned or photographed from multiple angles along a preset path to obtain high-density point cloud or multi-view images. After acquisition, a complete 3D model is generated through point cloud registration, filtering, and surface reconstruction and used for volume calculation. Although this method can obtain high-precision point cloud data, the equipment cost is high, the operating environment requirements are strict, and it is easily affected by factors such as obstruction, dust, and reflection at the construction site, which limits its real-time performance and universality.

[0147] (3) Binocular stereo vision uses two parallel cameras to simultaneously capture left and right views. Using disparity estimation and camera intrinsic and extrinsic parameters, pixels are back-projected into three-dimensional coordinates to generate a color point cloud with physical scale. This process includes camera calibration, disparity calculation, disparity refinement, and point cloud generation, and is suitable for camera-based on-site depth measurement. However, the 3D reconstruction results of this method are limited to the surface area visible to the camera; the geometry of occluded or invisible parts cannot be recovered, and the generated point cloud often has incompleteness.

[0148] (4) Deep learning reconstruction is based on deep learning models that extract features from one or more RGB images and infer the three-dimensional shape of the object. The image features are then mapped to a grid or dense point cloud by a decoder. This method can directly generate a complete three-dimensional representation from a regular photo, which is convenient for three-dimensional reconstruction under single-lens conditions. However, the results lack absolute scale information and are greatly affected by the distribution of training data. When used directly for volume calculation, the accuracy is insufficient and needs to be corrected by combining external scale or geometric constraints.

[0149] Traditional manual measurement suffers from low efficiency and sparse sampling; multi-view LiDAR / UAV measurement is costly and complex to deploy; binocular stereo vision point clouds only cover the visible surface incompletely; and deep learning-reconstructed point clouds lack absolute scale. These problems make it difficult for existing technologies to achieve efficient and accurate material stockpile volume measurement on construction sites.

[0150] Therefore, the present invention aims to generate a three-dimensional model that is both complete and has a real physical scale by jointly registering and fusing binocular stereo vision point clouds with absolute scale but incomplete and geometrically complete but scale-free deep learning point clouds, thereby achieving high-precision material pile volume calculation and solving the key problems existing in the prior art.

[0151] like Figure 1 As shown, a method for measuring the volume of a material pile in a construction scenario includes steps S1 to S6.

[0152] S1 uses two identical cameras as a binocular camera system to perform single-target calibration and stereo calibration to acquire binocular image data of the construction site, including the material pile area, and performs epipolar correction to generate left and right view pairs.

[0153] In the specific implementation process, the first step is to set up a binocular camera system and complete the calibration. The binocular camera system consists of two cameras of the same model. During installation, it is necessary to ensure that their optical axes are basically parallel and the horizontal baseline is fixed, while ensuring that the overlapping area of ​​the field of view covers the entire material pile area.

[0154] To obtain accurate geometric relationships, a checkerboard calibration board was used to perform single-target and stereo calibration of the binocular camera system. Single-target calibration was used to obtain the intrinsic parameter matrix K and distortion coefficients of each camera, and to establish the mapping relationship between pixel coordinates and the camera coordinate system. The mathematical model is as follows:

[0155] ;

[0156] in, These are the pixel coordinates; These are the coordinates of a 3D point in the camera coordinate system. Focal length is measured in pixels; These are the principal point coordinates, i.e., the coordinates of the intersection point of the camera's optical axis and the image plane; K is the intrinsic parameter matrix. This is the Z-axis coordinate in the camera coordinate system, i.e., the depth value.

[0157] The lens distortion model corrects coordinate deviations using radial and tangential distortion coefficients to improve imaging accuracy. The correction formula is as follows:

[0158] ;

[0159] ;

[0160] in, The coordinates are after correction; These are the coordinates of the distorted pixels; The distortion coefficient; This represents the radial distance from the pixel to the optical center. .

[0161] Stereo calibration is used to calculate the rotation matrix R and translation vector t between the two cameras, representing the transformation of the coordinate system between the two cameras, and to determine the extrinsic parameters of the stereo system. The formula is as follows:

[0162] ;

[0163] in, , These are the coordinates of the same point in the left and right camera coordinate systems; For rotation matrix, It is a translation vector.

[0164] Moreover, any set of corresponding points between the two cameras , The following relationship must be satisfied:

[0165] ;

[0166] ;

[0167] in, Let T be the essential matrix, and T be the transpose symbol.

[0168] These parameters together form the basis of epipolar geometry, providing the necessary mathematical support for subsequent parallax calculations.

[0169] After calibration, the translation vector is used. The baseline length of the binocular camera system was calculated. The formula for calculating depth is:

[0170] ;

[0171] Then, epipolar correction is performed on the images from the two cameras to make corresponding pixels lie in the same row, resulting in a left and right view pair. This can be saved as time-corresponding image frames, which facilitates subsequent disparity estimation and point cloud generation.

[0172] S2, based on the left and right view pairs and the parameters related to the binocular camera system, uses a cross-cost aggregation algorithm to estimate the disparity of the corrected binocular image data and generate a disparity map.

[0173] In this embodiment, the improved CBCA (Cross-Based Cost Aggregation) algorithm is used as the cross-cost aggregation algorithm. By constructing a cross-shaped adaptive support domain, the matching cost is smoothed while preserving edge details, thus solving the problems of edge blurring and region leakage caused by traditional fixed window aggregation.

[0174] Specifically, firstly, the matching cost is calculated on a local window. A matching cost function is constructed for multiple disparity candidate values ​​of each pixel in the epipolar-corrected binocular image, with the following formula:

[0175] ;

[0176] in, For pixels In disparity candidate values The overall matching cost; These are the weighting coefficients; The cost of Hamming distance based on Census transform; The normalized cross-correlation cost is used to enhance robustness to brightness inhomogeneities.

[0177] Subsequently, cross-adaptive support domain aggregation is used to smooth the matching cost, resulting in the aggregated cost volume. The formula is:

[0178] ;

[0179] in, To support domain Pixels in; For adaptive weights; For pixels In disparity candidate values The overall matching cost.

[0180] This aggregation method uses pixel grayscale similarity and edge gradient as constraints to establish a cross-shaped support domain. The cost is weighted and averaged within this support domain, which can effectively avoid the edge blurring and region leakage problems caused by traditional fixed window aggregation.

[0181] Based on the aggregated cost body, the disparity is calculated using the minimum cost criterion to obtain the discrete disparity result, as shown in the formula:

[0182] ;

[0183] in, This is the result of discrete disparity; The cost body after aggregation;

[0184] Finally, after the disparity calculation is completed, a disparity map is constructed based on the discrete disparity results. Post-processing operations are then performed on the disparity map, including:

[0185] First, isolated noise points are removed from the disparity map by median filtering (such as median filtering in a 5×5 window). Then, left-right consistency detection is performed on the median-filtered result. When the difference between the left and right matching disparities of a pixel is greater than the set disparity threshold (such as 1 pixel), the pixel is marked as an invalid pixel to eliminate occluded areas and obvious mismatched points.

[0186] In a preferred embodiment, to further improve depth accuracy, the method further includes: based on the disparity map, using a local plane fitting method to perform sub-pixel-level refinement and optimization of the disparity result of each pixel to generate a complete disparity map, specifically:

[0187] At a certain pixel point Within the neighborhood of the center, sub-pixel-level refinement is performed by fitting the local plane with the neighborhood disparity value, using the following formula:

[0188] ;

[0189] in, Represents the pixels in the neighborhood disparity value; , , These represent the parameters of the local plane, used to determine the tilt and offset of the local plane;

[0190] Then, the plane parameters are solved by least squares, and the value of the plane at the center position is taken as the sub-pixel disparity;

[0191] After subpixel retouching, a layered filling strategy is applied to the remaining invalid pixels. Specifically, for small holes with an area smaller than a set threshold (e.g., 20 pixels), a fast filling method based on distance transform is used to fill them, obtaining the filling disparity of the pixels within the hole. The formula is:

[0192] ;

[0193] in, Pixels inside the hole Fill parallax; It is the effective pixel of the neighborhood. Parallax; For pixels arrive The distance; It is the set of valid pixels in the neighborhood;

[0194] For the remaining large holes, edge-preserving interpolation is performed using joint bilateral filtering guided by the left view to obtain the interpolated disparity of pixels within the large holes. The formula is as follows:

[0195] ;

[0196] in, Pixels inside large holes Interpolated parallax; For pixels arrive Spatial weights are used to measure the spatial distance between pixels; For pixels arrive The grayscale weight is used to measure the grayscale similarity of pixels in the left view;

[0197] Based on optimized disparity results and Generate a complete disparity map .

[0198] S3, perform back projection reconstruction on the disparity map, extract the color information and confidence value corresponding to the pixels, generate a binocular point cloud image, and then segment the binocular point cloud image to extract the independent three-dimensional point cloud data of the material pile, i.e., the scaled point cloud.

[0199] Specifically, based on the complete disparity map, a three-dimensional point cloud is generated according to the back projection relationship of the pinhole imaging model, that is: firstly, the effective pixel is calculated. The depth value is calculated using the following formula:

[0200] ;

[0201] in, Effective pixels The depth value; B is the focal length; B is the baseline length. This is the complete disparity map.

[0202] The pinhole imaging model is a mathematical model that converts parallax information into depth data with real physical meaning. It can be implemented using the principle of triangulation. Its purpose is to ensure the scale accuracy of point clouds and avoid depth distortion caused by parallax errors.

[0203] Next, based on the camera imaging geometry, the pixel coordinates are... Convert to 3D coordinates in camera coordinate system The formula is:

[0204] ;

[0205] in, , Principal point coordinates, i.e., the coordinates of the intersection of the camera's optical axis and the image plane;

[0206] Three-dimensional points are generated for pixels with disparity values ​​greater than 0 in the complete disparity map to obtain a binocular point cloud image containing spatial three-dimensional coordinates.

[0207] To ensure subsequent color fusion and visualization effects, color information (R, G, B) corresponding to pixels is extracted from the left view and bound to spatial coordinates to form a color point cloud dataset (X, Y, Z, R, G, B), thus ensuring subsequent color fusion and visualization effects.

[0208] Furthermore, to improve the robustness and selectability of point cloud generation, this embodiment introduces a confidence evaluation mechanism to calculate the confidence value of each pixel to filter out reliable pixels and obtain a stereo point cloud image containing confidence attributes; the specific process is as follows:

[0209] When the confidence value is lower than a set threshold (e.g., 0.15), the pixel is deemed an unreliable match and is marked as a low-quality point during the point cloud image generation process, thus excluding or marking the pixel as a low-quality point. The confidence value of a pixel is determined by a combination of the left-right consistency flag and the uniqueness index of the matching cost, calculated as follows:

[0210] ;

[0211] in, This represents the confidence level value. This is a left-right consistency indicator; 1 indicates that the pixel disparity of the matching left and right views is consistent, and 0 indicates inconsistency. The uniqueness index of matching cost is used to reflect the degree of difference between the optimal matching cost and the second-best matching cost of a pixel. The greater the difference, the stronger the uniqueness and the more reliable the matching. As weight.

[0212] By following the steps above, a complete binocular point cloud image containing spatial three-dimensional coordinates, color information, and confidence attributes can be obtained.

[0213] The complete binocular point cloud image is segmented to extract the point cloud subset corresponding to the material pile area, thus obtaining independent 3D point cloud data of the material pile, i.e., scaled point cloud. Point clouds with scale It is generated by three-dimensional reconstruction of the visible surface of the material pile, which has absolute scale but is incomplete.

[0214] S4. The binocular point cloud image is input into the AtlasNet network architecture. After feature extraction, feature enhancement and fusion mapping, a dense three-dimensional point cloud is generated, i.e., a scale-free point cloud.

[0215] The AtlasNet network architecture used in this embodiment is an improved AtlasNet network architecture, which includes an encoder, a view fusion module, and a decoder.

[0216] The encoder uses two ResNet-18 networks with shared weights as the feature extraction backbone. Convolutional feature extraction is performed on the left and right view pairs respectively, and the final fully connected classification layer of the ResNet-18 is removed. After global average pooling, global feature vectors are obtained. and ;

[0217] The view fusion module employs a cross-attention mechanism to fuse the global feature vectors of the left and right view pairs. and The fusion process is as follows:

[0218] Global feature vector of the left view The global feature vector of the right view, used as the query vector. Using the key vector and value vector, cross-attention is calculated to obtain the enhanced features from the left view perspective;

[0219] by As a query vector Using the key and value as key vectors and value vectors, cross attention is calculated to obtain the enhanced features from the right view perspective;

[0220] The enhanced features from the left and right views are concatenated and then dimensionality-reduced using a fully connected layer to obtain a fused feature vector from the two views. ;

[0221] The decoder consists of multiple fully connected MLP (Multilayer Perceptron) layers, each MLP fusing feature vectors. Mapping to a surface region in a 3D point cloud space, the formula is:

[0222] ;

[0223] in, Three-dimensional coordinates; This represents the confidence level value. For two-dimensional parametric points, This is the fusion feature vector of the two views;

[0224] When generating a dense 3D point cloud, N two-dimensional parameterized points are uniformly sampled within a unit square. For each two-dimensional parameterized point, each corresponding MLP generates a set of 3D points. All MLPs generate M×N 3D points, forming a dense 3D point cloud, i.e., a scale-free point cloud. Where M is the number of MLPs;

[0225] Confidence value of each two-dimensional parameterized point The output is estimated by MLP and constrained to the range [0,1].

[0226] The training process for the AtlasNet network architecture includes, firstly, pre-training the AtlasNet using a publicly available 3D model dataset (such as ShapeNetCore) to provide initial geometric feature representations. Subsequently, RGB images of a construction site material pile scene and corresponding ground truth laser-scanned point cloud images are acquired. The training, validation, and test sets are divided at 80% / 10% / 10% to ensure the stability of model training and the reliability of evaluation. Furthermore, to enhance the model's robustness to different lighting conditions, viewing angles, and material pile shapes, diverse training samples can be generated through data augmentation techniques.

[0227] A dense point cloud is generated through three parts: an encoder, a view fusion module, and a decoder. In the confidence estimation part, the confidence value... The supervisory signal is divided into two parts:

[0228] For local regions, confidence-based supervision based on local reconstruction consistency is adopted, and an exponential function is used to map them to the target confidence level. The formula is:

[0229] ;

[0230] in, This is the adjustment coefficient; The Chamfer distance error is the distance between the point and its local neighborhood.

[0231] Low confidence levels are assigned to sparse regions or isolated points to reflect their poor reconstruction reliability.

[0232] Through the above steps, this embodiment can realize the conversion from a dual-view RGB image to a 3D point cloud. The point cloud is reconstructed, along with the depth confidence score for each point. It is a nearly complete 3D electric fish model that can effectively infer and complete the geometry of the occluded parts, but it has no absolute scale.

[0233] S5, perform unified alignment and scale restoration between the scaleless point cloud and the scaled point cloud to obtain the scale-restored point cloud.

[0234] To achieve unified alignment and scale recovery between scale-free and scaled point clouds, a two-stage registration strategy of coarse and fine registration is adopted, specifically as follows:

[0235] First, regarding the scaled point cloud... With the scale-free point cloud Preprocessing is performed; wherein, the preprocessing includes voxel downsampling and removal of obvious outliers.

[0236] Voxel downsampling refers to dividing the point cloud data into a grid according to a set voxel size based on the spatial distribution characteristics of the point cloud, and retaining a representative point within each voxel, thereby reducing data redundancy. Its purpose is to reduce subsequent computational complexity and avoid wasting computational resources due to excessively high data density. In practical applications, uniform sampling, random sampling, or density-based sampling methods can be used to achieve this. Removing obvious outliers involves identifying and removing isolated points far from the main body of the point cloud through statistical analysis or neighborhood search methods. Its purpose is to improve the purity of the input data and lay a reliable foundation for subsequent feature extraction. In practical applications, distance threshold-based filtering methods or local density-based anomaly detection methods can be used to achieve this.

[0237] To address the matching difficulties caused by significant differences in initial scale and pose between two point clouds, this embodiment employs a coarse registration strategy based on local features and robust estimation. The coarse registration strategy involves: [The text abruptly ends here, likely due to an incomplete sentence or missing information.] and Calculate the Fast Point Feature Histogram (FPFH) to characterize the local geometric features of points and generate high-dimensional feature descriptors; then, based on the high-dimensional feature descriptors, perform matching in the feature space to establish an initial correspondence between two point clouds.

[0238] In this embodiment, the fast point feature histogram is a tool for describing the local geometric features of a point cloud. It generates high-dimensional feature descriptors by analyzing the surface curvature information of the point cloud, which can accurately capture geometric details.

[0239] Based on the initial correspondence between two point clouds, the similarity transformation matrix is ​​robustly estimated using the Random Sample Consensus Algorithm (RANSAC) to obtain initial parameters. The RANSAC algorithm generates transformation hypotheses through multiple random samplings and obtains initial parameters based on maximizing the number of interior points. The initial parameters include an initial scale factor, an initial rotation matrix, and an initial translation vector.

[0240] After obtaining the initial parameters, the process proceeds to a fine registration stage to further refine the scale and pose. The fine registration strategy is as follows: based on the initial parameters, an iterative similarity transformation method is used to refine the scale and pose on the basis of coarse registration, so as to... Convert to Point clouds at the same scale This refers to the point cloud after scale restoration; the formula for the similarity transformation method is:

[0241] ;

[0242] in, After scaling and pose transformation, and Points of the same scale; Scale factor; It is a rotation matrix; It is a translation vector.

[0243] During the training iteration, based on the current estimate , , Using the similarity transformation method to Transform into In point clouds and Establish nearest neighbor relationships between them, and filter out incorrect matches by using the nearest neighbor and distance threshold;

[0244] based on and To establish effective correspondences between points, re-estimate the similarity transformation and update the parameters until the parameter changes converge. To improve stability, the initial iterations can prioritize point pairs with high confidence, followed by gradually relaxing the matching threshold. and The scale uniformity and pose alignment.

[0245] This step restores the scale and rigid transformation based on coarse registration, thereby transforming the scale-free point cloud. Convert to Point clouds at the same scale .

[0246] S6. The scale-restored point cloud and the scaled point cloud are assigned to grid cells for fusion, the fused height value is calculated, and the material pile volume is calculated based on this.

[0247] After completing scale restoration and registration, this embodiment uses an adaptive raster fusion algorithm to convert the scaled point cloud, which originates from binocular stereo vision and has absolute scale but only covers the visible surface, into a single point cloud. Compared to the scale-restored, deep learning-based reconstructed complete point cloud The integration aims to generate a unified 3D model that combines geometric integrity with true-scale accuracy, and to perform accurate volume calculations based on this model.

[0248] The process begins with the regular discretization of the horizontal space. A two-dimensional grid coordinate system is constructed with a specified ground sampling distance GL as the resolution. Specifically, firstly, all point cloud data are assigned to corresponding grid cells according to their x and y axis coordinates. A grid cell refers to a regular two-dimensional grid region that divides the point cloud data according to its spatial location; this can be achieved using uniform grid partitioning or adaptive grid partitioning.

[0249] For each grid cell, based on height Its corresponding confidence level Calculate the height-weighted sum and weight The formula is:

[0250] , ;

[0251] Where k represents the k-th grid cell;

[0252] Then calculate the initial weighted average height. The formula is:

[0253] ;

[0254] When fusing point clouds, the following three aspects should be considered:

[0255] (1) For point clouds with both scale and size Point cloud after scale restoration Within the grid cells, calculate the consistency difference of the weighted average height of the two. ;like If the data is less than a preset threshold, it is determined that the data is consistent, and highly weighted fusion is performed according to a preset source confidence level. The highly weighted fusion formula is as follows:

[0256] ;

[0257] in, This is the height value after fusion; , They are respectively Confidence level and height; , They are respectively Confidence level and height;

[0258] (2) If If the value exceeds a preset threshold, then the point cloud is determined. There is a significant error; scaled point clouds are adopted. height To enhance the model's robustness to completion errors, the formula is as follows:

[0259] ;

[0260] (3) For only existing or The data cells are filled directly using their height values, using the following formula:

[0261] ;

[0262] If missing units or data gaps exist after fusion, another preferred embodiment employs a progressive filling strategy from local to global to fill them.

[0263] First, for missing grid cells, a refined interpolation calculation based on the inverse of spatial distance and neighbor cell confidence is performed within the nearest valid data window (such as a 3×3 or 5×5 neighborhood). Neighbor cells that are closer and have higher confidence are given greater weight in the interpolation process, so as to maintain the coherence and reliability of the local terrain as much as possible while filling the gaps.

[0264] If the effective data in the neighborhood is too sparse, causing the interpolation to fail, a two-dimensional morphological dilation operation is used instead. This operation extends the height information of the neighboring effective region along the direction of the structuring element to fill the small-to-medium scale gaps with good continuity, thus effectively supplementing the preliminary interpolation results.

[0265] For isolated or large-scale voids that cannot be filled after the above local and regional level filling, the corresponding location height value predicted by the deep learning model is directly called to fill the void, thereby ensuring the spatial continuity and integrity of the final generated elevation model.

[0266] Based on the filled height map, a ground model is fitted using the Random Sample Consensus (RANSAC) algorithm, with the following formula:

[0267] ;

[0268] in, For the ground model in the grid cells The height value at that location; , , These are the parameters of the ground model, used to describe the tilt and offset of the ground;

[0269] For each grid cell, calculate the difference between the material pile height and the ground height using the following formula:

[0270] ;

[0271] in, For grid cells The height difference of the material pile relative to the ground; For the merged heightmap in the grid cells The height of the location;

[0272] Integrating the height differences of all grid cells yields the total volume of the material pile, using the following formula:

[0273] ;

[0274] in, This refers to the total volume of the material pile. This represents the side length of a single grid cell.

[0275] Through the above-mentioned rasterization fusion, this embodiment retains the true scale information of binocular observation in the visible area, and uses deep learning to complete the geometry in the invisible or missing areas, thereby obtaining a complete and highly accurate material pile point cloud model and calculating its volume.

[0276] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0277] This invention generates a complete 3D model with realistic physical scale by jointly registering and fusing binocular stereo vision point clouds with absolute scale but incomplete (i.e., scaled point clouds) with geometrically complete but scaleless deep learning point clouds (i.e., scaleless point clouds). This achieves geometric completion of occluded areas while maintaining the accuracy of volume calculation.

[0278] This invention requires only two fixed ordinary cameras as a binocular stereo vision system, eliminating the need for expensive LiDAR or drone equipment, significantly reducing equipment procurement and maintenance costs, while enabling rapid deployment and data acquisition, thus improving on-site measurement efficiency.

[0279] This invention employs a two-stage (coarse registration + fine registration) strategy, combined with confidence screening, which can effectively handle initial pose deviations and some noise points, achieving robust and fast convergence of point cloud alignment and fusion.

[0280] The 3D point cloud model generated by this invention can be directly used for volume calculation, color point cloud visualization, or triangular mesh reconstruction. It can also be integrated with BIM, project progress monitoring, or digital twin systems to achieve end-to-end automated measurement processes, reduce manual intervention, and improve the value for engineering application.

[0281] This invention is not only applicable to static material pile measurement, but can also be combined with dynamic scene monitoring to realize digital twins of material piles at construction sites and track volume changes, providing data support for real-time progress management and resource allocation.

[0282] Example 2

[0283] like Figure 2 As shown, the second embodiment of the present invention also provides a material pile volume measuring device for construction scenarios, comprising:

[0284] The binocular image acquisition unit is used to acquire binocular image data of the construction site, including the material pile area, by using two identical cameras as a binocular camera system for single-target calibration and stereo calibration, and to perform epipolar correction to generate left and right view pairs.

[0285] The disparity map generation unit is used to estimate the disparity of the corrected binocular image data based on the parameters related to the binocular camera system from the left and right views, and to generate a disparity map.

[0286] A scaled point cloud unit is used to back-project and reconstruct the disparity map, extract the color information and confidence value corresponding to the pixels, generate a binocular point cloud image, and then segment the binocular point cloud image to extract the independent three-dimensional point cloud data of the material pile, i.e., the scaled point cloud.

[0287] The scale-free point cloud unit is used to input the binocular point cloud image into the AtlasNet network architecture, and generate a dense three-dimensional point cloud, i.e., a scale-free point cloud, after feature extraction, feature enhancement and fusion mapping.

[0288] The scale restoration unit is used to uniformly align and restore the scale of the scale-free point cloud and the scaled point cloud to obtain a scale-restored point cloud.

[0289] The volume calculation unit is used to allocate the scale-restored point cloud and the scaled point cloud to grid cells for fusion, calculate the fused height value, and calculate the material pile volume based on this.

[0290] Example 3

[0291] The third embodiment of the present invention also provides a material pile volume measurement device for construction scenarios, which includes a memory and a processor. The memory stores a computer program, which can be executed by the processor to realize the material pile volume measurement method for construction scenarios as described above.

[0292] Example 4

[0293] The fourth embodiment of the present invention also provides a computer-readable storage medium storing computer-readable instructions. When the computer-readable instructions are executed by the processor of the device where the computer-readable storage medium is located, the method for measuring the volume of material piles in the construction scenario as described above is implemented.

[0294] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method of measuring the volume of a material pile in a construction site, characterized by, Comprise: S1, using two cameras of the same model as a binocular camera system to perform single target calibration and stereo calibration to obtain binocular image data of the material pile area in the construction site, and perform epipolar rectification to generate left and right view pairs; S2, based on the left and right view pairs and the related parameters of the binocular camera system, using a cross cost aggregation algorithm to estimate the disparity of the rectified binocular image data and generate a disparity map; S3, performing back projection reconstruction on the disparity map and extracting the color information and confidence value corresponding to the pixel to generate a binocular point cloud image, and then performing segmentation on the binocular point cloud image to extract independent three-dimensional point cloud data of the material pile, i.e. a scaled point cloud; S4, inputting the binocular point cloud image into the AtlasNet network architecture, performing feature extraction, feature enhancement and fusion mapping to generate a dense three-dimensional point cloud, i.e. an unscaled point cloud; S5, aligning and scaling the unscaled point cloud and the scaled point cloud to obtain a scaled point cloud after scale restoration; S6, distributing the scaled point cloud after scale restoration and the scaled point cloud to the grid cells for fusion, calculating the height value after fusion, and calculating the volume of the material pile based on the height value; Wherein, the S6 is specifically: First, all point cloud data is distributed to the corresponding grid cells according to its x and y coordinates; For each grid cell, based on the height the confidence of its correspondence , the height-weighted sum and the weight are calculated, with the formula: , ; wherein k represents the kth grid cell; is the network element coordinate; The initial weighted average height is then calculated with the formula: ; When fusing point clouds, for point clouds that simultaneously have scale... Point cloud after scale restoration Within the grid cells, calculate the consistency difference of the weighted average height of the two. ;like If the data is less than a preset threshold, it is determined that the data is consistent, and highly weighted fusion is performed according to a preset source confidence level. The highly weighted fusion formula is as follows: ; wherein, is the fused height value; , are respectively the confidence and height of , are respectively the confidence and height of If greater than a preset threshold, it is determined that the point cloud There is a large error, and the scale point cloud The height is adopted to enhance the robustness of the model to the completion error, and the formula is as follows: ; For the unit of data that only exists or The height value is directly filled in the formula: ; If there are missing cells or data holes after fusion, interpolation or two-dimensional morphological dilation operation or calling a deep learning model is used for filling; Based on the filled height map, a ground model is fitted by a random sample consensus algorithm, and the formula is: ; wherein, is a height value of the ground model at the grid cell ; , , are parameters of the ground model, respectively, for describing a tilt and a shift of the ground. For each grid cell, calculate the difference between the material pile height and the ground height, and the formula is: ; wherein, is the height of the grid cell is the height difference of the material pile at the grid cell is the height of the fused height map at the grid cell is the height of the fused height map at the grid cell Integrate the height difference of all grid cells to obtain the total volume of the material pile, and the formula is: ; wherein is the total volume of the material pile; is the edge length of a single grid cell.

2. The method of claim 1, wherein The S1 is specifically: A checkerboard calibration plate is used to calibrate the two cameras for single target calibration and stereo calibration; Wherein, the single target calibration is used to obtain the intrinsic matrix and distortion coefficient of each camera, and to establish the mapping relationship between the pixel coordinates and the camera coordinate system, and the mathematical model is: ; wherein, is a pixel point coordinate; is a three-dimensional point coordinate in the camera coordinate system; is a focal length in pixels; is a principal point coordinate, i.e. the intersection point coordinate of the camera optical axis and the image plane; K is an intrinsic matrix; is the Z-axis coordinate in the camera coordinate system, i.e. the depth value; And the pixel coordinates are corrected by the distortion model of the lens, and the correction formula is: ; ; wherein, is the corrected back coordinate; is the distorted pixel coordinate; is the distortion coefficient; denotes the radial distance of a pixel point to the optical center, ; The stereo calibration is used to calculate the rotation matrix R and the translation vector t between the two cameras, which represents the transformation of the coordinate system between the two cameras, and determines the extrinsic parameters of the binocular camera system, and the formula is: ; wherein, , are coordinates of the same spatial point in the left and right camera coordinate systems, respectively; is a rotation matrix, is a translation vector; and any corresponding point of the two cameras , satisfies the following relation: ; ; wherein is the essential matrix and T is the transpose symbol; After stereo calibration is completed, the baseline length of the binocular camera system is calculated by the translation vector The baseline length of the binocular camera system is calculated for calculating the depth, the formula is: ; Then, the epipolar rectification is performed on the images of the two cameras to make the corresponding pixels located in the same row, and the left and right view pairs are obtained.

3. The method of claim 2, wherein The S2 is specifically: First, calculate the matching cost on the local window, construct a matching cost function for multiple disparity candidate values of each pixel in the epipolar rectified binocular image, and the formula is: ; wherein, is a pixel point the overall matching cost under the disparity candidate value ; is a weight coefficient; is a Hamming distance cost based on Census transform; is a normalized cross-correlation cost for enhancing robustness to brightness unevenness; Then, the matching cost is smoothed by cross-adaptive support domain aggregation, and the aggregated cost volume is obtained The formula is: ; wherein, to support a domain of pixel points; adaptive weights; of pixel points under disparity candidate values of the pixel points; According to the aggregated cost volume, the disparity is calculated based on the minimum cost criterion to obtain discrete disparity results, and the formula is: ; wherein, is a discrete disparity result; is an aggregated cost volume; Finally, based on the discrete disparity results, a disparity map is constructed, and post-processing operations are performed on the disparity map, including: first, remove isolated noise points in the disparity map through median filtering, then perform left and right consistency detection on the result after median filtering; when the difference between the left and right matching disparities of a pixel point is greater than a set disparity threshold, the pixel is marked as invalid to remove the occluded area and obvious mismatch points.

4. The method of claim 3, wherein Further comprising: based on the disparity map, using a local plane fitting method to sub-pixel level refinement optimization of each pixel disparity result, generate complete disparity map, specifically: In the neighborhood centered on a certain pixel point The neighborhood disparity value is used to fit the local plane for sub-pixel level refinement, and the formula is: ; wherein, denotes the disparity value of a pixel point in the neighborhood; denote parameters of the local plane, respectively, for determining the tilt and offset of the local plane;​​​ Then solve the plane parameters by least square, and take the value of the plane in the center position as the sub-pixel disparity; After sub-pixel refinement, a layered filling strategy is used for invalid pixels, that is, first, for small holes with an area less than a certain threshold, a fast filling method based on distance transformation is used to fill the holes, and the filling disparity of the pixels in the holes is obtained, the formula is: ; wherein, is the hole filling disparity for the hole inside pixel ; is the disparity of the neighboring valid pixel ; is the distance from the pixel to ; is the set of neighboring valid pixels; For the remaining large holes, edge-preserving interpolation is performed using joint bilateral filtering guided by the left view to obtain the interpolation disparity of the pixels in the large holes, the formula is: ; wherein, is the interpolated disparity of the pixel in the large hole; is the spatial weight of the pixel to for measuring the spatial distance between pixels; is the gray weight of the pixel to for measuring the gray similarity of the pixel in the left view; Based on and , a complete disparity map is generated.

5. The method of claim 4, wherein The S3 specifically is: Based on the complete parallax map, a three-dimensional point cloud is generated according to a back projection relationship of a pinhole imaging model, that is, first, the depth value of each effective pixel is calculated, and the calculation formula is as follows: d = f * h / (x - x0) ; wherein, is a depth value of an effective pixel ; is a focal length; B is a baseline length; is a complete disparity map; Then, according to the camera imaging geometry, the pixel coordinates are converted into three-dimensional coordinates in the camera coordinate system , with the formula: ; wherein , is the principal point coordinate, i.e. the intersection of the camera optical axis with the image plane coordinate; Generate three-dimensional points for pixels with a disparity value greater than 0 in the complete disparity map to obtain a binocular point cloud image containing spatial three-dimensional coordinates; Extract the color information corresponding to the pixels from the left view and bind it with the spatial coordinates to form a color point cloud dataset to ensure the subsequent color fusion and visualization effect; Introduce a confidence evaluation mechanism to calculate the confidence value of each pixel to filter out reliable pixels and obtain a binocular point cloud image containing confidence attributes; The specific process is as follows: When the confidence value is lower than a certain threshold, it is determined that the pixel matching is unreliable, and the pixel is marked as a low-quality point in the point cloud image generation process; The confidence value of the pixel is determined by the left-right consistency identifier and the matching cost uniqueness indicator, and the calculation formula is as follows: ; wherein, is a confidence value; is a left-right consistency flag, 1 indicating that the pixel disparity of the left and right views matches the consistency, and 0 indicating inconsistency; is a matching cost uniqueness index, used to reflect the difference between the optimal matching cost and the suboptimal matching cost of a pixel, the greater the difference, the stronger the uniqueness, and the more reliable the matching; is a weight; Thus, a complete binocular point cloud image containing spatial three-dimensional coordinates, color information and confidence attributes is obtained; The complete binocular point cloud image is segmented to extract a point cloud subset corresponding to the material pile region, and independent three-dimensional point cloud data of the material pile, i.e., a point cloud with a scale, is obtained .

6. The method of claim 5, wherein The AtlasNet network architecture is an improved AtlasNet network architecture, including an encoder, a view fusion module and a decoder. Among them, the encoder adopts ResNet-18 with two shared weights as the feature extraction backbone, respectively extracts convolutional features for left and right view pairs, removes the last fully connected classification layer part of ResNet-18, and respectively obtains global feature vectors after global average pooling With ; The view fusion module adopts a cross-attention mechanism to fuse global feature vectors of left and right view pairs with , the fusion process is: global feature vector of the left view global feature vector of the right view as the query vector compute cross attention as the key vector and the value vector to obtain the enhanced feature under the left view perspective With As the query vector, As the key vector and the value vector, cross attention is calculated to obtain enhanced features under the right view perspective. The enhanced features under left and right view perspectives are spliced, dimension reduction is performed through a full connection layer, and a fusion feature vector of the double views is obtained ; The decoder consists of multiple fully connected layers MLPs, each MLP maps the fused feature vector to a surface region in the three-dimensional point cloud space, formulated as: ; wherein, is a three-dimensional coordinate; is a confidence value; is a two-dimensional parametric point, is a fused feature vector of dual views; In generating the dense three-dimensional point cloud, N two-dimensional parameterized points are uniformly sampled in a unit square, for each two-dimensional parameterized point, a set of three-dimensional points is generated by each MLP corresponding to the two-dimensional parameterized point, all the MLPs generate MxN three-dimensional points to form the dense three-dimensional point cloud, i.e., the scale-free point cloud ; wherein M is the number of MLPs; a confidence value for each two-dimensional parameterized point estimated by the MLP and constrained to the range [0, 1].

7. The method of claim 6, wherein , further comprising, while training the AtlasNet network architecture, a confidence value The supervisory signal is split into two parts: For local regions, confidence supervision based on local reconstruction consistency is adopted, and an exponential function is used to map it to the target confidence , the formula is: ; wherein, is a tuning coefficient; is the Chamfer distance error of the point within the local neighborhood. For sparse areas or isolated points, a lower confidence is assigned to reflect their poor reconstruction reliability.

8. The method of claim 6, wherein In the S5, a two-stage registration strategy of coarse registration and fine registration is adopted to align and restore the scale of the scaleless point cloud and the scaled point cloud, specifically: the scaled point cloud the un-scaled point cloud pre-processing; wherein the pre-processing comprises voxel down-sampling, outlier removal The coarse registration strategy is: for the pretreated With A fast point feature histogram is calculated to represent the local geometric features of the points and generate a high-dimensional feature descriptor; then, based on the high-dimensional feature descriptor, matching is performed in the feature space to establish an initial correspondence relationship between the two point clouds; Based on the initial correspondence between the two point clouds, a random sample consensus algorithm is used to robustly estimate the similarity transformation matrix to obtain the initial parameters; The random sample consensus algorithm generates transformation hypotheses through multiple random sampling, and obtains the initial parameters according to the criterion of maximum number of inliers; The initial parameters include an initial scale factor, an initial rotation matrix and an initial translation vector; The fine registration strategy is as follows: based on the initial parameters, an iterative similarity transformation method is used to refine the scale and pose on the basis of coarse registration, so as to... Convert to Point clouds at the same scale This refers to the point cloud after scale restoration; the formula for the similarity transformation method is: ; wherein, is the point after the scale and pose transformation, and is the point of the same scale; is the scale factor; is the rotation matrix; is the translation vector; In the training iteration process, based on the current estimated , , , the similarity transformation method is used to transform into ; the nearest neighbor correspondence relationship is established between the point cloud and , and the error matching is removed through mutual nearest neighbor and distance threshold filtering; based on and To establish an effective correspondence between points, re-estimate the similarity transformation and update the parameters until the parameter changes converge. During the iteration process, prioritize point pairs with high confidence for initial iterations, then gradually relax the matching threshold to achieve... and The scale uniformity and pose alignment.

9. A construction site material pile volume measuring device for implementing a construction site material pile volume measuring method according to any one of claims 1 to 8, characterized by, It includes: A binocular image acquisition unit for acquiring binocular image data of a construction site containing a material pile area by using two cameras of the same model as a binocular camera system for single target determination and stereo calibration, and performing epipolar rectification to generate a left-right view pair; A disparity map generation unit for generating a disparity map by using a cross cost aggregation algorithm based on the corrected binocular image data and the related parameters of the binocular camera system; A scaled point cloud unit for performing back projection reconstruction on the disparity map, extracting color information and confidence values corresponding to the pixels, generating a binocular point cloud image, and then segmenting and extracting independent three-dimensional point cloud data of the material pile, i.e., a scaled point cloud, from the binocular point cloud image. A scaleless point cloud unit is configured to input the binocular point cloud image into an AtlasNet network architecture, and generate a dense three-dimensional point cloud, i.e., a scaleless point cloud, after feature extraction, feature enhancement, and fusion mapping. A scale recovery unit is configured to align and recover the scale of the scaleless point cloud and the scale point cloud, and obtain a point cloud after scale recovery. A volume calculation unit is configured to distribute the point cloud after scale recovery and the scale point cloud into grid units for fusion, calculate a height value after fusion, and calculate a material pile volume based on the height value.

Citation Information

Patent Citations

  • Multi-view panoramic point cloud splicing method

    CN120219158A

  • Unstructured road pit extraction method based on unmanned aerial vehicle point cloud data and optical image fusion

    CN120298899A