WO2025199754A1 - 物品体积计算方法、装置、电子设备和存储介质 - Google Patents
物品体积计算方法、装置、电子设备和存储介质Info
- Publication number
- WO2025199754A1 WO2025199754A1 PCT/CN2024/083872 CN2024083872W WO2025199754A1 WO 2025199754 A1 WO2025199754 A1 WO 2025199754A1 CN 2024083872 W CN2024083872 W CN 2024083872W WO 2025199754 A1 WO2025199754 A1 WO 2025199754A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- point cloud
- target
- cargo box
- volume
- depth
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/08—Logistics, e.g. warehousing, loading or distribution; Inventory or stock management
- G06Q10/083—Shipping
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/50—Depth or shape recovery
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Definitions
- One of the purposes of the embodiments of the present application is to provide a method, device, electronic device and storage medium for calculating the volume of an item.
- an embodiment of the present application provides a method for calculating the volume of an item, comprising:
- the volume of the target object inside the cargo box is calculated based on the target point cloud that meets the preset conditions in the initial point cloud, and the target object is the object corresponding to the target point cloud.
- the parameter information includes focal length; and obtaining the initial point cloud inside the cargo box based on the depth information and the parameter information of the camera includes:
- An initial point cloud of the interior of the cargo box is determined based on the three-dimensional coordinates corresponding to the pixels in the internal image.
- calculating the volume of the target object inside the container based on the target point cloud that meets the preset conditions in the initial point cloud includes:
- filtering the initial point cloud based on the distance to obtain the target point cloud includes:
- Point clouds corresponding to grid cells exceeding the distance are filtered out from the initial point cloud, and the remaining point clouds in the initial point cloud are determined as target point clouds.
- calculating the volume of the target object inside the cargo box based on the target point cloud includes:
- the target grid cell Filling a target grid cell according to the depth information, and calculating the volume of a cuboid corresponding to the target grid cell based on the depth of the container, the target grid cell being the grid cell corresponding to the target point cloud;
- the volume of the target object is calculated according to the volume of the cuboid corresponding to the target grid unit and the number of the target grid units.
- an object volume calculation device comprising:
- An image acquisition unit used to acquire an image of the interior of the cargo box through a camera
- a depth acquisition unit configured to input the internal image into a trained target depth estimation model to obtain depth information of the internal image
- a point cloud acquisition unit configured to obtain an initial point cloud of the interior of the cargo box based on the depth information and parameter information of the camera;
- An initial point cloud of the interior of the cargo box is determined based on the three-dimensional coordinates corresponding to the pixels in the internal image.
- the volume calculation unit includes:
- the camera distance acquisition module is used to obtain the depth of the cargo box when the vehicle is empty, as well as the distance from the camera installation position to the four planes inside the cargo box;
- a point cloud filtering module configured to filter the initial point cloud based on the distance to obtain a target point cloud
- the volume calculation module is used to calculate the volume of the target object inside the cargo box based on the target point cloud and the depth of the cargo box.
- the point cloud filtering module is used to:
- Point clouds corresponding to grid cells exceeding the distance are filtered out from the initial point cloud, and the remaining point clouds in the initial point cloud are determined as target point clouds.
- the volume calculation module is used to:
- the target grid cell Filling a target grid cell according to the depth information, and calculating the volume of a cuboid corresponding to the target grid cell based on the depth of the container, the target grid cell being the grid cell corresponding to the target point cloud;
- the volume of the target object is calculated according to the volume of the cuboid corresponding to the target grid unit and the number of the target grid units.
- the apparatus further comprises:
- a training set construction unit used to construct a supervised training data set
- a training unit configured to perform supervised training on a target depth estimation model using the supervised training dataset to obtain a training loss
- a model updating unit is used to update the target depth estimation model based on the training loss until the training loss meets a preset loss condition, thereby obtaining a trained target depth estimation model.
- an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for calculating the volume of an item as described in the first aspect above is implemented.
- an embodiment of the present application provides a computer program product.
- the computer program product When the computer program product is run on an electronic device, the electronic device executes the method for calculating the volume of an item as described in the first aspect above.
- FIG1 is a flowchart of an implementation method for calculating the volume of an item provided in an embodiment of the present application
- FIG3 is a flowchart of a specific implementation of step S103 in the method for calculating the volume of an item provided in an embodiment of the present application;
- FIG4 is a flowchart of a specific implementation of step S104 in the method for calculating the volume of an item provided in an embodiment of the present application;
- FIG5 is a schematic diagram of a scenario in which the volume of a rectangular parallelepiped corresponding to a grid unit is calculated in the method for calculating the volume of an object provided in an embodiment of the present application;
- FIG6 is a structural block diagram of an apparatus for calculating the volume of an item provided in an embodiment of the present application.
- the term “if” can be interpreted as “when” or “upon” or “in response to determining” or “in response to detecting,” depending on the context.
- the phrase “if it is determined” or “if [described condition or event] is detected” can be interpreted as meaning “upon determination” or “in response to determining” or “upon detection of [described condition or event]” or “in response to detecting [described condition or event],” depending on the context.
- references to "one embodiment” or “some embodiments” in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application.
- phrases such as “in one embodiment,” “in some embodiments,” “in other embodiments,” and “in other embodiments” appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean “one or more but not all embodiments,” unless otherwise specifically emphasized.
- the terms “including,” “comprising,” “having,” and variations thereof all mean “including but not limited to,” unless otherwise specifically emphasized.
- LiDAR LiDAR volume measurement
- Lasers scan the contents of the boxes with lasers, generating point cloud data that is then used to perform volume measurements.
- LiDAR volume measurement is expensive, and LiDAR has low reflectivity for special items like black objects and glass, which can lead to inaccurate measurements. This makes it impossible to guarantee the precision and accuracy of volume measurements, which in turn affects the sorting and storage of objects and reduces logistics efficiency.
- the present invention provides a method, device, electronic device, and storage medium for calculating the volume of an object. These methods effectively reduce the hardware cost of volume measurement and ensure that the precision and accuracy of measurement are not affected by the material of the object.
- these methods effectively reduce the hardware cost of volume measurement and ensure that the precision and accuracy of measurement are not affected by the material of the object.
- the object volume calculation method provided in the embodiments of the present application can be applied to various types of electronic devices that need to perform object volume calculations, specifically including smart vehicle terminals, mobile phones, tablet computers, wearable devices, laptops, desktop computers, servers, etc.
- FIG1 shows the implementation process of the method for calculating the volume of an item provided in an embodiment of the present application, which includes steps S101 to S104.
- the specific implementation principles of each step are as follows:
- a monocular camera is used to capture images of the cargo box's interior.
- SLR monocular camera
- a monocular camera is used to capture images, light from the subject is focused by the lens and reflected by an angled mirror onto a focusing screen to form an image.
- Monocular cameras are relatively inexpensive, and using them to capture images and determine point cloud information within the cargo box helps reduce costs, thereby effectively lowering the hardware cost of volume measurement.
- the type and model of the monocular camera can be determined based on actual application requirements. This embodiment does not impose any restrictions on the type, model, or even brand of the monocular camera.
- Step S102 inputting the internal image into a trained target depth estimation model to obtain depth information of the internal image.
- the target depth estimation model is a trained neural network model used to estimate depth information.
- using the target depth estimation model to obtain depth information eliminates the need for expensive hardware equipment such as lidar. Instead, the model can be combined with the 2D information of the image to generate a 3D point cloud, effectively reducing hardware costs.
- laser point cloud data can be used as ground truth to train a neural network model, resulting in a depth estimation model for estimating depth information.
- this approach requires spatiotemporal calibration of the image and laser point cloud data, which is difficult to implement and results in low training efficiency.
- FIG2 shows a specific implementation process of training and obtaining a target depth estimation model in the object volume calculation method provided in an embodiment of the present application, which is detailed as follows:
- A1 Construct a supervised training dataset.
- Depth images with distance information are typically acquired using LiDAR point cloud data as ground truth, a costly acquisition method.
- the use of the DINOV2 depth estimation model to acquire depth images containing distance information can effectively reduce costs.
- A2 Perform supervised training on the initial depth estimation model using the supervised training dataset to obtain a training loss.
- A3 Update the initial depth estimation model based on the training loss until the training loss meets a preset loss condition, thereby obtaining a trained target depth estimation model.
- back propagation is used to update the initial depth estimation model based on the training loss.
- a parameter gradient is set for each convolution kernel in the initial depth estimation model.
- each model parameter that needs to be updated in the initial depth estimation model has a corresponding gradient.
- the model parameters therein can be optimized according to this gradient, thereby reducing the loss.
- the training loss is less than or equal to the preset loss threshold, the trained target depth estimation model is obtained.
- Step S103 obtaining an initial point cloud inside the cargo box according to the depth information and the parameter information of the camera.
- the depth information and camera parameters are combined to obtain an initial point cloud of the interior of the cargo box.
- the initial point cloud includes the point cloud of the cargo box and the point cloud of the objects inside the cargo box.
- the camera parameter information includes focal length.
- FIG3 shows a specific implementation process of obtaining the initial point cloud inside the cargo box based on the depth information and the camera parameter information in the method for calculating the volume of an item provided in an embodiment of the present application, which is detailed as follows:
- Pixel coordinates are two-dimensional coordinates.
- B2 Obtain the three-dimensional coordinates of the pixel in the internal image inside the container based on the focal length of the camera, the pixel coordinates of the pixel, and the depth information corresponding to the pixel.
- the three-dimensional coordinates are the position coordinates of the pixel coordinates in the world coordinate system.
- the three-dimensional coordinates corresponding to the pixel coordinates P(u, v) are determined according to the following formula (1):
- u represents the horizontal coordinate of the pixel in the internal image in the pixel coordinate system
- v represents the vertical coordinate of the pixel in the internal image in the pixel coordinate system
- z represents the depth information corresponding to the pixel in the internal image (the depth information is estimated based on the target depth above).
- c U and c V are the center coordinates of the pixel coordinate system (usually the center of the image)
- f U and f V represent the focal lengths of the camera in the x-axis and y-axis directions in the world coordinate system, respectively.
- x is the horizontal x-axis position information of the pixel P(u, v) in the world coordinate system
- y is the vertical y-axis position information of the pixel P(u, v) in the world coordinate system.
- B3 Determine an initial point cloud inside the cargo box based on the three-dimensional coordinates corresponding to the pixels in the internal image.
- the internal image is spatially transformed to obtain an initial point cloud including a cargo box point cloud and a target object point cloud, where the target object refers to an object inside the cargo box.
- the initial point cloud is determined by combining the internal image of the cargo box taken by the camera, the depth information determined by the target depth estimation model, and the parameter information of the camera, without the need for expensive lidar, which can effectively reduce costs.
- Step S104 Calculating the volume of the target object inside the cargo box based on the target point cloud that meets the preset conditions in the initial point cloud, where the target object is the object corresponding to the target point cloud.
- the above-mentioned target point cloud that meets the preset conditions is the point cloud of the target object. Since the initial point cloud includes the cargo box point cloud, in this embodiment, the initial point cloud is filtered by setting preset conditions, and the point cloud that meets the preset conditions is determined as the target point cloud, that is, the point cloud corresponding to the target object.
- FIG4 shows a specific implementation process of step S104 in the method for calculating the volume of an item provided in an embodiment of the present application, which is described in detail as follows:
- C1 Obtain the depth of the cargo box when empty, and the distance from the camera installation position to four planes inside the cargo box.
- the four planes inside the cargo box are the left plane, the right plane, the top plane, and the bottom plane.
- C2 Filter the initial point cloud based on the distance to obtain the target point cloud.
- the distance is the distance from the camera installation position to the four planes inside the cargo box.
- the distances from the camera to four planes within the cargo box are specifically acquired: the left interior plane, the right interior plane, the top plane, and the bottom plane.
- the distances from the camera installation position to the four planes within the cargo box include a first distance from the camera to the left interior plane, a second distance from the camera to the right interior plane, a third distance from the camera to the top plane, and a fourth distance from the camera to the bottom plane.
- the initial point cloud is filtered based on the relationship between the distances from the 3D coordinates in the initial point cloud to the corresponding planes and the distances between the camera and the corresponding planes to obtain the target point cloud.
- the initial point cloud is projected onto a two-dimensional plane. Specifically, the initial point cloud is projected onto a two-dimensional plane along the direction from the camera installation position toward the bottom of the cargo box to obtain a two-dimensional point coordinate set.
- Determining whether the grid coordinates corresponding to the grid cells are within the distance from the camera installation position to the four planes inside the cargo box refers to determining whether the grid coordinates corresponding to the grid cells are within the first distance, the second distance, the third distance, or the fourth distance. If the grid coordinates are within any of the first distance, the second distance, the third distance, or the fourth distance, then the grid coordinates corresponding to the grid cells are determined to be within the distance from the camera installation position to the four planes inside the cargo box. If the grid coordinates are not within the first distance, the second distance, the third distance, or the fourth distance, then the grid coordinates corresponding to the grid cells are determined to be not within the distance from the camera installation position to the four planes inside the cargo box.
- all three-dimensional coordinates in the initial point cloud are projected onto a two-dimensional plane to obtain a set of two-dimensional point coordinates on the two-dimensional plane, and the two-dimensional point coordinates are discretely converted according to a preset size.
- the preset size can be customized, for example, the two-dimensional point coordinates are discretized according to a size of 0.1m ⁇ 0.1m, and the continuous two-dimensional point coordinates in the two-dimensional point coordinate set are converted into discrete grid units, and the plane area of the grid unit is determined according to the preset size.
- a coordinate system is constructed with the camera installation position as the center, and the discretized grid cells are traversed in order from left to right and from bottom to top to determine whether the grid coordinates corresponding to the grid cells are within the distance between the camera and the cargo box plane.
- the point clouds corresponding to the grid cells that exceed the distance between the camera and the interior of the cargo box are marked as cargo box point clouds, and the grid cells within the distance between the camera and the interior of the cargo box are marked as target point clouds.
- an image of the interior of the cargo box is obtained by a camera, the image is input into a trained target depth estimation model, and the depth information of the image is obtained using the target depth estimation model. Then, based on the depth information and the parameter information of the camera, an initial point cloud of the interior of the cargo box is obtained.
- the collection of point clouds is not affected by the material of the object.
- the volume of the target object inside the cargo box is then calculated based on the target point cloud that meets the preset conditions in the initial point cloud. This application solution can effectively reduce the hardware cost of volume measurement and ensure that the precision and accuracy of the measurement are not affected by the material of the object.
- FIG6 shows a structural block diagram of the device for calculating the volume of items provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.
- the device for calculating the volume of an object includes: an image acquisition unit 61 , a depth acquisition unit 62 , a point cloud acquisition unit 63 , and a volume calculation unit 64 , wherein:
- the volume calculation unit 64 is configured to calculate the volume of a target object inside the container based on a target point cloud that meets a preset condition in the initial point cloud, where the target object is the object corresponding to the target point cloud.
- a training set construction unit used to construct a supervised training data set
- a training unit configured to perform supervised training on a target depth estimation model using the supervised training dataset to obtain a training loss
- the parameter information includes focal length
- the point cloud acquisition unit 63 is specifically configured to:
- An initial point cloud of the interior of the cargo box is determined based on the three-dimensional coordinates corresponding to the pixels in the internal image.
- a point cloud filtering module configured to filter the initial point cloud based on the distance to obtain a target point cloud
- the volume calculation module is used to calculate the volume of the target object inside the cargo box based on the target point cloud and the depth of the cargo box.
- the point cloud filtering module is specifically used to:
- Point clouds corresponding to grid cells exceeding the distance are filtered out from the initial point cloud, and the remaining point clouds in the initial point cloud are determined as target point clouds.
- the target grid cell Filling a target grid cell according to the depth information, and calculating the volume of a cuboid corresponding to the target grid cell based on the depth of the container, the target grid cell being the grid cell corresponding to the target point cloud;
- the volume of the target object is calculated according to the volume of the cuboid corresponding to the target grid unit and the number of the target grid units.
- an image of the interior of the cargo box is obtained by a camera, the image is input into a trained target depth estimation model, and the depth information of the image is obtained using the target depth estimation model. Then, based on the depth information and the parameter information of the camera, an initial point cloud of the interior of the cargo box is obtained.
- the collection of point clouds is not affected by the material of the object.
- the volume of the target object inside the cargo box is then calculated based on the target point cloud that meets the preset conditions in the initial point cloud. This application solution can effectively reduce the hardware cost of volume measurement and ensure that the precision and accuracy of the measurement are not affected by the material of the object.
- the present invention also provides a computer-readable storage medium that stores a computer-readable storage medium.
- Machine-readable instructions when executed by a processor, implement the steps of any one of the object volume calculation methods shown in Figures 1 to 5.
- An embodiment of the present application also provides an electronic device, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
- the processor executes the computer-readable instructions, the steps of any one of the object volume calculation methods shown in Figures 1 to 5 are implemented.
- An embodiment of the present application also provides a computer-readable instruction product, which, when executed on an electronic device, enables the electronic device to execute the steps of any one of the object volume calculation methods shown in FIG. 1 to FIG. 5 .
- the computer-readable instructions 72 may be divided into one or more modules/units, which are stored in the memory 71 and executed by the processor 70 to implement the present application.
- the one or more modules/units may be a series of computer-readable instruction segments capable of performing specific functions, which are used to describe the execution process of the computer-readable instructions 72 in the electronic device 7.
- the electronic device 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that FIG7 is merely an example of the electronic device 7 and does not limit the electronic device 7.
- the electronic device 7 may include more or fewer components than shown in the figure, or may combine certain components or different components.
- the electronic device 7 may also include input and output devices, network access devices, buses, and the like.
- the processor 70 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- the general-purpose processor may be a microprocessor or any conventional processor.
- the memory 71 may be an internal storage unit of the electronic device 7, such as a hard disk or memory of the electronic device 7.
- the memory 71 may also be an external storage device of the electronic device 7, such as a plug-in hard disk, a smart memory card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 7.
- the memory 71 may also include both an internal storage unit of the electronic device 7 and an external storage device.
- the memory 71 is used to store the computer-readable instructions and the Other programs and data required by the electronic device.
- the memory 71 can also be used to temporarily store data that has been output or is to be output.
- the computer-readable medium can at least include: any entity or device that can carry computer-readable instruction code to the device/terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium.
- ROM read-only memory
- RAM random access memory
- electric carrier signal telecommunication signal and software distribution medium.
- USB flash drive mobile hard disk, magnetic disk or optical disk.
- computer-readable medium cannot be electric carrier signal and telecommunication signal.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Economics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Development Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Human Resources & Organizations (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Strategic Management (AREA)
- Tourism & Hospitality (AREA)
- General Business, Economics & Management (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
本申请公开一种物品体积计算方法、装置、电子设备和存储介质,所述方法包括:通过相机获取货箱内部图像;将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。本申请可保障物体体积测量的精度和准确度不受物品材质影响,并有效控制体积测量的成本。
Description
本申请涉及物流技术领域,尤其涉及一种物品体积计算方法、装置、电子设备和存储介质。
物流派送作为现代物流业的重要环节,不仅是商品流通的重要保障,也是促进经济发展和提高企业竞争力的关键因素。而货箱中物品体积计算技术在物流行业、仓储管理、运输规划等领域具有广泛的应用和研究意义,通过准确测量货箱中物品的体积,可以帮助物流企业实现精准配载、优化运输路线等目标,从而提高物流效率、降低运输成本,并且货箱中物品体积计算技术可以与智能仓储系统相结合,实现自动化的货物分类、存储和取货,从而提高仓储效率和精度构建智能仓储系统,推动企业数字化转型。
鉴于此,如何保障物体体积测量的精度和准确度不受物品材质影响,同时有效控制体积测量的成本,是当前需要考虑的问题。
本申请实施例的目的之一在于:提供一种物品体积计算方法、装置、电子设备和存储介质。
第一方面,本申请实施例提供了一种物品体积计算方法,包括:
通过相机获取货箱内部图像;
将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;
根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;
根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
在一个实施例中,所述参数信息包括焦距;所述根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云,包括:
获取所述内部图像中像素的像素坐标;
根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内部图像中像素在所述货箱内部的三维坐标;
根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
在一个实施例中,所述根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,包括:
获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离;
基于所述距离对初始点云进行过滤,得到目标点云;
根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
在一个实施例中,所述基于所述距离对所述初始点云进行过滤后得到目标点云,包括:
将所述初始点云投影至二维平面,得到二维点坐标集合;
将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化的栅格单元;
遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在所述距离之内;
将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。
在一个实施例中,所述根据目标点云,计算所述货箱内部目标物体的体积,包括:
根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;
根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
在一个实施例中,所述方法还包括:
构建有监督训练数据集;
利用所述有监督训练数据集对初始深度估计模型进行有监督训练,获取训练损失;
基于所述训练损失更新所述初始深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
第二方面,本申请实施例提供了一种物品体积计算装置,包括:
图像获取单元,用于通过相机获取货箱内部图像;
深度获取单元,用于将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;
点云获取单元,用于根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;
体积计算单元,用于根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
在一个实施例中,所述参数信息包括焦距,所述点云获取单元用于:
获取所述内部图像中像素的像素坐标;
根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内部图像中像素在所述货箱内部的三维坐标;
根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
在一个实施例中,所述体积计算单元包括:
相机距离获取模块,用于获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离;
点云过滤模块,用于基于所述距离对初始点云进行过滤,得到目标点云;
体积计算模块,用于根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
在一个实施例中,所述点云过滤模块用于:
将所述初始点云投影至二维平面,得到二维点坐标集合;
将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化的栅格单元;
遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在所述距离之内;
将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。
在一个实施例中,所述体积计算模块用于:
根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;
根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
在一个实施例中,所述装置还包括:
训练集构建单元,用于构建有监督训练数据集;
训练单元,用于利用所述有监督训练数据集对目标深度估计模型进行有监督训练,获取训练损失;
模型更新单元,用于基于所述训练损失更新所述目标深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
第三方面,本申请实施例提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的物品体积计算方法。
第四方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面所述的物品体积计算方法。
第五方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在电子设备上运行时,使电子设备执行如上述第一方面所述的物品体积计算方法。
本申请实施例中,通过相机获取货箱内部图像,将所述内部图像输入至已训练完成的目标深度估计模型,利用目标深度估计模型获得所述内部图像的深度信息,然后根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云,无需使用高成本的激光雷达采集点云信息,可降低测量成本,点云的采集不受物体材质的影响,再根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积。本申请方案可有效降低体积测量的硬件成本,并保障测量的精度和准确度不受物体的材质影响。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或示范性技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1是本申请实施例提供的物品体积计算方法的实现流程图;
图2是本申请实施例提供的物品体积计算方法中训练获取目标深度估计模型的一种具体实现流程图;
图3是本申请实施例提供的物品体积计算方法中步骤S103的一种具体实现流程图;
图4是本申请实施例提供的物品体积计算方法中步骤S104的一种具体实现流程图;
图5是本申请实施例提供的物品体积计算方法中计算栅格单元对应长方体体积的一种场景示意图;
图6是本申请实施例提供的物品体积计算装置的结构框图;
图7是本申请实施例提供的电子设备的示意图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本申请。
应当理解,当在本申请说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。
如在本申请说明书和所附权利要求书中所使用的那样,术语“如果”可以依据上下文被解释为“当...时”或“一旦”或“响应于确定”或“响应于检测到”。类似地,短语“如果确定”或“如果检测到[所描述条件或事件]”可以依据上下文被解释为意指“一旦确定”或“响应于确定”或“一旦检测到[所描述条件或事件]”或“响应于检测到[所描述条件或事件]”。
另外,在本申请说明书和所附权利要求书的描述中,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。
目前,物流业一般采用激光雷达测量货箱中物品体积,通过激光对货箱内部物品进行扫描,获取点云数据,基于点云数据进行体积测量。然而,激光雷达进行物品体积测量的成本较高,且激光雷达对于黑色物体、玻璃制品等特殊物品的反射率低,易导致测量不准确,无法保障物体体积测量的精度和准确度,这会影响对物体的分类存储,进而降低物流效率。
针对该问题,本申请实施例提供了一种物品体积计算方法、装置、电子设备和存储介质,能够有效降低体积测量的硬件成本,并保障测量的精度和准确度不受物体的材质影响。关于本申请实施例更具体的技术实现细节,请参照下文所述的各个实施例。
本申请实施例提供的物品体积计算方法可应用于需要执行物体体积计算的各种类型的电子设备,具体可以包括智能车载终端、手机、平板电脑、可穿戴设备、笔记本电脑、台式电脑、服务器等。
为了说明本申请所提供的技术方案,以下结合具体附图及实施例进行详细说明。
图1示出了本申请实施例提供的物品体积计算方法的实现流程,该方法流程包括步骤S101至步骤S104。各步骤的具体实现原理如下:
步骤S101:通过相机获取货箱内部图像。
本实施例中,采用单目相机(Single-lens reflex camera,SLR)获取货箱内部图像。单目相机取景时来自被摄物的光线经镜头聚焦,被斜置的反光镜反射到聚焦屏上成像。单目相机成本较低,利用单目相机采集图像后确定货箱内部的点云信息,有助于降低成本,从而有效降低体积测量的硬件成本。单目相机的类型、型号可根据实际应用需求确定,本实施例不对单目相机的类型、型号甚至品牌作出任何限定。
步骤S102:将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息。
目标深度估计模型是训练完成、用于估计深度信息的神经网络模型。本实施例中,利用目标深度估计模型获取深度信息,无需采用昂贵的激光雷达等硬件设备,即可结合图像的2D信息转换得到3D点云,有效降低硬件成本。
一般地,可采用激光点云数据作为真值对神经网络模型进行训练,获得用于估计深度信息的深度估计模型。然而该种方式需要对图像和激光点云数据进行时空标定,操作难度较大,训练效率较低。
作为本申请一种可能的实施方式,图2示出了本申请实施例提供的物品体积计算方法中,训练获得目标深度估计模型的一种具体实现流程,详述如下:
A1:构建有监督训练数据集。
有监督训练数据集包括样本视频图像和样本深度图像。具体地,采集货箱内部的样本视频图像,样本视频图像中货箱内部包含物品,将该样本视频图像输入至DINOV2深度估计大模型获得对应的样本深度图像(或样本深度值),根据该样本视频图像和样本深度图像(或样本深度值),构建包含样本视频图像和样本深度图像(或样本深度值)的有监督训练数据集。
例如,有监督训练数据集包括一摄像头采集的RGB图像和对应包含距离信息的深度图像。先采集显示货箱内部RGB图像。将采集的RGB图像输入至DINOV2深度估计大模型,以获取包含距离信息的深度图像(或样本深度值),然后基于这些RGB图像和相应的深度图像(或样本深度值),构建出有监督训练数据集。
距离信息的深度图像一般通过采用激光雷达点云数据做真值获取,这种采集方式成本较高。而本申请实施例中,利用DINOV2深度估计大模型获取包含距离信息的深度图像,可有效降低成本。
A2:利用所述有监督训练数据集对初始深度估计模型进行有监督训练,获取训练损失。
本实施例中,将有监督训练数据集中样本视频图像作为初始深度估计模型的输入,获得该初始深度模型输出的第一深度图像,可采用最小化损失函数预测初始深度估计该第一
深度图像与有监督训练数据集中样本视频图像对应的样本深度图像之间的损失,得到对初始深度估计模型进行有监督训练的训练损失。
A3:基于所述训练损失更新所述初始深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
一种可能的实施方式中,采用反向传播的方式基于所述训练损失更新所述初始深度估计模型。
示例性地,对初始深度估计模型中每个卷积核设置一个参数梯度,当采用反向传播的时候,初始深度估计模型中每一个需要更新的模型参数都存在一个对应的梯度,在基于所述训练损失更新所述初始深度估计模型的过程中,可以根据这个梯度对其中的模型参数进行优化,从而降低损失,使得训练损失小于或等于预设损失阈值时,得到训练完成的目标深度估计模型。
本申请实施例中,利用训练完成的目标深度估计模型确定货箱内部图像的深度信息,不需要增加额外设备,过程简单,落地效率高,并且有监督学习和无监督学习方式结合进行模型训练得到的目标深度估计模型精度更高,可有效提升深度信息采集的准确度,并且可避免物体材质影响深度信息的采集。
步骤S103:根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云。
本实施例中,结合深度信息和相机的参数,得到货箱内部的初始点云。该初始点云包括货箱点云和货箱内物体的点云。
上述相机的参数信息包括焦距。作为本申请一种可能的实施方式,图3示出了本申请实施例提供的物品体积计算方法中,根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云的一种具体实现流程,详述如下:
B1:获取所述内部图像中像素的像素坐标。像素坐标为二维坐标。
B2:根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内部图像中像素在所述货箱内部的三维坐标。该三维坐标是像素坐标在世界坐标系中的位置坐标。
在本申请实施例中,根据下式(1)确定像素坐标P(u,v)对应的三维坐标:
其中,u表示内部图像中像素在像素坐标系的横坐标,v表示内部图像中像素在像素坐标系的纵坐标,z表示内部图像中像素对应的深度信息(深度信息是根据上述目标深度估
计模型得到的),cU和cV是像素坐标系的中心坐标(一般为图片中心),fU、fV分别表示相机在世界坐标系中x轴方向和y轴方向上的焦距。x是像素P(u,v)在世界坐标系的中的横向x轴的位置信息,y是像素P(u,v)在世界坐标系的中纵向y轴的位置信息。根据上述式(1),可获得内部图像中像素P(u,v)对应的三维坐标P(x,y,z)。
B3:根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
根据所述内部图像中像素对应的三维坐标,将所述内部图像进行空间转换,得到包含货箱点云、目标物体点云的初始点云,目标物体是指在所述货箱内部的物体。
本实施例中,结合相机拍摄的货箱内部图像、目标深度估计模型确定的深度信息以及相机的参数信息,确定初始点云,无需采用昂贵的激光雷达,可有效降低成本。
步骤S104:根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
上述满足预设条件的目标点云为目标物体的点云,由于初始点云中包括货箱点云,本实施例中,通过设置预设条件对初始点云进行过滤,将满足预设条件的点云确定为目标点云,也即目标物体对应的点云。
作为本申请一种可能的实施方式,图4示出了本申请实施例提供的物品体积计算方法中步骤S104的一种具体实现流程,详述如下:
C1:获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离。其中,货箱内部四个平面分别为货箱内部左侧平面、货箱内部右侧平面、货箱顶部平面以及货箱底部平面。
C2:基于所述距离对初始点云进行过滤,得到目标点云。所述距离即为相机安装位置到货箱内部四个平面的距离。
本实施例中,具体获取相机到货箱内部四个平面的距离,四个平面分别为货箱内部左侧平面、货箱内部右侧平面、货箱顶部平面以及货箱底部平面,相机安装位置到货箱内部四个平面的距离包括:相机到货箱内部左侧平面的第一距离,相机到货箱内部右侧平面的第二距离,相机到货箱顶部平面的第三距离,以及相机到货箱底部平面的第四距离。通过初始点云中的三维坐标到相应平面的距离与相机到相应平面之间距离的关系,对初始点云进行过滤筛选,从而获得目标点云。
作为本申请一种可能的实施方式,将所述初始点云沿着投影至二维平面,具体地,将所述初始点云沿着相机安装位置朝向货箱底部的方向投影至二维平面,得到二维点坐标集合,将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化
的栅格单元,其中,一个栅格单元中包括若干个密集的二维点坐标;遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在相机安装位置到货箱内部四个平面的距离之内,将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。其中,确定所述栅格单元对应的栅格坐标是否在相机安装位置到货箱内部四个平面的距离之内,是指确定所述栅格单元对应的栅格坐标是否在所述第一距离、所述第二距离、所述第三距离或者所述第四距离之内,若所述栅格坐标在所述第一距离、所述第二距离、所述第三距离或者所述第四距离中任意一个距离之内,则确定所述栅格单元对应的栅格坐标在相机安装位置到货箱内部四个平面的距离之内。若所述栅格坐标均不在所述第一距离、所述第二距离、所述第三距离或者所述第四距离之内,则确定所述栅格单元对应的栅格坐标不在相机安装位置到货箱内部四个平面的距离之内。
在本实施例中,将初始点云中的所有三维坐标均投影至二维平面,得到在二维平面上的二维点坐标集合,将二维点坐标按照预设尺寸进行离散转换处理,预设尺寸可以自定义,例如,按照0.1m×0.1m的尺寸将二维点坐标进行离散化,将二维点坐标集合中连续的二维点坐标转换为离散的栅格单元,栅格单元平面面积根据所述预设尺寸确定。
一些实施方式中,从货箱底部开始,以相机安装位置为中心构建坐标系,并按照从左到右、从下到上的顺序遍历离散化的栅格单元,确定栅格单元对应的栅格坐标是否在相机与货箱平面的距离之内,对于超出相机与货箱内部的距离的栅格单元对应的点云标记为货箱点云,在相机与货箱内部的距离之内的栅格单元标记为目标点云。
在一些实施方式中,栅格单元包括若干个密集的二维点坐标,确定该若干个密集的二维点坐标的中心二维点,并将该中心二维点确定为该栅格单元的栅格坐标。
C3:根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
在本申请实施例中,根据目标物体对应的目标点云,即可计算该目标物体的体积。
在一种可能的实施方式中,根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
示例性地,如图5所示,将标记为目标物品的栅格单元按深度值z0进行填充得到一个长方体,基于货箱深度L和深度信息中的深度值z0的差值,即可确定长方体的长度len,再结合栅格单元的预设尺寸x0×y0,即可计算该长方体的体积,例如,若栅格单元预设尺寸为0.1×0.1,该栅格单元对应长方体的体积为0.1×0.1×len,len=(L-z0),再通过累加所有目标栅格单元的体积,即可到货箱内部目标物体的体积。
由上可见,本申请实施例中,通过相机获取货箱内部图像,将所述内部图像输入至已训练完成的目标深度估计模型,利用目标深度估计模型获得所述内部图像的深度信息,然后根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云,无需使用高成本的激光雷达采集点云信息,可降低测量成本,点云的采集不受物体材质的影响,再根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积。本申请方案可有效降低体积测量的硬件成本,并保障测量的精度和准确度不受物体的材质影响。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
对应于上文实施例所述的物品体积计算方法,图6示出了本申请实施例提供的物品体积计算装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图6,该物品体积计算装置包括:图像获取单元61,深度获取单元62,点云获取单元63,体积计算单元64,其中:
图像获取单元61,用于通过相机获取货箱内部图像;
深度获取单元62,用于将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;
点云获取单元63,用于根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;
体积计算单元64,用于根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
作为本申请一种可能的实施方式,所述装置还包括:
训练集构建单元,用于构建有监督训练数据集;
训练单元,用于利用所述有监督训练数据集对目标深度估计模型进行有监督训练,获取训练损失;
模型更新单元,用于基于所述训练损失更新所述目标深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
作为本申请一种可能的实施方式,上述参数信息包括焦距,上述点云获取单元63具体用于:
获取所述内部图像中像素的像素坐标;
根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内
部图像中像素在所述货箱内部的三维坐标;
根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
作为本申请一种可能的实施方式,上述体积计算单元64包括:
相机距离获取模块,用于获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离;
点云过滤模块,用于基于所述距离对初始点云进行过滤,得到目标点云;
体积计算模块,用于根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
作为本申请一种可能的实施方式,上述点云过滤模块具体用于:
将所述初始点云投影至二维平面,得到二维点坐标集合;
将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化的栅格单元;
遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在所述距离之内;
将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。
作为本申请一种可能的实施方式,上述体积计算模块具体用于:
根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;
根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
由上可见,本申请实施例中,通过相机获取货箱内部图像,将所述内部图像输入至已训练完成的目标深度估计模型,利用目标深度估计模型获得所述内部图像的深度信息,然后根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云,无需使用高成本的激光雷达采集点云信息,可降低测量成本,点云的采集不受物体材质的影响,再根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积。本申请方案可有效降低体积测量的硬件成本,并保障测量的精度和准确度不受物体的材质影响。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算
机可读指令,所述计算机可读指令被处理器执行时实现如图1至图5表示的任意一种物品体积计算方法的步骤。
本申请实施例还提供一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如图1至图5表示的任意一种物品体积计算方法的步骤。
本申请实施例还提供一种计算机可读指令产品,当该计算机可读指令产品在电子设备上运行时,使得电子设备执行实现如图1至图5表示的任意一种物品体积计算方法的步骤。
图7是本申请一实施例提供的电子设备的示意图。如图7所示,该实施例的电子设备7包括:处理器70、存储器71以及存储在所述存储器71中并可在所述处理器70上运行的计算机可读指令72。所述处理器70执行所述计算机可读指令72时实现上述各个物品体积计算方法实施例中的步骤,例如图1所示的步骤S101至S104。或者,所述处理器70执行所述计算机可读指令72时实现上述各装置实施例中各模块/单元的功能,例如图6所示单元61至64的功能。
示例性的,所述计算机可读指令72可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器71中,并由所述处理器70执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令72在所述电子设备7中的执行过程。
所述电子设备7可包括,但不仅限于,处理器70、存储器71。本领域技术人员可以理解,图7仅仅是电子设备7的示例,并不构成对电子设备7的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备7还可以包括输入输出设备、网络接入设备、总线等。
所述处理器70可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器71可以是所述电子设备7的内部存储单元,例如电子设备7的硬盘或内存。所述存储器71也可以是所述电子设备7的外部存储设备,例如所述电子设备7上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器71还可以既包括所述电子设备7的内部存储单元也包括外部存储设备。所述存储器71用于存储所述计算机可读指令以及所述
电子设备所需的其他程序和数据。所述存储器71还可以用于暂时地存储已经输出或者将要输出的数据。
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机可读指令代码携带到装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含
在本申请的保护范围之内。
Claims (14)
- 一种物品体积计算方法,其特征在于,包括:通过相机获取货箱内部图像;将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
- 根据权利要求1所述的方法,其特征在于,所述参数信息包括焦距;所述根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云,包括:获取所述内部图像中像素的像素坐标;根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内部图像中像素在所述货箱内部的三维坐标;根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
- 根据权利要求1所述的方法,其特征在于,所述根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,包括:获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离;基于所述距离对初始点云进行过滤,得到目标点云;根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
- 根据权利要求3所述的方法,其特征在于,所述基于所述距离对所述初始点云进行过滤后得到目标点云,包括:将所述初始点云投影至二维平面,得到二维点坐标集合;将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化的栅格单元;遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在所述距离之内;将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。
- 根据权利要求4所述的方法,其特征在于,所述根据目标点云,计算所述货箱内部目标物体的体积,包括:根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格 单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:构建有监督训练数据集;利用所述有监督训练数据集对初始深度估计模型进行有监督训练,获取训练损失;基于所述训练损失更新所述初始深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
- 一种物品体积计算装置,其特征在于,包括:图像获取单元,用于通过相机获取货箱内部图像;深度获取单元,用于将所述内部图像输入至已训练完成的目标深度估计模型,获得所述内部图像的深度信息;点云获取单元,用于根据所述深度信息与所述相机的参数信息,得到所述货箱内部的初始点云;体积计算单元,用于根据所述初始点云中满足预设条件的目标点云,计算所述货箱内部目标物体的体积,所述目标物体为所述目标点云对应的物体。
- 根据权利要求7所述的装置,其特征在于,所述参数信息包括焦距,所述点云获取单元用于:获取所述内部图像中像素的像素坐标;根据所述相机的焦距、所述像素的像素坐标及所述像素对应的深度信息,获取所述内部图像中像素在所述货箱内部的三维坐标;根据所述内部图像中像素对应的三维坐标,确定所述货箱内部的初始点云。
- 根据权利要求7所述的装置,其特征在于,所述体积计算单元包括:相机距离获取模块,用于获取空车状态下货箱深度,以及相机安装位置到货箱内部四个平面的距离;点云过滤模块,用于基于所述距离对初始点云进行过滤,得到目标点云;体积计算模块,用于根据所述目标点云与所述货箱深度,计算所述货箱内部目标物体的体积。
- 根据权利要求9所述的装置,其特征在于,所述点云过滤模块用于:将所述初始点云投影至二维平面,得到二维点坐标集合;将所述二维点坐标集合中的二维点坐标按照预设尺寸进行离散转换处理,获得离散化 的栅格单元;遍历所述离散的栅格单元,确定所述栅格单元对应的栅格坐标是否在所述距离之内;将超出所述距离的栅格单元对应的点云从所述初始点云中过滤掉,并将所述初始点云中余下的点云确定为目标点云。
- 根据权利要求10所述的装置,其特征在于,所述体积计算模块用于:根据所述深度信息对目标栅格单元进行填充,并基于所述货箱深度计算所述目标栅格单元对应长方体的体积,所述目标栅格单元是所述目标点云对应的栅格单元;根据所述目标栅格单元对应的长方体体积以及所述目标栅格单元的数量,计算所述目标物体的体积。
- 根据权利要求7所述的装置,其特征在于,所述装置还包括:训练集构建单元,用于构建有监督训练数据集;训练单元,用于利用所述有监督训练数据集对目标深度估计模型进行有监督训练,获取训练损失;模型更新单元,用于基于所述训练损失更新所述目标深度估计模型,直至所述训练损失满足预设损失条件时,得到训练完成的目标深度估计模型。
- 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如权利要求1至6任一项所述的物品体积计算方法。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现如权利要求1至6任一项所述的物品体积计算方法。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/083872 WO2025199754A1 (zh) | 2024-03-26 | 2024-03-26 | 物品体积计算方法、装置、电子设备和存储介质 |
| CN202480000778.4A CN118414634A (zh) | 2024-03-26 | 2024-03-26 | 物品体积计算方法、装置、电子设备和存储介质 |
| EP24728009.2A EP4651084A4 (en) | 2024-03-26 | 2024-03-26 | METHOD AND APPARATUS FOR CALCULATING ARTICLE VOLUME, ELECTRONIC DEVICE AND STORAGE MECHANISM |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2024/083872 WO2025199754A1 (zh) | 2024-03-26 | 2024-03-26 | 物品体积计算方法、装置、电子设备和存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025199754A1 true WO2025199754A1 (zh) | 2025-10-02 |
Family
ID=92003741
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/083872 Pending WO2025199754A1 (zh) | 2024-03-26 | 2024-03-26 | 物品体积计算方法、装置、电子设备和存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| EP (1) | EP4651084A4 (zh) |
| CN (1) | CN118414634A (zh) |
| WO (1) | WO2025199754A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN118762072B (zh) * | 2024-09-06 | 2025-01-14 | 深圳依时货拉拉科技有限公司 | 基于点云的物体体积测量方法、装置、设备和存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111709987A (zh) * | 2020-06-11 | 2020-09-25 | 上海东普信息科技有限公司 | 包裹体积测量方法、装置、设备及存储介质 |
| CN112991427A (zh) * | 2019-12-02 | 2021-06-18 | 顺丰科技有限公司 | 物体体积测量方法、装置、计算机设备和存储介质 |
| CN114373005A (zh) * | 2021-12-07 | 2022-04-19 | 深圳市锐明技术股份有限公司 | 一种货物体积测量方法、装置、电子设备及可读存储介质 |
| EP4181064A1 (en) * | 2021-11-12 | 2023-05-17 | SITA Information Networking Computing UK Limited | Method and system for measuring an article |
| CN116205836A (zh) * | 2021-11-29 | 2023-06-02 | 汉海信息技术(上海)有限公司 | 物品码垛合规检测方法、装置、电子设备 |
| US11748901B1 (en) * | 2020-02-11 | 2023-09-05 | State Farm Mutual Automobile Insurance Company | Using deep learning and structure-from-motion techniques to generate 3D point clouds from 2D data |
| CN117670979A (zh) * | 2024-02-01 | 2024-03-08 | 四川港投云港科技有限公司 | 一种基于固定点位单目相机的大宗货物体积测量方法 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113362385A (zh) * | 2021-06-21 | 2021-09-07 | 山东产研信息与人工智能融合研究院有限公司 | 一种基于深度图像的货物体积测量方法及设备 |
| CN117132633A (zh) * | 2022-05-18 | 2023-11-28 | 北京嘀嘀无限科技发展有限公司 | 基于单目相机的装载率估计方法、装置、设备及介质 |
-
2024
- 2024-03-26 EP EP24728009.2A patent/EP4651084A4/en active Pending
- 2024-03-26 CN CN202480000778.4A patent/CN118414634A/zh active Pending
- 2024-03-26 WO PCT/CN2024/083872 patent/WO2025199754A1/zh active Pending
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112991427A (zh) * | 2019-12-02 | 2021-06-18 | 顺丰科技有限公司 | 物体体积测量方法、装置、计算机设备和存储介质 |
| US11748901B1 (en) * | 2020-02-11 | 2023-09-05 | State Farm Mutual Automobile Insurance Company | Using deep learning and structure-from-motion techniques to generate 3D point clouds from 2D data |
| CN111709987A (zh) * | 2020-06-11 | 2020-09-25 | 上海东普信息科技有限公司 | 包裹体积测量方法、装置、设备及存储介质 |
| EP4181064A1 (en) * | 2021-11-12 | 2023-05-17 | SITA Information Networking Computing UK Limited | Method and system for measuring an article |
| CN116205836A (zh) * | 2021-11-29 | 2023-06-02 | 汉海信息技术(上海)有限公司 | 物品码垛合规检测方法、装置、电子设备 |
| CN114373005A (zh) * | 2021-12-07 | 2022-04-19 | 深圳市锐明技术股份有限公司 | 一种货物体积测量方法、装置、电子设备及可读存储介质 |
| CN117670979A (zh) * | 2024-02-01 | 2024-03-08 | 四川港投云港科技有限公司 | 一种基于固定点位单目相机的大宗货物体积测量方法 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4651084A4 * |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4651084A4 (en) | 2025-12-31 |
| EP4651084A1 (en) | 2025-11-19 |
| CN118414634A (zh) | 2024-07-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112132523B (zh) | 一种货物数量确定方法、系统和装置 | |
| WO2024197815A1 (zh) | 一种工程机械的建图、方法、设备、及可读存储介质 | |
| CN113538555B (zh) | 基于规则箱体的体积测量方法、系统、设备及存储介质 | |
| CN111750804B (zh) | 一种物体测量的方法及设备 | |
| CN111696152B (zh) | 检测包裹堆垛的方法、装置、计算设备、系统及存储介质 | |
| CN112509126B (zh) | 三维物体检测的方法、装置、设备及存储介质 | |
| CN114862929A (zh) | 三维目标检测方法、装置、计算机可读存储介质及机器人 | |
| CN116363192A (zh) | 仓储货物的体积测量方法、装置、计算机设备及存储介质 | |
| CN116563384A (zh) | 一种图像采集装置标定方法、设备及计算机设备 | |
| EP4651084A1 (en) | Item volume calculation method and apparatus, and electronic device and storage medium | |
| CN115221981B (zh) | 一种目标跟踪方法、装置、终端设备及存储介质 | |
| CN116358486A (zh) | 基于单目相机的目标测距方法、装置及介质 | |
| CN116343186A (zh) | 一种数据处理方法、装置及电子设备 | |
| CN113538554B (zh) | 基于深度相机的体积测量方法、系统、设备及存储介质 | |
| CN118229772B (zh) | 基于图像处理的托盘位姿检测方法、系统、设备和介质 | |
| CN118518009B (zh) | 标定参数确定方法、校正方法、介质及设备 | |
| CN114757959A (zh) | 障碍物及悬崖检测方法、装置、可读存储介质及机器人 | |
| CN120318592A (zh) | 一种基于空间关系推理的货物搬运方法及系统 | |
| CN113608207A (zh) | 一种高炉料面形状测量方法、终端设备及存储介质 | |
| CN113188509A (zh) | 一种测距方法、装置、电子设备及存储介质 | |
| CN115546784B (zh) | 一种基于深度学习的3d目标检测办法 | |
| CN117830385A (zh) | 物料堆体积测量方法、装置、电子设备及存储介质 | |
| CN113538558B (zh) | 基于ir图的体积测量优化方法、系统、设备及存储介质 | |
| CN118262324A (zh) | 一种目标检测方法、装置、终端设备和无人驾驶设备 | |
| CN115438712A (zh) | 一种基于卷积神经网络与车路协同的感知融合方法、装置、设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| ENP | Entry into the national phase |
Ref document number: 2024728009 Country of ref document: EP Effective date: 20240531 |
|
| WWP | Wipo information: published in national office |
Ref document number: 2024728009 Country of ref document: EP |