Compartment volume measuring method and device of monocular camera and storage medium

By combining distortion calibration and segmentation algorithms with a 3D model, the problem of insufficient volume estimation accuracy of monocular cameras in logistics transportation is solved, achieving more accurate cargo volume calculation and improving the reliability of transportation decisions.

CN120807614APending Publication Date: 2025-10-17BAO NA SHENG (SHENZHEN) TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510826563.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

The volume estimation accuracy of monocular cameras in the field of logistics and transportation is insufficient and the deviation rate is large, resulting in inaccurate cargo volume estimation and affecting logistics and transportation decisions.

Method used

By acquiring images of the interior of the carriage and performing distortion correction and segmentation processing, the preset segmentation algorithm and 3D construction model are used to calculate the pixel ratio and height of the cargo in the 3D carriage area, and the total volume and remaining volume of the cargo are calculated based on the length, width and height of the carriage.

Benefits of technology

The volume estimation accuracy and precision of monocular cameras in the field of logistics and transportation are improved, helping drivers, operators and supervisors to quickly understand the loading situation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807614A_ABST
    Figure CN120807614A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, and discloses a compartment volume measuring method and device of a monocular camera and a storage medium. The method comprises the steps of obtaining an internal image and length, width and height of a carriage; distortion calibration processing is carried out on the internal image of the compartment to obtain a compartment calibration image; segmenting the compartment calibration image to obtain a cargo area image, a compartment floor image and a compartment wall image; carrying out modeling segmentation processing on the compartment floor image and the compartment wall image to obtain i three-dimensional compartment areas; calculating a cargo area image pixel proportion to obtain an Nth cargo bottom area; calculating a cargo area image pixel proportion to obtain an Nth cargo height; based on the bottom area of the Nth cargo and the height of the Nth cargo, the total volume of the cargo is calculated; according to the cargo total volume and the length, width and height of the carriage, obtaining the carriage residual volume. In the embodiment of the invention, the prediction accuracy and precision of the monocular camera on the transported goods are improved by increasing the size of the compartment body and correcting the image.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, in particular to a method and device for measuring the volume of a vehicle compartment using a monocular camera and a storage medium. BACKGROUND

[0002] Currently, there are two technical implementations for image analysis volume: monocular camera and binocular camera. In the binocular camera scheme, the image information captured by the two cameras is used to calculate the depth map of the object, and then combined with image recognition and processing algorithms to estimate the volume of the object. This technology has the advantages of low cost, strong portability, easy operation, etc., and can realize non-contact measurement, and has wide application prospects in logistics, agriculture, manufacturing, etc. In the monocular camera scheme, the image is captured by a monocular camera, and then the pixel ratio of the image is analyzed to estimate the volume of the object. This technology is simple to analyze, and has the advantages of rapid deployment and migration.

[0003] In the prior art, Chinese patent CN117670979A uses a monocular camera to measure the volume of an object. Although the influence of monocular image depth on the volume of the goods is considered, there is a problem of high error rate in cloud depth analysis based on the reconstruction of a 3D model from the image of the goods, which leads to a large deviation in the estimation of the volume of the goods in actual use, and the guidance effect on logistics transportation decision-making is not good. Therefore, in view of the technical problems of insufficient volume estimation accuracy and large deviation rate of the current monocular camera in the logistics transportation field, a new technology is needed to solve the current problems. SUMMARY

[0004] The main purpose of the present application is to solve the technical problems of insufficient volume estimation accuracy and large deviation rate of the current monocular camera in the logistics transportation field.

[0005] The first aspect of the present application provides a method for measuring the volume of a vehicle compartment using a monocular camera, which comprises: obtaining an image of the inside of the vehicle compartment and the length, width and height of the vehicle compartment; performing distortion correction processing on the image of the inside of the vehicle compartment according to a preset distortion correction model to obtain a corrected image of the vehicle compartment; performing segmentation processing on the corrected image of the vehicle compartment according to a preset segmentation algorithm to obtain a goods region image, a vehicle compartment floor image and a compartment wall image; performing modeling segmentation processing on the vehicle compartment floor image and the compartment wall image according to the length, width and height of the vehicle compartment and a preset three-dimensional modeling model to obtain i three-dimensional vehicle compartment regions, wherein the three-dimensional vehicle compartment regions include a three-dimensional floor region and a three-dimensional compartment wall region, i is a positive integer, and calculating a pixel ratio of the cargo area image mapping a three-dimensional floor area in the Nth three-dimensional compartment area, to obtain an Nth cargo floor area, wherein N=1, 2, …, i; calculating a pixel ratio of the cargo area image mapping a three-dimensional compartment wall area in the Nth three-dimensional compartment area, to obtain an Nth cargo height; calculating a total cargo volume based on the Nth cargo floor area and the Nth cargo height; obtaining a remaining compartment volume based on the total cargo volume and the length, width and height of the compartment.

