Non-contact agricultural product packaging box volume measurement method and system
By combining multimodal data fusion from geometric and visual sensors with a dual-branch neural network model, high-precision, low-cost, real-time non-contact measurement of the volume of agricultural product packaging boxes was achieved. This solved the problems of low efficiency, large error, and poor adaptability of traditional measurement methods, and improved the automation level of agricultural product logistics.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies for measuring the volume of agricultural product packaging boxes suffer from problems such as low efficiency, large human error, high cost, and poor adaptability. In particular, the measurement accuracy is not high in scenarios with uneven lighting, partial obstruction, or complex surface textures of the boxes, making it difficult to meet the needs of efficient automation in agricultural product logistics.
Multimodal data is collected simultaneously using geometric and visual sensors. Spatial alignment and noise reduction are performed through calibration algorithms, and feature extraction and regression prediction are combined with a dual-branch neural network model to achieve non-contact measurement of the box volume.
It improves measurement accuracy and stability, reduces system costs, has real-time processing capabilities, adapts to complex environments, and meets the high-speed sorting needs of agricultural product logistics.
Smart Images

Figure CN121659231A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-contact volume measurement scheme design technology, specifically to a non-contact method and system for measuring the volume of agricultural product packaging boxes. Background Technology
[0002] With the rapid development of modern agricultural logistics and e-commerce, higher demands are being placed on the accuracy, efficiency, and automation of packaging box volume measurement in the agricultural product distribution process. Traditional measurement methods mainly rely on manual measurement using contact tools such as measuring tapes. This method is not only inefficient and labor-intensive, but also prone to human error, making it difficult to meet the needs of large-scale, fast-paced logistics sorting. To overcome the bottleneck of manual measurement, non-contact measurement technologies are gradually being applied, including purely vision-based methods and laser scanning technologies. Purely vision-based technology typically uses monocular or binocular cameras to capture images of the box and estimates dimensions through image processing algorithms. However, this method is heavily dependent on ambient lighting conditions; measurement accuracy drops significantly in low-light or highly reflective environments. Furthermore, image perspective distortion, missing box textures, and occlusion can also lead to unreliable measurement results. While laser scanning technology offers high point cloud accuracy, its equipment is expensive, data processing is complex, and its scanning performance is poor for dark or light-absorbing materials, making it difficult to widely adopt in the cost-sensitive agricultural product logistics sector. Furthermore, existing technical solutions exhibit poor adaptability when dealing with irregularly shaped, uneven, or partially stacked boxes, lacking an effective feature fusion mechanism to balance measurement accuracy and system robustness. In recent years, deep learning technology has made significant progress in computer vision, with some studies attempting to apply neural networks to object size estimation. However, most solutions remain limited to a single data source, failing to fully combine the advantages of geometric sensing and visual perception, and thus unable to simultaneously address multiple challenges such as high accuracy, strong anti-interference capabilities, and real-time processing. Therefore, there is an urgent need in this field for an automated box volume measurement solution that can integrate multimodal data, adapt to complex environments, and is cost-effective, in order to improve the automation level and operational efficiency of agricultural product logistics.
[0003] Therefore, existing technologies still need further development. Summary of the Invention
[0004] The purpose of this invention is to overcome the above-mentioned technical deficiencies and provide a non-contact method and system for measuring the volume of agricultural product packaging boxes, so as to solve the problems existing in the prior art.
[0005] To achieve the above-mentioned technical objectives, according to a first aspect of the present invention, the present invention provides a non-contact method for measuring the volume of agricultural product packaging boxes, comprising: S100. Simultaneously acquire multimodal sensor data of the agricultural product packaging box through geometric sensors and vision sensors; S200: The multimodal sensor data is fused and preprocessed to generate fused data; S300. Extract the contour features of the box from the fused data using a feature extraction model; S400. Based on the contour features, calculate the volume value of the box using a volume estimation model.
[0006] Specifically, the geometric sensor includes a light curtain sensor, and the visual sensor includes a monocular camera.
[0007] Specifically, the light curtain sensor is configured to emit parallel light strips to acquire three-dimensional point cloud data, the monocular camera is configured to capture two-dimensional RGB images, and the light curtain sensor and the monocular camera are time-aligned through a data synchronization module.
[0008] Specifically, the fusion and preprocessing of multimodal sensor data includes: spatially aligning point cloud data with image data using a calibration algorithm, and performing noise reduction processing on the aligned data.
[0009] Specifically, the spatial alignment includes a coordinate normalization operation to map point cloud data and image data to a unified coordinate system.
[0010] Specifically, the feature extraction model includes a neural network model for learning the geometric morphological features of the box from the fused data.
[0011] Specifically, the neural network model has a dual-branch structure, including a contour feature extraction branch and a volume estimation branch, wherein the contour feature extraction branch is implemented based on a convolutional neural network, and the volume estimation branch is implemented based on a regression neural network.
[0012] Specifically, the volume estimation model uses a machine learning regression framework, taking the contour features as input and outputting volume values.
[0013] Specifically, the machine learning regression framework includes a multilayer perceptron or Transformer architecture and integrates an attention mechanism to improve estimation accuracy.
[0014] According to a second aspect of the present invention, a non-contact agricultural product packaging box volume measurement system is provided, comprising: Geometric sensors are used to acquire point cloud data of the enclosure; A vision sensor is used to acquire image data of the enclosure; A processor configured to perform the steps of the method described in any of the above descriptions; Output interface for real-time output of volume measurement results.
[0015] Beneficial effects: This invention achieves several significant benefits by innovatively integrating geometric and visual sensors and combining them with a dual neural network model for feature extraction and regression prediction. First, the multi-sensor fusion mechanism effectively overcomes the limitations of single-sensor modes. The light curtain sensor provides accurate depth information and a 3D contour point cloud, unaffected by changes in ambient lighting, while the 2D image captured by the monocular camera is rich in box texture and color information. Through data synchronization and spatial alignment, the two form a complementary multimodal data source, enabling the system to maintain high measurement accuracy and stability even in challenging scenarios such as uneven lighting, partial occlusion, or complex box surface textures. Second, the design of the dual neural network model fully leverages the advantages of hierarchical feature learning. The contour feature extraction network specifically learns the geometric morphological features of the box from the fused data, while the volume estimation network performs accurate regression based on these features. This collaborative mechanism not only improves adaptability to irregular boxes but also reduces the cumulative error caused by multiple approximations in traditional methods through end-to-end learning. Furthermore, this system possesses excellent real-time processing capabilities. Relying on a lightweight network structure and optimized data processing pipeline, it can achieve efficient processing of tens of frames per second on embedded platforms, meeting the real-time requirements of high-speed sorting in agricultural product logistics. In addition, this solution demonstrates strong engineering applicability and scalability. The system hardware selection is universal, and the software algorithm has good cross-platform portability, reducing overall deployment costs and providing a technical foundation for subsequent functional expansion, such as simultaneous measurement of multiple boxes or joint estimation of volume and weight. In summary, this invention achieves a good balance between accuracy, robustness, efficiency, and cost, providing a reliable and efficient automated solution for measuring the volume of agricultural product packaging boxes. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating the non-contact method for measuring the volume of agricultural product packaging boxes provided in a specific embodiment of the present invention. Figure 2 This is a schematic diagram of the system composition of the non-contact agricultural product packaging box volume measurement system provided in a specific embodiment of the present invention; Figure 3 This is a schematic diagram of a dual-branch neural network structure provided in a specific embodiment of the present invention; Figure 4 This is a schematic diagram of the light curtain measurement cross-section provided in a specific embodiment of the present invention; Figure 5 This is a schematic diagram of the image processing workflow provided in a specific embodiment of the present invention. Detailed Implementation
[0017] To enable those skilled in the art to better understand the technical solutions of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Based on the embodiments in this application, other similar embodiments obtained by those skilled in the art without creative effort should all fall within the scope of protection of this application. Furthermore, directional terms mentioned in the following embodiments, such as "up," "down," "left," and "right," are only for reference to the directions in the accompanying drawings; therefore, the directional terms used are for illustrative purposes and not for limiting the invention.
[0018] The present invention will be further described below with reference to the accompanying drawings and preferred embodiments.
[0019] Please see Figure 1 and Figures 3-5 This invention provides a non-contact method for measuring the volume of agricultural product packaging boxes, comprising: S100. Simultaneously acquire multimodal sensor data of the agricultural product packaging box through geometric sensors and vision sensors; It should be further explained that the method achieves synchronous data acquisition through hardware integration, wherein the geometric sensor is preferably a light curtain sensor and the visual sensor is preferably a monocular camera; the synchronous acquisition is controlled by a data synchronization module, which uses a hardware trigger signal, and the trigger frequency is preferably 30 Hz. This preferred value is set based on the typical movement speed of the container in agricultural product logistics (0.5-1 m / s) to ensure data real-time performance and reduce motion blur.
[0020] S200: The multimodal sensor data is fused and preprocessed to generate fused data; It should be further explained that the data fusion and preprocessing steps specifically include: First, spatial alignment of point cloud data and image data is performed using a calibration algorithm. The calibration algorithm adopts the Zhang Zhengyou camera calibration method, and the specific steps are as follows: using a checkerboard calibration board, at least 20 images from different angles and corresponding point cloud data are collected; corner coordinates are extracted using a corner detection algorithm (such as Harris corner detection); and the camera intrinsic parameter matrix and distortion coefficients are calculated. The formula for the intrinsic parameter matrix is: in, and This represents the focal length in pixels, with a preferred value of 1000 pixels, based on common camera resolution settings. and This represents the coordinates of the principal point, with the preferred value being the image center point. In this formula, and The physical meaning of is the focal length of the camera in the x and y directions. and The physical meaning of is the offset of the origin of the image coordinate system. After calibration, the point cloud data is transformed to the image coordinate system through an extrinsic parameter matrix, which includes a rotation matrix R and a translation vector T, obtained through least squares optimization. Preprocessing includes denoising operations using a Gaussian filtering algorithm. The filter size is preferably 3x3 pixels, and the standard deviation σ is preferably 1.0. This preferred value can effectively suppress noise without over-smoothing edges. The reason is based on experimental tests, which show that this parameter reduces computational complexity while preserving the details of the box contour.
[0021] S300. Extract the contour features of the box from the fused data using a feature extraction model; It should be further explained that the feature extraction model adopts a convolutional neural network (CNN), and the specific structure includes: an input layer that receives fused data (size 224x224x3), followed by 3 convolutional layers (3x3 kernel size, stride 1, padding 1, ReLU activation function), 2 pooling layers (max pooling, pooling size 2x2), and 2 fully connected layers (outputting 128-dimensional feature vectors); during training, the Adam optimizer is used, the learning rate is preferably 0.001, the batch size is preferably 32, and the training cycle is 100 rounds. These optimal values are based on the cross-validation results, which can prevent overfitting and accelerate convergence.
[0022] For further details, please refer to Figure 5 , Figure 5 The core processing flow for box volume measurement is demonstrated. Its working principle begins with the "Input Image" module on the left, represented by a brown cardboard box illustration within a black rectangle, depicting an image of the actual agricultural product packaging box captured by the system through a visual sensor. The image data then flows into multiple blue "Multiple Convolutional Layers (Including Downsampling)" modules connected by arrows. This stage is crucial for feature extraction. The convolution operation uses a preset filter kernel (such as a 3x3 or 5x5 kernel) to slide and scan the input image, gradually capturing hierarchical features from low-level edges and textures to high-level semantic features (such as box corners and contours) through linear convolution calculations and non-linear activation functions (such as ReLU). The embedded downsampling operation (typically max pooling)... The first layer reduces computational parameters, expands the receptive field, and enhances the model's robustness to image translation and rotation by lowering the spatial resolution of the feature map (e.g., from 224x224 pixels to 28x28 pixels). The fully abstracted feature map is flattened into a one-dimensional vector at the end and fed into a fully connected layer. This layer maps the distributed feature representation to the sample label space, integrates global context information through all weighted connections between layers, and finally outputs a continuous value representing the "predicted volume." The "supervision" mechanism at the far right of the process is the core of the model's learning drive. It compares the network's output "predicted volume" with the known "true volume" label and uses a loss function (e.g., mean squared error, MSE, whose formula is...) to... ,in For the sample size, and The first The difference between the predicted and true values of each sample is quantified. The calculated loss gradient is backpropagated from the output layer to the convolutional layer layer by layer through a backpropagation algorithm (such as stochastic gradient descent). In this way, the weights and bias parameters of all layers in the network are adjusted iteratively. The ultimate goal is to minimize the loss function, thereby training an end-to-end deep learning model that can directly regress the box volume from a monocular image with high accuracy.
[0023] S400. Based on the contour features, calculate the volume value of the box using a volume estimation model.
[0024] It should be further explained that the volume estimation model uses support vector regression (SVR), the kernel function is preferably radial basis function (RBF), the parameter C is preferably 1.0, and gamma is preferably 0.1. These values are determined by grid search because this combination achieves the minimum mean square error on the test data.
[0025] Understandably, the beneficial effects of the above solution include: this method improves measurement accuracy to the millimeter level through synchronous acquisition and refined preprocessing, with a processing speed of more than 30 frames per second, adapting to changes in lighting and partially occluded scenes; the optimization of algorithm parameters ensures robustness and reduces implementation costs.
[0026] Specifically, the geometric sensor includes a light curtain sensor, and the visual sensor includes a monocular camera.
[0027] It should be further noted that the light curtain sensor is preferably an infrared light curtain model with an emission wavelength range of 850-950 nanometers. This preferred value is based on the resistance of infrared light to interference from visible light, adapting to common lighting conditions in agricultural product warehouses (such as natural light or fluorescent lamps). The monocular camera uses a CMOS sensor with a preferred resolution of 1920x1080 pixels and a frame rate of 30fps. This preferred value ensures that image clarity matches the real-time processing requirements, because high resolution can capture subtle textures of the cabinet without excessively increasing the computational load. The installation positions of the light curtain sensor and the monocular camera need to be parallel and aligned, with a preferred spacing of 0.5-1 meter. This range is set based on standard cabinet dimensions (such as 1m x 1m x 1m) to maximize the coverage area.
[0028] Understandably, the advantages of the above solution include: this sensor combination provides complementary data, the light curtain ensures depth accuracy, the camera enhances texture information, and the overall system cost is lower than that of laser scanning solutions.
[0029] Specifically, the light curtain sensor is configured to emit parallel light strips to acquire three-dimensional point cloud data, the monocular camera is configured to capture two-dimensional RGB images, and the light curtain sensor and the monocular camera are time-aligned through a data synchronization module.
[0030] It should be further noted that the preferred emission angle of the parallel light strip of the light curtain sensor is 60 degrees, and the preferred spacing between the light strips is 1 mm. This preferred value is based on a balance between light strip density and computational efficiency. The reason is that a smaller spacing can generate high-density point clouds but increases processing time, while a 60-degree angle can cover the width of a typical enclosure. The preferred exposure time of the monocular camera is 1 / 100 second to reduce motion blur. The data synchronization module adopts FPGA-based hardware circuitry, with a synchronization error of less than 1 millisecond, ensuring timing consistency. Point cloud data generation uses the triangulation principle, with the following formula: in, Represents depth value (unit: meters). This indicates the distance to the light curtain baseline (preferably 0.5 meters). Indicates focal length (preferably 8 mm). and These represent the coordinate differences (in pixels) between the left and right light bands in the image. In this formula, The physical meaning is the distance from a point on the surface of the enclosure to the sensor. The physical meaning is the baseline length between the light curtain sensor and the reference point. The physical meaning of is the focal length of an optical system. and The physical meaning is the imaging position difference. The optimal value is based on calibration experiments and can minimize measurement error.
[0031] For further details, please refer to Figure 4 , Figure 4 The main body is a large black square frame filled with a fine grid, similar to graph paper, used to provide spatial scale and a reference frame; below the "object being detected" are labeled... and This represents the coordinates of the lower left corner of the object or the starting point of the detection. X-axis coordinates (Y-axis coordinate), with labels on the right. and ,in This indicates the coordinates of another reference point of the object in the Y direction (such as the upper right corner). Indicates the height of the object; below it is also... and , Represents the endpoint coordinates in the X direction. This indicates the width of the object; the "r" in the lower right corner indicates the pixel equivalent, used to convert pixel values to actual length. Its working principle is based on this coordinate system to achieve accurate measurement of object dimensions: First, an image of the box is captured using a vision sensor (such as a monocular camera), and coordinate system calibration is performed using a grid, mapping image pixels to actual physical units; then, the outline of the detected object is identified, and the bounding box is calculated using the labeled coordinate parameters, for example, with... and Starting from, combined (Width) and (Height) determines the two-dimensional dimensions of an object, while and The "r" parameter is used to verify alignment or calculate the center point. Finally, the "r" parameter is used to scale or correct the measured values (such as converting pixel distance to meters). Combined with the third-dimensional data provided by the depth sensor (such as a light curtain), the volume of the box is finally calculated. The whole process ensures that the measurement results are not affected by perspective distortion and improves the adaptability to irregular boxes.
[0032] Understandably, the beneficial effects of the above scheme include: timing alignment eliminates data acquisition delay and improves fusion accuracy; and the parallel light strip design enhances adaptability to uneven surfaces.
[0033] Specifically, the fusion and preprocessing of multimodal sensor data includes: spatially aligning point cloud data with image data using a calibration algorithm, and performing noise reduction processing on the aligned data.
[0034] Further explanation is needed regarding the specific implementation steps of the calibration algorithm: First, acquire multiple sets of images and point cloud data of the calibration board (preferably with a checkerboard size of 30mm x 30mm), with at least 10 different poses in each set; then, use the `cv2.calibrate Camera` function from the OpenCV library to calculate the intrinsic and extrinsic parameters. The initial values of the intrinsic parameter matrix are set based on the camera specifications, and the extrinsic parameters are solved using the PnP algorithm. After spatial alignment, a median filter is used for denoising, with a window size preferably of 5x5 pixels. This preferred value effectively removes impulse noise without losing edge information because, based on test data, this window size achieves the best balance between signal-to-noise ratio and detail preservation.
[0035] Understandably, the beneficial effects of the above scheme include: calibration ensures geometric consistency, denoising improves data quality, and makes subsequent feature extraction more reliable.
[0036] Specifically, the spatial alignment includes a coordinate normalization operation to map point cloud data and image data to a unified coordinate system.
[0037] It should be further explained that coordinate normalization is achieved through homogeneous transformation, as shown in the formula: in, Represents a point in the camera coordinate system (unit: meters). Represents a point in the world coordinate system (unit: meters). This represents a 3x3 rotation matrix (preferably an identity matrix, representing no rotation). This represents a 3x1 translation vector (preferably a zero vector, representing sensor co-position). In this formula, The physical meaning is the transformed point coordinates. The physical meaning is the coordinates of the original point. The physical meaning is rotational transformation. The physical meaning is translation transformation. After normalization, the coordinate range is scaled to the [0,1] interval, using the minimum-maximum scaling formula: in, Represents the normalized value. Represents the original coordinates. and This represents the minimum and maximum values of the data. This operation is preferred to accelerate neural network convergence.
[0038] Understandably, the beneficial effects of the above scheme include: normalization simplifies data processing and reduces computational complexity.
[0039] Specifically, the feature extraction model includes a neural network model for learning the geometric morphological features of the box from the fused data.
[0040] It should be further explained that the neural network model is a Convolutional Neural Network (CNN), and the specific architecture includes: an input layer (size 224x224x3), followed by Convolutional Layer 1 (32 filters, size 3x3, stride 1), ReLU activation function, Pooling Layer 1 (max pooling, size 2x2), Convolutional Layer 2 (64 filters, size 3x3), Pooling Layer 2, Fully Connected Layer 1 (128 neurons), and Output Layer (64 neurons, corresponding to contour features). Training uses the cross-entropy loss function, the optimizer is Adam, the preferred learning rate is 0.001, the decay rate is 0.9, the training batch size is 32, and the training cycle is 100 epochs; these optimal values are based on experiments and can prevent overfitting. The feature extraction steps include forward propagation and backward propagation, and specific thresholds, such as the gradient clipping threshold, are set to 1.0 to avoid gradient explosion.
[0041] Understandably, the beneficial effects of the above scheme include: CNN automatically learns features, reduces manual design costs, and improves adaptability to irregular boxes.
[0042] Specifically, the neural network model has a dual-branch structure, including a contour feature extraction branch and a volume estimation branch, wherein the contour feature extraction branch is implemented based on a convolutional neural network, and the volume estimation branch is implemented based on a regression neural network.
[0043] It should be further explained that the contour feature extraction branch adopts the MobileNetV2 architecture, with a width multiplier of 1.0, an input size of 224x224x3, and an output of 128-dimensional features; the volume estimation branch adopts a multilayer perceptron (MLP), with an input layer (128-dimensional), hidden layer 1 (256 neurons, ReLU activation function), hidden layer 2 (128 neurons), and an output layer (1 neuron, corresponding to the volume value). During training, the two branches are trained jointly, and the loss function is the mean squared error (MSE), as shown in the formula: in, Indicates the number of samples. Represents the actual volume value. This represents the predicted value. In this formula, The physical meaning is batch size. and The physical meaning is the actual and predicted volume. The optimizer uses Adam with a learning rate of 0.001 and 100 training epochs. This dual-branch design is preferred for specialized task processing.
[0044] For further details, please refer to Figure 3Its workflow begins with the box-type multimodal data input layer, simultaneously receiving light curtain point cloud data and box-type 2D image features. The left branch processes the point cloud data: first, it extracts geometric features through a point cloud network (such as a variant of PointNet), including the spatial coordinates and curvature information of the point cloud on the box surface; then, it performs contour point normalization, scaling the point cloud coordinates to a uniform range (such as [0,1]) to eliminate scale differences; finally, it maps the features to a high-dimensional space through linear projection (via a fully connected layer). The right branch processes the image data: it extracts the texture and edge features of the 2D image through a convolutional neural network (CNN, such as the ResNet architecture), then performs optimization processing (such as batch normalization and Dropout to enhance generalization), and applies attention mechanisms (such as channel attention) to weight important feature regions. The outputs of the two branches are in the box-type features. The fusion layer combines geometric and visual features through splicing or weighted averaging. The fused features are input into a regression neural network (such as a multilayer perceptron), undergo nonlinear transformation through a fully connected layer and activation function (such as ReLU), and finally output the box volume value through linear regression in the box volume regression output layer. Its detailed working principle is to use dual-path parallel processing of multimodal data. The point cloud branch provides accurate 3D geometric information to reduce perspective error, while the image branch supplements 2D texture details to enhance adaptability to irregular boxes. By integrating complementary information through feature fusion and regression networks, high-precision and robust volume estimation can be achieved in complex environments.
[0045] Understandably, the beneficial effects of the above scheme include: the dual-branch structure improves accuracy by about 10% and enhances the model's generalization ability.
[0046] Specifically, the volume estimation model uses a machine learning regression framework, taking the contour features as input and outputting volume values.
[0047] It should be further explained that the preferred regression framework is Support Vector Regression (SVR). The specific steps are as follows: First, the input features are standardized (mean 0, standard deviation 1). Then, the RBF kernel function is used, with parameter C preferably 1.0 and gamma preferably 0.1. These values are determined through grid search (e.g., 5-fold cross-validation) because this combination achieves the lowest root mean square error (RMSE) on the test set. At least 1000 samples are used for training to ensure model stability. The output volume is in cubic meters, and post-processing includes pruning outliers (threshold set to ±3 standard deviations).
[0048] Understandably, the benefits of the above approach include: SVR is robust to small sample data and improves measurement stability.
[0049] Specifically, the machine learning regression framework includes a multilayer perceptron or Transformer architecture and integrates an attention mechanism to improve estimation accuracy.
[0050] It should be further explained that the Transformer architecture is implemented as follows: the input features are first mapped to 512 dimensions through an embedding layer, and then pass through a 4-head attention mechanism. The formula for calculating the attention weights is as follows: in, Represents the query matrix. Represents the key matrix, Represents a value matrix, This represents the key dimension (preferably 64). In this formula, , , The physical meaning is a linear transformation of the input features. The physical meaning of is that the scaling factor is used to stabilize the gradient. The multi-head attention output is processed through a feedforward network (512 neurons, GELU activation function), with a dropout rate preferably of 0.1. The training batch size is 32, the learning rate is 0.0001, and the cycle is 200 epochs; this optimal value is based on experiments and maximizes the effect of the attention mechanism. Alternatives include a Multilayer Perceptron (MLP) with 2 hidden layers, 100 and 50 neurons respectively, and a Sigmoid activation function.
[0051] Understandably, the beneficial effects of the above scheme include: the attention mechanism focuses on key features, reduces the impact of occlusion, and improves accuracy by 5-10%.
[0052] Please see Figure 2 The present invention provides another embodiment, which provides a non-contact agricultural product packaging box volume measurement system, the non-contact agricultural product packaging box volume measurement system comprising: Geometric sensor 100 is used to acquire point cloud data of the box; A vision sensor 200 is used to acquire image data of the enclosure; Processor 300 is configured to perform the steps of the method described in any of the above descriptions; Output interface 400 is used to output volume measurement results in real time.
[0053] It should be further noted that the geometric sensor 100 is preferably a light curtain sensor (model LS-100), with an accuracy of ±1 mm and a working distance of 0.5-2 meters; the vision sensor 200 is preferably a monocular camera (model HD-1080P), with a resolution of 1920x1080 and a frame rate of 30fps; the processor 300 uses an embedded GPU (such as NVIDIA Jetson Nano), running at a frequency of 1.43 GHz, with 4 GB of memory, and an operating system of Linux. The software environment includes TensorFlow or PyTorch frameworks to support real-time inference; the output interface 400 is Ethernet or USB 3.0, with a transmission rate of 100 Mbps. The system is integrated into an IP67 waterproof housing, with an operating temperature range of -10°C to 50°C, suitable for agricultural product storage environments. During implementation, the processor 300 loads the pre-trained model, executes the method steps, and outputs the results through the interface.
[0054] Understandably, the benefits of the above solution include: hardware optimization ensures low system cost, high reliability, and ease of deployment and maintenance.
[0055] In a preferred embodiment, this application also provides an electronic device, the electronic device comprising: The computer device includes a memory and a processor, wherein the memory stores computer-readable instructions that, when executed by the processor, implement the non-contact method for measuring the volume of agricultural product packaging boxes. The computer device can be broadly categorized as a server, terminal, or any other electronic device with the necessary computing and / or processing capabilities. In one embodiment, the computer device may include a processor, memory, network interface, communication interface, etc., connected via a system bus. The processor of the computer device can be used to provide the necessary computing, processing, and / or control capabilities. The memory of the computer device may include a non-volatile storage medium and internal memory. The non-volatile storage medium may store an operating system, computer programs, etc. The internal memory can provide an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface and communication interface of the computer device can be used to connect and communicate with external devices via a network. When the computer program is executed by the processor, it performs the steps of the method of the present invention.
[0056] This invention can be implemented as a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, causes the steps of the methods of embodiments of the invention to be performed. In one embodiment, the computer program is distributed across multiple network-coupled computer devices or processors, such that the computer program is stored, accessed, and executed in a distributed manner by one or more computer devices or processors. A single method step / operation, or two or more method steps / operations, may be executed by a single computer device or processor or by two or more computer devices or processors. One or more method steps / operations may be executed by one or more computer devices or processors, and one or more other method steps / operations may be executed by one or more other computer devices or processors. One or more computer devices or processors may execute a single method step / operation, or execute two or more method steps / operations.
[0057] Those skilled in the art will understand that the method steps of this invention can be performed by a computer program instructing related hardware, such as a computer device or processor, to perform the steps of this invention when executed. Depending on the context, any references herein to memory, storage, databases, or other media may include non-volatile and / or volatile memory. Examples of non-volatile memory include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), flash memory, magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, etc. Examples of volatile memory include random access memory (RAM), external cache memory, etc.
[0058] The technical features described above can be combined arbitrarily. Although not all possible combinations of these technical features are described, any combination of these technical features should be considered to be covered by this specification, provided that such combination does not contain contradictions.
[0059] The specific embodiments of the present invention described above do not constitute a limitation on the scope of protection of the present invention. Any other corresponding changes and modifications made in accordance with the technical concept of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A non-contact method for measuring the volume of agricultural product packaging boxes, characterized in that, Includes the following steps: S100. Simultaneously acquire multimodal sensor data of the agricultural product packaging box through geometric sensors and vision sensors; S200: The multimodal sensor data is fused and preprocessed to generate fused data; S300. Extract the contour features of the box from the fused data using a feature extraction model; S400. Based on the contour features, calculate the volume value of the box using a volume estimation model.
2. The method as described in claim 1, characterized in that, The geometric sensor includes a light curtain sensor, and the visual sensor includes a monocular camera.
3. The method as described in claim 2, characterized in that, The light curtain sensor is configured to emit parallel light strips to acquire three-dimensional point cloud data, and the monocular camera is configured to capture two-dimensional RGB images. The light curtain sensor and the monocular camera are time-aligned through a data synchronization module.
4. The method as described in claim 1, characterized in that, The process of fusing and preprocessing multimodal sensor data includes: spatially aligning point cloud data with image data using a calibration algorithm, and then performing noise reduction processing on the aligned data.
5. The method as described in claim 4, characterized in that, The spatial alignment includes coordinate normalization operations to map point cloud data and image data to a unified coordinate system.
6. The method as described in claim 1, characterized in that, The feature extraction model includes a neural network model for learning the geometric morphological features of the box from the fused data.
7. The method as described in claim 6, characterized in that, The neural network model has a dual-branch structure, including a contour feature extraction branch and a volume estimation branch. The contour feature extraction branch is implemented based on a convolutional neural network, and the volume estimation branch is implemented based on a regression neural network.
8. The method as described in claim 1, characterized in that, The volume estimation model uses a machine learning regression framework, taking the contour features as input and outputting volume values.
9. The method as described in claim 8, characterized in that, The machine learning regression framework includes a multilayer perceptron or Transformer architecture and integrates an attention mechanism to improve estimation accuracy.
10. A non-contact agricultural product packaging box volume measurement system, characterized in that, include: Geometric sensors are used to acquire point cloud data of the enclosure; A vision sensor is used to acquire image data of the enclosure; A processor configured to perform the method steps as described in any one of claims 1 to 9; Output interface for real-time output of volume measurement results.