Method, device and electronic equipment for determining volume of goods in vehicle compartment

CN120931705BActive Publication Date: 2026-09-15LEISHEN INTELLIGENT SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410560076.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2026-09-15
Estimated Expiration
2044-05-08

AI Technical Summary

Technical Problem

相关技术中,通常采用手持式扫描仪或在货运列车的车厢内安装扫描仪的方式获取列车车厢内的货物体积,然而,如果采用手持式扫描仪扫描列车车厢内的货物,需要列车静止,影响了列车调度;如果每节车厢都安装扫描仪,成本较高,且扫描仪容易受货物的煤尘、烟雾等影响,难以保证采集精度

Benefits of technology

[0021]The present invention provides a method, apparatus, and electronic device for determining the volume of goods inside a train carriage. When a train passes through a railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a first specified frame reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved. Simultaneously, each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a second specified frame reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each subsequent frame, are saved. When the number of point cloud data points with a height greater than a first preset height threshold is less than a second threshold, the saving of the horizontal point cloud data for the second specified frame, as well as the horizontal point cloud data for each frame after the second specified frame, is stopped, and the saving of the vertical point cloud data for each frame is also stopped; wherein, the second threshold is less than or equal to the first threshold; based on the first and second specified frames, the number of point cloud frames corresponding to the carriage is determined; based on the saved vertical point cloud data for each frame, the length of the carriage corresponding to the carriage is determined; based on the number of point cloud frames corresponding to the carriage and the length of the carriage, a three-dimensional point cloud model is constructed, and the volume of goods in the carriage is determined based on the three-dimensional point cloud model. This method, by installing multiple single-line lidars on the railway gantry, can acquire the volume of goods in the carriages of running trains in real time without affecting train scheduling, and does not require the installation of lidars in each carriage, so the acquisition process is not affected by the goods, thus reducing costs while ensuring acquisition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120931705B_ABST
    Figure CN120931705B_ABST
Patent Text Reader

Abstract

The application provides a method and device for determining the volume of goods in a carriage and electronic equipment, saves the transverse point cloud data of a first specified frame and the transverse point cloud data of each frame thereafter; each second single-line laser radar starts collecting and saving the longitudinal point cloud data of each frame; stops saving the transverse point cloud data of a second specified frame and the transverse point cloud data of each frame thereafter, and stops saving the longitudinal point cloud data of each frame; determines the point cloud frame number corresponding to the carriage section; determines the carriage length corresponding to the carriage section based on the saved longitudinal point cloud data of each frame; and constructs a three-dimensional point cloud model to determine the volume of goods in the carriage section. This method can obtain the volume of goods in the carriage of a running train in real time by installing multiple single-line laser radars on a railway gantry, does not affect train scheduling, and does not need to install a laser radar in each carriage, so that the collection process is not affected by the goods, thereby reducing the cost while ensuring the collection accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of point cloud processing technology, and in particular to a method, apparatus, and electronic device for determining the volume of goods inside a vehicle compartment. Background Technology

[0002] Calculating the volume of freight on conventional railways is a crucial step in railway transportation and logistics. It primarily determines the actual volume of goods to ensure proper loading, transport, and storage. Common technologies for obtaining freight volume data include handheld scanners or scanners installed inside freight train carriages. However, using handheld scanners requires the train to be stationary, disrupting train scheduling. Installing scanners in every carriage is costly, and scanners are susceptible to dust, smoke, and other contaminants from the freight, making it difficult to guarantee accurate data collection. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for determining the volume of goods inside a train carriage, so as not to affect train scheduling and to ensure data collection accuracy while reducing costs.

[0004] This invention provides a method for determining the volume of cargo inside a railway carriage. At least four first single-line lidars for measuring transverse point clouds and at least one second single-line lidar for measuring longitudinal point clouds are installed on a railway gantry. Each first single-line lidar is installed on the top and side of the railway gantry, respectively; each second single-line lidar is installed on the top of the railway gantry; the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system. The method includes:

[0005] When a train passes through the railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of the first specified frame reaches the first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved; and each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data.

[0006] When the number of point cloud data with a height greater than a first preset height threshold in the horizontal point cloud data of the second specified frame is less than a second threshold, the saving of the horizontal point cloud data of the second specified frame, as well as the horizontal point cloud data of each frame after the second specified frame, is stopped, and the saving of the vertical point cloud data of each frame is also stopped; wherein, the second threshold is less than or equal to the first threshold; the number of point cloud frames corresponding to the carriage is determined according to the first specified frame and the second specified frame; the length of the carriage corresponding to the carriage is determined based on the saved vertical point cloud data of each frame; a three-dimensional point cloud model is constructed based on the number of point cloud frames corresponding to the carriage and the length of the carriage, so as to determine the volume of goods in the carriage based on the three-dimensional point cloud model.

[0007] Furthermore, the step of determining the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame includes: determining the total number of frames corresponding to the saved lateral point cloud data based on the first specified frame and the second specified frame; if the total number of frames is greater than a preset number threshold, determining each frame of saved lateral point cloud data as each frame of lateral point cloud data corresponding to the carriage, and determining the total number of frames as the number of point cloud frames corresponding to the carriage.

[0008] Furthermore, the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system in the following manner: At a first preset time before the train passes the railway gantry, each frame of raw point cloud data is collected by each first single-line lidar; after the collection time reaches a second preset time, each frame of raw point cloud data collected by each first single-line lidar is sequentially translated according to a preset distance value to obtain the region model point cloud corresponding to each first single-line lidar; the main single-line lidar is determined from at least one first single-line lidar installed on the top surface of the railway gantry.

[0009] A random sampling consensus algorithm is used to extract ground point cloud data from the regional model point cloud corresponding to the main single-line lidar. The ground point cloud data is then fitted to determine the first and second deviation angles corresponding to the main single-line lidar. Based on the first and second deviation angles, a first calibration matrix is ​​determined. The regional model point cloud corresponding to the main single-line lidar is calibrated based on the first calibration matrix. A data registration algorithm is used to transform each other first single-line lidar (excluding the main single-line lidar) to the coordinate system corresponding to the main single-line lidar, resulting in a second calibration matrix for each of the other first single-line lidars. Based on each second calibration matrix, the regional model point cloud corresponding to each of the other first single-line lidars is calibrated to the same coordinate system as the regional model point cloud corresponding to the main single-line lidar.

[0010] Furthermore, the step of determining the length of the carriage corresponding to the car based on the saved longitudinal point cloud data of each frame includes: for each frame of longitudinal point cloud data, using a histogram algorithm, identifying multiple first histogram grids in the longitudinal point cloud data of that frame whose point cloud height exceeds a second preset height threshold; determining the position coordinates of the center point of each first histogram grid; calculating the difference between the center points of every two adjacent first histogram grids based on each position coordinate; and determining the largest difference among the multiple difference results corresponding to each frame of longitudinal point cloud data as the length of the carriage corresponding to that car.

[0011] Furthermore, based on the number of point cloud frames and the length of the carriage, the steps for constructing a 3D point cloud model include: calculating the ratio of the carriage length to the number of point cloud frames to obtain the translation interval distance; translating each frame of lateral point cloud data corresponding to the carriage sequentially in the depth direction according to the translation interval distance to obtain an initial point cloud model; and interpolating the initial point cloud model to obtain a 3D point cloud model.