[0006] Optionally, in the first implementation manner of the first aspect, the calculating the pixel ratio of the cargo area image mapping the three-dimensional floor area in the Nth three-dimensional compartment area to obtain the Nth cargo floor area comprises: calculating a total pixel value of the three-dimensional floor area in the Nth three-dimensional compartment area to obtain an Nth total floor pixel number; performing mask pixel statistical processing on the cargo area image of the three-dimensional floor area in the Nth three-dimensional compartment area to obtain an Nth floor cargo pixel number; obtaining the Nth cargo floor area based on the Nth floor cargo pixel number, the Nth total floor pixel number and a floor area of the Nth three-dimensional compartment area.

[0007] Optionally, in the second implementation manner of the first aspect, the calculating the pixel ratio of the cargo area image mapping the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain the Nth cargo height comprises: calculating a total pixel value of the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain an Nth total compartment wall pixel number; performing mask pixel statistical processing on the cargo area image of the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain an Nth compartment wall cargo pixel number; obtaining the Nth cargo height based on the Nth compartment wall cargo pixel number, the Nth total compartment wall pixel number and a height value of the Nth three-dimensional compartment area.

[0008] Optionally, in the third implementation manner of the first aspect, the calculating the total cargo volume based on the Nth cargo floor area and the Nth cargo height comprises: ; wherein V all is the total cargo volume, d N is the Nth cargo floor area, and h N is the Nth cargo height.

[0009] Optionally, in a fourth implementation form of the first aspect of the present application, the step of performing distortion calibration on the interior image of the vehicle compartment according to the preset distortion calibration model to obtain a calibrated image of the vehicle compartment comprises: normalizing the pixel coordinates of the interior image of the vehicle compartment according to the preset camera focal length and the preset camera optical center coordinates to obtain image normalized coordinates; calculating radial distortion parameters and tangential distortion parameters according to the image normalized coordinates; calculating distortion normalized coordinates according to the radial distortion parameters and the tangential distortion parameters; performing remapping processing on the distortion normalized coordinates according to the preset camera focal length and the preset camera optical center coordinates to obtain calibrated pixel coordinates, wherein the calibrated pixel coordinates are pixel coordinates of the calibrated image of the vehicle compartment.

[0010] Optionally, in a fifth implementation form of the first aspect of the present application, the step of performing remapping processing on the distortion normalized coordinates according to the preset camera focal length and the preset camera optical center coordinates to obtain calibrated pixel coordinates comprises: u d =f x x d +c x ; v d =f y y d +c y ; wherein (f x , f y ) is the camera focal length, (c x , c y ) is the camera optical center coordinates, (x d , y d ) is the distortion normalized coordinates, and (u d , v d ) is the calibrated pixel coordinates.

[0011] Optionally, in a sixth implementation form of the first aspect of the present application, the step of normalizing the pixel coordinates of the interior image of the vehicle compartment according to the preset camera focal length and the preset camera optical center coordinates to obtain image normalized coordinates comprises: x= (u-c x ) / f x ; y= (v-c y ) / f y ; wherein (f x , f y ) is the camera focal length, (c x , c y) is the camera optical center coordinate, (u, v) is the pixel coordinate of the image inside the carriage, and (x, y) is the normalized coordinate of the image.

[0012] Optionally, in a seventh implementation form of the first aspect of the present application, the step of performing segmentation processing on the carriage calibration image according to the preset segmentation algorithm to obtain the cargo area image, the carriage floor image and the compartment wall image comprises: performing segmentation processing on the carriage calibration image according to a preset deep learning segmentation algorithm to obtain the cargo area image, the carriage floor image and the compartment wall image.

[0013] The second aspect of the present application provides a single camera vehicle compartment volume measuring device, comprising a memory and at least one processor, the memory has instructions stored therein, and the memory and the at least one processor are interconnected by a circuit; the at least one processor invokes the instructions in the memory to enable the single camera vehicle compartment volume measuring device to perform the single camera vehicle compartment volume measuring method described above.

