Volume measurement method and device, computer readable medium and electronic device

Through voxel reconstruction and grid model calculation, the problems of low efficiency and poor accuracy of existing volume measurement technology are solved, efficient and accurate volume measurement is achieved, and costs are reduced.

CN112270702BActive Publication Date: 2024-10-29GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011261398.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-12
Publication Date
2024-10-29
Estimated Expiration
2040-11-12

AI Technical Summary

Technical Problem

Existing volumetric measurement techniques are inefficient, inaccurate, and require specialized tools and significant labor and hardware costs.

Method used

By obtaining characteristic images and real-time pose data of the environment to be measured, voxel reconstruction is performed, a grid model is constructed, and the voxel volume is calculated to obtain volume measurement data, avoiding reliance on professional tools and a large amount of manpower.

Benefits of technology

It improves the efficiency and accuracy of volume measurement, reduces hardware and labor costs, and simplifies the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112270702B_ABST
    Figure CN112270702B_ABST
Patent Text Reader

Abstract

The present disclosure provides a volume measurement method and device, a computer-readable medium and an electronic device, and relates to the field of volume measurement technology. The method includes: obtaining a feature image corresponding to an indoor environment to be measured and real-time posture data corresponding to the feature image; performing voxel reconstruction on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result; performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, the grid model includes multiple target voxels, and the target voxel includes at least eight voxels; obtaining the voxel volume corresponding to the voxel, and calculating the voxel volume of the target voxel according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume. The present disclosure can realize the measurement of indoor volume based on a relatively simple measurement device, which not only has high measurement accuracy, but also can effectively reduce hardware costs.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In production and life, it is often necessary to measure the volume of regular or irregular objects in reality, for example, measuring the volume of a container, measuring the volume occupied by indoor objects, etc.

[0003] At present, the relevant volume measurement technology solutions either require manual measurement with professional measuring tools, or visually marking the measured object and then using a laser rangefinder to assist in the measurement. On the one hand, manual measurement with the help of professional measuring tools not only relies on the accuracy of the measuring tools, but also the measurement process is cumbersome. When measuring the volume of large irregular objects or objects in complex environments, the measurement efficiency is low, and it is easy to miss or mismeasure, resulting in inaccurate measurement results. On the other hand, visually marking the measured object and then using a laser rangefinder to assist in the measurement is not convenient enough, and it also requires additional hardware and labor costs. Summary of the invention

[0004] The purpose of the present disclosure is to provide a volume measurement method, a volume measurement device, a computer-readable medium and an electronic device, thereby at least to a certain extent overcoming the problems of low volume measurement efficiency, poor accuracy and the need to consume additional hardware and manpower costs in related technical solutions.

[0005] According to a first aspect of the present disclosure, there is provided a volume measurement method, comprising:

[0006] Acquire a feature image corresponding to the indoor environment to be measured and real-time posture data corresponding to the feature image;

[0007] Performing voxel reconstruction on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result;

[0008] Performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, and the target voxel includes at least eight voxels;

[0009] The voxel volume corresponding to the voxel is acquired, and the voxel volume of the target voxel is calculated according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

[0010] According to a second aspect of the present disclosure, there is provided a volume measurement device, comprising:

[0011] A posture data acquisition module, used to acquire a characteristic image corresponding to the indoor environment to be measured and real-time posture data corresponding to the characteristic image;

[0012] A voxel reconstruction module, used for performing voxel reconstruction on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result;

[0013] A grid model reconstruction module, used for performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, and the target voxel includes at least eight voxels;

[0014] The volume measurement data module is used to obtain the voxel volume corresponding to the voxel, and calculate the voxel volume of the target voxel according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

[0015] According to a third aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented.

[0016] According to a fourth aspect of the present disclosure, there is provided an electronic device, characterized in that it includes:

[0017] Processor; and

[0018] The memory is used to store one or more programs. When the one or more programs are executed by one or more processors, the one or more processors implement the above method.

[0019] A volume measurement method provided by an embodiment of the present disclosure obtains a feature image corresponding to an indoor environment to be measured and real-time posture data corresponding to the feature image; then, voxel reconstruction can be performed on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result, and a grid model corresponding to the indoor environment to be measured can be obtained according to the voxel reconstruction result, and then the voxel volume of the target voxel in the grid model can be calculated according to the voxel volume, and the volume measurement data corresponding to the indoor environment to be measured can be obtained by accumulating the voxel volume. On the one hand, the voxel reconstruction result is constructed according to the feature image that is easier to collect and the real-time posture data corresponding to the feature image, and then the volume calculation is performed according to the voxel reconstruction result, which not only does not require professional measurement tools such as laser rangefinders, does not rely on a large amount of manpower, reduces hardware costs and manpower costs, but also makes the operation of collecting feature images and real-time posture data more convenient, increases the applicable population of volume measurement, and improves measurement efficiency; on the other hand, the grid model corresponding to the indoor environment to be measured is constructed according to the voxel reconstruction result, and then the volume data of the entire indoor environment to be measured is calculated according to the volume of the voxels constituting the grid model, which can effectively improve the measurement efficiency of volume measurement, and at the same time, the indoor environment to be measured is calculated according to a smaller voxel volume, which can improve the accuracy of volume measurement data.