[0012] Furthermore, the steps for determining the cargo volume in the carriage based on the 3D point cloud model include: rasterizing the 3D point cloud model in the X-axis and Y-axis directions according to a preset raster size, and projecting the 3D point cloud model onto the XOY plane to obtain the point cloud projection result; determining the target filtering boundary based on the point cloud projection result; wherein, the target filtering boundary includes: upper filtering boundary, lower filtering boundary, left filtering boundary, and right filtering boundary; segmenting the 3D point cloud model according to the target filtering boundary to obtain the segmented point cloud model; and using a random sampling consistency algorithm on the main single-line lidar to extract the planar point cloud data of the bottom of the carriage from the point cloud of the region model corresponding to the main single-line lidar.

[0013] Fit the point cloud data of the bottom plane of the carriage to determine the first height between the bottom plane of the carriage and the XOY plane; filter out the point cloud with a height lower than the first height from the segmented point cloud model to obtain the target point cloud model; project the target point cloud model onto the XOY plane and divide it into two-dimensional grids according to the preset grid size to obtain the divided grid; determine the volume of the cargo in the carriage based on the divided grid.

[0014] Furthermore, the step of determining the cargo volume in the carriage based on the divided grid includes: identifying target grids containing point cloud data from the divided grids; for each target grid, determining the maximum and minimum height values ​​of the point cloud in the target grid; determining the percentage of grid voxels corresponding to the target grid based on the maximum and minimum height values ​​of the point cloud and the preset grid voxel size; calculating the sum of the percentages of grid voxels corresponding to each target grid; and determining the cargo volume in the carriage based on the sum and the volume of the grid voxels.

[0015] This invention provides a device for determining the volume of cargo inside a railway carriage. At least four first single-line lidars for measuring transverse point clouds and at least one second single-line lidar for measuring longitudinal point clouds are installed on a railway gantry. Each first single-line lidar is installed on the top and side of the railway gantry, respectively; each second single-line lidar is installed on the top of the railway gantry; the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system. The device includes:

[0016] The acquisition module is used to acquire each frame of lateral point cloud data for each carriage of a train when a train passes through the railway gantry, using each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of the first specified frame reaches a first threshold, the module saves the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame; and triggers each second single-line lidar to start acquiring and saving each frame of longitudinal point cloud data.

[0017] The stop-save module is used to stop saving the horizontal point cloud data of the second specified frame, as well as the horizontal point cloud data of each frame after the second specified frame, when the number of point cloud data with a point cloud height greater than a first preset height threshold is less than a second threshold; and to stop saving the vertical point cloud data of each frame; wherein the second threshold is less than or equal to the first threshold.

[0018] The first determining module is used to determine the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame; the second determining module is used to determine the length of the carriage corresponding to the carriage based on the saved longitudinal point cloud data of each frame; the third determining module is used to construct a three-dimensional point cloud model based on the number of point cloud frames corresponding to the carriage and the length of the carriage, so as to determine the volume of goods in the carriage based on the three-dimensional point cloud model.

[0019] The present invention provides an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the method for determining the volume of cargo inside a carriage as described above.

[0020] The present invention provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement any of the above-mentioned methods for determining the volume of goods inside a carriage.

[0021] The present invention provides a method, apparatus, and electronic device for determining the volume of goods inside a train carriage. When a train passes through a railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a first specified frame reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved. Simultaneously, each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a second specified frame reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each subsequent frame, are saved. When the number of point cloud data points with a height greater than a first preset height threshold is less than a second threshold, the saving of the horizontal point cloud data for the second specified frame, as well as the horizontal point cloud data for each frame after the second specified frame, is stopped, and the saving of the vertical point cloud data for each frame is also stopped; wherein, the second threshold is less than or equal to the first threshold; based on the first and second specified frames, the number of point cloud frames corresponding to the carriage is determined; based on the saved vertical point cloud data for each frame, the length of the carriage corresponding to the carriage is determined; based on the number of point cloud frames corresponding to the carriage and the length of the carriage, a three-dimensional point cloud model is constructed, and the volume of goods in the carriage is determined based on the three-dimensional point cloud model. This method, by installing multiple single-line lidars on the railway gantry, can acquire the volume of goods in the carriages of running trains in real time without affecting train scheduling, and does not require the installation of lidars in each carriage, so the acquisition process is not affected by the goods, thus reducing costs while ensuring acquisition accuracy. Attached Figure Description

[0022] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 A schematic diagram of the installation position of a lidar provided in an embodiment of the present invention;

[0024] Figure 2 A flowchart illustrating a method for determining the volume of goods inside a carriage, as provided in an embodiment of the present invention;

[0025] Figure 3 A schematic diagram of a three-dimensional point cloud model provided in an embodiment of the present invention;

[0026] Figure 4 This is a schematic diagram of a point cloud projection result provided in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of a segmented point cloud model provided in an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of a system for determining the volume of goods inside a carriage, provided in an embodiment of the present invention.

[0029] Figure 7 A flowchart illustrating a method for determining the volume of goods inside a carriage, as provided in an embodiment of the present invention;

[0030] Figure 8 A schematic diagram of a device for determining the volume of goods inside a carriage, provided in an embodiment of the present invention;

[0031] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0032] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] Calculating the volume of freight on conventional railways is a crucial step in railway transportation and logistics. It primarily determines the actual volume of goods to ensure proper loading, transport, and storage. The following is an analysis of the freight volume calculation industry for railways:

[0034] 1. Railway Transportation Industry: Calculating the volume of freight on trains is crucial for railway companies. By accurately calculating the volume of freight, railway companies can rationally plan the loading of train carriages, avoiding wasted space or underloading, thereby improving transportation efficiency and reducing costs. Furthermore, calculating the volume of freight on trains also helps ensure the safety and stability of freight transportation.

[0035] 2. Logistics Industry: Railway transportation is a crucial component of the logistics system; therefore, calculating the volume of freight transported by train is closely related to the logistics industry. Logistics companies need to accurately understand the volume of goods in order to rationally load and plan transportation schemes, ensuring that goods can be effectively handled and transported during train transport.

[0036] 3. Freight Loading Industry: Calculating the volume of freight on trains is also crucial in the freight loading industry. Loading companies need to rationally arrange the loading and stacking of freight based on its actual volume to ensure that the freight is not damaged or delayed during transportation.

[0037] 4. Railway Logistics Planning and Management: Railway logistics planning and management departments need to rationally plan and manage the railway transportation system by calculating the volume of freight on trains. Understanding the actual volume of freight helps optimize the transportation network, reduce congestion, and improve transportation efficiency. It also helps in planning appropriate storage and handling facilities based on the characteristics of the freight.

[0038] In summary, the railway freight volume calculation industry involves multiple fields such as railway transportation, logistics, freight loading, and railway logistics planning and management, and is crucial for the efficient operation and management of the entire railway transportation system. Accurate freight volume calculation can reduce transportation costs, improve transportation efficiency, and ensure the smooth progress of freight transportation.

[0039] Existing technologies for calculating the volume of freight on trains mainly include the following:

[0040] 1. Laser scanning measurement technology: This method involves installing a laser scanner in the loading area to scan and measure the actual volume of the cargo in real time. 2. Ultrasonic ranging technology: This method uses ultrasonic sensors installed in the loading area to perform long-distance, non-contact measurement of the cargo using ultrasonic ranging technology. 3. Visual measurement technology: This method uses cameras and image processing technology to photograph or record the cargo, and then uses image processing algorithms to measure and calculate the cargo's dimensions. 4. 3D scanning technology: This method uses a 3D scanner to scan the cargo, obtain its 3D model, and calculates the volume based on the model. 5. Rail vehicle-mounted loading sensor technology: Load sensors and volume sensors are installed on railway freight cars or trains to calculate the volume and weight of the cargo by detecting weight and dimension information inside the carriages.

[0041] The aforementioned related technologies typically employ handheld scanners or scanners installed inside freight train carriages to obtain the volume of goods within the carriages. However, using handheld scanners requires the train to be stationary, impacting train scheduling; installing scanners in each carriage is costly, and the scanners are susceptible to interference from coal dust, smoke, and other contaminants on the goods, making it difficult to guarantee data acquisition accuracy. Therefore, this invention provides a method, apparatus, and electronic device for determining the volume of goods within a train carriage. This technology can be applied to applications requiring volume calculation of goods within train carriages.

[0042] To facilitate understanding of this embodiment, a method for determining the volume of cargo inside a train carriage, as disclosed in this embodiment, is first introduced. At least four first single-line lidars for measuring transverse surface point clouds and at least one second single-line lidar for measuring longitudinal surface point clouds are installed on the railway gantry. The transverse surface point cloud can be understood as a point cloud obtained by scanning the train's outline; the longitudinal surface point cloud can be understood as a point cloud used to indicate the train's length; the single-line lidar refers to a lidar with only one laser beam. Its working principle is to scan the surrounding environment with the laser beam and construct a three-dimensional model of the environment by receiving the echo signal through a receiver. Each first single-line lidar is installed on the top and side surfaces of the railway gantry; each second single-line lidar is installed on the top surface of the railway gantry; for example, see... Figure 1 The diagram shows the installation location of a lidar system. Lidars numbered 1, 2, 3, and 4 correspond to the first single-line lidar, and lidar number 5 corresponds to the second single-line lidar. The four first single-line lidars are distributed on the top and sides of the railway gantry. Lidars numbered 1 and 2 on the top surface can be installed diagonally above passing trains. The second single-line lidar is installed on the top surface of the railway gantry; preferably, it can be installed directly above passing trains to accurately measure train length. The point cloud data collected by each first single-line lidar is calibrated to the same coordinate system to achieve precise spatial correspondence. Figure 2 As shown, the method includes the following steps:

[0043] Step S202: When a train passes through the railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of the first specified frame reaches the first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved; and each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data.

[0044] The aforementioned trains are typically used for loading and transporting goods, with each cargo-loading carriage featuring an open-top design. The preset height threshold can be set according to actual needs, such as 1.3 meters. The first threshold can be set as needed, such as 50 meters. In actual implementation, when a train passes over a railway gantry, for each carriage, each frame of lateral point cloud data is collected using a single-line lidar. A pre-defined ROI (Region of Interest) range can be set, and the point cloud height of each frame of lateral point cloud data collected within the ROI range is compared with the preset height threshold. By comparing the point cloud height with the preset height threshold, the connection points between train carriages can be filtered. Normally, point cloud data exists within the ROI area of ​​a train carriage. However, there is little or no point cloud data at the train connection point within the ROI area. If the number of point cloud data with a height greater than a preset height threshold in the horizontal point cloud data of the first specified frame reaches the first threshold, it can be considered that the train has arrived or the next carriage of the train has arrived. At this time, the horizontal point cloud data of the first specified frame, as well as the horizontal point cloud data of each frame after the first specified frame, can be stored in a container. This triggers each second single-line lidar to start collecting vertical point cloud data for each frame and saves the vertical point cloud data for each frame.

[0045] Step S204: When the number of point cloud data with a height greater than the first preset height threshold in the horizontal point cloud data of the second specified frame is less than the second threshold, stop saving the horizontal point cloud data of the second specified frame and the horizontal point cloud data of each frame after the second specified frame, and stop saving the vertical point cloud data of each frame; wherein, the second threshold is less than or equal to the first threshold.

[0046] The aforementioned second threshold can be set as needed, and is usually less than or equal to the first threshold, such as setting the second threshold to 30. For each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. The height of the collected lateral point cloud data in each frame is compared with a preset height threshold. If the number of point cloud data with a height greater than the preset height threshold in the lateral point cloud data of the second specified frame is lower than the second threshold, it can be considered that the train has left, or the current carriage of the train has been scanned and has reached the vehicle connection point. At this time, the saving of the lateral point cloud data of the second specified frame, as well as the lateral point cloud data of each frame after the second specified frame, can be stopped, and the collection and saving of each frame of longitudinal point cloud data by each second single-line lidar can be stopped.

[0047] Step S206: Determine the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame;

[0048] Since the first specified frame represents the starting position of a carriage and the second specified frame represents the ending position of a carriage, the number of point cloud frames corresponding to that carriage can be determined based on the first and second specified frames.

[0049] Step S208: Based on the saved longitudinal point cloud data of each frame, determine the length of the carriage corresponding to the current carriage.

[0050] Step S210: Based on the number of point cloud frames and the length of the carriage, construct a three-dimensional point cloud model to determine the volume of goods in the carriage based on the three-dimensional point cloud model.

[0051] The aforementioned 3D point cloud model is a geometric model based on discrete sampling points, and is one way to represent a 3D model. In actual implementation, for each carriage, the length of the carriage can be calculated based on the saved longitudinal point cloud data of each frame. Then, based on the number of point cloud frames corresponding to the carriage and the carriage length, a 3D point cloud model is constructed. The volume of goods in the carriage can then be calculated based on this 3D point cloud model.

[0052] The method for determining the cargo volume inside the aforementioned carriage involves the following steps: When a train passes over the railway gantry, for each carriage, each first single-line lidar collects one frame of lateral point cloud data. When the number of point cloud data points in the lateral point cloud data of a first specified frame that have a height greater than a first preset height threshold reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each subsequent frame, is saved. Simultaneously, each second single-line lidar is triggered to begin collecting and saving one frame of longitudinal point cloud data. When the number of point cloud data points in the lateral point cloud data of a second specified frame that have a height greater than a first preset height threshold reaches a first threshold, the lateral point cloud data of the first specified frame, along with the lateral point cloud data of each subsequent frame, is saved. When the number of point cloud data points at a preset height threshold falls below a second threshold, saving the horizontal point cloud data for the second specified frame, as well as the horizontal point cloud data for each frame after the second specified frame, is stopped, and saving the vertical point cloud data for each frame is also stopped; wherein, the second threshold is less than or equal to the first threshold; based on the first and second specified frames, the number of point cloud frames corresponding to the carriage is determined; based on the saved vertical point cloud data for each frame, the length of the carriage corresponding to the carriage is determined; based on the number of point cloud frames corresponding to the carriage and the length of the carriage, a three-dimensional point cloud model is constructed, and the volume of goods in the carriage is determined based on the three-dimensional point cloud model. This method, by installing multiple single-line lidars on the railway gantry, can acquire the volume of goods in the carriages of running trains in real time without affecting train scheduling, and does not require the installation of lidars in each carriage, so the acquisition process is not affected by the goods, thus reducing costs while ensuring acquisition accuracy.

[0053] This invention also provides another method for determining the volume of goods inside a carriage. This method is based on the method described in the above embodiments. In practical applications, before calculating the volume of goods inside a carriage, it is usually necessary to calibrate multiple first single-line lidars. This can be achieved by using steps A to I to calibrate the point cloud data collected by each first single-line lidar to the same coordinate system.

