Object volume measurement method, apparatus, device, and storage medium
By fusing multi-source data from lidar and visible light cameras, combined with dense point cloud processing and component screening technology, the problem of low accuracy in measuring the volume of target objects in complex loading environments was solved, achieving volume measurement with centimeter-level accuracy.
Patent Information
- Application Number
- CN202611147833.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-30
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to accurately distinguish between target materials and metal components in complex loading environments, resulting in low volume measurement accuracy, especially under conditions of insufficient lighting or with rough surfaces and irregular shapes, leading to significant errors.
By fusing multi-source data from lidar and visible light cameras, metal components and debris are removed by using laser reflection intensity, curvature, and color features. Combined with voxelization processing, the volume is accurately calculated. Dense point cloud processing, component clustering, and screening techniques are used to achieve the measurement of the target object's volume.
It significantly improves the accuracy of volume measurement, reduces structural interference and false detection, adapts to complex environments, has strong anti-interference ability, and controls errors within the centimeter level.
Smart Images

Figure CN123160637A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of object volume detection technology, and more specifically, to an object volume measurement method, apparatus, device, and storage medium. Background Technology
[0002] Existing volume measurement methods mainly include manual estimation, 3D reconstruction based on visible light images, and single-lidar point cloud measurement. Manual estimation relies on visual inspection by operators or the use of simple rulers to estimate the volume of the material pile. This is not only labor-intensive and inefficient, but also highly susceptible to subjective factors, resulting in large measurement errors. 3D reconstruction methods based on visible light images (such as Structure for Motion Recovery (SFM) and binocular vision) depend on lighting conditions. In low-light scenarios, feature matching fails, point clouds are sparse, and there is no reflective intensity, easily leading to misidentification of metal components loaded with objects as materials. While single-lidar systems can overcome lighting limitations, they largely rely on manual elevation thresholds and lack intensity measurement capabilities. Color-based identification is insufficient to eliminate metal components; relying solely on geometric features makes it difficult to distinguish between rough bulk materials and debris, and it has poor adaptability to irregular material piles, resulting in significant errors.
[0003] Therefore, how to automatically and accurately distinguish target materials from metal components and debris in complex loading environments, and overcome the classification difficulties caused by the rough surface and irregular shape of target objects, and achieve volume measurement with centimeter-level accuracy, is an urgent problem to be solved in the field of intelligent detection of bulk materials. Summary of the Invention
[0004] The main objective of this application is to provide a method, apparatus, device, and storage medium for measuring the volume of an object, so as to solve the technical problem of low accuracy in measuring the volume of a target object under complex loading conditions in the prior art, and to achieve the technical effect of improving the accuracy of measuring the volume of a target object under complex conditions.
[0005] To achieve the above objectives, a first aspect of this application proposes a method for measuring the volume of an object, comprising: Obtain dense point clouds of the target region; Non-target objects and metal components of loading objects used to load target objects are initially removed from the dense point cloud to obtain candidate object point clouds. Cluster the candidate object point cloud to obtain a set of components to be screened that contains multiple components to be screened; Each component in the set of components to be filtered is filtered based on its component attributes; If there are remaining components in the filtered set of components to be filtered, then it is determined whether there is at least one merge group among the remaining components; wherein, the merge group includes at least two components that meet the preset merge conditions; If none of the at least one merged group exists, then the target object point cloud is constructed based on the remaining components; If at least one merged group exists, at least two components within the merged group are merged, the set of components to be filtered is updated based on the merged components, and the steps of filtering each component in the set of components to be filtered based on component attributes are repeated until there are no more than one merged group. The point cloud of the target object is voxelized to determine the volume of the target object.
[0006] In one possible implementation, before the preliminary removal of non-target objects and metal components of the loading object used to load the target object from the dense point cloud to obtain the candidate object point cloud, the method further includes: The dense point cloud is denoised to obtain the first point cloud; The base plane of the loaded object within the target area is extracted from the first point cloud using a plane fitting algorithm; Remove points in the first point cloud whose height is lower than a preset height to obtain a second point cloud; wherein, the preset height is the height of the base plate plane offset downward by a preset margin; The second point cloud is projected and cropped onto the interior region of the loaded object based on the bounding box to obtain a preprocessed dense point cloud; wherein the bounding box is obtained by target detection of a color image of the target area taken by a visible light camera mounted on the UAV.
[0007] In one possible implementation, the preliminary removal of non-target objects and metal components of the loading object used to load the target object from the dense point cloud to obtain a candidate object point cloud includes: Points with a reflection intensity greater than a preset reflection intensity threshold are identified as first rejection points, and the first rejection points are removed from the dense point cloud. The remaining points in the dense point cloud are identified as first retention points. For any first retained point, obtain all points within a sphere centered on the first retained point and with a preset radius, to form a neighborhood point set of the first retained point; Based on the neighborhood point set, calculate the curvature, flatness, scattering, and local density of the first retained point; If the curvature is greater than a preset curvature threshold, the flatness is less than a preset flatness threshold, the scattering is greater than a preset scattering threshold, and the local density is greater than a preset density threshold, then the first retention point is retained; otherwise, the first retention point is determined as the second rejection point, and the second rejection point is rejected. All remaining first-reserved points are designated as second-reserved points; For any second retained point, extract the maximum luminance component, saturation, and brightness of the second retained point respectively; If the maximum luminance component is less than the preset maximum luminance, the saturation is less than the first preset maximum saturation, and the brightness is less than the first preset maximum brightness, then the second retention point is retained; otherwise, the second retention point is discarded. The candidate object point cloud is constructed based on all remaining second-reserved points.
[0008] In one possible implementation, calculating the curvature, flatness, scattering, and local density of the first retained point based on the neighborhood point set includes: A quadratic surface is obtained by fitting the neighborhood point set using the least squares method, and the curvature of the first retained point is calculated. Calculate the average coordinates of all neighborhood points of the first retained point, construct a covariance matrix based on the average coordinates, calculate the three real eigenvalues of the covariance matrix using principal component analysis (PCA), and construct dimensional features based on the three real eigenvalues; wherein, the dimensional features include flatness and scattering. The local density of the first reserved point is obtained by counting the number of all neighboring points of the first reserved point.
[0009] In one possible implementation, the component attributes include component center, number of points, bounding box volume, average laser reflection intensity, average saturation, and average brightness; the filtering of each component in the set of components to be filtered based on the component attributes includes: Determine whether each of the components to be filtered meets the preset filtering conditions; If the preset filtering conditions are met, the component to be filtered is removed; otherwise, the component to be filtered is retained. The preset filtering conditions include at least one of the following: The total number of points in the component to be filtered is less than the preset minimum number of points; The volume of the first bounding box is smaller than a preset minimum volume; wherein, the first bounding box is determined by the maximum and minimum coordinates of the component to be screened in three-dimensional space; The average laser reflection intensity of all points within the component to be screened is not within the preset reflection intensity range; The average saturation of all points in the component to be screened is greater than the second preset maximum saturation. The average brightness of all points within the component to be screened is greater than the second preset maximum brightness.
[0010] In one possible implementation, any two components within the merge group must satisfy the preset merge conditions, which include at least one of the following: The center distance between two components should not exceed the preset merge distance; The absolute value of the average laser reflection intensity difference between the two components is not greater than the preset reflection intensity difference; The average color difference between the two components is no greater than the preset color difference value.
[0011] In one possible implementation, the voxelization of the target object point cloud to determine the volume of the target object includes: Based on the maximum and minimum coordinates of the target object's point cloud in three-dimensional space, a second bounding box is determined. The number of voxels and the volume of a single voxel in the second bounding box are determined based on the preset voxel side length. Calculate the voxel grid index and count the number of voxels occupied by the point cloud of the target object; The volume of the target object is determined based on the number of voxels occupied by the point cloud of the target object and the volume of a single voxel.
[0012] A second aspect of this application provides an object volume measuring device, comprising: The point cloud acquisition module is used to acquire dense point clouds of the target area; The preliminary elimination module is used to initially eliminate non-target objects and metal components of loading objects used to load target objects in the dense point cloud to obtain candidate object point clouds. The component clustering module is used to cluster the candidate object point cloud to obtain a set of components to be screened that contains multiple components to be screened. The component filtering module is used to filter each component in the set of components to be filtered based on its component attributes. The judgment module is used to determine whether there is at least one merge group among the remaining components if there are remaining components in the filtered set of components to be filtered; wherein the merge group includes at least two components that meet the preset merging conditions; The target point cloud construction module is used to construct a target object point cloud based on the remaining components if at least one merged group does not exist. The component merging module is used to merge at least two components in the merging group if at least one merging group exists, update the set of components to be filtered based on the merged components, and repeat the step of filtering each component in the set of components to be filtered based on component attributes until there are no more than one merging group. The voxelization module is used to perform voxelization processing on the point cloud of the target object to determine the volume of the target object.
[0013] A third aspect of this application provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the object volume measurement method provided in the first aspect of this application.
[0014] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the object volume measurement method provided in the first aspect of this application.
[0015] The technical solutions provided by the embodiments of this application may include the following beneficial effects: This application utilizes multi-source data fusion from lidar and visible light cameras to layer and eliminate metal beams and various debris (such as stones and sticks) using laser reflection intensity, curvature, and color features. Then, through voxelization, the number of occupied voxels is accurately calculated. Compared to traditional manual estimation or single-sensor methods, this significantly reduces structural interference and false detections, controlling volume errors to the centimeter level and greatly improving the accuracy of target object volume measurement. This represents an optimized strategy for target object volume measurement. Furthermore, the laser reflection intensity actively measured by lidar is independent of ambient light. Combined with color features (RGB / HSV) from image recognition, it further confirms that even under harsh conditions such as dust, shadows, and nighttime operations, it can stably distinguish target objects, metal objects, and debris. Curvature and PCA scattering analysis effectively overcome misclassification problems caused by rough surfaces and irregular shapes of target objects, adapting to complex environments and exhibiting strong anti-interference capabilities. Attached Figure Description
[0016] The accompanying drawings, which form part of this application, are used to provide a further understanding of the application and to make other features, objects, and advantages of the application more apparent. The illustrative embodiments and descriptions of this application are used to explain the application and do not constitute an undue limitation of the application. In the drawings: Figure 1 A flowchart of the object volume measurement method provided in this application; Figure 2 A schematic diagram of the object volume measuring device provided in this application; Figure 3 A schematic diagram of the electronic device provided in this application. Detailed Implementation
[0017] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0018] This application provides a method for measuring the volume of an object. This method can be executed by a cloud or a ground station data center. The cloud refers to a remote server cluster with massive storage and GPU computing power, used for model training, big data analysis and global scheduling. The ground station data center refers to the local edge server or industrial control room of the power plant, deployed in the substation / control building, responsible for receiving data transmitted back by the UAV, real-time inference, storing inspection files, and cooperating with the cloud.
[0019] Figure 1 This is a flowchart illustrating a method for measuring the volume of an object provided in this embodiment. Figure 1 As shown, the main process of this method is described below (steps S101 to S108): Step S101: Obtain the dense point cloud of the target area; Step S102: Non-target objects and metal components of loading objects used to load target objects are initially removed from the dense point cloud to obtain candidate object point clouds. Step S103: Cluster the candidate object point cloud to obtain a set of components to be filtered that contains multiple components to be filtered. Step S104: Filter each component in the set of components to be filtered based on its component attributes; Step S105: If there are remaining components in the filtered set of components to be filtered, then determine whether there is at least one merge group among the remaining components; wherein, the merge group includes at least two components that meet the preset merge conditions; Step S106: If there is no at least one merged group, then construct the target object point cloud based on the remaining components; Step S107: If there is at least one merge group, merge at least two components within the merge group, update the set of components to be filtered based on the merged components, and repeat step S104 until there is no more than one merge group. Step S108: Perform voxelization on the point cloud of the target object to determine the volume of the target object.
[0020] In this embodiment, the UAV is equipped with a visible light camera and a lidar, and performs imaging and scanning of the target area (i.e., the bulk material handling area) according to a preset route. During flight, the lidar continuously collects laser echoes and obtains the local coordinates and echo intensity of each scan point. Simultaneously, the UAV's position and attitude at each scan moment are synchronously recorded via a high-precision Global Navigation Satellite System (GNSS) and an Inertial Measurement Unit (IMU). After time synchronization and extrinsic parameter calibration, each frame of laser points is converted to a unified world coordinate system. Multiple frames of point clouds are stitched together to form a dense three-dimensional point cloud of the target area, where each point contains at least spatial coordinates (x, y, z) and laser reflection intensity I. Furthermore, based on the pre-calibrated extrinsic and extrinsic parameters of the lidar and visible light camera, the RGB colors of the color images captured by the visible light camera are mapped to the dense point cloud, giving each point in the dense point cloud three-dimensional coordinates, RGB colors, and reflection intensity.
[0021] Because the dense point cloud contains very dense points and is mixed with noise points (flying points, outliers), it is necessary to remove isolated noise points using methods such as statistical filtering / radius filtering to obtain the first point cloud. Then, the base plane of the loaded object in the target area is extracted from the first point cloud using a plane fitting algorithm. Points in the first point cloud whose height is lower than a preset height (e.g., 0.1 to 0.2) are removed to obtain the second point cloud. The preset height is the height of the base plane offset downwards by a preset margin.
[0022] When searching for the base plane of a loaded object, since the target area contains various items such as metal components, stones, and wooden sticks, there are many outliers. Therefore, the RANSAC plane fitting algorithm can be used, which is the most robust to outliers, does not require prior knowledge, and can find the correct plane by random sampling.
[0023] Image detection is performed on color images of target regions captured by visible light cameras, such as deep learning-based object detectors YOLOv5 / v8 and Faster R. CNN and other object detection technologies are used to output bounding boxes. The bounding boxes are back-projected onto the second point cloud. Camera calibration parameters are used to filter points whose projected pixel coordinates fall within the bounding box. Simultaneously, floating noise above the base plate and outliers outside the carriage are removed, and only effective echoes inside the loaded object are retained to form a pre-processed dense point cloud. Then, step S102 is performed based on the pre-processed dense point cloud.
[0024] In this embodiment, high-reflectivity metal components (such as metal beams, reinforcing ribs, etc.) are eliminated based on a laser reflection intensity threshold, while low-reflectivity candidate materials are retained, laying the foundation for subsequent geometric and color screening. Specifically, points with reflection intensity greater than a preset reflection intensity threshold are determined as the first elimination points for metal components. The first elimination points are removed from the dense point cloud, and the remaining points in the dense point cloud are determined as the first retention points.
[0025] Furthermore, target objects (such as coal and ore) generally have uneven surfaces and dark colors, while mixed non-target objects, i.e., impurities (such as brightly colored stones, colored plastic sheets, and wooden sticks), have physical characteristics of brighter colors or smoother surfaces. Therefore, we use curvature + PCA dispersion + density to identify coarse particles, use HSV color to remove brightly colored impurities, and finally use RGB darkness thresholding to remove non-target objects (such as wooden blocks, stones, and plastics) from the clean point cloud.
[0026] For any first reserved point, obtain all points within a sphere centered on the first reserved point with a preset radius, forming a neighborhood point set of the first reserved point; then calculate the curvature, flatness, scattering, and local density of the first reserved point based on the neighborhood point set.
[0027] Specifically, for each point p in the clean point cloud, take the set of neighborhood points within its radius r. (p), will The coordinates of each point in (p) are transformed to a local coordinate system with p as the origin, and the least squares method is used to fit a bivariate quadratic surface so that the quadratic surface best approximates the neighborhood point set in the least squares sense. Based on this, the principal curvature or Gaussian curvature of the quadratic surface at p is calculated as the curvature C(p) of point p, which is used to distinguish the rough surface of the target object from planar components or debris.
[0028] Calculate the average coordinates of all neighborhood points of the first retained point. Using these average coordinates as the centroid, construct a 3×3 covariance matrix based on the offset vector between the first retained point and the centroid. Calculate the three real eigenvalues of the covariance matrix using principal component analysis (PCA). , , And satisfy The linearity L is constructed based on three real eigenvalues. Flatness P = Dispersion S= The sum of these three feature dimensions is 1.
[0029] Count the number of all neighboring points of the first reserved point and use it as the local density of the first reserved point.
[0030] If the curvature is greater than the preset curvature threshold, the flatness is less than the preset flatness threshold, the scattering is greater than the preset scattering threshold, and the local density is greater than the preset density threshold, then the first retention point is retained; otherwise, the first retention point is determined as the second rejection point, and the second rejection point is rejected; all remaining first retention points are determined as second retention points.
[0031] Next, for any second retained point, the maximum luminance component, saturation, and brightness of the second retained point are extracted respectively. If the maximum luminance component is less than the preset maximum luminance, the saturation is less than the first preset maximum saturation, and the brightness is less than the first preset maximum brightness, then the second retained point is retained; otherwise, the second retained point is discarded. Finally, a candidate object point cloud is constructed based on all the remaining second retained points.
[0032] In step S104, the candidate object point cloud is divided into several components based on spatial proximity through clustering. Each component is a subset of the point cloud composed of multiple points, providing objects for subsequent attribute filtering, merging, and volume calculation. Euclidean clustering can be used specifically, but this embodiment does not impose a specific limitation.
[0033] In this embodiment, the component attributes include component center, number of points, bounding box volume, average laser reflection intensity, average saturation, and average brightness. The component center is the average coordinate of all points in the component.
[0034] For step S105, determine whether each component to be filtered meets the preset filtering conditions; if it meets the preset filtering conditions, remove the component to be filtered; otherwise, retain the component to be filtered. Optionally, the preset filtering conditions may include at least one of the following: (1) The total number of points in the component to be filtered is less than the preset minimum number of points (e.g., 50-100).
[0035] (2) The volume of the first bounding box is less than the preset minimum volume; wherein, the first bounding box is determined by the maximum and minimum coordinates of the component to be screened in three-dimensional space, and its calculation formula is as follows: In the formula, Let be the volume of the first bounding box of the k-th component to be filtered. , , The maximum x-coordinate, maximum y-coordinate, and maximum z-coordinate of the k-th component to be filtered are, in order. , , The minimum x-coordinate, minimum y-coordinate, and minimum z-coordinate of the k-th component to be filtered are, in order.
[0036] If the above conditions (1) or (2) are met, it indicates that the component to be screened is noise and should be removed.
[0037] (3) The average laser reflection intensity of all points within the component to be screened is not within the preset reflection intensity range (e.g., [0.1, 0.5]); the preset reflection intensity range is the range of reflection intensity that the target object should be within. If this condition is met, it means that the component to be screened is not the target object and should be removed.
[0038] (4) The average saturation of all points in the component to be screened is greater than the second preset maximum saturation; the average saturation is the arithmetic mean of the saturation of each point in the component.
[0039] (5) The average brightness of all points in the component to be screened is greater than the second preset maximum brightness; the average brightness is the arithmetic mean of the brightness of each point in the component.
[0040] If the above conditions (4) or (5) are met, it means that the component to be screened is highly saturated or bright, which is inconsistent with the characteristics of the target object being dark and low saturation, so it needs to be removed.
[0041] It should be noted that the first preset maximum saturation and the second preset maximum saturation can be set to the same value or different values; similarly, the first preset maximum brightness and the second preset maximum brightness can be set to the same value or different values.
[0042] In this embodiment, any two components within each merge group must meet preset merge conditions, and the preset merge conditions include at least one of the following: (1) The center distance between two components is not greater than the preset merging distance; the center distance is the distance between the center of the two components. If this condition is met, it means that the two components are spatially adjacent and should be merged.
[0043] (2) The absolute value of the difference in average laser reflection intensity between the two components is not greater than the preset difference in reflection intensity; the difference in average laser reflection intensity is the difference in average laser reflection intensity between the two components, and the average laser reflection intensity is the arithmetic mean of the laser reflection intensity at each point within the component. If this condition is met, it indicates that the difference in average reflection intensity between the two components is small, and they should be merged.
[0044] (3) The average color difference between the two components is not greater than the preset color difference value; the average color difference value is the Euclidean distance between the vectors formed by the average RGB color values of the point clouds of the two components. If this condition is met, it means that the average color difference between the two components is small and they should be merged.
[0045] In this embodiment, if the filtering operation removes all components from the set of components to be filtered, that is, there are no remaining components, it means that the target object quantity in the loaded object is 0, that is, there is no target object in the loaded object. At this time, the current process should be terminated, an error should be reported, and the user should be waited for the next instruction.
[0046] It should be noted that at least two components within the same merge group that meet the preset merge conditions are merged. If, in addition to the new merged component, there are still old components that were not merged, these new components are combined with the old components to form a new set of components to be filtered. The filtering operation is then performed on each component in this new set until no further merging operations are performed. The union of these components is then taken to form the final target object point cloud. The final target object point cloud may contain only one point cloud cluster or multiple point cloud clusters, with each cluster corresponding to one target object, as multiple target objects may exist within the target area.
[0047] In some optional embodiments, a second bounding box is first determined based on the maximum and minimum coordinates of the target object point cloud in three-dimensional space; the second bounding box and the first bounding box are both axis-aligned bounding boxes, which are determined by the maximum and minimum coordinate values of the target object point cloud in three-dimensional space.
[0048] Then, based on the preset voxel side length s, the number of voxels in the second bounding box and the volume s of a single voxel are determined. 3 Assume the maximum x-coordinate of the second bounding box. Maximum y-coordinate Maximum z-coordinate Minimum x-coordinate Minimum y-coordinate Minimum z-coordinate The second enclosing box is evenly divided into , , , , To round up, a minimum axis-aligned bounding box that covers the final target object's point cloud is determined by calculating the number of voxels.
[0049] Next, calculate the voxel grid index and count the number of voxels occupied by the target object point cloud. Each voxel's position in the grid is uniquely identified by three integer indices (i, j, l). For any point (x, y, z) in the target object point cloud, it is necessary to calculate whether it falls within the target voxel. The index calculation formula is: i = j= , l= ,in, This is for rounding down.
[0050] Finally, based on the number of voxels occupied by the point cloud of the target object. And the volume of a single voxel, to determine the volume of the target object. The calculation formula is: .
[0051] Based on the same inventive concept, embodiments of this application provide an object volume measuring device. Figure 2 This is a structural block diagram of an object volume measuring device 200 provided in an embodiment of this application. Figure 2 As shown, the object volume measuring device 200 mainly includes: Point cloud acquisition module 201 is used to acquire dense point clouds of the target area; The preliminary elimination module 202 is used to perform preliminary elimination of non-target objects and metal components of loading objects used to load target objects in the dense point cloud to obtain candidate object point clouds. The component clustering module 203 is used to cluster the point cloud of candidate objects to obtain a set of components to be screened containing multiple components to be screened. The component filtering module 204 is used to filter each component in the set of components to be filtered based on its attributes. The judgment module 205 is used to determine whether there is at least one merge group among the remaining components if there are remaining components in the filtered set of components to be filtered; wherein, the merge group includes at least two components that meet the preset merge conditions; The target point cloud composition module 206 is used to construct a target object point cloud based on the remaining components if there is no at least one merged group. The component merging module 207 is used to merge at least two components in the merging group if there is at least one merging group, update the set of components to be filtered based on the merged components, and repeat the steps of filtering each component to be filtered in the set of components to be filtered based on the component attributes, until there is no more than one merging group. The voxelization module 208 is used to voxelize the point cloud of the target object to determine the volume of the target object.
[0052] In some optional embodiments, the object volume measuring device 200 further includes a point cloud preprocessing module, specifically used to perform noise reduction processing on the dense point cloud before initially removing non-target objects and metal components of the loading object used to load the target object from the dense point cloud to obtain a candidate object point cloud; extract the base plane of the loading object within the target area from the first point cloud using a plane fitting algorithm; remove points in the first point cloud whose height is lower than a preset height to obtain a second point cloud; wherein the preset height is the height of the base plane offset downward by a preset margin; and project and crop the second point cloud onto the internal area of the loading object based on the bounding box to obtain the preprocessed dense point cloud; wherein the bounding box is obtained by target detection of a color image of the target area captured by a visible light camera mounted on a UAV.
[0053] In some optional embodiments, the initial rejection module 202 includes: The first point processing module is used to identify points with reflection intensity greater than a preset reflection intensity threshold as first rejection points, remove the first rejection points from the dense point cloud, and identify the remaining points in the dense point cloud as first retention points. The neighborhood point set acquisition module is used to acquire all points within a sphere centered on the first reserved point and with a preset radius for any first reserved point, thus forming the neighborhood point set of the first reserved point; The calculation module is used to calculate the curvature, flatness, scattering, and local density of the first retained point based on the neighborhood point set. The second processing module is used to retain the first retention point if the curvature is greater than the preset curvature threshold, the flatness is less than the preset flatness threshold, the scattering is greater than the preset scattering threshold, and the local density is greater than the preset density threshold; otherwise, the first retention point is determined as the second rejection point and the second rejection point is rejected. The retention point determination module is used to determine all remaining first retention points as second retention points; For any second retention point, extract the maximum luminance component, saturation, and brightness of the second retention point respectively; The third processing module is used to retain the second retention point if the maximum brightness component is less than the preset maximum brightness, the saturation is less than the first preset maximum saturation, and the brightness is less than the first preset maximum brightness; otherwise, the second retention point is discarded. The candidate point cloud construction module is used to construct a candidate object point cloud based on all remaining second-reserved points.
[0054] Further, the calculation module is specifically used to fit the neighborhood point set using the least squares method to obtain a quadratic surface, calculate the curvature of the first retained point; calculate the average coordinates of all neighborhood points of the first retained point, construct a covariance matrix based on the average coordinates, calculate the three real eigenvalues of the covariance matrix using principal component analysis (PCA), and construct dimensional features based on the three real eigenvalues; wherein, the dimensional features include flatness and scattering; count the number of all neighborhood points of the first retained point to obtain the local density of the first retained point.
[0055] In some optional embodiments, component attributes include component center, number of points, bounding box volume, average laser reflection intensity, average saturation, and average brightness; the component filtering module 204 is specifically used to determine whether each component to be filtered meets preset filtering conditions; if the preset filtering conditions are met, the component to be filtered is removed; otherwise, the component to be filtered is retained; wherein, the preset filtering conditions include at least one of the following: the number of all points in the component to be filtered is less than a preset minimum number of points; the volume of the first bounding box is less than a preset minimum volume; wherein, the first bounding box is determined by the maximum and minimum coordinates of the component to be filtered in three-dimensional space; the average laser reflection intensity of all points in the component to be filtered is not located within a preset reflection intensity range; the average saturation of all points in the component to be filtered is greater than a second preset maximum saturation; the average brightness of all points in the component to be filtered is greater than a second preset maximum brightness.
[0056] In some optional embodiments, any two components within the merge group must meet preset merge conditions, which include at least one of the following: The center distance between two components should not exceed the preset merge distance; The absolute value of the average laser reflection intensity difference between the two components is not greater than the preset reflection intensity difference; The average color difference between the two components is no greater than the preset color difference value.
[0057] In some optional embodiments, the voxelization module 208 is specifically used to determine a second bounding box based on the maximum and minimum coordinates of the target object point cloud in three-dimensional space; determine the number of voxels in the second bounding box and the volume of a single voxel based on a preset voxel side length; calculate the voxel mesh index and count the number of voxels occupied by the target object point cloud; and determine the volume of the target object based on the number of voxels occupied by the target object point cloud and the volume of a single voxel.
[0058] The functional modules in the embodiments of this application can be integrated together to form an independent unit, such as integrated into a processing unit, or each module can exist physically separately, or two or more modules can be integrated to form an independent unit. The integrated unit can be implemented in hardware or as a software functional unit. If the function is implemented as a software functional module and determined to be an independent product for sale or use, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media that can store program code, such as USB flash drives, mobile hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0059] Various variations and specific examples of the methods provided in the embodiments of this application are also applicable to the object volume measuring device provided in this embodiment. Through the foregoing detailed description of the object volume measuring method, those skilled in the art can clearly understand the implementation method of the object volume measuring device in this embodiment. For the sake of brevity, it will not be described in detail here.
[0060] Figure 3 This is a structural block diagram of an electronic device 300 provided in an embodiment of this application. (See diagram below.) Figure 3 As shown, the electronic device 300 includes a memory 301, a processor 302, and a communication bus 303; the memory 301 and the processor 302 are connected through the communication bus 303.
[0061] The memory 301 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 301 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the object volume measurement method provided in the above embodiments, etc. The data storage area may store data involved in the object volume measurement method provided in the above embodiments, etc.
[0062] Processor 302 may include one or more processing cores. Processor 302 executes instructions, programs, code sets, or instruction sets stored in memory 301, and calls data stored in memory 301 to perform various functions and process data as described in this application. Processor 302 may be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that, for different devices, the electronic devices used to implement the functions of processor 302 may also be other types, and this application embodiment does not specifically limit the specific devices used.
[0063] The communication bus 303 may include a path for transmitting information between the aforementioned components. The communication bus 303 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 303 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The symbol is represented by only one double arrow, but this does not indicate that there is only one bus or one type of bus. Figure 3 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0064] This application also provides a computer-readable storage medium storing a computer program that can be loaded by a processor and executed as described in the above embodiments for measuring the volume of an object.
[0065] In this embodiment, the computer-readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. The computer-readable storage medium can be, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof. Specifically, the computer-readable storage medium can be a portable computer disk, a hard disk, a USB flash drive, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), staging random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory stick, floppy disk, optical disk, magnetic disk, mechanical encoding device, or any combination thereof.
[0066] The computer program in this embodiment includes functions for executing... Figure 1 The program code for the method shown may include instructions corresponding to the execution of the method steps provided in the above embodiments. The computer program may be downloaded from a computer-readable storage medium to various computing / processing devices, or downloaded via a network (e.g., the Internet, local area network, wide area network, and / or wireless network) to an external computer or external storage device. The computer program may be executed entirely on the user's computer as a standalone software package.
[0067] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0068] Obviously, those skilled in the art should understand that the various units or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device, or fabricating them separately as individual integrated circuit modules, or fabricating multiple modules or steps into a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0069] It should be noted that the data used in this way can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, meaning that a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0070] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for measuring the volume of an object, characterized in that, include: Obtain dense point clouds of the target region; Non-target objects and metal components of loading objects used to load target objects are initially removed from the dense point cloud to obtain candidate object point clouds. Cluster the candidate object point cloud to obtain a set of components to be screened that contains multiple components to be screened; Each component in the set of components to be filtered is filtered based on its component attributes; If there are remaining components in the filtered set of components to be filtered, then it is determined whether there is at least one merge group among the remaining components; wherein, the merge group includes at least two components that meet the preset merge conditions; If none of the at least one merged group exists, then the target object point cloud is constructed based on the remaining components; If at least one merged group exists, at least two components within the merged group are merged, the set of components to be filtered is updated based on the merged components, and the steps of filtering each component in the set of components to be filtered based on component attributes are repeated until there are no more than one merged group. The point cloud of the target object is voxelized to determine the volume of the target object.
2. The method according to claim 1, characterized in that, Before performing preliminary removal of non-target objects and metal components of loading objects used to load target objects from the dense point cloud to obtain candidate object point clouds, the method further includes: The dense point cloud is denoised to obtain the first point cloud; The base plane of the loaded object within the target area is extracted from the first point cloud using a plane fitting algorithm; Remove points in the first point cloud whose height is lower than a preset height to obtain a second point cloud; wherein, the preset height is the height of the base plate plane offset downward by a preset margin; The second point cloud is projected and cropped onto the interior region of the loaded object based on the bounding box to obtain a preprocessed dense point cloud; wherein the bounding box is obtained by target detection of a color image of the target area taken by a visible light camera mounted on the UAV.
3. The method according to claim 1 or 2, characterized in that, The preliminary removal of non-target objects and metal components of loading objects used to load target objects from the dense point cloud to obtain a candidate object point cloud includes: Points with a reflection intensity greater than a preset reflection intensity threshold are identified as first rejection points, and the first rejection points are removed from the dense point cloud. The remaining points in the dense point cloud are identified as first retention points. For any first retained point, obtain all points within a sphere centered on the first retained point and with a preset radius, to form a neighborhood point set of the first retained point; Based on the neighborhood point set, calculate the curvature, flatness, scattering, and local density of the first retained point; If the curvature is greater than a preset curvature threshold, the flatness is less than a preset flatness threshold, the scattering is greater than a preset scattering threshold, and the local density is greater than a preset density threshold, then the first retention point is retained; otherwise, the first retention point is determined as the second rejection point, and the second rejection point is rejected. All remaining first-reserved points are designated as second-reserved points; For any second retained point, extract the maximum luminance component, saturation, and brightness of the second retained point respectively; If the maximum luminance component is less than the preset maximum luminance, the saturation is less than the first preset maximum saturation, and the brightness is less than the first preset maximum brightness, then the second retention point is retained; otherwise, the second retention point is discarded. The candidate object point cloud is constructed based on all remaining second-reserved points.
4. The method according to claim 3, characterized in that, The calculation of the curvature, flatness, scattering, and local density of the first retained point based on the neighborhood point set includes: A quadratic surface is obtained by fitting the neighborhood point set using the least squares method, and the curvature of the first retained point is calculated. Calculate the average coordinates of all neighborhood points of the first retained point, construct a covariance matrix based on the average coordinates, calculate the three real eigenvalues of the covariance matrix using principal component analysis (PCA), and construct dimensional features based on the three real eigenvalues; wherein, the dimensional features include flatness and scattering. The local density of the first reserved point is obtained by counting the number of all neighboring points of the first reserved point.
5. The method according to claim 1 or 2, characterized in that, The component attributes include component center, number of points, bounding box volume, average laser reflection intensity, average saturation, and average brightness; The step of filtering each component in the set of components to be filtered based on its component attributes includes: Determine whether each of the components to be filtered meets the preset filtering conditions; If the preset filtering conditions are met, the component to be filtered is removed; otherwise, the component to be filtered is retained. The preset filtering conditions include at least one of the following: The total number of points in the component to be filtered is less than the preset minimum number of points; The volume of the first bounding box is smaller than a preset minimum volume; wherein, the first bounding box is determined by the maximum and minimum coordinates of the component to be screened in three-dimensional space; The average laser reflection intensity of all points within the component to be screened is not within the preset reflection intensity range; The average saturation of all points in the component to be screened is greater than the second preset maximum saturation. The average brightness of all points within the component to be screened is greater than the second preset maximum brightness.
6. The method according to claim 1 or 2, characterized in that, Any two components within the merge group must meet the preset merge conditions, which include at least one of the following: The center distance between two components should not exceed the preset merge distance; The absolute value of the average laser reflection intensity difference between the two components is not greater than the preset reflection intensity difference; The average color difference between the two components is no greater than the preset color difference value.
7. The method according to claim 1 or 2, characterized in that, The process of voxelizing the point cloud of the target object to determine its volume includes: Based on the maximum and minimum coordinates of the target object's point cloud in three-dimensional space, a second bounding box is determined. The number of voxels and the volume of a single voxel in the second bounding box are determined based on the preset voxel side length. Calculate the voxel grid index and count the number of voxels occupied by the point cloud of the target object; The volume of the target object is determined based on the number of voxels occupied by the point cloud of the target object and the volume of a single voxel.
8. A device for measuring the volume of an object, characterized in that, include: The point cloud acquisition module is used to acquire dense point clouds of the target area; The preliminary elimination module is used to initially eliminate non-target objects and metal components of loading objects used to load target objects in the dense point cloud to obtain candidate object point clouds. The component clustering module is used to cluster the candidate object point cloud to obtain a set of components to be screened that contains multiple components to be screened. The component filtering module is used to filter each component in the set of components to be filtered based on its component attributes. The judgment module is used to determine whether there is at least one merge group among the remaining components if there are remaining components in the filtered set of components to be filtered; wherein the merge group includes at least two components that meet the preset merging conditions; The target point cloud construction module is used to construct a target object point cloud based on the remaining components if at least one merged group does not exist. The component merging module is used to merge at least two components in the merging group if at least one merging group exists, update the set of components to be filtered based on the merged components, and repeat the step of filtering each component in the set of components to be filtered based on component attributes until there are no more than one merging group. The voxelization module is used to perform voxelization processing on the point cloud of the target object to determine the volume of the target object.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the object volume measurement method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the object volume measurement method according to any one of claims 1 to 7.