[0020] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0022] Figure 1 A schematic diagram showing an exemplary system architecture to which embodiments of the present disclosure may be applied;

[0023] Figure 2 A schematic diagram showing an electronic device to which the embodiments of the present disclosure can be applied;

[0024] Figure 3 A flow chart schematically illustrates a volume measurement method in an exemplary embodiment of the present disclosure;

[0025] Figure 4 A flowchart for calculating real-time posture data in an exemplary embodiment of the present disclosure is schematically shown;

[0026] Figure 5 Schematically showing a flow chart of voxel segmentation in an exemplary embodiment of the present disclosure;

[0027] Figure 6 A flowchart for determining signed distance data in an exemplary embodiment of the present disclosure is schematically shown;

[0028] Figure 7 A flowchart for constructing a grid model in an exemplary embodiment of the present disclosure is schematically shown;

[0029] Figure 8 A schematic diagram showing a structure of a target voxel in an exemplary embodiment of the present disclosure is shown;

[0030] Fig. 9 A schematic diagram schematically illustrates a configuration of a volume element interface in an exemplary embodiment of the present disclosure;

[0031] Fig.10 The figure schematically shows the components of a volume measuring device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.

[0033] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0034] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a volume measurement method and device according to an embodiment of the present disclosure can be applied is shown.

[0035] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with image processing functions, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.

[0036] The volume measurement method provided in the embodiment of the present disclosure is generally executed by the terminal devices 101, 102, and 103, and accordingly, the volume measurement device is generally arranged in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the volume measurement method provided in the embodiment of the present disclosure can also be executed by the server 105, and accordingly, the volume measurement device can also be arranged in the server 105, which is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, the user can obtain the feature image corresponding to the indoor environment to be measured through the image acquisition unit of the terminal devices 101, 102, and 103, and obtain the real-time posture data corresponding to the feature image through the inertial measurement unit, and then upload the feature image and the real-time posture data to the server 105. After the server generates the volume measurement data through the volume measurement method provided in the embodiment of the present disclosure, the server transmits the volume measurement data to the terminal devices 101, 102, and 103, etc.

[0037] An exemplary embodiment of the present disclosure provides an electronic device for implementing a volume measurement method, which may be Figure 1 The terminal device 101, 102, 103 or the server 105 in the embodiment of the present invention comprises at least a processor and a memory, wherein the memory is used to store executable instructions of the processor, and the processor is configured to execute the volume measurement method by executing the executable instructions.

[0038] Below Figure 2 Taking the mobile terminal 200 in FIG. 1 as an example, the structure of the electronic device is exemplarily described. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2 The structure in the figure can also be applied to fixed type devices. In other embodiments, the mobile terminal 200 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware. The interface connection relationship between the components is only shown schematically and does not constitute a structural limitation of the mobile terminal 200. In other embodiments, the mobile terminal 200 may also adopt the same Figure 2 Different interface connection methods, or a combination of multiple interface connection methods.

[0039] like Figure 2As shown, the mobile terminal 200 may specifically include: a processor 210, an internal memory 221, an external memory interface 222, a Universal Serial Bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 271, a receiver 272, a microphone 273, an earphone interface 274, a sensor module 280, a display screen 290, a camera module 291, an indicator 292, a motor 293, a button 294, and a subscriber identification module (SIM) card interface 295, etc. The sensor module 280 may include a depth sensor 2801, a pressure sensor 2802, a gyroscope sensor 2803, etc.

[0040] The processor 210 may include one or more processing units, for example, the processor 210 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor and / or a neural network processor (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0041] The processor 210 is provided with a memory. The memory can store instructions for implementing six modular functions: detection instructions, connection instructions, information management instructions, analysis instructions, data transmission instructions, and notification instructions, and the execution is controlled by the processor 210.

[0042] The mobile terminal 200 implements the display function through a GPU, a display screen 290, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 290 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs that execute program instructions to generate or change display information.

[0043] The mobile terminal 200 can realize the shooting function through the ISP, the camera module 291, the video codec, the GPU, the display screen 290 and the application processor, etc. Among them, the ISP is used to process the data fed back by the camera module 291; the camera module 291 is used to capture static images or videos; the digital signal processor is used to process digital signals, and can process other digital signals in addition to digital image signals; the video codec is used to compress or decompress digital videos, and the mobile terminal 200 can also support one or more video codecs.