[0054] Step A: At the first preset time before the train passes the railway gantry, collect each frame of raw point cloud data using each first single-line lidar.

[0055] Step B: After the acquisition time reaches the second preset time, each frame of raw point cloud data acquired by each first single-line lidar is sequentially translated according to a preset distance value to obtain the regional model point cloud corresponding to each first single-line lidar.

[0056] The first preset time, second preset time, and preset distance value mentioned above can all be set according to actual needs. For example, the first preset time can be set to 3 seconds, and the second preset time can be set to 10 seconds. In actual implementation, each first single-line lidar can be controlled to collect each frame of raw point cloud data at the first preset time (e.g., 3 seconds) before the train passes the railway gantry. When the collection time reaches the second preset time (e.g., 10 seconds), each frame of raw point cloud data collected by each first single-line lidar within the second preset time can be translated according to the preset distance value to form the regional model point cloud corresponding to each first single-line lidar. Since the single-line lidar only has two-dimensional cross-sectional data when scanning an object, it is necessary to translate each frame of raw point cloud data collected by each first single-line lidar within these 10 seconds. For example, the second frame of raw point cloud data is translated to 5cm after the first frame of raw point cloud data, and so on, transforming the two-dimensional point cloud data into a three-dimensional model point cloud, which is the aforementioned regional model point cloud. For example, still using Figure 1 For example, the point clouds of the regional models corresponding to the four first single-line lidars numbered 1, 2, 3, and 4 can be represented by A1, A2, A3, and A4, respectively.

[0057] Step C: Determine the main single-line lidar from at least one first single-line lidar mounted on the top surface of the railway gantry;

[0058] Step D: Apply the random sampling consensus algorithm to the main single-line lidar to extract ground point cloud data from the area model point cloud corresponding to the main single-line lidar.

[0059] For ease of explanation, we will still use Figure 1 For example, one of the two first single-line lidars, numbered 1 and 2, can be selected as the main single-line lidar. For ease of explanation, this embodiment uses the first single-line lidar corresponding to number 1 as the main single-line lidar. The aforementioned random sample consensus algorithm is an iterative method for estimating mathematical model parameters from a dataset containing noise and outliers. In practical implementation, the random sample consensus algorithm can be used to extract ground point cloud data from the area model point cloud A1 corresponding to the main single-line lidar.

[0060] Step E: Fit the ground point cloud data to determine the first and second deviation angles corresponding to the main single-line lidar.

[0061] The extracted ground point cloud data is fitted with a plane equation. The fitting method can be found in relevant techniques and will not be elaborated here. Based on the generated ground equation normal Vector(A,B,C), the spatial position angles of the main single-line lidar are calculated, namely the first deviation angle α and the second deviation angle β, as follows:

[0062] α=atan(C / B)*180 / π; β=atan(C / A)*180 / π;

[0063] Where A, B, and C are the coefficients of the ground equation.

[0064] The spatial plane is fitted using RANSAC (Random Sample Consensus) based on the planar point cloud extracted from the regional model point cloud A1. The plane coefficients are the plane normal vectors, which are always perpendicular to the plane. If the plane normal vectors are perpendicular upwards, it means that the scanning position of the main single-line lidar on the flat ground is parallel to the XOY plane. Considering that it is difficult to achieve a perpendicular upward normal in actual installation, the angle between the normal vector and the three-dimensional coordinate system can be calculated based on the normal vector. This angle is the actual deviation angle of the main single-line lidar installation coordinate system, corresponding to the first and second deviation angles mentioned above.

[0065] Step F: Determine the first calibration matrix based on the first deviation angle and the second deviation angle;

[0066] Step G: Calibrate the point cloud of the region model corresponding to the main single-line lidar based on the first calibration matrix;

[0067] After obtaining the first deviation angle α and the second deviation angle β, the first calibration matrix corresponding to the main single-line lidar can be determined:

[0068]

[0069] The main single-line lidar completes the spatial calibration of the regional model point cloud A1 using the first calibration matrix mentioned above. Specifically, the calibration process can be completed by A1×RA1. After calibration, the point cloud of the flat ground scanned by the main single-line lidar can be converted to a plane parallel to the XOY plane.

[0070] Step H: Using a data registration algorithm, each of the other first single-line lidars (excluding the main single-line lidar) is transformed to the coordinate system corresponding to the main single-line lidar, thus obtaining the second calibration matrix corresponding to each of the other first single-line lidars.

[0071] The above data registration algorithm can be implemented using the improved ICP (Iterative Closest Point) algorithm. The improved ICP algorithm is a point cloud registration algorithm that achieves alignment by finding the optimal rigid transformation between two point clouds.

[0072] Step I: Based on each second calibration matrix, calibrate the corresponding area model point cloud of each other first single-line lidar, so as to calibrate the area model point cloud collected by each other first single-line lidar to the same coordinate system as the area model point cloud corresponding to the main single-line lidar.

[0073] In practical implementation, the improved ICP algorithm (point-to-surface projection matching) can be applied to the regional model point cloud data of A2, A3, A4 and A1*RA1 respectively. After outputting the second calibration matrices RtA2, RtA3 and RtA4, the unified coordinate system of the regional model point cloud collected by each other first single-line lidar and the regional model point cloud corresponding to the main single-line lidar is realized by calculating A2*RtA2, A3*RtA3 and A4*RtA4.

[0074] Here, an improved ICP algorithm is introduced to estimate the coordinates of two point clouds, stitch them together, and output a rotation matrix. For example, if region model point cloud A1 and region model point cloud A2 are placed in the coordinate system of region model point cloud A1, the scanned trains will not overlap. Therefore, region model point cloud A2 needs to be rotated and translated to make the scanned trains of region model point cloud A2 overlap with those of region model point cloud A1. The rotation and translation parameters are then output in matrix form, which is RtA2. Multiplying region model point cloud A2 by RtA2 achieves coordinate system unification.

[0075] The determination of the cargo volume inside the carriage in this embodiment includes the following steps:

[0076] Step 1: When a train passes through the railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of the first specified frame reaches the first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved; and each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data.

[0077] Step 2: When the number of point cloud data with a height greater than the first preset height threshold in the horizontal point cloud data of the second specified frame is less than the second threshold, stop saving the horizontal point cloud data of the second specified frame, as well as the horizontal point cloud data of each frame after the second specified frame, and stop saving the vertical point cloud data of each frame; wherein, the second threshold is less than or equal to the first threshold.

[0078] Step 3: Determine the total number of frames corresponding to the saved horizontal point cloud data based on the first specified frame and the second specified frame.

[0079] In actual implementation, for each carriage, each frame of lateral point cloud data that meets the aforementioned conditions can be stored in a container, and the size of the container can be determined, that is, the total number of frames of lateral point cloud data stored in the container can be determined.

[0080] Step 4: If the total number of frames is greater than the preset threshold, the saved horizontal point cloud data of each frame is determined as the horizontal point cloud data of each frame corresponding to the carriage, and the total number of frames is determined as the number of point cloud frames corresponding to the carriage.