[0014] The third aspect of the present application provides a computer readable storage medium, which has instructions stored therein, and when the instructions are run on a computer, the computer performs the single camera vehicle compartment volume measuring method described above.

[0015] In the embodiment of the present application, the volume of the goods in the carriage or container of logistics transportation is estimated by using the monocular camera technology. The embedded device equipped with a camera inside the carriage captures images, increases the data of the carriage body of transportation, corrects the images taken by the monocular camera, and transmits the corrected images to the internal multiple algorithms for image analysis and calculation, so as to calculate the volume of the goods and the remaining volume of the carriage, improve the prediction accuracy and precision of the monocular camera for the transported goods, and better assist drivers, drivers and supervisors to quickly understand the loading condition, and solve the technical problems of insufficient volume estimation precision and large deviation rate of the monocular camera in the field of logistics transportation. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 An embodiment schematic diagram of the vehicle compartment volume measuring method of the monocular camera in the embodiment of the present application; Figure 2 A specific embodiment of the step 102 of the vehicle compartment volume measuring method of the monocular camera in the embodiment of the present application; Figure 3 A three-dimensional modeling schematic diagram of the vehicle compartment volume measuring method of the monocular camera in the embodiment of the present application; Figure 4 A volume calculation schematic diagram of the vehicle compartment volume measuring method of the monocular camera in the embodiment of the present application; Figure 5An embodiment of a vehicle compartment volume measurement device using a monocular camera. DETAILED DESCRIPTION

[0017] The embodiment of the present application provides a vehicle compartment volume measurement method and device using a monocular camera and a storage medium.

[0018] The embodiments disclosed by the present application will be described in detail below with reference to the drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments described herein, but rather, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes, and are not intended to limit the scope of protection of the present application.

[0019] In the description of the embodiments of the present application, the term "comprising" and similar terms are to be understood as open-ended, i.e., "including but not limited to". The term "based on" is to be understood as "based at least in part on". The term "one embodiment" or "the embodiment" is to be understood as "at least one embodiment". The terms "first", "second", etc. can refer to different or identical objects. Other explicit and implicit definitions can also be included below.

[0020] For ease of understanding, the specific process of the embodiments of the present application is described below. Please refer to Figure 1 An embodiment of a vehicle compartment volume measurement method using a monocular camera in the embodiments of the present application includes: 101, obtaining an image inside the vehicle compartment and the length, width and height of the vehicle compartment; In this embodiment, the interior image of the vehicle compartment is captured by using a monocular camera, and the length, width and height of the vehicle compartment, i.e., the length L, the width W and the height H, are obtained in advance. Specifically, L can be assigned a value of 10 m, the width can be assigned a value of 2 m, and the height can be assigned a value of 2.5 m.

[0021] 102, performing distortion correction processing on the image inside the vehicle compartment according to a preset distortion correction model to obtain a vehicle compartment calibration image; In this embodiment, since the lens has a curved surface, the captured image will be distorted relative to the actual object, so the image inside the vehicle compartment needs to be corrected first to obtain a vehicle compartment calibration image. This scheme can upload the image inside the vehicle compartment to an external API interface for calibration, and then obtain the vehicle compartment calibration image from the external API interface. This scheme can also internally correct the image inside the vehicle compartment by using a correction algorithm, and then obtain the vehicle compartment calibration image.

[0022] Specifically, please refer to Figure 2 , Figure 2For a specific embodiment of step 102 of the vehicle compartment volume measurement method using a monocular camera in the embodiments of the present application, step 102 includes the following specific implementation: 1021. Normalize the pixel coordinates of the vehicle compartment interior image according to the preset camera focal length and preset camera optical center coordinates to obtain image normalized coordinates; 1022. Calculate radial distortion parameters and tangential distortion parameters according to the image normalized coordinates; 1023. Calculate distortion normalized coordinates according to the radial distortion parameters and the tangential distortion parameters; 1024. Remap the distortion normalized coordinates according to the preset camera focal length and preset camera optical center coordinates to obtain calibration pixel coordinates, wherein the calibration pixel coordinates are pixel coordinates of a vehicle compartment calibration image.

[0023] In steps 1021-1024, one pixel of the vehicle compartment interior image is described, and other pixels are corrected in the same way.

[0024] Let (u, v) be the pixel coordinates of the vehicle compartment interior image, which are original pixel coordinates, and are the horizontal and vertical coordinates of a point in the pixel space.