[0044] The depth sensor 2801 is used to obtain the depth information of the scene. In some embodiments, the depth sensor can be arranged in the camera module 291, for example, the depth sensor 2801 can also be a TOF (Time of flight) lens.

[0045] The gyroscope sensor 2803 (also called an inertial measurement unit) can be used to determine the motion posture (such as real-time posture data) of the mobile terminal 200. In some embodiments, the angular velocity of the mobile terminal 200 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 2803. The gyroscope sensor 2803 can be used for shooting anti-shake, navigation, somatosensory game scenes, etc.

[0046] The internal memory 221 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the mobile terminal 200 (such as a fused global model, etc.), etc. In addition, the internal memory 221 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash memory (Universal Flash Storage, UFS), etc. The processor 210 executes various functional applications and data processing of the mobile terminal 200 by running instructions stored in the internal memory 221 and / or instructions stored in a memory provided in the processor.

[0047] The mobile terminal 200 can implement audio functions through the audio module 270, the speaker 271, the receiver 272, the microphone 273, the earphone interface 274 and the application processor, for example, playing the calculated volume measurement data.

[0048] In addition, sensors with other functions may be set in the sensor module 280 according to actual needs, such as an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0049] The volume measurement method and volume measurement device according to an exemplary embodiment of the present disclosure will be described in detail below.

[0050] Figure 3 The flow chart of a volume measurement method in this exemplary embodiment includes the following steps S310 to S340:

[0051] In step S310, a characteristic image corresponding to the indoor environment to be measured and real-time posture data corresponding to the characteristic image are obtained.

[0052] In an exemplary embodiment, the feature image may be an image containing feature information of the indoor environment to be measured, which is acquired in real time by an image acquisition unit. For example, the feature image may be a color RGB image corresponding to the indoor environment to be measured acquired by an RGB camera module mounted on a handheld device or a smart wearable device, and a depth image corresponding to the color RGB image acquired by a TOF lens. Of course, the feature image may also be a color image containing depth information acquired by an RGB-D camera (such as a Kinect camera, an Xtion camera, a RealSense camera, etc., and this exemplary embodiment is not limited thereto) mounted on a handheld device or a smart wearable device. This exemplary embodiment does not specifically limit this.

[0053] Real-time pose data may refer to the pose of the camera that collects the feature image. For example, the real-time pose data may be the 6DOF (6 Degrees Of Freedom) pose corresponding to the feature image, or the 3DOF pose corresponding to the feature image. This exemplary embodiment does not specifically limit this, and the real-time pose data corresponding to the feature image may be measured by the ARCore platform. The ARCore platform uses the inertial measurement unit (such as a gyroscope sensor) of the terminal device, and the inertial measurement unit can record the acceleration and angular velocity of the terminal device in real time. The ARCore platform calculates the real-time pose data of the camera based on the acceleration and angular velocity of the terminal device and the relative pose between the camera and the inertial measurement unit, and then simultaneously records the color RGB image, the depth image and the camera pose at that moment through the data acquisition application, so as to complete the collection of real-time pose data under the synchronized timestamp.

[0054] When acquiring feature images, the image acquisition unit can be controlled by combining hardware and software to ensure the time synchronization of the color RGB image and the corresponding depth image. At the same time, when acquiring RGB images and depth images, no violent movements can be made, otherwise the image will be blurred and the pose solution will be affected. The frame rate of the acquired image also needs to be kept continuous and stable to avoid frame loss as much as possible. For example, the frame rate of image acquisition can be stabilized at 25 to 30 fps to improve the accuracy of the current feature image acquired.

[0055] In step S320, voxel reconstruction is performed on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result.

[0056] In an exemplary embodiment, the voxel reconstruction result may refer to the result obtained by voxel reconstruction of the current feature image and the global model obtained by fusing other feature images at the previous moment. For example, the voxel reconstruction result may be calculated based on the current feature image, the real-time pose data corresponding to the feature image, and the global model obtained by fusing other feature images at the previous moment using the TSDF (Truncated Signed Distance Function) algorithm.

[0057] In step S330, surface rendering is performed on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, and the target voxel includes at least eight voxels.

[0058] In an exemplary embodiment, surface rendering processing may refer to the process of drawing a mesh model based on a voxel reconstruction result. For example, the voxel reconstruction result may be subjected to triangular surface extraction using a marching cube algorithm to obtain a mesh model, thereby achieving surface rendering processing of the voxel reconstruction result.

[0059] A voxel may refer to the smallest unit for describing a three-dimensional space. Compared with a pixel in a two-dimensional space, the size of a voxel depends on the size of the smallest rectangular bounding box and the number of preset divided voxels. For example, the size of a voxel may be a cube of 0.05m*0.05m*0.05m. This example embodiment does not specifically limit this.