[0081] The aforementioned preset threshold can be set according to actual needs, such as 15 frames. In actual implementation, the total number of frames corresponding to the lateral point cloud data of one carriage is usually not less than the preset threshold (e.g., 15 frames). If it is less than the preset threshold, it can be considered as interference. The total number of frames determined above can be compared with the preset threshold. If the total number of frames is greater than the preset threshold, it can be considered that the point cloud statistics of one carriage have been completed. At this time, the saved lateral point cloud data of each frame can be determined as the lateral point cloud data of each frame corresponding to that carriage, and the above total number of frames can be determined as the point cloud frame number of that carriage. The carriage can also be numbered.

[0082] Step 5: For each frame of vertical point cloud data, use the histogram algorithm to determine the multiple first histogram grids in the vertical point cloud data of that frame whose point cloud height exceeds the second preset height threshold.

[0083] Step 6: Determine the coordinates of the center point of each first histogram grid.

[0084] Step 7: Calculate the difference between the center points of every two adjacent first histogram grids based on each location coordinate.

[0085] Step 8: Among the multiple difference results corresponding to each frame of longitudinal point cloud data, the one with the largest value is determined as the length of the corresponding carriage.

[0086] The second preset height threshold can be used to filter out point clouds that represent the height of the carriage. In actual implementation, the scanning range corresponding to each frame of vertical point cloud data usually includes at least the length of a complete carriage, and can generally include the length range of multiple carriages, such as two carriages. In actual implementation, a histogram algorithm can be used to filter out multiple first histogram grids with point cloud heights exceeding the second preset height threshold from each frame of vertical point cloud data, and determine the position coordinates of the center point of each first histogram grid. Based on each position coordinate, the difference between the center points of each two adjacent first histogram grids can be calculated. Multiple difference results may be the same or different. The multiple difference results can be stored in a difference container. The difference result with the largest value in the difference container is the carriage length corresponding to that carriage.

[0087] For example, if the scanning range of one frame of vertical point cloud data includes the complete second carriage and a part of the third carriage, then the positions of the multiple first histogram grids filtered according to the second preset height threshold are the front wall of the second carriage, the rear wall of the second carriage, and the front wall of the third carriage. Calculating the difference between the center points of every two adjacent first histogram grids in these three grids will yield two difference results: difference A between the front wall and the rear wall of the second carriage, and difference B between the rear wall of the second carriage and the front wall of the third carriage. Since difference A must be greater than difference B, difference A represents the length of the second carriage.

[0088] Step 9: Calculate the ratio of the carriage length to the number of point cloud frames to obtain the translation interval distance;

[0089] Step 10: Translate each frame of the horizontal point cloud data corresponding to the carriage in the depth direction according to the translation interval distance to obtain the initial point cloud model;

[0090] Step 11: Interpolate the initial point cloud model to obtain a 3D point cloud model.

[0091] In practical implementation, for each carriage, the ratio of the carriage length to the number of point cloud frames can be calculated to obtain the translation interval distance. For the storage container corresponding to the lateral point cloud, each frame of lateral point cloud data corresponding to that carriage is translated in the depth direction according to this translation interval distance, thus completing the first 3D modeling of that carriage and obtaining the initial point cloud model. Then, an interpolation algorithm is used to perform point cloud interpolation processing on the initial point cloud model in the depth direction to obtain the processed 3D point cloud model, such as... Figure 3 The diagram shows a 3D point cloud model. Interpolation can increase the point cloud density, making subsequent cargo volume calculations easier.

[0092] Step 12: According to the preset grid size, perform grid processing on the 3D point cloud model in the X-axis and Y-axis directions, and project the 3D point cloud model onto the XOY plane to obtain the point cloud projection result;

[0093] The preset grid size can be set according to actual needs, such as 0.05cm. In actual implementation, grid processing can be designed for the X-axis and Y-axis directions of the above 3D point cloud model. The grid unit can be set to a preset grid size, such as 0.05cm. The above 3D point cloud model data is then projected onto the XOY plane, as shown below. Figure 4 This is a schematic diagram of a point cloud projection result.

[0094] Step 13: Determine the target filtering boundary based on the point cloud projection results; the target filtering boundary includes: upper filtering boundary, lower filtering boundary, left filtering boundary and right filtering boundary;

[0095] Step fourteen: Segment the 3D point cloud model according to the target filtering boundary to obtain the segmented point cloud model;

[0096] Based on the point cloud projection results above, we find the grid cells in the X-axis direction where the number of points falling into the grid exceeds a preset threshold. We sort these grid cells, determine the centers of the leftmost and rightmost grid cells, and shift the center of the leftmost grid cell 0.025cm to the right to obtain the left filter boundary. We also shift the center of the rightmost grid cell 0.025cm to the left to obtain the right filter boundary. Similarly, we find the grid cells in the Y-axis direction where the number of points falling into the grid exceeds a preset threshold. We sort these grid cells, determine the centers of the topmost and bottommost grid cells, and shift the center of the topmost grid cell 0.025cm downwards to obtain the upper filter boundary. We also shift the center of the bottommost grid cell 0.025cm upwards to obtain the lower filter boundary. By applying constraints to the upper, lower, left, and right filter boundaries, the point cloud data for which the volume needs to be calculated is extracted. This involves deleting the point cloud data within the offset space, essentially removing the thickness of the cargo compartment walls, leaving only the point cloud data corresponding to the cargo. For example... Figure 5 The diagram shows a segmented point cloud model, where gray represents the point cloud of the train carriages and white represents the segmented point cloud model of the cargo. This method can be used to process all the train carriage data.

[0097] Step 15: Apply the random sampling consensus algorithm to the main single-line lidar to extract the planar point cloud data of the bottom of the carriage from the point cloud of the area model corresponding to the main single-line lidar.

[0098] Step 16: Fit the point cloud data of the bottom plane of the carriage to determine the first height between the bottom plane of the carriage and the XOY plane;

[0099] Step 17: Filter out point clouds whose height is lower than the first height from the segmented point cloud model to obtain the target point cloud model;

[0100] In practical implementation, the bottom plane point cloud data of the carriage can be extracted from the point cloud of the area model corresponding to the main single-line lidar. Through fitting processing, the bottom plane equation can be obtained. Based on the bottom plane equation, the first height from the XOY plane can be calculated. This first height can be understood as the height of the bottom of the carriage from the ground. Point clouds with heights lower than the first height need to be filtered out from the above segmented point cloud model, that is, point cloud data below the bottom of the carriage is removed. Outlier filtering algorithm can also be used to remove peripheral noise to obtain the target point cloud model.

[0101] Step 18: Project the target point cloud model onto the XOY plane and divide it into two-dimensional grids according to the preset grid size to obtain the divided grids;

[0102] The target point cloud model after removal is projected onto the XOY plane, and a two-dimensional grid is divided according to the preset grid size. The grid voxel size is set to 0.05cm*0.05cm*0.025cm to obtain the divided grid.

[0103] Step 19: Determine the volume of cargo in the carriage based on the divided grid.

[0104] This step nineteen can be achieved through the following steps 190 to 194:

[0105] Step 190: Determine the target raster containing point cloud data from the divided raster;

[0106] Step 191: For each target grid cell, determine the maximum height value and the minimum height value of the point cloud in that target grid cell;

[0107] The target grid of the point cloud data can be determined from the divided grid, and the grid state is recorded as 1. For all target grids with grid state 1, the maximum and minimum height values ​​of the point cloud in the target grid can be determined.

[0108] Step 192: Determine the percentage of the raster voxels corresponding to the target raster based on the maximum height value and minimum height value of the point cloud, as well as the preset raster voxel size.