[0025] Let (c x , c y ) be the camera optical center coordinates, which are principal point coordinates, and are the optical center positions in the camera intrinsic matrix, generally close to the image center.

[0026] Let (f x , f y ) be the camera focal length, which is in units of pixels, and is the calibration focal length in the horizontal and vertical directions in the camera intrinsic matrix.

[0027] Therefore, the following calculation is performed in step 1021: x=(u-c x ) / f x ; y=(v-c y ) / f y ; The calculated (x, y) is the image normalized coordinates. After calculating the image normalized coordinates, set the distortion radius r, let r 2 =x 2 +y 2 , and r 2 is used to measure the degree of distortion.

[0028] Then, according to the calculated r 2 , calculate the radial distortion parameters and the tangential distortion parameters, respectively, in the following specific calculation manner: 1. Radial distortion x rad = x (1 + k1r 2 + k2r 4 + k3r 6 ); y rad = y (1 + k1r 2 + k2r 4 + k3r 6 ); where k1 is the first order radial distortion coefficient, k2 is the second order radial distortion coefficient, and k3 is the third order radial distortion coefficient. (x rad , y rad ) are the new coordinates on the normalized plane considering only radial distortion.

[0029] 2. Tangential distortion x tan = 2p1xy + p2(r 2 + 2x 2 ); y tan = p1(r 2 + 2y 2 ) + 2p2xy; where (p1, p2) are the tangential distortion coefficients, which are caused by the non-parallelism between the lens and the imaging plane. (x tan , y tan ) are the incremental coordinates on the normalized plane considering only tangential distortion.

[0030] The distortion normalized coordinates (x d , y d ) are set as: x d = x rad + x tan ; y d = y rad + y tan ; It should be noted that the radial and tangential distortions are simultaneously superimposed to obtain the final distortion coordinates on the normalized plane The final 104 steps include the following specific implementations: u d = f x x d + c x ; v d = f y y d + c y ; where (fx , f y ) is the camera focal length, (c x , c y ) is the camera optical center coordinates, (x d , y d ) is the normalized distortion coordinates, (u d , v d ) is the calibrated pixel coordinates.

[0031] 103. segmenting the vehicle compartment calibration image according to a preset segmentation algorithm to obtain a cargo area image, a vehicle compartment floor image, and a compartment wall image; In this embodiment, the segmentation algorithm can be an edge detection segmentation algorithm or a clustering-based segmentation algorithm.

[0032] The edge detection-based segmentation algorithm identifies the object boundary by detecting the region with changes in grayscale, color, etc. in the image, such as Sobel operator, Prewitt operator, Roberts operator, and Canny edge detection operator, etc.

[0033] The clustering-based segmentation algorithm divides similar pixels into the same cluster according to the features of the pixel points such as color, texture, spatial position, etc., and different clusters of pixels form different regions, thereby realizing object segmentation. Common ones are K-means clustering algorithm, mean shift clustering algorithm, fuzzy C-means clustering algorithm, etc. The K-means clustering algorithm first randomly selects K initial clustering centers, then calculates the distance between each pixel point and each clustering center, divides the pixel points into the cluster with the nearest clustering center, and recalculates the clustering center of each cluster. Repeat the above steps until the clustering center no longer changes or the maximum iteration number is reached.

[0034] Specifically, the step 103 includes the following specific implementation: 1031. segmenting the vehicle compartment calibration image according to a preset deep learning segmentation algorithm to obtain a cargo area image, a vehicle compartment floor image, and a compartment wall image.

[0035] In step 1031, a deep learning segmentation algorithm such as FCN, U-Net, PolarMask, DETR, SETR, etc. can be used to segment the vehicle compartment calibration image to obtain a cargo area image, a vehicle compartment floor image, and a compartment wall image. The sizes of the segmented areas presented on the two-dimensional image are not the same. The number of segmented areas is determined according to the actual length of the vehicle compartment. The segmented areas are divided into three parts: one part is the vehicle compartment floor, and each of the left and right surfaces of the vehicle compartment is one part. Each region of the three parts is numbered and one-to-one corresponding, and finally a three-dimensional visual compartment segmented modeling is output. The purpose of the partition is to realize more accurate cargo volume ratio calculation in the subsequent process. Because the cargo may have irregular volume, multiple partitions can calculate the volume of the cargo dispersed in different partitions, thereby improving the robustness and accuracy.