[0060] The target voxel may refer to a cubic grid composed of at least eight adjacent voxel points in the voxel reconstruction result. All voxels are traversed to determine the positive or negative TSDF values ​​corresponding to the eight voxels in each voxel, and then the target voxel may be divided into virtual voxels, boundary voxels, and solid voxels. A virtual voxel may indicate that the TSDF values ​​of the eight voxels corresponding to the voxel are all negative, whereas a solid voxel may indicate that the TSDF values ​​of the eight voxels corresponding to the voxel are all positive. Boundary voxels are between the two. The construction of the target voxel is used to fit triangular patches to the surface edges of objects.

[0061] In step S340, the voxel volume corresponding to the voxel is obtained, and the voxel volume of the target voxel is calculated according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

[0062] In an exemplary embodiment, the grid model is composed of multiple target voxels, and each target voxel is composed of multiple voxels. The voxel volume of each voxel can be calculated based on the size of the minimum rectangular bounding box and the preset number of divided voxels, and then the voxel volume of the target voxel is calculated based on the voxel volume. Finally, the volume corresponding to the grid model is obtained by accumulating the voxel volume of each target voxel, that is, the volume measurement data corresponding to the indoor environment to be measured.

[0063] Steps S310 to S340 are further explained below.

[0064] In an exemplary embodiment, the Figure 4 The steps in the calculation of the real-time pose data corresponding to the feature image are as follows: Figure 4 As shown, it may specifically include:

[0065] Step S410, respectively acquiring the color image and the depth image corresponding to the indoor environment to be measured;

[0066] Step S420, acquiring inertial measurement data, and performing time alignment on the inertial measurement data, the color image, and the depth image;

[0067] Step S430: Calculate real-time pose data corresponding to the color image and the depth image through the time-aligned inertial measurement data.

[0068] Among them, inertial measurement data may refer to the data collected by the inertial measurement unit when collecting feature images. For example, the inertial measurement data may include but is not limited to the acceleration and angular velocity of the terminal device. After the inertial measurement data is collected by the inertial measurement unit (such as a gyroscope sensor), the inertial measurement data is uploaded to the ARCore platform. The ARCore platform calculates the real-time posture data of the camera based on the acceleration and angular velocity of the terminal device and the relative posture between the camera and the inertial measurement unit. In order to improve the accuracy of the real-time posture data, the color RGB image, the depth image and the camera posture at the same time can be recorded based on the same timestamp by the data acquisition application to achieve the time alignment of the inertial measurement data with the color image and the depth image, and then the time-aligned inertial measurement data is uploaded to the ARCore platform to calculate the real-time posture data with higher accuracy.

[0069] In an exemplary embodiment, the Figure 5 The steps in the voxel reconstruction of the indoor environment to be measured are referenced Figure 5 As shown, it may specifically include:

[0070] Step S510, constructing map point cloud data corresponding to the indoor environment to be measured according to the feature image and the real-time posture data;

[0071] Step S520, establishing a minimum rectangular bounding box surrounding the map point cloud data;

[0072] Step S530, dividing the minimum rectangular parallelepiped bounding box into multiple voxels, wherein the voxel volume of the voxel depends on the volume of the minimum rectangular parallelepiped bounding box and the number of divisions;

[0073] Step S540 , performing voxel reconstruction on the indoor environment to be measured according to the voxels obtained by segmentation to obtain a voxel reconstruction result.

[0074] The map point cloud data may be data of the indoor environment to be measured that is collected and recorded through a point cloud structure. Each map point cloud data may include a three-dimensional spatial coordinate, may include color information (RGB), and may include reflection intensity information (Intensity). This example embodiment does not specifically limit this. The map point cloud data corresponding to the indoor environment to be measured may be constructed based on the internal parameters of the image acquisition unit, the feature image, and the real-time posture data. The internal parameters of the image acquisition unit may include the focal length of the camera, the aperture center of the camera, and may also include other internal parameters related to the camera. This example embodiment does not specifically limit this.

[0075] The minimum rectangular bounding box (Bounding Box) may refer to a virtual cuboid that approximately replaces complex map point cloud data (or geometric objects) with a slightly larger volume and simpler characteristics geometric body (called a bounding box). The minimum rectangular bounding box may be segmented according to a preset segmentation number to obtain a plurality of voxels. For example, the volume size of the minimum rectangular bounding box that encloses the map point cloud data may be a 5m*5m*5m cube, and the preset segmentation number may be 1000000, then the voxel volume size of the segmented voxel may be a 0.05m*0.05m*0.05m cube. Of course, this is only a schematic example. In actual application, the segmentation number may be determined according to the segmentation number set by the user or according to the set accuracy level. This exemplary embodiment does not specifically limit this.

[0076] Specifically, you can Figure 6 The steps in the above are to reconstruct the indoor environment to be measured by segmenting the voxels, refer to Figure 6 As shown, it may specifically include:

[0077] Step S610, determining the three-dimensional space coordinates of the voxel in the world coordinate system, and transforming the three-dimensional space coordinates through the real-time posture data to obtain the camera coordinates of the voxel in the camera coordinate system of the corresponding feature image;

[0078] Step S620, determining a depth value corresponding to the voxel according to the depth image and the camera coordinates;

[0079] Step S630: determining the signed distance data corresponding to the voxel according to the camera coordinates and the depth value corresponding to the voxel, so as to obtain the voxel reconstruction result corresponding to the indoor environment to be measured according to the signed distance data.

[0080] Among them, the three-dimensional space coordinates may refer to the coordinates of the voxels corresponding to the feature image in the world coordinate system, and the camera coordinates may refer to the coordinates of the voxels corresponding to the feature image in the camera coordinate system when the feature image is captured. The three-dimensional space coordinates corresponding to the voxels can be converted to the camera coordinate system through real-time posture data to obtain the camera coordinates corresponding to the voxels. The signed distance data may refer to the TSDF value of the voxels corresponding to the current feature image.

[0081] For example, for each voxel g in the constructed minimum rectangular bounding box, the voxel g is determined to be the three-dimensional space coordinate p in the world coordinate system, and the camera pose data collected by ARCore is used to transform the three-dimensional space coordinate p in the world coordinate system into the camera coordinate system of the current feature image (i.e., the feature image corresponding to the voxel), and the camera coordinate v of the three-dimensional space coordinate p in the camera coordinate system corresponding to the current feature image is obtained, and then the camera coordinate v is projected to the imaging plane according to the camera intrinsic parameters (such as camera focal length, camera aperture center, camera aperture size and other internal parameters), and then the pixel coordinate x of the voxel in the feature image is obtained, and the depth value value(x) corresponding to the pixel coordinate x is obtained from the depth image corresponding to the pixel coordinate x, and then the signed distance data corresponding to the voxel is determined according to the camera coordinate v and the depth value value(x) corresponding to the voxel.

[0082] Furthermore, the distance data from the camera coordinates to the origin of the camera coordinate system can be determined, and the difference between the distance data and the depth value can be calculated; then the preset cutoff distance can be obtained, and the signed distance data corresponding to the voxel can be determined based on the difference within the cutoff distance, so as to obtain the voxel reconstruction result based on the signed distance data.

[0083] For example, the distance from the camera coordinate v to the origin of the camera coordinate can be calculated, denoted as distance(v), and then the camera coordinate is projected onto the imaging plane using the camera internal parameters (such as the camera focal length, the camera aperture center, the camera aperture size, and other internal parameters), thereby obtaining the pixel coordinate x of the voxel in the feature image, and the depth value value(x) corresponding to the pixel coordinate x is obtained from the depth image corresponding to the pixel coordinate x. The SDF value of the three-dimensional space coordinate p can be calculated using the following relationship (1):

[0084] SDF(p)=value(x)-distance(v) (1)

[0085] Among them, SDF(p) can represent the SDF value of the three-dimensional space coordinate p, value(x) can represent the depth value corresponding to the pixel coordinate x in the depth image, and distance(v) can represent the distance from the camera coordinate v to the camera coordinate origin. If the calculated SDF value is outside the cutoff distance u, the voxel corresponding to the three-dimensional space coordinate p is not considered; if the calculated SDF value is within the cutoff distance u, the positive and negative nature of SDF(p) is further determined. If SDF(p)>0, the signed distance data TSDF(p) of the voxel corresponding to the three-dimensional space coordinate p is 1, and if SDF(p)<0, the signed distance data TSDF(p) of the voxel corresponding to the three-dimensional space coordinate p is -1.

[0086] Specifically, the weight data corresponding to the voxel can be calculated according to the distance data; then the current feature image corresponding to the voxel can be voxel-fused with the global model through the signed distance data and the weight data to obtain the voxel reconstruction result corresponding to the indoor environment to be measured.

[0087] The weight data may refer to the weight when the voxels corresponding to the feature image are fused into the global model obtained by fusing other feature images at the previous moment.

[0088] For example, the weight data of the voxels corresponding to the feature image can be calculated by equation (2):

[0089] w(p)=cos(θ) / distance(v) (2)

[0090] Among them, w(p) can represent the weight data corresponding to the voxel of the current feature image, and θ can represent the angle between the surface normal vector of the pixel coordinate x corresponding to the voxel and the projection light (or camera line of sight).

[0091] Then, the current feature image corresponding to the voxel can be fused with the global model according to the signed distance data and the weight data. During the fusion, if the current feature image corresponding to the voxel is the first frame image collected, then the current feature image is the fusion result of the global model; if the current feature image corresponding to the voxel is not the first frame image collected, then the current feature image can be fused with the global model by using the relationship group (3):

[0092]