[0109] Taking a preset raster voxel size of 0.05cm*0.05cm*0.025cm as an example, the following formula can be used to calculate the raster voxel percentage corresponding to each target raster:

[0110] Vnumber = Maximum height of point cloud / 0.025cm - Minimum height of point cloud / 0.025cm.

[0111] The calculated percentage of raster voxels corresponding to each target raster can be represented by Vnumber0, Vnumber1, ..., Vnumberi, respectively.

[0112] Step 193: Calculate the sum of the voxel percentages corresponding to each target raster.

[0113] Step 194: Determine the cargo volume in the car based on the summation result and the volume of the raster voxels.

[0114] The calculated voxel percentages Vnumber0, Vnumber1, ..., Vnumberi for each target raster can be summed, and the cargo volume in that car can be calculated using the following formula: VT = (Vnumber0 + Vnumber1 + ... + Vnumberi) * 0.025 * 0.05 * 0.05. Following this method, the cargo volume in all cars of the train can be calculated. The calculated cargo volumes in all cars, the data generated from the relevant point cloud models, and the car numbers are then transmitted to the dispatching platform system via a TCP (Transmission Control Protocol) service architecture to obtain real-time train-related information.

[0115] For ease of understanding, see [link to relevant documentation]. Figure 6 The diagram illustrates the structure of a system for determining the volume of goods inside a train carriage. This system includes a lidar sensor (corresponding to the first and second single-line lidars mentioned above), a GPS module, a data processing module, and a dispatching platform system. The lidar sensor inputs the collected raw point cloud data to the data processing module. The GPS module specifically refers to a GPS timer, which collects raw GPRMC (Global Positioning System Receiver Monitoring Control, a data format in a GPS positioning system) data, parses the time information in the GPRMC data, and inputs the parsed information into the data processing module for time synchronization. After calibrating the received raw point cloud data, the data processing module completes a 3D model of the point cloud according to the algorithm flow described in the aforementioned embodiment and calculates the volume of goods inside the train carriage. The data processing module then transmits the statistically relevant 3D model data, goods volume data, carriage number, etc., to the dispatching platform system via TCP service.

[0116] The system comprises a conventional train modeling and cargo volume calculation system, consisting of a lidar sensor, a GPS module, and a data processing module. The GPS module provides timing for the data processing module. The lidar sensor, mounted vertically downwards, performs high-precision model scanning of the trains passing over the same track, acquiring all point cloud data of the entire train. All point cloud data is transmitted to the data processing module via Ethernet. Through the relevant processing procedures described in the previous embodiment, the point cloud of the entire train is segmented into point cloud data for each carriage. After segmentation, smoothing, and noise reduction processing of the point cloud data for each carriage, the cargo volume in each carriage is calculated. The calculated data is then transmitted to the dispatching platform system via TCP service.

[0117] For ease of understanding, see [link to relevant documentation]. Figure 7 The flowchart shown illustrates a method for determining the volume of goods inside a carriage. Figure 1 The installation of a single-line lidar sensor is used as an example for explanation. The GPS module's GPRMC signal is analyzed and processed to perform time calibration on the data processing module, synchronizing the time of the time processing module with UTC (Coordinated Universal Time). The raw point cloud data collected by single-line lidar sensors in different installation directions for acquiring lateral surface point clouds are processed into a unified coordinate system using a calibration algorithm to generate unified fused point cloud data. Statistical processing is performed on the calibrated point cloud data. The calibrated point cloud data of single-line lidar sensors 1, 2, 3, and 4 are statistically analyzed together, while the data collected by single-line lidar sensor 5 is statistically analyzed separately. For lateral surface point clouds, HighFrame = 0, and a height condition High is set in the ROI region. If, in each frame of the fused point cloud within the ROI region, the height of any point cloud exceeds the height condition High, then HighFrame is set. htFrame is incremented once until a frame of fused point cloud is processed. If HightFrame is greater than the set first threshold (greater than 50 in this embodiment), the train is considered to have started scanning. All horizontal point clouds within the ROI area are collected and stored. Each time a point cloud is collected, the size of the first container for the collected point cloud is recorded. For vertical point clouds, the vertical point clouds are collected and stored in the second container. If the number of point cloud frames collected in the first container is greater than the preset number threshold (15 in this embodiment), then it is considered to be train car data. This filters out containers with fewer frames. After the point cloud statistics for a car are completed, a car number is assigned, starting from 0, and the collection and storage of the vertical point cloud is completed.

[0118] For each frame of the vertical point cloud, a histogram algorithm is used to statistically analyze the points, identifying all vertical lines in the current frame and centering the grid cells containing those lines. The difference between the centers of any two adjacent vertical lines is calculated and stored. The maximum value from the stored differences is then taken as the train car length. Based on the calculated car length, the car length divided by the number of point cloud frames is used as the translation interval for each frame. Interpolation is then applied to complete the 3D model of the train. After modeling, the 3D point cloud model corresponding to each car is smoothed and denoised. A histogram segmentation algorithm is designed to calculate the target filtering boundary. The 3D point cloud model is segmented based on the target filtering boundary to remove the car car boundary wall thickness. Statistical processing is performed on the segmented grid cells to calculate the cargo volume within the car.

[0119] The aforementioned method for determining the volume of goods inside the carriages, using a non-contact system, can complete the real-time calculation of the volume of goods loaded in railway trains and the generation of 3D point cloud models without affecting train scheduling or the status of the train scheduling system. The scheduling platform system can obtain the train's loading capacity and loading status in real time, which helps to improve transportation efficiency and capacity. Since the point cloud accuracy of high-speed single-line lidar is higher than that of 3D lidar, and the cost is lower, using high-speed single-line lidar to obtain the 3D model information of the train and the calculation data of the cargo volume is more accurate. According to actual experiments, the detection accuracy of single-line lidar can reach ±5cm.

[0120] This method primarily utilizes high-speed single-line LiDAR to perform laser scanning modeling of the entire train and segmentation of carriages under normal operating conditions. It calculates and transmits data such as volume and carriage numbering back to the platform, providing real-time, accurate data on the loading status of each train. This approach does not impact the train dispatching system and rapidly acquires 3D train model data and cargo volume data. It boasts a high degree of automation, overcoming the shortcomings of low accuracy, low scanning frequency, and low modeling detail in 3D laser scanning. Simultaneously, it reduces application costs and allows for large-scale deployment. This method can quickly, accurately, and automatically calculate the volume of cargo within train carriages, enabling rational loading and transportation planning, improving transportation efficiency, reducing costs, and ensuring safe cargo transport.

[0121] This invention provides a device for determining the volume of cargo inside a railway carriage. At least four first single-line lidars for measuring lateral point clouds and at least one second single-line lidar for measuring longitudinal point clouds are installed on a railway gantry. Each first single-line lidar is installed on the top and side of the railway gantry; each second single-line lidar is installed on the top of the railway gantry; the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system. Figure 8 As shown, the device includes:

[0122] The acquisition module 80 is used to acquire each frame of lateral point cloud data for each carriage of a train when a train passes over the railway gantry, using each first single-line lidar. When the number of point cloud data in the lateral point cloud data of a first specified frame that has a point cloud height greater than a first preset height threshold reaches a first threshold, the module saves the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame thereafter; and triggers each second single-line lidar to start acquiring and saving each frame of longitudinal point cloud data. The stop-save module 81 is used to stop the saving when the number of point cloud data in the lateral point cloud data of a second specified frame that has a point cloud height greater than the first preset height threshold reaches a certain threshold. When the value is below the second threshold, the saving of the horizontal point cloud data of the second specified frame and the horizontal point cloud data of each frame after the second specified frame is stopped, and the saving of the vertical point cloud data of each frame is stopped; wherein, the second threshold is less than or equal to the first threshold; the first determining module 82 is used to determine the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame; the second determining module 83 is used to determine the length of the carriage corresponding to the carriage based on the saved vertical point cloud data of each frame; the third determining module 84 is used to construct a three-dimensional point cloud model based on the number of point cloud frames corresponding to the carriage and the length of the carriage, so as to determine the volume of goods in the carriage based on the three-dimensional point cloud model.

[0123] The aforementioned device for determining the volume of goods inside a train carriage saves the lateral point cloud data of a first specified frame and subsequent frames of lateral point cloud data. Each second single-line lidar begins acquiring and saving the longitudinal point cloud data of each frame. Saving the lateral point cloud data of the second specified frame and subsequent frames of lateral point cloud data ceases, as does saving the longitudinal point cloud data of each frame. The number of point cloud frames corresponding to the carriage is determined. Based on the saved longitudinal point cloud data of each frame, the length of the carriage is determined. A three-dimensional point cloud model is constructed to determine the volume of goods in the carriage. This device, by installing multiple single-line lidars on the railway gantry, can acquire the volume of goods inside a moving train carriage in real time without affecting train scheduling. Furthermore, it eliminates the need to install lidars in each carriage, thus the acquisition process is unaffected by the goods, reducing costs while ensuring acquisition accuracy.

[0124] Furthermore, the first determining module is also used to: determine the total number of frames corresponding to the saved lateral point cloud data based on the first specified frame and the second specified frame; if the total number of frames is greater than a preset number threshold, determine each frame of the saved lateral point cloud data as the lateral point cloud data corresponding to the carriage, and determine the total number of frames as the number of point cloud frames corresponding to the carriage.

[0125] Furthermore, the device is also used to calibrate the point cloud data collected by each first single-line lidar to the same coordinate system in the following manner: At a first preset time before the train passes the railway gantry, each first single-line lidar collects a frame of raw point cloud data; after the collection time reaches a second preset time, each frame of raw point cloud data collected by each first single-line lidar is sequentially translated according to a preset distance value to obtain the region model point cloud corresponding to each first single-line lidar; a main single-line lidar is determined from at least one first single-line lidar installed on the top surface of the railway gantry; a random sampling consensus algorithm is used on the main single-line lidar to extract ground point cloud data from the region model point cloud corresponding to the main single-line lidar; the ground point cloud data is fitted to determine a first deviation angle and a second deviation angle corresponding to the main single-line lidar; a first calibration matrix is ​​determined based on the first deviation angle and the second deviation angle; and the region model point cloud corresponding to the main single-line lidar is calibrated based on the first calibration matrix.

[0126] A data registration algorithm is used to transform each of the other first single-line lidars (excluding the main single-line lidar) to the coordinate system corresponding to the main single-line lidar, thereby obtaining a second calibration matrix corresponding to each of the other first single-line lidars. Based on each second calibration matrix, the corresponding area model point cloud of each of the other first single-line lidars is calibrated, so that the area model point cloud collected by each of the other first single-line lidars is calibrated to the same coordinate system as the area model point cloud corresponding to the main single-line lidar.

[0127] Furthermore, the second determining module is also used to: for each frame of longitudinal point cloud data, use a histogram algorithm to determine multiple first histogram grids in the longitudinal point cloud data of that frame whose point cloud height exceeds a second preset height threshold; determine the position coordinates of the center point of each first histogram grid; calculate the difference between the center points of every two adjacent first histogram grids based on each position coordinate; and determine the largest difference among the multiple difference results corresponding to each frame of longitudinal point cloud data as the length of the carriage corresponding to that carriage.

[0128] Furthermore, the third determining module is also used to: calculate the ratio of the carriage length to the number of point cloud frames to obtain the translation interval distance; translate each frame of lateral point cloud data corresponding to the carriage in the depth direction according to the translation interval distance to obtain the initial point cloud model; and perform interpolation processing on the initial point cloud model to obtain the three-dimensional point cloud model.

[0129] Furthermore, the third determining module is also used to: perform raster processing on the 3D point cloud model in the X-axis and Y-axis directions according to a preset raster size, and project the 3D point cloud model onto the XOY plane to obtain the point cloud projection result; determine the target filtering boundary based on the point cloud projection result; wherein, the target filtering boundary includes: upper filtering boundary, lower filtering boundary, left filtering boundary and right filtering boundary; segment the 3D point cloud model according to the target filtering boundary to obtain a segmented point cloud model;

[0130] A random sampling consensus algorithm is used to extract the bottom plane point cloud data of the carriage from the point cloud of the region model corresponding to the main single-line lidar. The bottom plane point cloud data of the carriage is fitted to determine the first height between the bottom plane of the carriage and the XOY plane. Point clouds with heights lower than the first height are filtered out from the segmented point cloud model to obtain the target point cloud model. The target point cloud model is projected onto the XOY plane and divided into two-dimensional grids according to the preset grid size to obtain the divided grid. Based on the divided grid, the volume of cargo in the carriage is determined.

[0131] Furthermore, the third determining module is also used to: determine the target grid containing point cloud data from the divided grid; for each target grid, determine the maximum height value and the minimum height value of the point cloud in the target grid; determine the percentage of grid voxels corresponding to the target grid based on the maximum height value and the minimum height value of the point cloud, as well as the preset grid voxel size; calculate the sum of the percentages of grid voxels corresponding to each target grid; and determine the volume of cargo in the carriage based on the sum and the volume of the grid voxels.

[0132] The device for determining the volume of goods inside a carriage provided in this embodiment of the invention has the same implementation principle and technical effect as the aforementioned method for determining the volume of goods inside a carriage. For the sake of brevity, any parts not mentioned in the embodiment of the device for determining the volume of goods inside a carriage can be referred to the corresponding content in the aforementioned method for determining the volume of goods inside a carriage.

[0133] This invention also provides an electronic device, see [link to relevant documentation]. Figure 9 As shown, the electronic device includes a processor 130 and a memory 131. The memory 131 stores machine-executable instructions that can be executed by the processor 130. The processor 130 executes the machine-executable instructions to implement the method for determining the volume of goods inside the carriage.

[0134] Furthermore, Figure 9 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.

[0135] The memory 131 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0136] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0137] This invention also provides a machine-readable storage medium storing machine-executable instructions. When these machine-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned method for determining the volume of goods inside the carriage. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0138] The computer program product of the method, apparatus and electronic equipment for determining the volume of goods in a carriage provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0139] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of determining the volume of cargo within a vehicle compartment, characterized by, At least four first single-line lidars for measuring lateral point clouds and at least one second single-line lidar for measuring longitudinal point clouds are installed on a railway gantry. Each first single-line lidar is installed on the top and side surfaces of the railway gantry, respectively; each second single-line lidar is installed on the top surface of the railway gantry; the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system; the method includes: When a train passes through the railway gantry, for each carriage of the train, each frame of lateral point cloud data is collected by each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a first specified frame reaches a first threshold, the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame, are saved; and each second single-line lidar is triggered to start collecting and saving each frame of longitudinal point cloud data. When the number of point cloud data with a height greater than a first preset height threshold in the horizontal point cloud data of the second specified frame is less than the second threshold, the saving of the horizontal point cloud data of the second specified frame, as well as the horizontal point cloud data of each frame after the second specified frame, is stopped, and the saving of the vertical point cloud data of each frame is also stopped; wherein, the second threshold is less than or equal to the first threshold. The number of point cloud frames corresponding to the carriage is determined based on the first specified frame and the second specified frame; Based on the saved longitudinal point cloud data of each frame, the length of the corresponding carriage is determined; Based on the number of point cloud frames and the length of the carriage, a three-dimensional point cloud model is constructed to determine the volume of cargo in the carriage.

