Carriage volume measurement method and apparatus, computer device, storage medium, and program product
By obtaining the point cloud inside the carriage and fitting it to the volume measurement plane, the carriage size parameters are determined by the positional relationship between the measurement points and the plane. This solves the problem of balancing efficiency and accuracy in carriage volume measurement, and achieves efficient and accurate volume measurement.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2026-04-02
AI Technical Summary
Existing technologies struggle to balance measurement efficiency and accuracy in measuring the volume of a vehicle compartment. Single-time acquisition of dimensional parameters is prone to errors, while multiple acquisitions are too time-consuming.
By acquiring point clouds inside the carriage, a volume measurement plane is obtained by fitting an irregular surface. The carriage size parameters are determined by using the positional relationship between the measurement points and the plane. Low-precision 3D imaging equipment is used in conjunction with fitting constraints to simplify the amount of data processing.
This improved the accuracy and efficiency of carriage volume measurement, reduced measurement errors, and enhanced measurement flexibility and cost control.
Smart Images

Figure CN2025109154_02042026_PF_FP_ABST
Abstract
Description
Vehicle compartment volume measurement method and device, computer device, storage medium and program product
[0001] Cross-reference to Related Applications
[0002] This application claims priority to the Chinese patent application No. 2024113688051, filed on September 27, 2024, and entitled "Vehicle compartment volume measurement method, computer device, storage medium and program product", the entire content of which is incorporated herein by reference. TECHNICAL FIELD
[0003] The present application relates to the technical field of computer vision, in particular to a vehicle compartment volume measurement method, device, computer device, computer readable storage medium and computer program product. BACKGROUND
[0004] With the continuous development of technology, the "intelligent logistics" system has emerged as the times require, and the volume measurement of the vehicle compartment is an indispensable part. After measuring the volume of the vehicle compartment, there is a definite basis for cost control, vehicle allocation and loading rate, etc.
[0005] In related technologies, the volume measurement of the vehicle compartment usually collects size parameters first, and then calculates the volume through the size parameters. However, due to the single collection of size parameters, measurement errors may occur due to vehicle deformation or misalignment of measurement angle, and multiple collections of size parameters will consume a lot of time, which may lead to the situation that the final measured volume does not meet the actual measurement expectation of the user. Therefore, it is difficult to balance the measurement efficiency and accuracy when measuring the volume of the vehicle compartment. SUMMARY
[0006] According to various embodiments of the present application, a vehicle compartment volume measurement method, device, computer device, computer readable storage medium and computer program product are provided, which balance the measurement efficiency and accuracy.
[0007] In a first aspect, the present application provides a vehicle compartment volume measurement method, comprising:
[0008] According to the vehicle compartment internal point cloud collected at the measurement point, the irregular surface associated with the vehicle compartment volume measurement in the vehicle compartment is fitted to obtain a volume measurement plane, wherein the vehicle compartment internal point cloud is obtained by scanning each internal wall surface of the vehicle compartment, and each internal wall surface includes the irregular surface;
[0009] According to the position relationship between the measurement point and the volume measurement plane, the size parameters of the vehicle compartment are determined;
[0010] According to the size parameters, the volume of the vehicle compartment is measured.
[0011] In a second aspect, the present application provides a vehicle compartment volume measurement device, comprising:
[0012] an acquisition module configured to fit irregular surfaces associated with vehicle compartment volume measurement in the vehicle compartment according to a vehicle compartment interior point cloud collected at a measurement point, to obtain a volume measurement plane, wherein the vehicle compartment interior point cloud is obtained by scanning each interior wall surface of the vehicle compartment, and each of the interior wall surfaces comprises the irregular surfaces;
[0013] a determination module configured to determine a size parameter of the vehicle compartment according to a positional relationship between the measurement point and the volume measurement plane;
[0014] a measurement module configured to measure the volume of the vehicle compartment according to the size parameter.
[0015] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements operations of the method according to any one of the above aspects when executing the computer program.
[0016] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements operations of the method according to any one of the above aspects when executed by a processor.
[0017] In a fifth aspect, the present application provides a computer program product, comprising a computer program, and the computer program implements operations of the method according to any one of the above aspects when executed by a processor.
[0018] The details of one or more embodiments of the present application are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the application will be apparent from the description, drawings, and claims. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the accompanying drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the accompanying drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can be obtained from these drawings without any creative effort, and additional details or examples used to describe the drawings should not be considered as limiting the scope of any one of the disclosed application, the presently described embodiments and / or examples, and the presently understood best mode of these applications.
[0020] FIG. 1 is a flowchart of a vehicle compartment volume measurement method according to one or more embodiments.
[0021] FIG. 2 is a schematic diagram of an internal structure of a vehicle cabin according to a vehicle cabin volume measurement method of one or more embodiments.
[0022] FIG. 3 is a schematic diagram of fitting a volume measurement plane according to a vehicle cabin volume measurement method of one or more embodiments.
[0023] FIG. 4 is a schematic diagram of a volume measurement plane according to a vehicle cabin volume measurement method of one or more embodiments.
[0024] FIG. 5 is a schematic diagram of identifying size parameters of a vehicle cabin according to a vehicle cabin volume measurement method of one or more embodiments.
[0025] FIG. 6 is a schematic diagram of a flow of a vehicle cabin volume measurement method according to one or more embodiments.
[0026] FIG. 7 is a schematic diagram of a position of a measurement point according to a vehicle cabin volume measurement method of one or more embodiments.
[0027] FIG. 8 is a schematic diagram of plane fitting of three irregular surfaces according to a vehicle cabin volume measurement method of one or more embodiments.
[0028] FIG. 9 is a schematic diagram of selecting irregular surfaces based on a measurement angle according to a vehicle cabin volume measurement method of one or more embodiments.
[0029] FIG. 10 is a schematic diagram of solving size parameters of a vehicle cabin according to a vehicle cabin volume measurement method of one or more embodiments.
[0030] FIG. 11 is a structural block diagram of a vehicle cabin volume measurement device according to one or more embodiments.
[0031] FIG. 12 is a schematic diagram of an internal structure of a computer device according to one or more embodiments. DETAILED DESCRIPTION
[0032] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0033] For the logistics field, measuring the volume of the carriage is the key to controlling the cost of land transportation, controlling the vehicle allocation and calculating the loading rate. At present, there are many ways to measure the volume of the carriage. For example, for a van trailer, a tape measure or a laser range finder is mainly used to measure the volume of the carriage. The measuring process is as follows: a tape measure or a laser range finder is used to sample and measure a single point along the length, width and height of the carriage to obtain the size parameters of length, width and height, and then the product of length, width and height is taken as the volume of the carriage. However, due to the deformation of the carriage body, the roughness of the carriage surface and the fact that the measurement angle cannot be aligned with the carriage boundary, the size parameters obtained by single-point sampling and measurement usually have large errors. In order to make up for the errors caused by single-point sampling and measurement, multiple distributed sampling is usually performed in the carriage, and the average value of the values measured by multiple points is taken as the size parameter, and finally the volume of the carriage is measured. However, the multi-point distributed sampling and measurement method not only increases the measurement time due to the complicated process, but also has certain limitations in measurement accuracy due to the limited number of samplings. Therefore, there is an urgent need for a carriage volume measurement method that takes into account the measurement efficiency and accuracy of the carriage volume measurement.
[0034] In one embodiment, as shown in FIG. 1, a carriage volume measurement method is provided. This embodiment takes the method applied to a terminal as an example. The terminal includes, but is not limited to, a personal computer, a notebook computer, a smart phone and a tablet computer, etc. The terminal includes an acquisition module, a determination module and a measurement module. The acquisition module is used to acquire the point cloud inside the carriage obtained by scanning the irregular surface of each inner wall surface of the carriage at the measurement point, fit the irregular surface associated with the carriage volume measurement in each inner wall surface of the carriage, and obtain a volume measurement plane. The determination module is used to determine the size parameters of the carriage through the positional relationship between the measurement point and the volume measurement plane. The measurement module is used to measure the volume of the carriage according to the size parameters. Through the information interaction between the acquisition module, the determination module and the measurement module, the positional relationship between the volume measurement plane and the measurement point can be determined by means of the volume measurement plane having the characteristics associated with the carriage volume measurement and accurately reflecting the geometric characteristics of the irregular surface, and the accurate size parameters of the carriage can be simply determined, thereby avoiding the problems of poor carriage volume measurement accuracy caused by poor accuracy of single acquisition of size parameters and low carriage volume measurement efficiency caused by too long time consumption of multiple acquisition of size parameters. Therefore, the measurement efficiency and accuracy of the carriage volume measurement can be taken into account. It can be understood that the method can also be applied to a server and can also be applied to a system including a terminal and a server and realized through the interaction of the terminal and the server. In this embodiment, the method includes the following operations:
[0035] At operation 202, irregular surfaces associated with the volume measurement of the vehicle cabin are fitted according to the point cloud of the vehicle cabin interior collected at the measuring point, to obtain a volume measurement plane, wherein the point cloud of the vehicle cabin interior is obtained by scanning each inner wall surface of the vehicle cabin, and each inner wall surface includes irregular surfaces.
[0036] In an embodiment, the point cloud of the vehicle cabin interior can be obtained by scanning each inner wall surface of the vehicle cabin, specifically a set of sampling points of the vehicle cabin interior, wherein the sampling points of the point cloud of the vehicle cabin interior can include position information and intensity information, and the position information can be the three-dimensional coordinates (x0, y0, z0) of the sampling points, and the intensity information can be the intensity value 0-255, and each inner wall surface of the vehicle cabin collectively constitutes the boundary of the vehicle cabin interior, and can specifically include a top wall surface, a side wall surface, a bottom wall surface, etc.
[0037] For example, in an optional embodiment, referring to FIG. 2, which is a schematic diagram showing the internal structure of the vehicle cabin, each inner wall surface of the vehicle cabin includes a top wall surface 11, a side wall surface 12, a side wall surface 13, a side wall surface 14, a side wall surface 15, and a bottom wall surface 16, wherein the side wall surface 12 is a surface away from the vehicle head, and the side wall surface 14 is a surface close to the vehicle head, and except that the side wall surface 12 is movable, the other inner wall surfaces of the vehicle cabin are fixed, and the side wall surface 12 can be used for loading and unloading goods when it is opened, and the side wall surface 12 can collectively constitute a closed vehicle cabin interior space with the other inner wall surfaces when it is closed. It can be understood that when the side wall surface 12 is closed, each inner wall surface of the vehicle cabin can be used as an irregular surface associated with the volume measurement of the vehicle cabin, and when the side wall surface 12 is opened, the side wall surfaces other than the side wall surface 12 can be used as irregular surfaces associated with the volume measurement of the vehicle cabin, because when the side wall surface 12 is opened, effective point cloud data cannot be scanned, and thus plane fitting of the side wall surface 12 cannot be achieved.
[0038] It should be noted that since each inner wall surface of the vehicle cabin is irregular, and thus to accurately reflect the geometric characteristics of the vehicle cabin, plane fitting can be performed on the surfaces based on the collected point cloud of the vehicle cabin interior. It can be understood that to achieve the volume measurement of the vehicle cabin, plane fitting can be performed only on the specified surfaces when plane fitting is performed.
[0039] The determination of the irregular surface associated with the volume of the vehicle compartment can be determined based on the geometric relationship between the measurement point and the irregular surface. The vehicle compartment interior point cloud can be acquired by a three-dimensional imaging device, which can be a face scanning laser radar. The irregular surface can be imaged and processed based on the vehicle compartment interior point cloud, and a complete volume measurement plane can be obtained. The measurement point refers to the position point at which the three-dimensional imaging device is placed to acquire the vehicle compartment interior point cloud, and can be the intersection of three or more surfaces. For example, in an optional embodiment, referring to FIG. 3, which is a schematic diagram showing a volume measurement plane, 21 is a measurement point, 22 is a volume measurement plane, and a preset three-dimensional coordinate system is shown in the figure. Since the volume measurement plane is a complete plane, z1 can reflect the size parameter “height” of the vehicle compartment, y1 can reflect the size parameter “width” of the vehicle compartment, and the distance x1 between the measurement point and the volume measurement plane can reflect the size parameter “length” of the vehicle compartment. The volume of the vehicle compartment can be measured based on the above size parameters, i.e., the volume of the vehicle compartment is x1·y1·z1.
[0040] It should be noted that the volume measurement plane is used for volume measurement, and can be a complete plane carrying part of the size parameters of the vehicle compartment. For example, in an optional embodiment, referring to FIG. 4, which is a schematic diagram showing a volume measurement plane, it is assumed that the vehicle compartment interior space is approximately a cylinder, and the measurement point is arranged at the bottom left corner of the tail of the vehicle compartment. The volume measurement plane can be a complete plane tangent to the right inner surface of the vehicle compartment. The depth l of the vehicle compartment can be obtained based on the volume measurement plane, the distance from the measurement point to the plane can be used to obtain the radius r of the vehicle compartment, and the geometric characteristics of the vehicle compartment can be reflected based on the volume measurement plane, thereby simplifying the solving process of the size parameters of the vehicle compartment.
[0041] In one embodiment, operation 202 can include connecting the measurement point and the coordinate origin of the preset three-dimensional coordinate system to obtain a measurement reference line, selecting any inner wall surface of the vehicle compartment as a to-be-measured inner wall surface, detecting whether the measurement reference line and the to-be-measured inner wall surface satisfy a preset geometric constraint condition, if it is detected that the measurement reference line and the to-be-measured inner wall surface satisfy the preset geometric constraint condition, regarding the to-be-measured inner wall surface as an irregular surface associated with the volume measurement of the vehicle compartment, screening to-be-fitted point cloud from the vehicle compartment interior point cloud acquired at the measurement point based on the distance from the to-be-fitted point cloud to the irregular surface, fitting the irregular surface based on the to-be-fitted point cloud to obtain a volume measurement plane, and if it is detected that the measurement reference line and the to-be-measured inner wall surface do not satisfy the preset geometric constraint condition, returning to the operation of selecting any inner wall surface of the vehicle compartment as a to-be-measured inner wall surface until an inner wall surface satisfying the preset geometric constraint condition with the measurement reference line is selected. The preset geometric constraint condition can be that a straight line in the to-be-measured inner wall surface is parallel to the measurement reference line. The to-be-fitted point cloud refers to the point cloud belonging to the irregular surface and waiting to be fitted.
[0042] At operation 204, the size parameter of the vehicle compartment is determined according to the positional relationship between the measuring point and the volume measuring plane.
[0043] It should be noted that when the volume measuring plane can fully reflect the geometric features of the irregular surface in the vehicle compartment that is related to the volume measurement of the vehicle compartment, the volume measuring plane can have a size parameter in a certain dimension. For example, in an alternative embodiment, referring to FIG. 5, which is a schematic diagram showing the size parameters of the vehicle compartment, the plane with four edges in solid line is the volume measuring plane, E is the measuring point, the volume of the vehicle compartment is calculated by the size parameters of length l1, width b1 and height h1, the size parameter of length l1 is determined by the positional relationship between the measuring point 31 and the volume measuring plane 32, and the size parameters of width b1 and height h1 are carried by the volume measuring plane 32. In this embodiment, l1 can be the distance between the measuring point and the vertical point of the measuring point on the volume measuring plane.
[0044] In one embodiment, operation 204 can include determining a first size parameter of the vehicle compartment according to the positional relationship between the measuring point and the volume measuring plane, extracting a second size parameter from the volume measuring plane, and taking the first size parameter and the second size parameter together as the size parameter of the vehicle compartment.
[0045] In an alternative embodiment, assuming that the three-dimensional position coordinates of the measuring point are (x0, y0, z0), and the plane equation of the volume measuring plane is A1x+B1y+C1z+D1=0, the first size parameter can be:
[0046] wherein A1 is the inclination of the volume measuring plane in the x-axis direction, B1 is the inclination of the volume measuring plane in the y-axis direction, C1 is the inclination of the volume measuring plane in the z-axis direction, D1 is the constant term, and d is the first size parameter. It can be understood that A1, B1, C1 and D1 are known quantities.
[0047] At operation 206, the volume of the vehicle compartment is measured according to the size parameter.
[0048] As an example, operation 206 can include taking the product of the first size parameter and the second size parameter as the measured volume.
[0049] In an alternative embodiment, the first size parameter is l1, the second size parameter is b1 and h1, and the measured volume of the vehicle compartment is:
[0050] wherein v is the volume of the vehicle compartment.
[0051] In the above vehicle compartment volume measurement method, firstly, the irregular surface associated with the vehicle compartment volume measurement is determined in each inner wall surface of the vehicle compartment through the measurement point and the preset geometric constraint condition, then the irregular surface is taken as the screening condition for screening the vehicle compartment internal point cloud obtained by scanning each inner wall surface of the vehicle compartment at the measurement point, the vehicle compartment internal point cloud is screened to obtain the point cloud belonging to the irregular surface to be fitted, the irregular surface is fitted through the above point cloud to obtain the volume measurement surface, then the first size parameter is obtained through the positional relationship between the volume measurement surface and the measurement point, and the second size parameter is extracted from the volume measurement surface, so that the size parameters of the vehicle compartment are integrated, and finally the product of the size parameters of the vehicle compartment is taken as the vehicle compartment volume. Since the volume measurement surface is obtained by fitting the irregular surface associated with the vehicle compartment volume measurement in the vehicle compartment inner wall surface, the volume measurement plane has the characteristics associated with the vehicle volume measurement, and because the volume measurement plane is fitted based on all the vehicle compartment internal point clouds, compared with the limited multi-point distributed sampling method, the irregular surface geometric characteristics can be more accurately reflected. At the same time, a large amount of vehicle compartment internal point cloud is simplified to the volume measurement plane for representation, which can more directly reflect the size parameters of the vehicle compartment from the spatial structure, thereby reducing the data processing amount in the process of determining the size parameters of the vehicle compartment. Therefore, the technical defects that the measurement error is caused by the deformation of the vehicle compartment or the misalignment of the measurement angle due to the single collection of the size parameters, and a large amount of time is consumed due to the multiple collection of the size parameters, and the volume measured finally does not meet the actual measurement expectation of the user are overcome. Therefore, when the volume is measured by relying on the size parameters determined by the volume measurement surface, the vehicle compartment volume meeting the actual measurement expectation of the user can be obtained, that is, the measurement efficiency and the measurement accuracy are considered when the vehicle compartment volume is measured.
[0052] In one embodiment, as shown in FIG. 6, according to the vehicle compartment internal point cloud collected at the measurement point, the irregular surface associated with the vehicle compartment volume measurement in the vehicle compartment is fitted to obtain the volume measurement plane, including:
[0053] Operation 302: selecting the irregular surface associated with the vehicle compartment volume measurement in each inner wall surface of the vehicle compartment according to the position of the measurement point in the vehicle compartment.
[0054] It should be noted that in the actual measurement scene, the configuration of the high-precision three-dimensional imaging device will lead to the increase of the measurement cost for measuring the volume of the vehicle compartment, and with the continuous development of science and technology, the low-precision three-dimensional imaging device is not only low in price, but also in continuous optimization of performance, such as TOF (Time of flight, time of flight) camera, line scanning laser radar and gimbal three-dimensional imaging device. In order to control the measurement cost of measuring the volume of the vehicle compartment, the low-precision three-dimensional imaging device can be used to replace the high-precision three-dimensional imaging device to measure the volume of the vehicle compartment in the usual case. Compared with the high-precision three-dimensional imaging device, the low-precision three-dimensional imaging device has poor completeness of the volume measurement plane obtained by fitting the irregular surface, and thus specific fitting constraints need to be set to fit the required volume measurement plane.
[0055] It should be noted that due to the different deployment requirements of the measurement points in the actual application scene, the irregular surfaces associated with the volume measurement of the vehicle compartment are selected on the surface of each inner wall of the vehicle compartment through the position of the measurement point in the vehicle compartment. For example, in an optional embodiment, a mapping relationship table between the position attribute of the measurement point position and the irregular surface is established. When the position of the measurement point is P1, the selected irregular surface is V1, and when the position of the measurement point is P2, the selected irregular surface is V2. Referring to FIG. 7, which is a schematic diagram of the setting position of the measurement point. Since different size parameters need to be determined based on the distance of A1 to each volume measurement plane, if A1 is set as the measurement point, the position attribute is 1, and then the inner wall surfaces B1, B2 and B3 can be selected as the irregular surfaces associated with the volume measurement of the vehicle compartment. If A2 is set as the measurement point, the position attribute is 2, and then the inner wall surfaces B1, B2, B3, B4, B5 and B6 can be selected as the irregular surfaces associated with the volume of the vehicle compartment. If A3 is set as the measurement point, the position attribute is 3, and then the inner wall surfaces B4, B5 and B6 can be selected as the irregular surfaces associated with the volume measurement of the vehicle compartment. If A4 is set as the measurement point, the position attribute is 4, and then the inner wall surfaces B1, B2, B3 and B4 can be selected as the irregular surfaces associated with the volume measurement of the vehicle compartment.
[0056] In one embodiment, operation 302 includes: determining the position attribute of the measurement point according to the position of the measurement point in the vehicle compartment, querying the preset mapping table with the position attribute as the index to obtain the corresponding surface identifier, and taking the inner wall surface identified by the surface identifier as the irregular surface associated with the volume measurement of the vehicle compartment.
[0057] Operation 304, determining the fitting constraint condition for fitting the irregular surface according to the point cloud inside the vehicle compartment.
[0058] It should be noted that when the volume measurement planes fitted for any irregular surface cannot carry the size parameters of the carriage due to incompleteness, the fitting constraint conditions can be set so that the volume measurement planes and the volume measurement planes can reflect the size parameters of the carriage. It can be understood that the fitting constraint conditions can be different when the number of selected irregular surfaces is different. For example, in an alternative embodiment, referring to FIG. 8, which is a schematic diagram of plane fitting of three irregular surfaces, the measurement point is arranged at 41, the distance between the volume measurement plane 42 and the measurement point 41 is the size parameter "length", the distance between the volume measurement plane 43 (front surface) and the measurement point 41 is the size parameter "width", and the distance between the volume measurement plane 44 (top surface) and the measurement point is the size parameter "height". Thus, the fitting constraint conditions can include that the volume measurement planes fitted for the three irregular surfaces are perpendicular or approximately perpendicular to each other.
[0059] It should be noted that for any irregular surface, under unconstrained conditions, a plurality of planes can be fitted by the carriage interior point cloud, and different sampling points of the carriage interior point cloud belong to different irregular surfaces. Thus, the plane structure of different irregular surfaces can be determined by segmentation of the carriage interior point cloud, and further fitting constraint conditions can be established based on the plane structure.
[0060] In one embodiment, operation 304 can include segmenting the carriage interior point cloud to obtain point cloud subsets belonging to respective irregular surfaces, and determining fitting constraint conditions for fitting the irregular surfaces based on the planes fitted from the respective point cloud subsets.
[0061] It can be understood that the planes preliminarily fitted based on the point cloud subsets can represent the approximate geometric shapes of different irregular surfaces to some extent, and further fitting constraint conditions can be extracted between the planes to lay a foundation for further fitting the volume measurement planes that meet the fitting constraint conditions.
[0062] Operation 306, fitting the irregular surfaces according to the fitting constraint conditions to obtain the volume measurement planes.
[0063] In one embodiment, operation 306 can include fitting the respective irregular surfaces by the respective point cloud subsets under the constraint of the fitting constraint conditions to obtain the respective volume measurement planes of the respective irregular surfaces.
[0064] It can be understood that after fitting the respective volume measurement planes of the plurality of irregular surfaces based on the fitting constraint conditions, the different volumes of the carriage can be simply calculated according to the geometric relationship between the respective volume measurement planes and the positional relationship between the respective volume measurement planes and the measurement point.
[0065] In the embodiment, the irregular surfaces associated with the volume measurement of the vehicle compartment are selected from the inner wall surfaces of the vehicle compartment by measuring the positions of the measuring points in the vehicle compartment, in other words, the irregular surfaces reflecting the different size parameters of the vehicle compartment are determined by measuring the positions of the measuring points in the vehicle compartment, and then the preliminary fitting of the irregular surfaces is performed by the point cloud in the vehicle compartment to reflect the geometric characteristics of the different irregular surfaces, and then the fitting constraints required to be met by the different irregular surfaces are extracted, and finally the fitting of the irregular surfaces is completed under the fitting constraints to obtain the volume measurement planes corresponding to the different irregular surfaces. Since the irregular surfaces associated with the volume measurement of the vehicle compartment can be selected from the measuring points arranged at any position, the irregular surfaces reflecting the size parameters of the vehicle compartment in the vehicle compartment are determined by measuring the positions of the measuring points in the vehicle compartment, and then the point cloud in the vehicle compartment is collected by the low-precision three-dimensional imaging device, and after the fitting constraints of the irregular surfaces are determined, the volume measurement planes corresponding to the irregular surfaces fitted under the fitting constraints can more accurately reflect the different size parameters of the vehicle compartment. Therefore, the fitting manner of the embodiment lays a foundation for taking into account the measurement efficiency and measurement accuracy while improving the measurement flexibility of the volume measurement of the vehicle compartment.
[0066] In one embodiment, the irregular surfaces include a first irregular surface and a second irregular surface, and the fitting constraints include a first fitting constraint and a second fitting constraint; fitting the irregular surfaces according to the fitting constraints to obtain the volume measurement plane includes: when fitting the first irregular surface, performing a first loop process until the first fitting constraint is met; the first loop process includes: fitting the first irregular surface according to at least three sampling points selected from the point cloud in the vehicle compartment to obtain a first candidate plane; determining first sampling points belonging to the first candidate plane in the point cloud in the vehicle compartment; comparing a first sampling point statistic of the first sampling points with a first preset statistical threshold, wherein the fitting constraint is that the first sampling point statistic is greater than the first preset statistical threshold; taking the first candidate plane as the volume measurement plane corresponding to the first irregular surface; when fitting the second irregular surface, performing a second loop process until the second fitting constraint is met; the second loop process includes: updating the point cloud in the vehicle compartment to obtain an updated point cloud in the vehicle compartment; fitting the second irregular surface according to at least three sampling points selected from the updated point cloud in the vehicle compartment to obtain a second candidate plane; determining second sampling points belonging to the second candidate plane in the updated point cloud in the vehicle compartment; comparing a second sampling point statistic of the second sampling points with a second preset statistical threshold, wherein the second fitting constraint is that the second sampling point statistic is greater than the second preset statistical threshold; and taking the second candidate plane as the volume measurement plane corresponding to the second irregular surface.
[0067] It should be noted that, in the process of obtaining the volume measurement plane based on the fitting of the irregular surface inside the vehicle compartment, when multiple irregular surfaces are involved in the fitting, since the point cloud inside the vehicle compartment can be fitted to obtain multiple volume measurement planes that meet the requirements, the determination of the volume measurement plane can be performed through the specified fitting constraint condition, and the point cloud inside the vehicle compartment is sequentially screened to improve the fitting efficiency of the plane fitting of multiple irregular surfaces.
[0068] Among them, the first irregular surface refers to the reference irregular surface for fitting, which can be one in particular, and the second irregular surface refers to the non-reference irregular surface for fitting, which can be one or more. It can be understood that after the volume measurement plane corresponding to the first irregular surface is fitted, the point cloud inside the vehicle compartment belonging to the first irregular surface is removed through screening, which can reduce the number of plane fitting of the volume measurement plane corresponding to the second irregular surface, and the plane fitting efficiency of the second irregular surface can be improved in turn.
[0069] For example, as shown in FIG. 8, the volume measurement plane 42 is taken as the volume measurement plane corresponding to the first irregular surface, and the volume measurement plane 43 and the volume measurement plane 44 are taken as the volume measurement plane corresponding to the second irregular surface. First, the first loop process is performed based on the first fitting constraint condition, and the volume measurement plane 42 is fitted. Then, the point cloud belonging to the volume measurement plane 42 is screened from the point cloud inside the vehicle compartment, and the second loop process is performed based on the second fitting constraint condition, until the volume measurement plane 43 and the volume measurement plane 44 are fitted. The order of fitting the volume measurement plane 43 and the volume measurement plane 44 is not specifically limited.
[0070] It should be noted that the first sampling point statistic refers to the sampling point statistic belonging to the first candidate plane, which can specifically include the number of sampling points with a distance less than a preset distance threshold to the first candidate plane or the proportion of the number of sampling points belonging to the first candidate plane in the overall number of point clouds inside the vehicle compartment; the second sampling point statistic refers to the sampling point statistic belonging to the second candidate plane, which can specifically include the number of sampling points with a distance less than a preset distance threshold to the second candidate plane or the proportion of the number of sampling points belonging to the second candidate plane in the overall number of point clouds inside the vehicle compartment; the first preset statistical threshold and the second preset statistical threshold are set according to actual needs; wherein the way of fitting the first candidate plane and the second candidate plane can be a way of solving the plane equation based on a preset number of point clouds. It can be understood that the first preset statistical threshold and the second preset statistical threshold can be the same or different.
[0071] As an example, when fitting the first irregular surface, the first loop process is performed until the first fitting constraint condition is met; the first loop process can include:
[0072] Three sampling points are randomly selected from the interior point cloud of the vehicle compartment, a first plane equation is solved according to the position coordinates of the three sampling points, and a plane described by the first plane equation is taken as a first candidate plane; a first sampling point belonging to the first candidate plane in the interior point cloud of the vehicle compartment is determined according to a size relationship between a distance from the interior point cloud of the vehicle compartment to the first candidate plane and a first preset distance threshold; and a point cloud proportion of the first sampling point in the interior point cloud of the vehicle compartment is compared with a first preset point cloud proportion threshold.
[0073] When the point cloud proportion of the first sampling point in the interior point cloud of the vehicle compartment is greater than the first preset point cloud proportion threshold, the first candidate plane is taken as a volume measurement plane of the first irregular surface; and when the second irregular surface is fitted, a second loop process is executed until a second fitting constraint condition is met, and the second loop process includes:
[0074] The first sampling point is removed from the interior point cloud of the vehicle compartment to obtain an updated interior point cloud of the vehicle compartment; three sampling points are randomly selected from the updated interior point cloud of the vehicle compartment, a second plane equation is solved according to the position coordinates of the three sampling points, and a plane described by the second plane equation is taken as a second candidate plane; a second sampling point belonging to the second candidate plane in the interior point cloud of the vehicle compartment is determined according to a size relationship between a distance from the updated interior point cloud of the vehicle compartment to the first candidate plane and a second preset distance threshold, wherein the first preset distance threshold and the second preset distance threshold can be the same or different; and a point cloud proportion of the second sampling point in the interior point cloud of the vehicle compartment is compared with a second preset point cloud proportion threshold.
[0075] When the point cloud proportion of the second sampling point in the interior point cloud of the vehicle compartment is greater than the second preset point cloud proportion threshold, the second candidate plane is taken as a volume measurement plane of the second irregular surface.
[0076] In an optional implementation, assuming that irregular surfaces associated with the volume measurement of the vehicle compartment include a first irregular surface H1, a second irregular surface H2 and a third irregular surface H3, the number N of point clouds of the interior point cloud of the vehicle compartment is first counted, and the distance threshold of the sampling point on the candidate plane is defined as ε1 (a preset distance threshold), and the distance threshold of the sampling point on one side of the candidate plane is defined as ε2, and then the first irregular surface H1 is fitted first, and the fitting process is as follows:
[0077] 1) Three points are randomly sampled in the interior point cloud of the vehicle compartment, and a first candidate plane is obtained by substituting the position coordinates of the three points into a plane equation.
[0078] 2) The point cloud with a distance d1 < ε1 from the first candidate plane in the interior point cloud of the vehicle compartment is taken as a first sampling point belonging to the first candidate plane.
[0079] 3) count the number of first sampling points M1 and set the first candidate plane to contain the least number of point clouds T N , or count the proportion of the number of first sampling points M1 in the overall number of points in the interior of the carriage N, and set the minimum proportion of the first sampling points in the interior of the carriage R N .
[0080] 4) When M1 < T N or M1 / N < R N , the first candidate plane is taken as the volume measurement plane corresponding to the first irregular surface H1; after determining the volume measurement plane corresponding to the first irregular surface H1, the second irregular surface H2 is fitted, and the fitting process is as follows:
[0081] 4-1. The first sampling points are removed from the interior point cloud of the carriage to obtain an updated interior point cloud of the carriage.
[0082] 4-2. Three points are randomly sampled in the updated interior point cloud of the carriage, and the position coordinates of the three points are substituted into the plane equation to obtain a second candidate plane.
[0083] 4-3. The point cloud with a distance d2 < ε1 from the second candidate plane is taken as the second sampling point belonging to the second candidate plane.
[0084] 4-4. Count the number of second sampling points M2 and set the second candidate plane to contain the least number of point clouds T N , or count the proportion of the number of second sampling points M2 in the overall number of points in the interior of the carriage N, and set the minimum proportion of the second sampling points in the interior of the carriage R N .
[0085] 4-5. When M2 < T N or M2 / N < R N , the second candidate plane is taken as the volume measurement plane corresponding to the second irregular surface H1; after determining the volume measurement plane corresponding to the second irregular surface H2, the third irregular surface H3 is fitted in the same way as the fitting of the second irregular surface H2, thereby completing the plane fitting process of the three irregular surfaces.
[0086] It can be understood that after the different volume measurement planes are fitted, the point clouds belonging to the different volume measurement planes are recorded, and the above fitting embodiments are carried out without considering whether the device coordinates are consistent with the size parameters of the carriage, i.e., the size parameters can all be expressed in absolute values.
[0087] In the embodiment, when fitting multiple irregular surfaces, by setting corresponding fitting constraints for different irregular surfaces, the candidate planes fitted for the irregular surfaces are iteratively screened in the fitting process until the volume measurement plane meeting the fitting constraints is screened, since the plane fitting of all the interior point clouds of the vehicle compartment is involved in the screening process, the volume measurement plane corresponding to the fitted irregular surface can more objectively reflect the geometric characteristics of the irregular surface, and at the same time, in the fitting process of multiple irregular surfaces, the screening of the number of interior point clouds of the vehicle compartment is sequentially performed, so that the screening of different irregular surfaces does not need to completely rely on the overall interior point clouds of the vehicle compartment, and the fitting process of multiple irregular surfaces is shorter in time, so that the plane fitting method of the embodiment can further lay a foundation for balancing the measurement efficiency and accuracy of the volume of the vehicle compartment.
[0088] In one embodiment, the fitting constraints include a third fitting constraint; taking the first candidate plane as the volume measurement plane corresponding to the first irregular surface includes:
[0089] According to the first distance between the first candidate plane and the preset coordinate center point, the interior point clouds of the vehicle compartment are divided into first interior point clouds of the vehicle compartment and second interior point clouds of the vehicle compartment; the third sampling point statistics of the first interior point clouds of the vehicle compartment and the fourth sampling point statistics corresponding to the first interior point clouds of the vehicle compartment and the second interior point clouds of the vehicle compartment are determined respectively; if the third sampling point statistics and the fourth sampling point statistics meet the third fitting constraint, the first candidate plane is taken as the volume measurement plane corresponding to the first irregular surface, wherein the third fitting constraint is that the third sampling point statistics is greater than a third preset statistical threshold, and the fourth sampling point statistics is greater than a fourth preset statistical threshold; if the third sampling point statistics or the fourth sampling point statistics does not meet the third fitting constraint, the first loop process is returned to be executed.
[0090] It should be noted that, in the process of fitting the irregular surface, since the collected interior point clouds of the vehicle compartment may have errors, the volume measurement plane corresponding to the irregular surface selected by finally relying on the first fitting constraint and the second fitting constraint cannot reflect the boundary characteristics of the inner wall surface, and then the third fitting constraint can be set to judge the candidate plane meeting the first fitting constraint or the second fitting constraint again, and only when the third fitting constraint is met, the candidate plane is taken as the volume measurement plane corresponding to the irregular surface.
[0091] The third sampling point statistics can be specifically the number of sampling points located on the side of the candidate plane far from the measurement point, and the fourth sampling point statistics can be specifically the ratio between the number of sampling points located on the side of the candidate plane far from the measurement point and the number of sampling points located on the side of the candidate plane close to the measurement point. The third preset statistics threshold and the fourth preset statistics threshold can be set according to requirements. For example, the third preset statistics threshold can be set as the maximum number of point clouds located on the side of the candidate plane far from the measurement point, and the fourth preset statistics threshold can be set as the maximum ratio between the number of point clouds located on the side of the candidate plane far from the measurement point and the number of point clouds located on the side of the candidate plane close to the measurement point.
[0092] As an example, the point clouds in the car interior point cloud with a distance to the first candidate plane greater than a first distance between the first candidate plane and a preset coordinate center point can be taken as first car interior point clouds, and the point clouds in the car interior point cloud with a distance to the first candidate plane less than or equal to the first distance can be taken as second car interior point clouds. The first point cloud number of the first car interior point clouds is counted, and the point cloud number ratio between the first point cloud number and the second point cloud number of the second car interior point clouds is counted. When the first point cloud number is less than a set maximum point cloud number and the point cloud number ratio is less than a set maximum point cloud number ratio, the first candidate plane is taken as the volume measurement plane corresponding to the first irregular surface. When the first point cloud number is greater than or equal to the set maximum point cloud number, or the second point cloud number is greater than or equal to the set maximum point cloud number ratio, the first loop process is returned to execute.
[0093] In an optional implementation, the first distance between the first candidate plane and the preset coordinate center point is calculated as ε2, and it can be understood that ε2>ε1. After obtaining the first candidate plane satisfying the first constraint condition, the first point cloud number O located on the side of the first candidate plane far from the measurement point and the second point cloud number I located on the side of the first candidate plane close to the measurement point are counted respectively, and the number of point clouds allowed on the first candidate plane and far from the measurement point is set as T F and the ratio between the number of point clouds allowed on the side of the first candidate plane far from the measurement point and the number of point clouds allowed on the side of the first candidate plane close to the measurement point is set as R F When O F and O / I F R, the first candidate plane is taken as the volume measurement plane corresponding to the first irregular surface, otherwise the generation and discrimination of the first candidate plane are re-performed. It can be understood that when determining whether the second candidate plane satisfying the second fitting constraint condition can be taken as the volume measurement plane corresponding to the second irregular surface, the above third fitting constraint condition can also be used for multiple determinations.
[0094] In the embodiment, for the candidate plane meeting the preliminary fitting constraint condition, based on the comparison of the statistical quantities of the point clouds inside and outside the candidate plane, it is ensured that the candidate plane obtained by fitting the irregular surface is the boundary plane of the interior of the carriage, that is, the technical defect that the candidate plane parallel to the volume measurement plane is mistakenly regarded as the volume measurement plane due to the error of the point cloud in the interior of the carriage or the error of the environment in the interior of the carriage is avoided, and the edge feature of the obtained volume measurement plane is sufficiently ensured, so that after the irregular surface fitting according to the point cloud in the interior of the carriage, the obtained volume measurement plane can objectively reflect the geometric feature and edge feature of the irregular surface, thereby laying a foundation for further improving the measurement accuracy of the volume measurement of the carriage.
[0095] In one embodiment, according to the position of the measurement point in the carriage, the irregular surface associated with the volume measurement of the carriage is selected from the inner wall surfaces of the carriage, including:
[0096] According to the position of the measurement point in the carriage, the measurement direction vector of the measurement point in the carriage is determined, the measurement angle between the measurement direction vector and the normal vector of each inner wall surface of the carriage is determined, and the irregular surface associated with the volume measurement of the carriage is selected from each inner wall surface according to each measurement angle.
[0097] It should be noted that in the process of selecting the irregular surface associated with the volume measurement of the carriage, there are multiple inner wall surfaces that can be selected as the irregular surface. Since the measurement angle of the three-dimensional measurement device is fixed after the placement position of the measurement point is fixed, the larger the measurement angle, the more point clouds in the interior of the carriage can be scanned, and the geometric feature of the inner wall surface can be more comprehensively reflected, and then the irregular surface can be selected based on the measurement angle.
[0098] Referring to FIG. 9, FIG. 9 is a schematic diagram of selecting an irregular surface based on a measurement angle. Assuming that the measurement point 61 is the position of the measurement point in the carriage, when 3D imaging, the three faces close to the three-dimensional imaging device cannot generate effective point cloud data due to the small angle, and at this time, the selection of the irregular surface in the interior of the carriage is better determined. However, when the measurement point 62 is the position of the measurement point in the carriage, point cloud data will be generated on each inner wall surface. Since only three faces need to be selected for plane fitting from the six faces, at this time, the positive correlation between the number of point cloud imaging and the measurement angle can be utilized, and the irregular surface can be screened from the mutually parallel inner wall surfaces through the measurement angle.
[0099] As an example, the measurement direction vector of the measurement point in the vehicle compartment can be calculated according to the position coordinates of the measurement point at the location in the vehicle compartment and the origin coordinates of the preset three-dimensional coordinate system; the reference planes of the inner wall surfaces are obtained, and the normal vectors corresponding to the inner wall surfaces are calculated, and the normal vectors and the measurement direction vector are sequentially input into a preset measurement angle calculation formula to obtain a plurality of measurement angles; a target measurement angle greater than the preset measurement angle is selected from the measurement angles, and the inner wall surface corresponding to the target measurement angle is taken as the irregular surface associated with the volume of the vehicle compartment. This embodiment utilizes the positive correlation between the measurement angle and the number of point clouds, and when there are multiple selectable irregular surfaces of the same feature inner wall surface, the inner wall surface with a larger measurement angle (more point clouds obtained by scanning) is always taken as the irregular surface, so that the geometric characteristics of the inner wall surface can be fed back to the greatest extent, thereby laying a foundation for more accurately fitting the volume measurement plane.
[0100] In one embodiment, the volume measurement plane includes a first volume measurement plane and a second volume measurement plane parallel to the first volume measurement plane; and the size parameter of the vehicle compartment is determined according to the positional relationship between the measurement point and the volume measurement plane, including:
[0101] The second distance between the measurement point and the first volume measurement plane is determined according to the positional relationship between the measurement point and the first volume measurement plane, and the third distance between the measurement point and the first volume measurement plane is determined according to the positional relationship between the measurement point and the second volume measurement plane; and the size parameter of the vehicle compartment is obtained by fusing the second distance and the third distance.
[0102] It should be noted that when the measurement point is arranged at any position, there is no geometric relationship between the measurement point and the fitted volume measurement plane associated with the size parameter of the vehicle compartment, and at this time, the fitting amount of the irregular surface can be increased in the fitting process to construct the geometric relationship between the fitted volume measurement planes, so that the size parameter of the vehicle compartment can be solved without complex position coordinate conversion.
[0103] For example, in an alternative embodiment, referring to FIG. 10, which is a schematic diagram for solving the size parameter of the vehicle compartment, the volume measurement plane 71 is parallel to the volume measurement plane 73, the volume measurement plane 72 is parallel to the volume measurement plane 74, and the volume measurement plane 75 is parallel to the volume measurement plane 76, and then the size parameter "length" of the vehicle compartment can be obtained by calculating the distances from the measurement point to the volume measurement plane 71 and the volume measurement plane 73, the size parameter "width" of the vehicle compartment can be obtained by calculating the distances from the measurement point to the volume measurement plane 72 and the volume measurement plane 74, and the size parameter "height" of the vehicle compartment can be obtained by calculating the distances from the measurement point to the volume measurement plane 75 and the volume measurement plane 76.
[0104] As an example, a second distance of the measurement point to the first volume measurement plane is calculated according to the position coordinates of the measurement point and the position coordinates of the measurement point perpendicular to the first volume measurement plane, and a third distance of the measurement point to the second volume measurement plane is calculated according to the position coordinates of the measurement point and the position coordinates of the measurement point perpendicular to the second volume measurement plane; and a sum of the second distance and the third distance is taken as the size parameter of the vehicle compartment. In this embodiment, by setting the geometric constraint relationship between the planes in the stage of fitting the irregular surface, the geometric constraint relationship can be relied on when the size parameter of the vehicle compartment is solved, and the size parameter of the vehicle compartment can be obtained through simple geometric conversion, so that the efficiency of converting the volume measurement plane to the size parameter of the vehicle compartment is improved, and a foundation is laid for the measurement efficiency of the vehicle compartment volume measurement.
[0105] In one embodiment, before the size parameter of the vehicle compartment is determined according to the positional relationship between the measurement point and the volume measurement plane, the vehicle compartment volume measurement method further comprises:
[0106] A fifth sampling point belonging to the volume measurement plane is obtained; the volume measurement plane is optimized according to the fifth sampling point to obtain a volume measurement optimized plane of the volume measurement plane under a preset geometric constraint condition; and the volume measurement optimized plane is taken as the volume measurement plane.
[0107] As an example, before the size parameter of the vehicle compartment is determined, the geometric relationship between the obtained volume measurement planes may not satisfy the geometric constraint condition required by the vehicle compartment volume measurement, and the geometric relationship between the different volume measurement planes can be optimized based on the set geometric constraint condition to facilitate the determination of the size parameter. For example, in an optional embodiment, the set geometric constraint condition can be that the three volume measurement planes are perpendicular to each other and the plane normal vectors of the volume measurement planes are unit vectors, and the geometric relationship between the volume measurement planes is optimized by the least square method to minimize the distance of the vehicle compartment internal point cloud belonging to different volume measurement planes to the volume measurement plane. For example, assuming that the three volume measurement planes are M1, M2 and M3 in sequence, the plane equation of M1 is A2x+B2y+C2z+D2=0, the plane equation of M2 is A3x+B3y+C3z+D3=0, and the plane equation of M3 is A4x+B4y+C4z+D4=0, the optimization expression is as follows: a1·a2=0 a1·a3=0 a2·a3=0 a1·a1=1 a2·a2=1 a3·a3=1
[0108] wherein,
[0109] Wherein, P1 is a point cloud set belonging to the volume measurement plane M1, P2 is a point cloud set belonging to the volume measurement plane M2, P3 is a point cloud set belonging to the volume measurement plane M3, a1 is a normal vector of the volume measurement plane M1, a2 is a normal vector of the volume measurement plane M1, a3 is a normal vector of the volume measurement plane M1, A2, A3, A4, B2, B3, B4, C2, C3, C4, D2, D3, D4 are all constants.
[0110] As an example, the fifth sampling point contained in the volume measurement plane is counted; according to the fifth sampling point, the volume measurement plane is optimized by using the least square method to obtain a volume measurement optimization plane; and the volume measurement optimization plane is taken as the volume measurement plane.
[0111] In this embodiment, the volume measurement plane is optimized by the fifth sampling point contained in the volume measurement plane, the distance between the fifth sampling point and the volume measurement plane is minimized, and the volume measurement optimization plane obtained by optimization satisfies the preset geometric constraint condition, and then the volume measurement optimization plane is replaced by the volume measurement plane, so that the different volume measurement planes satisfy the preset geometric constraint condition, and the point cloud in the vehicle compartment accurately reflects the geometric characteristics of the volume measurement plane, thereby laying a foundation for accurately solving the size parameters of the vehicle compartment.
[0112] In an optional implementation, the three-dimensional imaging device is placed at the edge corner point of the lower left corner of the vehicle compartment, at this time only three inner wall surfaces away from the three-dimensional imaging device will generate effective vehicle interior point cloud, and then the three-dimensional imaging device is used to collect the vehicle interior point cloud generated in the vehicle compartment, and then three sampling points are selected in the vehicle interior point cloud to fit a plurality of candidate planes, and the first fitting constraint condition, the second fitting constraint condition and the third fitting constraint condition are set to screen the plurality of candidate planes, and the corresponding volume measurement planes are fitted for the three inner wall surfaces. At this time, the least square method and the preset geometric constraint condition (constraining the three volume measurement planes to be perpendicular to each other and the normal vectors to be unit vectors) can be used to optimize the three volume measurement planes, and the volume measurement optimization planes obtained by optimization are taken as the volume measurement planes again, and then the size parameters of the vehicle compartment, i.e. length, width and height, are obtained in turn according to the distances from the measurement points to the three volume measurement planes, and finally the product of length, width and height is taken as the volume of the vehicle compartment, and finally the measurement of the volume of the vehicle compartment is completed.
[0113] Since the volume measurement surface is obtained by fitting irregular surfaces in the inner wall surface of the vehicle compartment that are related to the volume measurement of the vehicle compartment, the volume measurement plane has characteristics related to the volume measurement of the vehicle compartment, and since the volume measurement plane is fitted based on all the point clouds in the vehicle compartment, compared with the limited multi-point distributed sampling mode, the irregular surface geometric characteristics can be more accurately reflected, at the same time, a large number of point clouds in the vehicle compartment are simplified to a volume measurement plane for characterization, which can more intuitively reflect the size parameters of the vehicle compartment from the spatial structure, thereby reducing the data processing amount in the process of determining the size parameters of the vehicle compartment, so as to overcome the technical defects that the measurement error is caused by the deformation of the vehicle compartment or the misalignment of the measurement angle due to single collection of size parameters, and a large amount of time is consumed due to multiple collection of size parameters, thereby leading to the situation that the finally measured volume does not meet the actual measurement expectation of the user, so that when the volume measurement is performed by relying on the size parameters determined by the volume measurement surface, the vehicle compartment volume that meets the actual measurement expectation of the user can be obtained, that is, the measurement efficiency and measurement accuracy are considered when the volume of the vehicle compartment is measured.
[0114] It should be understood that, although each operation in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these operations are not necessarily executed in sequence according to the order of the arrow. Unless otherwise specified herein, the execution of these operations is not strictly limited in sequence, and these operations can be executed in other orders. Moreover, at least part of the operations in the flowchart involved in each of the above embodiments can include multiple operations or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these operations or stages is not necessarily sequential, but can be alternately executed with at least part of other operations or stages in other operations.
[0115] Based on the same inventive concept, the embodiments of the present application also provide a vehicle compartment volume measurement device for implementing the above-mentioned vehicle compartment volume measurement method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more vehicle compartment volume measurement device embodiments provided below can refer to the limitations of the vehicle compartment volume measurement method in the above text, which will not be repeated here.
[0116] In one exemplary embodiment, as shown in FIG. 11, a vehicle compartment volume measurement device is provided, comprising: an acquisition module 401, a determination module 402 and a measurement module 403, wherein:
[0117] The acquisition module 401 is configured to fit an irregular surface associated with volume measurement of the vehicle compartment according to a point cloud in the vehicle compartment collected at a measurement point, to obtain a volume measurement plane, wherein the point cloud in the vehicle compartment is obtained by scanning each inner wall surface of the vehicle compartment, and each inner wall surface includes the irregular surface.
[0118] The determination module 402 is configured to determine a size parameter of the vehicle compartment according to a positional relationship between the measurement point and the volume measurement plane.
[0119] The measurement module 403 is configured to measure a volume of the vehicle compartment according to the size parameter.
[0120] In one of the embodiments, the acquisition module 401 is further configured to:
[0121] select the irregular surface associated with volume measurement of the vehicle compartment from each inner wall surface according to a position of the measurement point in the vehicle compartment; determine a fitting constraint condition for fitting the irregular surface according to the point cloud in the vehicle compartment; and fit the irregular surface according to the fitting constraint condition to obtain the volume measurement plane.
[0122] In one of the embodiments, the irregular surface includes a first irregular surface and a second irregular surface, and the fitting constraint condition includes a first fitting constraint condition and a second fitting constraint condition; and the acquisition module 401 is further configured to:
[0123] In the fitting of the first irregular surface, a first loop process is performed until the first fitting constraint condition is met; the first loop process comprises: fitting the first irregular surface according to at least three sampling points selected from the vehicle interior point cloud to obtain a first candidate plane; determining first sampling points belonging to the first candidate plane in the vehicle interior point cloud; comparing a first sampling point statistic of the first sampling points with a first preset statistic threshold, wherein the fitting constraint condition is that the first sampling point statistic is greater than the first preset statistic threshold; taking the first candidate plane as a volume measurement plane corresponding to the first irregular surface; in the fitting of the second irregular surface, a second loop process is performed until the second fitting constraint condition is met; the second loop process comprises: updating the vehicle interior point cloud to obtain an updated vehicle interior point cloud; fitting the second irregular surface according to at least three sampling points selected from the updated vehicle interior point cloud to obtain a second candidate plane; determining second sampling points belonging to the second candidate plane in the updated vehicle interior point cloud; comparing a second sampling point statistic of the second sampling points with a second preset statistic threshold, wherein the second fitting constraint condition is that the second sampling point statistic is greater than the second preset statistic threshold; taking the second candidate plane as a volume measurement plane corresponding to the second irregular surface.
[0124] In one of the embodiments, the fitting constraint condition comprises a third fitting constraint condition; the obtaining module 401 is further configured to:
[0125] According to a first distance between the first candidate plane and a preset coordinate center point, the vehicle interior point cloud is divided into a first vehicle interior point cloud and a second vehicle interior point cloud; a third sampling point statistic of the first vehicle interior point cloud and a fourth sampling point statistic corresponding to the first vehicle interior point cloud and the second vehicle interior point cloud are respectively determined; if the third sampling point statistic and the fourth sampling point statistic meet the third fitting constraint condition, the first candidate plane is taken as a volume measurement plane corresponding to the first irregular surface, wherein the third fitting constraint condition is that the third sampling point statistic is greater than a third preset statistic threshold and the fourth sampling point statistic is greater than a fourth preset statistic threshold; if the third sampling point statistic or the fourth sampling point statistic does not meet the third fitting constraint condition, the first loop process is returned to be performed.
[0126] In one of the embodiments, the obtaining module 401 is further configured to:
[0127] According to the position of the measuring point at the vehicle cabin, a measuring direction vector of the measuring point at the vehicle cabin is determined; a measuring angle between the measuring direction vector and a normal vector of each inner wall surface of the vehicle cabin is determined; according to each measuring angle, an irregular surface associated with the vehicle cabin volume measurement is selected at each inner wall surface.
[0128] In one of the embodiments, the volume measurement plane includes a first volume measurement plane and a second volume measurement plane parallel to the first volume measurement plane; the determining module 402 is further configured to:
[0129] According to the positional relationship between the measuring point and the first volume measurement plane, a second distance between the measuring point and the first volume measurement plane is determined, and according to the positional relationship between the measuring point and the second volume measurement plane, a third distance between the measuring point and the first volume measurement plane is determined; by fusing the second distance and the third distance, the size parameter of the vehicle cabin is obtained.
[0130] In one of the embodiments, the vehicle cabin volume measurement device is further configured to:
[0131] A fifth sampling point belonging to the volume measurement plane is obtained; according to the fifth sampling point, the volume measurement plane is optimized to obtain a volume measurement optimized plane of the volume measurement plane under a preset geometric constraint condition; the volume measurement optimized plane is taken as the volume measurement plane.
[0132] Each module in the vehicle cabin volume measurement device can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operation corresponding to each module.
[0133] In an example embodiment, a computer device, which can be a terminal, is provided, and an internal structure diagram of the computer device can be as shown in FIG. 12. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals, and the wireless communication can be achieved through WIFI, mobile cellular network, NFC (Near Field Communication), or other technologies. The computer program is executed by the processor to implement a method for measuring a volume of a vehicle compartment. Those skilled in the art can understand that the structure shown in FIG. 12 is only a block diagram of part of the structure related to the scheme of the present application, and does not limit the computer device to which the scheme of the present application is applied. Specifically, the computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0134] In an example embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the operations in the above method embodiments.
[0135] In an example embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the operations in the above method embodiments.
[0136] In an example embodiment, a computer program product is provided, and the computer program product includes a computer program, and the computer program is executed by a processor to implement the operations in the above method embodiments.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0138] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.
[0139] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, not all possible combinations of technical features in the above embodiments are described, but as long as the combination of technical features does not exist contradictory, it should be considered as the scope of the present application.
[0140] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method for measuring a volume of a vehicle compartment, the method comprising: fitting irregular surfaces associated with volume measurement of the vehicle compartment in the vehicle compartment based on a point cloud of the vehicle compartment collected at a measurement point, wherein the point cloud of the vehicle compartment is obtained by scanning each inner wall surface of the vehicle compartment, and each of the inner wall surfaces comprises the irregular surfaces; determining size parameters of the vehicle compartment based on a positional relationship between the measurement point and the volume measurement plane; and measuring the volume of the vehicle compartment based on the size parameters. 2.The method of claim 1, wherein the fitting of the irregular surfaces associated with volume measurement of the vehicle compartment in the vehicle compartment based on the point cloud of the vehicle compartment collected at the measurement point comprises: selecting irregular surfaces associated with volume measurement of the vehicle compartment from each of the inner wall surfaces based on positions of the measurement point in the vehicle compartment; determining fitting constraints for fitting the irregular surfaces based on the point cloud of the vehicle compartment; and fitting the irregular surfaces based on the fitting constraints to obtain the volume measurement plane. 3.The method of claim 2, wherein the irregular surfaces comprise a first irregular surface and a second irregular surface, the fitting constraints comprise a first fitting constraint and a second fitting constraint, and the fitting of the irregular surfaces based on the fitting constraints to obtain the volume measurement plane comprises: performing a first loop process until the first fitting constraint is satisfied when fitting the first irregular surface; and the first loop process comprises: fitting the first irregular surface based on at least three sampling points selected from the point cloud of the vehicle compartment to obtain a first candidate plane; determining first sampling points belonging to the first candidate plane from the point cloud of the vehicle compartment; comparing a first sampling point statistic of the first sampling points with a first preset statistic threshold, wherein the fitting constraint is that the first sampling point statistic is greater than the first preset statistic threshold; and regarding the first candidate plane as the volume measurement plane corresponding to the first irregular surface. performing a second loop process until the second fitting constraint is satisfied when fitting the second irregular surface, and the second loop process comprises: updating the point cloud of the vehicle compartment to obtain an updated point cloud of the vehicle compartment; fitting the second irregular surface based on at least three sampling points selected from the updated point cloud of the vehicle compartment to obtain a second candidate plane; determining second sampling points belonging to the second candidate plane from the updated point cloud of the vehicle compartment; comparing a second sampling point statistic of the second sampling points with a second preset statistic threshold, wherein the second fitting constraint is that the second sampling point statistic is greater than the second preset statistic threshold; and regarding the second candidate plane as the volume measurement plane corresponding to the second irregular surface.
4. The method of claim 3, wherein the fitting constraints comprise a third fitting constraint; and wherein the selecting the first candidate plane as the volume measurement plane corresponding to the first irregular surface comprises: dividing the interior point cloud of the vehicle cabin into a first interior point cloud of the vehicle cabin and a second interior point cloud of the vehicle cabin according to a first distance between the first candidate plane and a preset coordinate center point; determining a third sampling point statistic of the first interior point cloud of the vehicle cabin and a fourth sampling point statistic corresponding to the first interior point cloud of the vehicle cabin and the second interior point cloud of the vehicle cabin, respectively; and selecting the first candidate plane as the volume measurement plane corresponding to the first irregular surface if the third sampling point statistic and the fourth sampling point statistic satisfy the third fitting constraint, wherein the third fitting constraint is that the third sampling point statistic is greater than a third preset statistical threshold and the fourth sampling point statistic is greater than a fourth preset statistical threshold; and returning to execute the first loop process if the third sampling point statistic or the fourth sampling point statistic does not satisfy the third fitting constraint.
5. The method of claim 2, wherein the selecting the irregular surface associated with the volume measurement of the vehicle cabin from each of the inner wall surfaces according to the position of the measurement point in the vehicle cabin comprises: determining a measurement direction vector of the measurement point in the vehicle cabin according to the position of the measurement point in the vehicle cabin; determining a measurement angle between the measurement direction vector and a normal vector of each inner wall surface of the vehicle cabin; and selecting the irregular surface associated with the volume measurement of the vehicle cabin from each of the inner wall surfaces according to each of the measurement angles.
6. The method of claim 1, wherein the volume measurement plane comprises a first volume measurement plane and a second volume measurement plane parallel to the first volume measurement plane; and wherein the determining the size parameter of the vehicle cabin according to the positional relationship between the measurement point and the volume measurement plane comprises: determining a second distance between the measurement point and the first volume measurement plane according to the positional relationship between the measurement point and the first volume measurement plane, and determining a third distance between the measurement point and the first volume measurement plane according to the positional relationship between the measurement point and the second volume measurement plane; and obtaining the size parameter of the vehicle cabin by fusing the second distance and the third distance.
7. The method of claim 1, wherein the vehicle volume measurement method further comprises: obtaining a fifth sampling point belonging to the volume measurement plane; optimizing the volume measurement plane according to the fifth sampling point to obtain a volume measurement optimization plane of the volume measurement plane under a preset geometric constraint condition; and selecting the volume measurement optimization plane as the volume measurement plane, before the determining the size parameter of the vehicle cabin according to the positional relationship between the measurement point and the volume measurement plane.
8. The method of claim 1, wherein the fitting the irregular surface associated with the volume measurement of the vehicle cabin in the vehicle cabin according to the interior point cloud of the vehicle cabin collected at the measurement point to obtain the volume measurement plane comprises: connecting the measuring point and the coordinate origin of the preset three-dimensional coordinate system to obtain a measuring reference line, selecting any inner wall surface of the inner wall surfaces of the vehicle compartment as a to-be-measured inner wall surface; if it is detected that the measuring reference line and the to-be-measured inner wall surface satisfy a preset geometric constraint condition, taking the to-be-measured inner wall surface as an irregular surface associated with the volume measurement of the vehicle compartment, screening a to-be-fitted point cloud from the vehicle compartment internal point cloud according to the distance from the measuring point to the irregular surface, and fitting the irregular surface through the to-be-fitted point cloud to obtain a volume measurement plane; if it is detected that the measuring reference line and the to-be-measured inner wall surface do not satisfy the preset geometric constraint condition, returning to perform the operation of selecting any inner wall surface of the inner wall surfaces of the vehicle compartment as a to-be-measured inner wall surface until an inner wall surface that satisfies the preset geometric constraint condition with the measuring reference line is selected; wherein the preset geometric constraint condition can be specifically that a straight line in the to-be-measured inner wall surface is parallel to the measuring reference line, and the to-be-fitted point cloud refers to a point cloud that is affiliated to the irregular surface and is waiting to be fitted.
9. The method of any one of claims 1 to 8, wherein the determining the size parameter of the vehicle compartment according to the positional relationship between the measuring point and the volume measurement plane comprises: determining a first size parameter of the vehicle compartment according to the positional relationship between the measuring point and the volume measurement plane; extracting a second size parameter on the volume measurement plane, and taking the first size parameter and the second size parameter together as the size parameter of the vehicle compartment.
10. The method of claim 9, wherein the volume measurement of the vehicle compartment according to the size parameter comprises: taking the product of the first size parameter and the second size parameter as a measured volume.
11. A vehicle compartment volume measurement device, comprising: an acquisition module configured to fit an irregular surface associated with the volume measurement of the vehicle compartment in the vehicle compartment according to a vehicle compartment internal point cloud collected at a measuring point to obtain a volume measurement plane, wherein the vehicle compartment internal point cloud is obtained by scanning each inner wall surface of the vehicle compartment, and each inner wall surface includes the irregular surface; a determination module configured to determine a size parameter of the vehicle compartment according to a positional relationship between the measuring point and the volume measurement plane; a measurement module configured to perform volume measurement of the vehicle compartment according to the size parameter.
12. The device of claim 11, wherein the acquisition module is further configured to: select an irregular surface associated with the volume measurement of the vehicle compartment from each inner wall surface according to the position of the measuring point in the vehicle compartment; determine a fitting constraint condition for fitting the irregular surface according to the vehicle compartment internal point cloud; and fit the irregular surface according to the fitting constraint condition to obtain the volume measurement plane.
13. The device of claim 12, wherein the irregular surface includes a first irregular surface and a second irregular surface, the fitting constraint condition includes a first fitting constraint condition and a second fitting constraint condition, and the acquisition module is further configured to: perform a first loop process until the first fitting constraint condition is satisfied when fitting the first irregular surface, and the first loop process includes: fitting the first irregular surface according to at least three sampling points selected from the interior point cloud of the vehicle compartment, to obtain a first candidate plane; determining first sampling points belonging to the first candidate plane from the interior point cloud of the vehicle compartment; comparing a first sampling point statistic of the first sampling points with a first preset statistic threshold, wherein the fitting constraint condition is that the first sampling point statistic is greater than the first preset statistic threshold; taking the first candidate plane as a volume measurement plane corresponding to the first irregular surface; in the fitting of the second irregular surface, performing a second loop process until the second fitting constraint condition is met; the second loop process comprises: updating the interior point cloud of the vehicle compartment to obtain an updated interior point cloud of the vehicle compartment; fitting the second irregular surface according to at least three sampling points selected from the updated interior point cloud of the vehicle compartment, to obtain a second candidate plane; determining second sampling points belonging to the second candidate plane from the updated interior point cloud of the vehicle compartment; comparing a second sampling point statistic of the second sampling points with a second preset statistic threshold, wherein the second fitting constraint condition is that the second sampling point statistic is greater than the second preset statistic threshold; taking the second candidate plane as a volume measurement plane corresponding to the second irregular surface.
14. The apparatus according to claim 13, wherein the fitting constraint condition comprises a third fitting constraint condition; and the obtaining module is further configured to: divide the interior point cloud of the vehicle compartment into a first interior point cloud of the vehicle compartment and a second interior point cloud of the vehicle compartment according to a first distance between the first candidate plane and a preset coordinate center point; determine a third sampling point statistic of the first interior point cloud of the vehicle compartment and a fourth sampling point statistic corresponding to the first interior point cloud of the vehicle compartment and the second interior point cloud of the vehicle compartment respectively; if the third sampling point statistic and the fourth sampling point statistic meet the third fitting constraint condition, take the first candidate plane as a volume measurement plane corresponding to the first irregular surface, wherein the third fitting constraint condition is that the third sampling point statistic is greater than a third preset statistic threshold, and the fourth sampling point statistic is greater than a fourth preset statistic threshold; if the third sampling point statistic or the fourth sampling point statistic does not meet the third fitting constraint condition, return to perform the first loop process.
15. The apparatus according to claim 12, wherein the obtaining module is further configured to: determine a measurement direction vector of the measurement point in the vehicle compartment according to a position of the measurement point in the vehicle compartment; determine a measurement angle between the measurement direction vector and a normal vector of each inner wall surface of the vehicle compartment; select irregular surfaces associated with vehicle compartment volume measurement from each inner wall surface according to each measurement angle.
16. The apparatus according to claim 11, wherein the volume measurement plane comprises a first volume measurement plane and a second volume measurement plane parallel to the first volume measurement plane; and the determining module is further configured to: determine a second distance between the measuring point and the first volume measurement plane according to the positional relationship between the measuring point and the first volume measurement plane, and determine a third distance between the measuring point and the second volume measurement plane according to the positional relationship between the measuring point and the second volume measurement plane; obtain the size parameter of the vehicle compartment by fusing the second distance and the third distance.
17. The apparatus of claim 11, wherein the vehicle compartment volume measurement apparatus is further configured to: obtain a fifth sampling point belonging to the volume measurement plane; optimize the volume measurement plane according to the fifth sampling point to obtain a volume measurement optimized plane of the volume measurement plane under a preset geometric constraint condition; and use the volume measurement optimized plane as the volume measurement plane. 18.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-17. The processor implements the operations of the method of any one of claims 1-10 when executing the computer program.
19. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the operations of the method of any one of claims 1-10.
20. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the operations of the method of any one of claims 1-10. The computer program, when executed by the processor, implements the operations of the method of any one of claims 1-10.
Citation Information
Patent Citations
Train compartment cargo volume and bulk density detection method based on point cloud data processing
CN109029254A
Boxcar volume measurement method and system based on laser radar
CN113280733A
Volume measurement method, system and device based on depth camera and storage medium
CN113538554A
Road line acquisition method and device, equipment and medium
CN114942027A
Clustering and boundary feature preserving automobile trunk point cloud volume calculation method
CN115131424A