[0093] Among them, TSDF(p) can represent the signed distance data corresponding to the fused voxels, TSDF′(p) can represent the signed distance data corresponding to the voxels in the global model, tsdf(p) can represent the signed distance data corresponding to the voxels in the current feature image, W(p) can represent the weight data corresponding to the voxels of the global model obtained after fusion (it will be W′(p) in the next fusion), W′(p) can represent the weight data corresponding to the voxels in the global model, and w(p) can represent the weight data corresponding to the voxels in the current feature image.

[0094] In an exemplary embodiment, the Figure 7 The voxel reconstruction result is processed by surface rendering in the step to obtain the grid model corresponding to the indoor environment to be measured. Figure 7 As shown, it may specifically include:

[0095] Step S710, constructing a target voxel using the voxels in the voxel reconstruction result;

[0096] Step S720, obtaining a voxel interface configuration, and matching the target voxel in the voxel interface configuration;

[0097] Step S730: performing surface rendering processing on the voxel reconstruction result according to the matched voxel interface configuration to obtain a grid model corresponding to the indoor environment to be measured.

[0098] Among them, the voxel interface configuration can be an interface configuration constructed in advance according to different types of voxels. There are mainly 15 types of voxel interface configurations. A total of 256 voxel interface configurations can be obtained through the rotation transformation of the 15 voxel interface configurations. Then, the corresponding interface configurations of the obtained target voxels are matched in the 256 voxel interface configurations to obtain the interface corresponding to each target voxel, and then the voxel reconstruction result is fitted through the interface corresponding to the matched voxel interface configuration to obtain the grid model corresponding to the indoor environment to be measured.

[0099] Figure 8 The structure diagram of a target volume element in an exemplary embodiment of the present disclosure is schematically shown.

[0100] refer to Figure 8 As shown, the voxels in the voxel reconstruction result can be used to construct target voxels, and the target voxels obtained can be roughly divided into virtual voxels 801, boundary voxels 802, and solid voxels 803. Among them, the TSDF values ​​of voxels 1, voxel 2, voxel 3, voxel 4, voxel 5, voxel 6, voxel 7, and voxel 8 constituting the virtual voxel 801 are all negative values, the TSDF values ​​of voxels 1, voxel 3, voxel 4, and voxel 8 constituting the boundary voxel 802 are negative values, and the TSDF values ​​of voxels 2, voxel 5, voxel 6, and voxel 7 are positive values. The TSDF values ​​of voxels 1, voxel 2, voxel 3, voxel 4, voxel 5, voxel 6, voxel 7, and voxel 8 constituting the solid voxel 803 are all positive values. Of course, the boundary voxel 802 here is only an illustrative example, and the boundary voxel can also be a voxel with one, two, or three voxels as positive or negative values, which is not particularly limited in this exemplary embodiment.

[0101] Fig. 9 A schematic diagram schematically shows a volume element interface configuration in an exemplary embodiment of the present disclosure.

[0102] refer to Fig. 9 As shown, the voxel interface configuration can be pre-constructed according to different types of voxels. Fig. 9There are 15 main interface configurations. Specifically, these 15 interface configurations can be rotated to obtain other 241 interface configurations, resulting in a total of 256 voxel interface configurations. Then, the target voxels are matched with the corresponding interface configurations in the 256 voxel interface configurations to obtain the interface corresponding to each target voxel. Then, the voxel reconstruction results are fitted with the interface corresponding to the matched voxel interface configuration to obtain the grid model corresponding to the indoor environment to be measured.

[0103] Taking voxel interface configuration 901 among the 15 voxel interface configurations as an example, voxel interface configuration 901 belongs to a boundary voxel, among which the TSDF values ​​of voxel 1, voxel 2, voxel 3, voxel 4, voxel 5, voxel 6, and voxel 7 constituting voxel interface configuration 901 are positive, while the TSDF value of voxel 8 is negative, indicating that there is an interface between voxel 8 and other voxels. Specifically, the interface (generally composed of triangular faces) corresponding to voxel interface configuration 901 is fitted according to the Marching Cube algorithm.

[0104] To summarize, in this exemplary embodiment, on the one hand, a voxel reconstruction result is constructed based on the feature image that is easier to collect and the real-time posture data corresponding to the feature image, and then the volume calculation is performed based on the voxel reconstruction result. Not only does it not need to rely on professional measurement tools such as laser rangefinders and a large amount of manpower, thus reducing hardware costs and manpower costs, but the operation of collecting feature images and real-time posture data is also simpler, thereby increasing the applicable population for volume measurement and improving measurement efficiency. On the other hand, a grid model corresponding to the indoor environment to be measured is constructed based on the voxel reconstruction result, and then the volume data of the entire indoor environment to be measured is calculated based on the volume of the voxels that constitute the grid model, which can effectively improve the measurement efficiency of the volume measurement. At the same time, the indoor environment to be measured is calculated based on a smaller voxel volume, which can improve the accuracy of the volume measurement data.