[0036] 104. According to the length, width and height of the vehicle compartment and the preset three-dimensional modeling model, the vehicle compartment floor image and the compartment wall image are modeled and segmented to obtain i three-dimensional vehicle compartment areas, wherein the three-dimensional vehicle compartment areas include a three-dimensional floor area and a three-dimensional compartment wall area, and i is a positive integer. In this embodiment, please refer to Figure 3 , Figure 3 is a three-dimensional modeling schematic diagram of the vehicle compartment volume measurement method of the monocular camera in the embodiment of the application. The length, width and height of the vehicle compartment, the vehicle compartment floor image and the compartment wall image are used for three-dimensional modeling. The length L is equally divided into 10 parts, and the width W and the height H are not divided. The three-dimensional modeling segmentation is performed on the areas of the compartment wall image and the vehicle compartment floor image.

[0037] 105. Calculate the pixel ratio of the cargo area image mapped in the three-dimensional floor area of the Nth three-dimensional vehicle compartment area to obtain the Nth cargo bottom area, wherein N = 1, 2, …, i. In this embodiment, the first to tenth three-dimensional vehicle compartment areas are calculated in turn. Taking the third three-dimensional vehicle compartment area as an example, the pixel ratio of the cargo area image on the three-dimensional floor area in the third three-dimensional vehicle compartment area is calculated t3, and then based on the pixel ratio t3 and the area of the three-dimensional floor area (1 / 10 length L * width W), the third cargo bottom area is obtained.

[0038] Specifically, the following specific embodiments are included in step 105: 1051. Calculate the total pixel value of the three-dimensional floor area in the Nth three-dimensional vehicle compartment area to obtain the Nth floor total pixel number. 1052. Perform mask pixel statistical processing on the cargo area image of the three-dimensional floor area in the Nth three-dimensional vehicle compartment area to obtain the Nth floor cargo pixel number. 1053. Obtain an Nth cargo bottom area according to the Nth floor cargo pixel count, the Nth floor total pixel count, and the floor area of ​​the Nth three-dimensional compartment area.

[0039] In steps 1051-1053, the total pixel value of the third three-dimensional carriage area is first calculated. For example, the total pixel value is R N , then perform red mask processing on the cargo area image and calculate the number of red mask pixels A in the third floor area N , calculate A N / R N *1 / 10*length L*width W to get the bottom area of ​​the third cargo.

[0040] 106. Calculate the pixel ratio of the three-dimensional compartment wall area in the Nth three-dimensional compartment area mapped with the cargo area image to obtain the Nth cargo height; In this embodiment, the number of pixels of the cargo area image on the third three-dimensional compartment wall area is calculated. The three-dimensional compartment wall area here is based on identifying the inner wall of the compartment that is physically perpendicular to the ground. Then, the total number of pixels in the third three-dimensional compartment wall area is calculated, the pixel ratio is calculated, and then the pixel ratio*height H is determined as the third cargo height.

[0041] Specifically, step 106 includes the following specific implementation methods: 1061. Calculate the total pixel value of the three-dimensional compartment wall region in the Nth three-dimensional compartment region to obtain the total number of pixels of the Nth compartment wall; 1062. Perform mask pixel statistics processing on the cargo area image of the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain the number of cargo pixels on the Nth compartment wall. 1063. Obtain the Nth cargo height according to the number of cargo pixels on the Nth compartment wall, the total number of pixels on the Nth compartment wall, and the height value of the Nth three-dimensional compartment area.

[0042] In steps 1061-1063, the total pixel value of the third three-dimensional compartment wall area is first calculated. For example, the total pixel value is R N , then perform red mask processing on the cargo area image and calculate the number of red mask pixels A in the third floor area N , calculate A N / R N *The value of height H will give the third cargo height.

[0043] 107. Calculate the total volume of the cargo based on the bottom area of ​​the Nth cargo and the height of the Nth cargo; In this embodiment, the bottom area of ​​the 1st to 10th cargo items is multiplied by the corresponding height of the 1st to 10th cargo items in sequence to obtain the total volume of the cargo items. Figure 4 ,Figure 4 The volume calculation schematic diagram of the vehicle compartment volume measurement method of the monocular camera in the embodiment of the application. Figure 4 The left is the original vehicle interior image, and then the total volume of the goods, the remaining space of the vehicle compartment, and the three-dimensional modeling diagram are obtained after calibration, segmentation, and modeling Figure 4 The right, the total volume of the goods, the remaining space of the vehicle compartment, and the three-dimensional modeling diagram are obtained after calibration, segmentation, and modeling