2. The method of claim 1, wherein, The steps for determining the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame include: Based on the first specified frame and the second specified frame, determine the total number of frames corresponding to the saved horizontal point cloud data; If the total number of frames is greater than a preset threshold, the saved horizontal point cloud data of each frame is determined as the horizontal point cloud data of each frame corresponding to the carriage, and the total number of frames is determined as the number of point cloud frames corresponding to the carriage.

3. The method of claim 1, wherein, The point cloud data acquired by each first single-line lidar is calibrated to the same coordinate system using the following method: At a first preset time before the train passes the railway gantry, each frame of raw point cloud data is collected by each first single-line lidar. When the acquisition time reaches the second preset time, each frame of raw point cloud data acquired by each of the first single-line lidars is sequentially translated according to a preset distance value to obtain the regional model point cloud corresponding to each of the first single-line lidars. The main single-line lidar is determined from at least one first single-line lidar mounted on the top surface of the railway gantry; The random sampling consensus algorithm is used to extract ground point cloud data from the point cloud of the area model corresponding to the main single-line lidar. The ground point cloud data is fitted to determine the first and second deviation angles corresponding to the main single-line lidar. Based on the first deviation angle and the second deviation angle, determine the first calibration matrix; The point cloud of the region model corresponding to the main single-line lidar is calibrated based on the first calibration matrix. Using a data registration algorithm, each of the other first single-line lidars (excluding the main single-line lidar) is transformed to the coordinate system corresponding to the main single-line lidar, thereby obtaining the second calibration matrix corresponding to each of the other first single-line lidars. Based on each of the second calibration matrices, the corresponding area model point cloud of each other first single-line lidar is calibrated so that the area model point cloud collected by each other first single-line lidar is calibrated to the same coordinate system as the area model point cloud corresponding to the main single-line lidar.

4. The method of claim 1, wherein, The steps for determining the length of a carriage based on each frame of saved longitudinal point cloud data include: For each frame of vertical point cloud data, a histogram algorithm is used to identify multiple first histogram grids in the vertical point cloud data of that frame whose point cloud height exceeds the second preset height threshold. Determine the position coordinates of the center point of each of the first histogram grids; Based on each of the said location coordinates, calculate the difference between the center points of every two adjacent first histogram grids; Among the multiple difference results corresponding to each frame of vertical point cloud data, the one with the largest value is determined as the length of the corresponding carriage.

5. The method of claim 1, wherein, The steps for constructing a 3D point cloud model based on the number of point cloud frames corresponding to the carriage and the length of the carriage include: Calculate the ratio of the carriage length to the number of point cloud frames to obtain the translation interval distance; For each frame of lateral point cloud data corresponding to the carriage, the depth direction is translated sequentially according to the translation interval distance to obtain the initial point cloud model; The initial point cloud model is interpolated to obtain a three-dimensional point cloud model.

6. The method of claim 3, wherein, The steps for determining the cargo volume in the carriage based on the three-dimensional point cloud model include: The three-dimensional point cloud model is rasterized in the X-axis and Y-axis directions according to the preset raster size, and the three-dimensional point cloud model is projected onto the XOY plane to obtain the point cloud projection result. The target filtering boundary is determined based on the point cloud projection results; wherein, the target filtering boundary includes: upper filtering boundary, lower filtering boundary, left filtering boundary and right filtering boundary; The three-dimensional point cloud model is segmented according to the target filtering boundary to obtain a segmented point cloud model; The random sampling consensus algorithm is used to extract the planar point cloud data of the bottom of the carriage from the point cloud of the area model corresponding to the main single-line lidar. The point cloud data of the bottom plane of the carriage is fitted to determine the first height between the bottom plane of the carriage and the XOY plane; Filter out point clouds whose height is lower than the first height from the segmented point cloud model to obtain the target point cloud model; The target point cloud model is projected onto the XOY plane and divided into two-dimensional grids according to a preset grid size to obtain the divided grid. Based on the divided grid, the volume of cargo in the carriage is determined.

7. The method of claim 6, wherein, The steps for determining the volume of cargo in a car based on the divided grid include: Identify the target raster containing point cloud data from the divided raster; For each target grid cell, determine the maximum and minimum height values ​​of the point cloud within that grid cell; Based on the maximum and minimum height values ​​of the point cloud, and the preset grid voxel size, determine the grid voxel percentage corresponding to the target grid. Calculate the sum of the voxel percentages corresponding to each target raster; Based on the summation result and the volume of the raster voxel, the volume of cargo in the carriage is determined.

8. An apparatus for determining the volume of cargo within a vehicle bed, the apparatus comprising: At least four first single-line lidars for measuring lateral point clouds and at least one second single-line lidar for measuring longitudinal point clouds are installed on a railway gantry. Each first single-line lidar is installed on the top and side surfaces of the railway gantry, respectively; each second single-line lidar is installed on the top surface of the railway gantry; the point cloud data collected by each first single-line lidar is calibrated to the same coordinate system; the device includes: The acquisition module is used to acquire each frame of lateral point cloud data for each carriage of the train when a train passes through the railway gantry, using each first single-line lidar. When the number of point cloud data with a height greater than a first preset height threshold in the lateral point cloud data of a first specified frame reaches a first threshold, the module saves the lateral point cloud data of the first specified frame, as well as the lateral point cloud data of each frame after the first specified frame; and triggers each second single-line lidar to start acquiring and saving each frame of longitudinal point cloud data. The stop-save module is used to stop saving the horizontal point cloud data of the second specified frame, as well as the horizontal point cloud data of each frame after the second specified frame, and to stop saving the vertical point cloud data of each frame when the number of point cloud data with a point cloud height greater than a first preset height threshold in the horizontal point cloud data of the second specified frame is less than a second threshold; wherein, the second threshold is less than or equal to the first threshold. The first determining module is used to determine the number of point cloud frames corresponding to the carriage based on the first specified frame and the second specified frame; The second determining module is used to determine the length of the carriage corresponding to the current carriage based on the saved longitudinal point cloud data of each frame. The third determining module is used to construct a three-dimensional point cloud model based on the number of point cloud frames corresponding to the carriage and the length of the carriage, so as to determine the volume of the cargo in the carriage based on the three-dimensional point cloud model.

9. An electronic device, comprising: The system includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for determining the volume of cargo inside a carriage as described in any one of claims 1-7.

10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions that, when invoked and executed by a processor, cause the processor to implement the method for determining the volume of cargo inside the carriage as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Boxcar volume measurement method and system based on laser radar

    CN113280733A

  • Method and apparatus for measuring remaining volume in closed space on basis of laser radar

    WO2021197345A1