[0105] It should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0106] For further reference, Fig.10 As shown, in the embodiment of this example, a volume measurement device 1000 is also provided, including a posture data acquisition module 1010, a voxel reconstruction module 1020, a grid model reconstruction module 1030 and a volume measurement data module 1040. Among them:

[0107] The posture data acquisition module 1010 can be used to acquire a feature image corresponding to the indoor environment to be measured and real-time posture data corresponding to the feature image;

[0108] The voxel reconstruction module 1020 may be used to perform voxel reconstruction on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result;

[0109] The grid model reconstruction module 1030 may be used to perform surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, and the target voxel includes at least eight voxels;

[0110] The volume measurement data module 1040 may be configured to obtain the voxel volume corresponding to the voxel, and calculate the voxel volume of the target voxel according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

[0111] In an exemplary embodiment, the posture data acquisition module 1010 may also be used to:

[0112] Respectively acquiring the color image and the depth image corresponding to the indoor environment to be measured;

[0113] Acquire inertial measurement data, and time-align the inertial measurement data with the color image and the depth image;

[0114] The real-time posture data corresponding to the color image and the depth image are calculated by using the time-aligned inertial measurement data.

[0115] In an exemplary embodiment, the voxel reconstruction module 1020 further includes:

[0116] A map point cloud data construction unit, used to construct map point cloud data corresponding to the indoor environment to be measured according to the feature image and the real-time posture data;

[0117] A bounding box establishing unit, used to establish a minimum rectangular bounding box that encloses the map point cloud data;

[0118] A voxel construction unit, used for dividing the minimum rectangular parallelepiped bounding box to obtain a plurality of voxels, wherein the voxel volume of the voxels depends on the volume of the minimum rectangular parallelepiped bounding box and the number of divisions;

[0119] The voxel reconstruction unit is used to perform voxel reconstruction on the indoor environment to be measured according to the voxels obtained by segmentation to obtain a voxel reconstruction result.

[0120] In an exemplary embodiment, the voxel reconstruction unit further comprises:

[0121] A coordinate conversion subunit, used for determining the three-dimensional space coordinates of the voxel in the world coordinate system, and converting the three-dimensional space coordinates through the real-time posture data to obtain the camera coordinates of the voxel in the camera coordinate system of the corresponding feature image;

[0122] A depth value calculation subunit, used to determine the depth value corresponding to the voxel according to the depth image and the camera coordinates;

[0123] The voxel reconstruction subunit is used to determine the signed distance data corresponding to the voxel according to the camera coordinates and the depth value corresponding to the voxel, so as to obtain the voxel reconstruction result corresponding to the indoor environment to be measured according to the signed distance data.

[0124] In an exemplary embodiment, the voxel reconstruction subunit may also be used to:

[0125] Determine distance data from the camera coordinates to the origin of the camera coordinate system, and calculate a difference between the distance data and the depth value;

[0126] A preset cutoff distance is obtained, and signed distance data corresponding to the voxel is determined according to the difference within the cutoff distance, so as to obtain a voxel reconstruction result according to the signed distance data.

[0127] In an exemplary embodiment, the voxel reconstruction subunit may also be used to:

[0128] Calculate weight data corresponding to the voxel according to the distance data;

[0129] The current feature image corresponding to the voxel is voxel-fused with the global model through the signed distance data and the weight data to obtain a voxel reconstruction result corresponding to the indoor environment to be measured.

[0130] In an exemplary embodiment, the mesh model reconstruction module 1030 may also be used to:

[0131] constructing a target voxel using voxels in the voxel reconstruction result;

[0132] Acquire a voxel interface configuration, and match the target voxel in the voxel interface configuration;

[0133] The voxel reconstruction result is subjected to surface rendering processing according to the matched voxel interface configuration to obtain a grid model corresponding to the indoor environment to be measured.

[0134] The specific details of each module in the above device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0135] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".

[0136] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-mentioned method of the present specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of the present specification, for example, it can execute Figures 3 to 7 Any one or more steps in .

[0137] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0138] In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0139] In addition, program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0140] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0141] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A volume measurement method, characterized in that: include: Acquire a feature image corresponding to the indoor environment to be measured and real-time posture data corresponding to the feature image; The indoor environment to be measured is reconstructed by voxels according to the feature image and the real-time posture data to obtain a voxel reconstruction result; wherein, based on weight data, the voxels corresponding to the feature image are fused into a global model obtained by fusion of other feature images at the previous moment, and the weight data is calculated according to the distance data, and the distance data is the distance from the camera coordinate corresponding to the voxel to the origin of the camera coordinate; Performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, wherein the target voxel refers to a cube grid composed of at least eight adjacent voxels in the voxel reconstruction result, wherein the voxel refers to the smallest unit describing a three-dimensional space, and the construction of the target voxel is used to perform triangular facet fitting on the surface edge of the object; The voxel volume corresponding to the voxel is acquired, and the voxel volume of the target voxel is calculated according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