[0044] Specifically, the following specific implementation is included in the 107 steps: wherein, V all is the total volume of the goods, d N is the bottom area of the Nth goods, h N is the height of the Nth goods.

[0045] 108. Obtain the remaining volume of the vehicle compartment according to the total volume of the goods and the length, width, and height of the vehicle compartment.

[0046] In this embodiment, the total volume of the vehicle compartment corresponding to the length, width, and height of the vehicle compartment is calculated, and then the total volume of the vehicle compartment is subtracted from the total volume of the goods to obtain the remaining volume of the vehicle compartment, thereby completing the entire vehicle compartment volume measurement and calculation process.

[0047] In the embodiment of the application, the monocular camera technology is used to estimate the volume of goods in the vehicle compartment or container for logistics transportation. The embedded device equipped with a camera inside the vehicle compartment captures images, increases the data of the vehicle compartment for transportation, corrects the images taken by the monocular camera, transmits the corrected images to the internal multiple algorithms for image analysis and calculation, thereby calculating the volume of the goods and estimating the remaining volume of the vehicle compartment, improving the prediction accuracy and precision of the monocular camera for the transported goods, and better assisting drivers, drivers, and supervisors to quickly understand the loading situation, solving the technical problems of insufficient volume estimation accuracy and large deviation rate of the monocular camera in the field of logistics transportation.

[0048] Figure 5 ​is a structural schematic diagram of a single camera vehicle compartment volume measuring device provided by an embodiment of the present application. The single camera vehicle compartment volume measuring device 500 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 510 (for example, one or more processors) and a memory 520, one or more storage media 530 (for example, one or more mass storage devices) storing application programs 533 or data 532. The memory 520 and the storage media 530 can be temporary storage or persistent storage. The programs stored in the storage media 530 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the single camera vehicle compartment volume measuring device 500. Further, the processor 510 can be configured to communicate with the storage media 530 and execute the series of instruction operations in the storage media 530 on the single camera vehicle compartment volume measuring device 500.

[0049] The single camera vehicle compartment volume measuring device 500 can also include one or more power supplies 540, one or more wired or wireless network interfaces 550, one or more input / output interfaces 560, and / or one or more operating systems 531, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art can understand that the single camera vehicle compartment volume measuring device 500 can include more or fewer components than those shown, or combine certain components, or arrange different components. Figure 5 The illustrated structure of the single camera vehicle compartment volume measuring device does not constitute a limitation on the single camera vehicle compartment volume measuring device, and can include more or fewer components than those shown, or combine certain components, or arrange different components.

[0050] The present application also provides a computer readable storage medium, which can be a non-volatile computer readable storage medium or a volatile computer readable storage medium. The computer readable storage medium stores instructions, which, when executed on a computer, cause the computer to perform the steps of the single camera vehicle compartment volume measuring method.

[0051] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.

[0052] Moreover, while operations have been depicted in a particular order, this should not be understood as requiring such order nor that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, while several specific implementation details have been discussed, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.

[0053] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims

1. A method for measuring the volume of a vehicle compartment using a monocular camera, characterized in that: Including steps: Obtain the interior image of the carriage and the length, width and height of the carriage; According to a preset distortion calibration model, the vehicle interior image is subjected to distortion calibration processing to obtain a vehicle interior calibration image; Segment the carriage calibration image according to a preset segmentation algorithm to obtain a cargo area image, a carriage floor image, and a carriage wall image; According to the length, width, and height of the carriage and a preset three-dimensional construction model, the carriage floor image and the carriage wall image are modeled and segmented to obtain i three-dimensional carriage areas, wherein the three-dimensional carriage areas include: a three-dimensional floor area and a three-dimensional wall area, and i is a positive integer; Calculate the pixel ratio of the three-dimensional floor area of ​​the cargo area image mapped in the Nth three-dimensional compartment area to obtain the Nth cargo bottom area, where N=1, 2, ..., i; Calculating the pixel ratio of the three-dimensional compartment wall area in the Nth three-dimensional compartment area of ​​the cargo area image mapping to obtain the Nth cargo height; Calculating the total volume of the cargo based on the bottom area of ​​the Nth cargo and the height of the Nth cargo; The remaining volume of the carriage is obtained according to the total volume of the cargo and the length, width and height of the carriage.