2. The method according to claim 1, characterized in that The characteristic image includes a color image and a depth image, and the step of obtaining the characteristic image corresponding to the indoor environment to be measured and the real-time posture data corresponding to the characteristic image includes: Respectively acquiring the color image and the depth image corresponding to the indoor environment to be measured; Acquire inertial measurement data, and time-align the inertial measurement data with the color image and the depth image; The real-time posture data corresponding to the color image and the depth image are calculated by using the time-aligned inertial measurement data.

3. The method according to claim 1, characterized in that The voxel reconstruction of the indoor environment to be measured is performed according to the feature image and the real-time posture data to obtain a voxel reconstruction result, including: Constructing map point cloud data corresponding to the indoor environment to be measured according to the feature image and the real-time posture data; Establishing a minimum cuboid bounding box that encloses the map point cloud data; Dividing the minimum rectangular parallelepiped bounding box to obtain a plurality of voxels, wherein the voxel volume of the voxels depends on the volume of the minimum rectangular parallelepiped bounding box and the number of divisions; The indoor environment to be measured is reconstructed by voxels according to the voxels obtained by segmentation to obtain a voxel reconstruction result.

4. The method according to claim 3, characterized in that The voxels obtained by segmentation are used to perform voxel reconstruction on the indoor environment to be measured to obtain a voxel reconstruction result, including: Determine the three-dimensional space coordinates of the voxel in the world coordinate system, and transform the three-dimensional space coordinates through the real-time posture data to obtain the camera coordinates of the voxel in the camera coordinate system of the corresponding feature image; Determine the depth value corresponding to the voxel according to the depth image and the camera coordinates; The signed distance data corresponding to the voxel is determined according to the camera coordinates and the depth value corresponding to the voxel, so as to obtain the voxel reconstruction result corresponding to the indoor environment to be measured according to the signed distance data.

5. The method according to claim 4, characterized in that Determining signed distance data corresponding to the voxel according to the camera coordinates and the depth value corresponding to the voxel, so as to obtain a voxel reconstruction result according to the signed distance data, comprising: Determine distance data from the camera coordinates to the origin of the camera coordinate system, and calculate a difference between the distance data and the depth value; A preset cutoff distance is obtained, and signed distance data corresponding to the voxel is determined according to the difference within the cutoff distance, so as to obtain a voxel reconstruction result according to the signed distance data.

6. The method according to claim 5, characterized in that The step of obtaining a voxel reconstruction result corresponding to the indoor environment to be measured according to the signed distance data includes: Calculate weight data corresponding to the voxel according to the distance data; The current feature image corresponding to the voxel is voxel-fused with the global model through the signed distance data and the weight data to obtain a voxel reconstruction result corresponding to the indoor environment to be measured.

7. The method according to claim 1, characterized in that The performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured includes: constructing a target voxel using voxels in the voxel reconstruction result; Acquire a voxel interface configuration, and match the target voxel in the voxel interface configuration; The voxel reconstruction result is subjected to surface rendering processing according to the matched voxel interface configuration to obtain a grid model corresponding to the indoor environment to be measured.

8. A volume measuring device, characterized in that: include: A posture data acquisition module, used to acquire a characteristic image corresponding to the indoor environment to be measured and real-time posture data corresponding to the characteristic image; A voxel reconstruction module is used to perform voxel reconstruction on the indoor environment to be measured according to the feature image and the real-time posture data to obtain a voxel reconstruction result; wherein, based on weight data, the voxels corresponding to the feature image are fused into a global model obtained by fusion of other feature images at the previous moment, and the weight data is calculated according to the distance data, and the distance data is the distance from the camera coordinate corresponding to the voxel to the origin of the camera coordinate; A grid model reconstruction module, used for performing surface rendering processing on the voxel reconstruction result to obtain a grid model corresponding to the indoor environment to be measured, wherein the grid model includes a plurality of target voxels, wherein the target voxel refers to a cube grid composed of at least eight adjacent voxels in the voxel reconstruction result, wherein the voxel refers to the smallest unit describing a three-dimensional space, and the construction of the target voxel is used for performing triangular facet fitting on the surface edge of the object; The volume measurement data module is used to obtain the voxel volume corresponding to the voxel, and calculate the voxel volume of the target voxel according to the voxel volume, so as to calculate the volume measurement data corresponding to the grid model according to the voxel volume.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 7 by executing the executable instructions.

Citation Information

Patent Citations

  • Volume measurement device and method

    CN109632033A

  • Method and device for acquiring laser point cloud density

    CN111736167A