2. The method for measuring the compartment volume using a monocular camera according to claim 1, wherein: Calculating the pixel ratio of the three-dimensional floor area of ​​the cargo area image mapped in the Nth three-dimensional compartment area to obtain the Nth cargo bottom area includes: Calculate the total pixel value of the three-dimensional floor area in the N-th three-dimensional carriage area to obtain the total number of pixels of the N-th floor; performing mask pixel statistics processing on the cargo area image of the three-dimensional floor area in the Nth three-dimensional compartment area to obtain the number of cargo pixels on the Nth floor; The Nth cargo bottom area is obtained according to the Nth floor cargo pixel number, the Nth floor total pixel number, and the floor area of ​​the Nth three-dimensional compartment area.

3. The method for measuring the compartment volume using a monocular camera according to claim 1, wherein: Calculating the pixel ratio of the three-dimensional compartment wall area in the Nth three-dimensional compartment area of ​​the cargo area image mapping to obtain the Nth cargo height includes: Calculating the total pixel value of the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain the total number of pixels of the Nth compartment wall; Performing mask pixel statistics processing on the cargo area image of the three-dimensional compartment wall area in the Nth three-dimensional compartment area to obtain the number of cargo pixels on the Nth compartment wall; The Nth cargo height is obtained according to the number of cargo pixels on the Nth compartment wall, the total number of pixels on the Nth compartment wall, and the height value of the Nth three-dimensional compartment area.

4. The method for measuring the compartment volume using a monocular camera according to claim 1, wherein: Calculating the total volume of the cargo based on the Nth cargo bottom area and the Nth cargo height includes: ; Among them, V all is the total volume of cargo, d N is the bottom area of ​​the Nth cargo, h N is the height of the Nth cargo.

5. The method for measuring the compartment volume using a monocular camera according to claim 1, wherein: The step of performing distortion calibration on the vehicle interior image according to the preset distortion calibration model to obtain a vehicle interior calibration image includes: Normalizing the pixel coordinates of the interior image of the vehicle compartment according to the preset camera focal length and the preset camera optical center coordinates to obtain image normalized coordinates; Calculating radial distortion parameters and tangential distortion parameters according to the normalized coordinates of the image; Calculating distortion normalized coordinates according to the radial distortion parameter and the tangential distortion parameter; According to the preset camera focal length and the preset camera optical center coordinates, the distorted normalized coordinates are remapped to obtain calibration pixel coordinates, wherein the calibration pixel coordinates are the pixel coordinates of the vehicle cabin calibration image.

6. The method for measuring the compartment volume using a monocular camera according to claim 5, wherein: The remapping process of the distorted normalized coordinates to obtain the calibrated pixel coordinates according to the preset camera focal length and the preset camera optical center coordinates includes: u d =f x x d +c x ; v d =f y y d +c y ; Among them, (f x , f y ) is the focal length of the camera, (c x , c y ) is the coordinate of the camera optical center, (x d ,y d ) distorted normalized coordinates, (u d , v d ) are the calibration pixel coordinates.

7. The method for measuring the compartment volume using a monocular camera according to claim 5, wherein: Normalizing the pixel coordinates of the interior image of the vehicle compartment according to the preset camera focal length and the preset camera optical center coordinates to obtain the normalized image coordinates includes: x=(u-c x ) / f x ; y=(v-c y ) / f y ; Among them, (f x , f y ) is the focal length of the camera, (c x , c y ) is the coordinate of the camera optical center, (u, v) is the pixel coordinate of the interior image of the vehicle, and (x, y) is the normalized coordinate of the image.

8. The method for measuring the compartment volume using a monocular camera according to claim 1, wherein: The segmentation process of the carriage calibration image according to the preset segmentation algorithm to obtain the cargo area image, the carriage floor image, and the carriage wall image includes: The carriage calibration image is segmented according to a preset deep learning segmentation algorithm to obtain a cargo area image, a carriage floor image, and a carriage wall image.

9. A vehicle compartment volume measurement device using a monocular camera, characterized in that: The monocular camera compartment volume measurement device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor calls the instructions in the memory to enable the monocular camera vehicle compartment volume measurement device to execute the monocular camera vehicle compartment volume measurement method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for measuring the compartment volume using a monocular camera according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Bulk cargo volume measurement method based on fixed point monocular camera

    CN117670979A