A data tracing method and device for a parcel inspection machine

By employing multi-angle barcode scanning and dynamically adjusting the weights of the image quality assessment model, the problem of low barcode recognition rate for air column bag packaging was solved, enabling efficient data traceability and improving the accuracy and efficiency of e-commerce logistics.

CN120430327BActive Publication Date: 2026-03-31HUIZHOU LIANCHANG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing package inspection machines have low barcode recognition rates when dealing with air column bag packages, resulting in missing or incorrect traceability data. This affects the efficiency of inbound and outbound operations and the level of logistics management in e-commerce warehouses, especially during peak business periods when it is difficult to reliably obtain barcode information.

Method used

Multiple barcode images are acquired using a multi-angle barcode scanning device. The image quality assessment model weights are initialized and dynamically adjusted. The image with the highest overall quality score is selected for decoding, and the exposure time and gain parameters of the decoder are adaptively adjusted to ensure successful decoding.

Benefits of technology

It improves the barcode recognition rate and data traceability accuracy of air column bag packaging, enhances e-commerce logistics efficiency and data traceability reliability, and reduces hardware costs and system complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120430327B_ABST
    Figure CN120430327B_ABST
Patent Text Reader

Abstract

The application provides a data tracing method and device of a parcel inspection machine, applied to the technical field of data tracing, and quality best images are screened from multiple images for decoding, so as to improve the decoding success rate; then the optimal image is decoded, if the decoding is successful, the bar code information is associated with the parcel information and uploaded to the data tracing system, so as to realize the data tracing of the parcel. Through the above steps, the technical scheme can dynamically adjust the image quality evaluation model according to the actual decoding condition, and adaptively optimize the quality evaluation and selection process of the bar code image, so as to improve the bar code recognition rate of the air column bag packaging parcel and the accuracy of data tracing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data traceability technology, and in particular to a data traceability method and apparatus for a package inspection machine. Background Technology

[0002] In modern e-commerce warehousing and logistics centers, package inspection machines have become indispensable core equipment for automated parcel handling, widely used to improve logistics efficiency. To reduce the risk of breakage of fragile goods during transportation, e-commerce companies typically choose to use air column bags for packaging. However, air column bag packaging results in irregular bumps and depressions on the surface of the parcel, and the packaging material itself often has reflective properties. Currently, mainstream package inspection machines mainly rely on visual recognition technology to scan parcel barcodes to achieve data traceability and management of goods. However, for parcels packaged in air column bags, the inherent unevenness of the surface and the reflective properties of the material can easily cause problems such as barcode wrinkles, obstruction, or reflective interference, making it difficult for traditional visual recognition systems to reliably and accurately read barcode information. This situation directly leads to missing or incorrect traceability data for some air column bag-packaged parcels, seriously affecting the inbound and outbound efficiency of e-commerce warehouses and the overall logistics management level. Especially during peak business periods such as e-commerce promotional seasons, the rapid processing of massive numbers of parcels places higher demands on the accuracy and efficiency of barcode recognition. However, existing technologies generally have low barcode recognition rates when processing air column bag packaging, which has become a key bottleneck restricting further improvement in e-commerce logistics efficiency and data accuracy.

[0003] In the complex, high-speed operating environment of e-commerce warehouses, especially for fragile packages packaged in air column bags, the uneven surfaces and reflective materials of these bags make it difficult for existing barcode scanning methods based on visual recognition to reliably acquire barcode information when the barcodes are easily obscured or interfered with by glare. This often leads to missing or incorrect traceability data. Therefore, designing a data traceability method and device that can adapt to environmental changes without significantly increasing hardware costs and system complexity, and ensuring accurate data traceability for air column bag packages even with poor barcode quality, has become a pressing technical challenge. Summary of the Invention

[0004] In view of the shortcomings of the prior art, this application provides a data traceability method and apparatus for a package inspection machine, which is applied in the field of data traceability technology. It has the function of adapting to environmental changes and ensuring that even when the quality of the package barcode is poor, it can still achieve the beneficial effect of accurate data traceability of air column bag packaged packages.

[0005] Firstly, a data traceability method for inspection machines, the method comprising the following steps:

[0006] S1: Use a multi-angle barcode scanning device to collect barcode images of packages in real time and obtain multiple barcode images;

[0007] S2: Initialize the image quality assessment model weights;

[0008] S3: Decode multiple barcode images and monitor the decoding success rate in real time; if the decoding success rate is less than a preset threshold, analyze the barcode images that have recently failed to decode and evaluate the image quality features.

[0009] S4: Based on the image quality features of the failed decoding, dynamically adjust the weights of the image quality assessment model to obtain the adjusted image quality assessment model;

[0010] S5: Using the adjusted image quality assessment model, calculate the comprehensive quality score of each barcode image that failed to decode, and select the barcode image with the highest comprehensive quality score as the optimal image;

[0011] S6: Decode the optimal image. If decoding is successful, associate the barcode information with the package information and upload it to the data traceability system.

[0012] Furthermore, the image quality assessment model weights include at least sharpness score weights, integrity score weights, and reflection interference degree score weights. Step S4 includes:

[0013] S41: Calculate the percentage of reflective area in each barcode image that failed to decode. If the percentage of reflective area is greater than a preset reflective area threshold, the barcode image is determined to be a highly reflective image.

[0014] S42: Count the number of highly reflective images among the barcode images that have recently failed to decode, and calculate the proportion of highly reflective images;

[0015] S43: If the proportion of highly reflective images is greater than a preset proportion threshold, the weight of the reflection interference level score is reduced, and according to the reduced weight of the reflection interference level score, the weight of the clarity score and the weight of the integrity score are increased according to the initial ratio of the clarity score weight and the integrity score weight, so that the total weight of the adjusted image quality assessment model is 1.

[0016] S44: If the proportion of highly reflective images is less than or equal to the preset proportion threshold, the weights of the image quality assessment model remain unchanged.

[0017] Furthermore, step S43 includes:

[0018] S431: Set the reflection adjustment step size, sharpness adjustment step size, and integrity adjustment step size;

[0019] S432: If the proportion of highly reflective images is greater than a preset proportion threshold, the reflective interference degree score weight is reduced according to the reflective adjustment step size to obtain the adjusted reflective interference degree score weight.

[0020] S433: Calculate the increment of the sharpness score weight and the increment of the integrity score weight based on the initial ratio of the sharpness score weight to the integrity score weight, as well as the sharpness adjustment step size and the integrity adjustment step size.

[0021] S434: Based on the increase in the sharpness score weight and the increase in the integrity score weight, increase the sharpness score weight and the integrity score weight respectively to obtain the adjusted sharpness score weight and the adjusted integrity score weight, so that the total weight of the adjusted image quality assessment model is 1.

[0022] Furthermore, step S433 includes:

[0023] S4331: Calculate the sharpness adjustment coefficient and the integrity adjustment coefficient according to the initial ratio of the sharpness score weight and the integrity score weight, wherein the sharpness adjustment coefficient is equal to the initial value of the sharpness score weight divided by the sharpness adjustment step size, and the integrity adjustment coefficient is equal to the initial value of the integrity score weight divided by the integrity adjustment step size.

[0024] S4332: Based on the reflection adjustment step size, the sharpness adjustment coefficient, and the integrity adjustment coefficient, calculate the sharpness score weight increment and the integrity score weight increment, wherein the sharpness score weight increment is equal to the reflection adjustment step size multiplied by the sharpness adjustment coefficient, and the integrity score weight increment is equal to the reflection adjustment step size multiplied by the integrity adjustment coefficient.

[0025] Furthermore, step S5 includes:

[0026] S51: Calculate the clarity score, integrity score, and reflection interference score for each of the barcode images;

[0027] S52: Based on the adjusted clarity score weight, the adjusted integrity score weight, and the adjusted reflective interference score weight, the clarity score, the integrity score, and the reflective interference score of each barcode image are weighted and summed to obtain the comprehensive quality score of each barcode image.

[0028] S53: Sort all the barcode images by their overall quality scores, and select the barcode image with the highest overall quality score as the optimal image.

[0029] Furthermore, step S51 includes:

[0030] S511: For each barcode image acquired by the multi-angle barcode scanning device, extract the gray-level co-occurrence matrix, and calculate four texture feature parameters—energy, entropy, contrast, and uniformity—based on the gray-level co-occurrence matrix.

[0031] S512: Based on the preset light intensity threshold range, count the number of pixels in each barcode image whose pixel value falls outside the light intensity threshold range, calculate the proportion of pixels with abnormal light intensity, and if the proportion of pixels with abnormal light intensity is greater than the preset light intensity abnormality proportion threshold, then determine that the barcode image has an abnormal light intensity.

[0032] S513: If the barcode image has an illumination anomaly, then calculate the sharpness score based on the energy and uniformity texture feature parameters of the barcode image; otherwise, calculate the sharpness score based on the entropy and contrast texture feature parameters of the barcode image.

[0033] S514: Use an image segmentation algorithm to segment the barcode region of each barcode image, and calculate the ratio of the area of ​​the segmented barcode region to the area of ​​the original image as a completeness score;

[0034] S515: Calculate the number of bright pixels in each barcode image, and calculate the reflection interference level score based on the ratio of the number of bright pixels to the total number of pixels in the image.

[0035] Furthermore, step S6 includes:

[0036] S61: If the optimal image decoding fails, then a preset number of suboptimal images are selected in descending order of the comprehensive quality score of the barcode image.

[0037] S62: For each suboptimal image, according to the preset decoding parameter adjustment strategy, based on the image sharpness score and the reflection interference degree score, the exposure time and gain parameters of the decoder are adaptively adjusted to obtain the adjusted decoding parameters;

[0038] S63: Decode the suboptimal image using the adjusted decoding parameters. If decoding is successful, associate the barcode information with the package information and upload it to the data traceability system; otherwise, return to step S62 until all suboptimal images have been decoded.

[0039] S64: If decoding of all suboptimal images fails, the best image and all suboptimal images are uploaded to the human-assisted recognition interface, and the reason for decoding failure is recorded for subsequent model optimization.

[0040] Furthermore, step S62 includes:

[0041] S621: Based on the image sharpness score, the target exposure time adjustment amount is calculated using a linear mapping according to the preset exposure time adjustment range. The target exposure time adjustment amount is negatively correlated with the image sharpness score.

[0042] S622: Based on the image reflection interference level score, the target gain parameter adjustment amount is calculated using nonlinear mapping according to the preset gain parameter adjustment range. The target gain parameter adjustment amount is negatively correlated with the image reflection interference level score, and when the image reflection interference level score exceeds the preset reflection threshold, the absolute value of the target gain parameter adjustment amount increases exponentially.

[0043] S623: Add the current exposure time of the decoder to the target exposure time adjustment to obtain the adjusted exposure time, and add the current gain parameter of the decoder to the target gain parameter adjustment to obtain the adjusted gain parameter. Use the adjusted exposure time and the adjusted gain parameter to obtain the adjusted decoding parameter.

[0044] Furthermore, step S623 includes:

[0045] S6231: Based on the exposure time adjustment amount, determine whether the sum of the current exposure time of the decoder and the exposure time adjustment amount exceeds a preset exposure time range. If it does, adjust the exposure time of the decoder to the boundary value of the preset exposure time range. Otherwise, use the sum of the current exposure time of the decoder and the exposure time adjustment amount as the adjusted exposure time.

[0046] S6232: Based on the gain parameter adjustment amount, determine whether the sum of the current gain parameter of the decoder and the gain parameter adjustment amount exceeds a preset gain parameter range. If it does, adjust the gain parameter of the decoder to the boundary value of the preset gain parameter range; otherwise, use the sum of the current gain parameter of the decoder and the gain parameter adjustment amount as the adjusted gain parameter.

[0047] S6233: Use the adjusted exposure time and the adjusted gain parameter as the adjusted decoding parameter.

[0048] Secondly, a data traceability device for a package inspection machine, applied in the steps of the data traceability method for a package inspection machine described in any of the above claims, the device comprising:

[0049] Barcode scanning module: Used to acquire real-time images of package barcodes using a multi-angle barcode scanning device, obtaining multiple barcode images;

[0050] Parameter initialization module: Used to initialize the weights of the image quality assessment model;

[0051] Decoding monitoring module: used to decode multiple barcode images and monitor the decoding success rate of barcodes in real time; if the decoding success rate is less than a preset threshold, analyze the barcode images that have recently failed to decode and evaluate the image quality features.

[0052] Dynamic weight adjustment module: used to dynamically adjust the weights of the image quality assessment model based on the image quality features of the decoded image, so as to obtain the adjusted image quality assessment model;

[0053] Image optimization module: Used to calculate the comprehensive quality score of each barcode image that fails to decode using the adjusted image quality assessment model, and select the barcode image with the highest comprehensive quality score as the optimal image;

[0054] Data processing and uploading module: used to decode the optimal image. If the decoding is successful, the barcode information is associated with the package information and uploaded to the data traceability system.

[0055] Beneficial Effects: The data traceability method and apparatus for package inspection machines proposed in this application improve the decoding success rate by selecting the highest quality image from multiple images for decoding. Then, the optimal image is decoded; if decoding is successful, the barcode information is associated with the package information and uploaded to the data traceability system, achieving data traceability of the package. Through these steps, this technical solution can dynamically adjust the image quality assessment model based on the actual decoding situation, adaptively optimizing the barcode image quality assessment and selection process, thereby improving the barcode recognition rate and data traceability accuracy of air column bag-packaged parcels. Attached Figure Description

[0056] Figure 1 This is a flowchart of a data traceability method for a package inspection machine proposed in this application.

[0057] Figure 2 This is a structural diagram of a data traceability device for a package inspection machine proposed in this application.

[0058] Labeling Explanation: 201, Barcode Scanning Module; 202, Parameter Initialization Module; 203, Decoding Monitoring Module; 204, Dynamic Weight Adjustment Module; 205, Image Optimization Module; 206, Data Processing and Uploading Module. Detailed Implementation

[0059] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and marked in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0060] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0061] Please refer to Figure 1 Firstly, a data traceability method for inspection machines, the method comprising the steps of:

[0062] S1: Use a multi-angle barcode scanning device to collect barcode images of packages in real time and obtain multiple barcode images;

[0063] S2: Initialize the image quality assessment model weights;

[0064] S3: Decode multiple barcode images and monitor the decoding success rate in real time; if the decoding success rate is less than a preset threshold, analyze the barcode images that have recently failed to decode and evaluate the image quality features.

[0065] S4: Based on the image quality characteristics of the decoded images, dynamically adjust the weights of the image quality assessment model to obtain the adjusted image quality assessment model;

[0066] S5: Using the adjusted image quality assessment model, calculate the overall quality score for each barcode image that failed to decode, and select the barcode image with the highest overall quality score as the optimal image;

[0067] S6: Decode the optimal image. If decoding is successful, associate the barcode information with the package information and upload it to the data traceability system.

[0068] In step S1, the multi-angle barcode scanning device is set to collect barcode images from different angles of the package, thereby obtaining an image set containing barcode information from different angles, overcoming the problem of missing barcode information that may be caused by single-angle scanning.

[0069] In step S2, the image quality assessment model weight initialization operation provides a benchmark value for subsequent dynamic adjustment of model weights.

[0070] In step S3, the decoding process uses a barcode decoder to identify the acquired barcode image. The decoding success rate monitoring provides triggering conditions for subsequent model adjustments. The analysis of recently decoded barcode images and the evaluation of image quality features provide a basis for model adjustments. Image quality features include, but are not limited to, clarity, integrity, and the degree of reflection interference.

[0071] In step S4, dynamically adjusting the weights of the image quality assessment model is the core step of the method, which realizes the adaptive optimization of the model for image quality assessment. The adjustment strategy is determined based on the image quality features obtained in step S3.

[0072] In step S5, the adjusted image quality assessment model is used to score the quality of the images that failed to be decoded. The purpose is to select the image with the best quality from multiple images and improve the success rate of subsequent decoding.

[0073] In step S6, the optimal image is decoded, and the data is uploaded to the data traceability system based on the decoding result. If decoding fails, feedback can be sent to step S3 to readjust the model weights or start the manual assisted recognition process.

[0074] By dynamically adjusting the weights of the image quality assessment model, this method can adapt to changes in the quality of package barcode images, optimize image selection, and improve the barcode recognition rate and data traceability accuracy of air column bag packaging.

[0075] Furthermore, the image quality assessment model weights include at least sharpness score weights, integrity score weights, and reflection interference degree score weights. Step S4 includes:

[0076] S41: Calculate the percentage of reflective area in each barcode image that failed to decode. If the percentage of reflective area is greater than the preset reflective area threshold, the barcode image is determined to be a highly reflective image.

[0077] S42: Count the number of highly reflective images among the barcode images that have recently failed to decode, and calculate the proportion of highly reflective images;

[0078] S43: If the proportion of highly reflective images is greater than the preset proportion threshold, the weight of the reflection interference level score is reduced, and according to the reduced weight of the reflection interference level score, the weight of the sharpness score and the weight of the integrity score are increased according to the initial ratio of the sharpness score weight and the integrity score weight, so that the total weight of the adjusted image quality assessment model is 1.

[0079] S44: If the proportion of highly reflective images is less than or equal to the preset proportion threshold, the weights of the image quality assessment model remain unchanged.

[0080] In step S41, the calculation of the reflective area ratio can be implemented as follows: First, the image is converted into a grayscale image; then, a grayscale threshold is set to distinguish between reflective and non-reflective areas; after that, the number of pixels with grayscale values ​​higher than the threshold is counted, and this number is regarded as the reflective area; finally, the ratio of the reflective area to the total image area is calculated to obtain the reflective area ratio.

[0081] In step S42, recently decoded barcode images can be defined as images that failed to decode within a recent period (e.g., the last 5 minutes or the last 100 packages). The calculation of the proportion of highly reflective images can be implemented as follows: count the number of images identified as highly reflective images among the recently decoded barcode images, and then divide the number of highly reflective images by the total number of recently decoded barcode images to obtain the proportion of highly reflective images.

[0082] In step S43, the preset percentage threshold can be set to, for example, 0.6 or 0.7, to determine whether the reflection problem is prominent. Reducing the reflection interference level score weight can be achieved by, for example, directly subtracting a fixed value (e.g., 0.05) from the reflection interference level score weight, or reducing it by a certain proportion (e.g., 10%). Increasing the sharpness score weight and the integrity score weight can be achieved by: first calculating the ratio of the initial value of the sharpness score weight to the initial value of the integrity score weight; then, based on the reduction in the reflection interference level score weight, allocating the reduced value to the sharpness score weight and the integrity score weight according to the previously calculated ratio, thereby increasing the sharpness score weight and the integrity score weight, while maintaining the total weight of the adjusted image quality assessment model at 1.

[0083] In step S44, keeping the image quality assessment model weights unchanged means that when the proportion of highly reflective images is less than or equal to the preset proportion threshold, the image quality assessment model weights, including the sharpness score weight, the integrity score weight, and the reflectivity interference score weight, all remain unchanged from their original values.

[0084] Furthermore, step S43 includes:

[0085] S431: Set the reflection adjustment step size, sharpness adjustment step size, and integrity adjustment step size;

[0086] S432: If the proportion of highly reflective images is greater than the preset proportion threshold, the weight of the reflection interference level score is reduced according to the reflection adjustment step size to obtain the adjusted reflection interference level score weight.

[0087] S433: Calculate the increment of the sharpness score weight and the increment of the integrity score weight based on the initial ratio of the sharpness score weight to the integrity score weight, as well as the sharpness adjustment step size and the integrity adjustment step size.

[0088] S434: Based on the increment of the sharpness score weight and the increment of the integrity score weight, increase the sharpness score weight and the integrity score weight respectively to obtain the adjusted sharpness score weight and the adjusted integrity score weight, so that the sum of the weights of the adjusted image quality assessment model is 1.

[0089] In step S431, the reflection adjustment step size, sharpness adjustment step size, and integrity adjustment step size are preset values ​​used to control the magnitude of weight adjustment. These step size values ​​can be set according to the actual application scenario and the sensitivity requirements of the model adjustment.

[0090] In step S432, when the proportion of highly reflective images exceeds a preset proportion threshold, it indicates that the reflection problem is more prominent in the barcode images that have recently failed to decode. At this time, it is necessary to reduce the weight of the reflection interference score. The reduction amount is determined by the reflection adjustment step size.

[0091] In step S433, the increment of the sharpness score weight and the increment of the integrity score weight are calculated based on the initial ratio between the sharpness score weight and the integrity score weight and their respective adjustment step size.

[0092] In step S434, in order to ensure that the total weight of the image quality assessment model is 1, the weight of the sharpness score and the integrity score are increased while the weight of the reflection interference score is reduced.

[0093] Furthermore, step S433 includes:

[0094] S4331: Calculate the sharpness adjustment coefficient and the integrity adjustment coefficient based on the initial ratio of the sharpness score weight and the integrity score weight. The sharpness adjustment coefficient is equal to the initial value of the sharpness score weight divided by the sharpness adjustment step size, and the integrity adjustment coefficient is equal to the initial value of the integrity score weight divided by the integrity adjustment step size.

[0095] S4332: Based on the reflection adjustment step size, the sharpness adjustment coefficient, and the integrity adjustment coefficient, calculate the sharpness score weight increment and the integrity score weight increment. The sharpness score weight increment is equal to the reflection adjustment step size multiplied by the sharpness adjustment coefficient, and the integrity score weight increment is equal to the reflection adjustment step size multiplied by the integrity adjustment coefficient.

[0096] In step S4331, the adjustment coefficient is obtained by dividing the initial weight value by the adjustment step size. This adjustment coefficient can be understood as a sensitivity parameter of weight adjustment. The larger the adjustment coefficient, the more sensitive the weight is to changes in the adjustment step size.

[0097] In step S4332, the weight increment is controlled by adjusting the coefficients, which ensures the proportionality of the weight adjustment. That is, the adjustment range of the clarity score weight and the integrity score weight is related to their initial weight ratio. The larger the initial weight ratio, the larger the adjustment range, and vice versa. This proportional adjustment method can adjust the image quality assessment model weight more finely and reasonably, thereby improving the accuracy and stability of barcode recognition.

[0098] Furthermore, step S5 includes:

[0099] S51: Calculate the sharpness score, integrity score, and reflection interference score for each barcode image;

[0100] S52: Based on the adjusted sharpness score weight, the adjusted integrity score weight, and the adjusted reflectivity score weight, the sharpness score, integrity score, and reflectivity score of each barcode image are weighted and summed to obtain the comprehensive quality score of each barcode image.

[0101] S53: Sort all barcode images by their overall quality score and select the barcode image with the highest overall quality score as the optimal image.

[0102] The sharpness score can be calculated by analyzing the texture features of the image, such as using the gray-level co-occurrence matrix to extract texture feature parameters such as energy, entropy, contrast and uniformity, and then determining the score based on these parameters.

[0103] The integrity score can be obtained by segmenting the barcode region using an image segmentation algorithm and calculating the ratio of the area of ​​the segmented barcode region to the area of ​​the original image.

[0104] The reflection interference level score can be calculated based on the ratio of the number of highlighted pixels to the total number of pixels in the image. After obtaining these three scores, a weighted summation operation is performed on these three scores according to the dynamically adjusted image quality assessment model weights, thereby obtaining the comprehensive quality score for each image.

[0105] The weighting adjustment mechanism allows the quality assessment model to be optimized based on the characteristics of images that fail to be decoded. For example, when glare becomes the main cause of decoding failure, the weight of the glare severity score is reduced, while the weights of the sharpness and integrity scores are increased accordingly. This allows the overall quality score to more accurately reflect the key factors currently affecting the decoding success rate.

[0106] Finally, the overall quality scores of all barcode images are sorted, and the image with the highest score is selected as the optimal image for subsequent decoding steps.

[0107] Furthermore, step S51 includes:

[0108] S511: For each barcode image acquired by the multi-angle barcode scanning device, extract the gray-level co-occurrence matrix and calculate four texture feature parameters, namely energy, entropy, contrast and uniformity, based on the gray-level co-occurrence matrix.

[0109] S512: Based on the preset light intensity threshold range, count the number of pixels in each barcode image whose pixel value falls outside the light intensity threshold range, calculate the proportion of pixels with abnormal light intensity, and if the proportion of pixels with abnormal light intensity is greater than the preset light intensity abnormality proportion threshold, then determine that the barcode image has an abnormal light intensity.

[0110] S513: If the barcode image has lighting abnormalities, calculate the sharpness score based on the energy and uniformity texture feature parameters of the barcode image; otherwise, calculate the sharpness score based on the entropy and contrast texture feature parameters of the barcode image.

[0111] S514: Use an image segmentation algorithm to segment the barcode region of each barcode image, and calculate the ratio of the area of ​​the segmented barcode region to the area of ​​the original image as the integrity score;

[0112] S515: Calculate the number of highlighted pixels in each barcode image, and calculate the reflection interference level score based on the ratio of the number of highlighted pixels to the total number of pixels in the image.

[0113] In step S511, the extraction of the gray-level co-occurrence matrix can be achieved as follows: for each barcode image, under the condition of setting the step size and direction angle, the frequency of occurrence of pixel pairs with different gray values ​​in the image is counted, thereby constructing the gray-level co-occurrence matrix.

[0114] Texture feature parameters can be calculated based on the gray-level co-occurrence matrix. For example, energy can be calculated as the sum of squares of the elements of the gray-level co-occurrence matrix, entropy can be calculated as the negative of the sum of the products of the elements of the gray-level co-occurrence matrix and their logarithms, contrast can be calculated as the sum of the squares of the products of the elements in the gray-level co-occurrence matrix and their positions, and uniformity can be calculated as the square root of the sum of squares of the elements of the gray-level co-occurrence matrix.

[0115] In step S512, the light intensity threshold range can be preset to a reasonable range of pixel grayscale values. For example, within the grayscale range of 0-255, the light intensity threshold range can be set to [50, 200]. The light abnormality percentage threshold can be set to a percentage, for example, 10%. When the percentage of pixels with light abnormalities exceeds 10%, the image is determined to have light abnormalities.

[0116] In step S513, the method for calculating the sharpness score can be adaptively selected based on the lighting abnormality. For example, under abnormal lighting conditions, the sharpness score can be calculated as a weighted sum of energy and uniformity texture feature parameters; under normal lighting conditions, the sharpness score can be calculated as a weighted sum of entropy and contrast texture feature parameters.

[0117] In step S514, the image segmentation algorithm can employ methods such as thresholding, edge detection, or region growing to segment the barcode region. The area of ​​the barcode region and the area of ​​the original image can be obtained by calculating the number of pixels in the segmented region and the original image, respectively.

[0118] In step S515, a bright pixel can be defined as a pixel whose pixel value exceeds a preset brightness threshold; for example, the brightness threshold can be set to 230. The reflection interference level score can be calculated as the ratio of the number of bright pixels to the total number of pixels in the image.

[0119] Furthermore, step S6 includes:

[0120] S61: If the optimal image decoding fails, then select a preset number of suboptimal images in descending order of the overall quality score of the barcode image.

[0121] S62: For each suboptimal image, adjust the decoding parameters according to the preset decoding parameter adjustment strategy. Based on the image sharpness score and the reflection interference score, adaptively adjust the exposure time and gain parameters of the decoder to obtain the adjusted decoding parameters.

[0122] S63: Decode the suboptimal image using the adjusted decoding parameters. If decoding is successful, associate the barcode information with the package information and upload it to the data traceability system; otherwise, return to step S62 until all suboptimal images have been decoded.

[0123] S64: If decoding of all suboptimal images fails, upload the best image and all suboptimal images to the human-assisted recognition interface and record the reason for the decoding failure for subsequent model optimization.

[0124] In step S61, when the optimal image decoding fails, the system selects a preset number of suboptimal images from high to low based on the overall quality score. The preset number can be adjusted according to the actual application scenario and system performance. The selection of suboptimal images provides an image foundation for subsequent decoding attempts, utilizing other images of relatively good quality to avoid interrupting the entire process due to the failure of decoding a single image.

[0125] In step S62, for each suboptimal image, a decoding parameter adjustment strategy is applied. The decoder's exposure time and gain parameters are adaptively adjusted based on the image sharpness score and the reflection interference level score. The adjustment range of the exposure time and gain parameters can be preset; for example, the exposure time adjustment range can be set to 1ms-30ms, and the gain parameter adjustment range can be set to 0dB-24dB.

[0126] In step S63, if decoding is successful, the barcode information is associated with the package information and uploaded to the data traceability system, completing the data traceability process. If decoding fails, the process returns to step S62 to adjust the decoding parameters and attempt decoding again for the next suboptimal image, until all suboptimal images have been decoded.

[0127] In step S64, if decoding of all suboptimal images fails, the best image and all suboptimal images will be uploaded to the human-assisted recognition interface. Simultaneously, the reasons for decoding failure will be recorded for subsequent model optimization; for example, recorded as "barcode damage" or "severe barcode wrinkling."

[0128] Furthermore, step S62 includes:

[0129] S621: Based on the image sharpness score, the target exposure time adjustment amount is calculated using linear mapping according to the preset exposure time adjustment range. The target exposure time adjustment amount is negatively correlated with the image sharpness score.

[0130] S622: Based on the image reflection interference level score, the target gain parameter adjustment amount is calculated using nonlinear mapping according to the preset gain parameter adjustment range. The target gain parameter adjustment amount is negatively correlated with the image reflection interference level score, and when the image reflection interference level score exceeds the preset reflection threshold, the absolute value of the target gain parameter adjustment amount increases exponentially.

[0131] S623: Add the current exposure time of the decoder to the target exposure time adjustment to obtain the adjusted exposure time, and add the current gain parameter of the decoder to the target gain parameter adjustment to obtain the adjusted gain parameter. Use the adjusted exposure time and the adjusted gain parameter to obtain the adjusted decoding parameter.

[0132] In step S621, the exposure time adjustment range can be preset. The sharpness score is normalized to the [0,1] interval. The higher the sharpness score, the smaller the target exposure time adjustment, and vice versa.

[0133] In step S622, a preset gain parameter adjustment range, such as [-3dB, +3dB], and a reflection threshold, such as 0.8, can be set. When the reflection interference score is lower than the reflection threshold, a linear negative correlation mapping is used; the higher the reflection interference score, the smaller the target gain parameter adjustment. When the reflection interference score exceeds the reflection threshold, the absolute value of the target gain parameter adjustment increases exponentially, thereby rapidly reducing the gain and suppressing reflection.

[0134] In step S623, the calculated target exposure time adjustment and target gain parameter adjustment are added to the current decoder parameters to obtain the adjusted decoding parameters, which are then used for subsequent decoding operations. In this way, the decoding parameters can adaptively adjust according to image quality, improving the decoding success rate.

[0135] Furthermore, step S623 includes:

[0136] S6231: Based on the exposure time adjustment amount, determine whether the sum of the current exposure time of the decoder and the exposure time adjustment amount exceeds the preset exposure time range. If it does, adjust the exposure time of the decoder to the boundary value of the preset exposure time range. Otherwise, use the sum of the current exposure time of the decoder and the exposure time adjustment amount as the adjusted exposure time.

[0137] S6232: Based on the gain parameter adjustment amount, determine whether the sum of the current gain parameter of the decoder and the gain parameter adjustment amount exceeds the preset gain parameter range. If it does, adjust the gain parameter of the decoder to the boundary value of the preset gain parameter range. Otherwise, use the sum of the current gain parameter of the decoder and the gain parameter adjustment amount as the adjusted gain parameter.

[0138] S6233: Use the adjusted exposure time and the adjusted gain parameter as the adjusted decoding parameter.

[0139] In step S6231, when adjusting the exposure time, a range determination is first required. Specifically, the current exposure time used by the decoder is added to the calculated target exposure time adjustment amount to obtain an estimated adjusted exposure time. Subsequently, the system checks whether this estimated value exceeds a pre-set effective range for exposure time. This effective range is typically determined by the physical limitations and optimal performance range of the decoder hardware. If the estimated exposure time exceeds the effective range, to ensure the normal operation of the decoder and avoid parameter setting errors, the system will force the decoder's exposure time to be set to a boundary value of the effective range. The boundary value refers to the maximum or minimum value of the effective range, depending on whether the estimated value exceeds the upper or lower limit. If the estimated exposure time is within the effective range, this estimated value is directly used as the adjusted exposure time.

[0140] Step S6232, the adjustment process for the gain parameter, is similar to the exposure time adjustment process, also including range judgment and boundary value limitation. The system first calculates the estimated value of the adjusted gain parameter, and then determines whether the estimated value exceeds the preset effective range of the gain parameter. If it exceeds the range, the gain parameter is adjusted to the range boundary value. Otherwise, if it is within the range, the estimated value is used as the adjusted gain parameter.

[0141] Step S6233 combines the exposure time and gain parameters adjusted by the range limitation in steps S6231 and S6232 to form the final adjusted decoding parameters, which are used for subsequent barcode decoding operations.

[0142] Please refer to Figure 2 Secondly, a data traceability device for a package inspection machine, applied in the steps of any of the above-mentioned data traceability methods for a package inspection machine, the device comprising:

[0143] Barcode scanning module 201: Used to acquire barcode images of packages in real time using a multi-angle barcode scanning device to obtain multiple barcode images;

[0144] Parameter initialization module 202: Used to initialize the weights of the image quality assessment model;

[0145] Decoding monitoring module 203: used to decode multiple barcode images and monitor the decoding success rate of barcodes in real time; if the decoding success rate is less than a preset threshold, it analyzes the barcode images that have recently failed to decode and evaluates the image quality features.

[0146] Dynamic weight adjustment module 204: used to dynamically adjust the weights of the image quality assessment model based on the image quality characteristics of the decoded image, so as to obtain the adjusted image quality assessment model;

[0147] Image optimization module 205: Used to calculate the comprehensive quality score of each barcode image that fails to decode using the adjusted image quality assessment model, and select the barcode image with the highest comprehensive quality score as the optimal image;

[0148] Data processing and uploading module 206: used to decode the optimal image. If the decoding is successful, the barcode information is associated with the package information and uploaded to the data traceability system.

[0149] Specifically, the barcode scanning module 201 is connected to a multi-angle barcode scanning device, which is configured to capture barcode images on the package from different angles to address issues such as uneven package surfaces and barcode occlusion. The parameter initialization module 202 sets the initial weights of the image quality assessment model upon system startup; for example, it can set the initial weight ratios for clarity, integrity, and reflective interference. The decoder in the decoding monitoring module 203 performs barcode decoding operations and continuously monitors the decoding success rate. When the decoding success rate falls below a set threshold, a quality analysis process is triggered. The image quality feature assessment process analyzes recently decoded images, for example, by detecting the proportion of reflective areas and other parameters using image processing algorithms. Image quality indicators such as blur level; the dynamic weight adjustment module 204 adjusts the weights of the image quality assessment model based on the evaluated image quality features. For example, when a prominent reflection problem is detected, the weight of the reflection interference score is reduced, and the weights of the clarity and integrity scores are increased accordingly; the image optimization module 205 uses the adjusted model weights to recalculate the comprehensive quality score of the images that failed to be decoded, and selects the image with the highest score as the optimal image in order to improve the subsequent decoding success rate; the data processing and uploading module 206 makes a final decoding attempt on the optimal image. If the decoding is successful, the decoded barcode information is associated with the package information, and the data is uploaded to the data traceability system to complete the data traceability process.

[0150] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0151] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A data trace method for a parcel inspection machine, the method comprising: The method comprises the steps of: S1: Real-time acquisition of package barcode images by a multi-angle barcode scanning device to obtain multiple barcode images; S2: Initialization of image quality evaluation model weights; S3: Decoding of the multiple barcode images to monitor the decoding success rate of barcode decoding in real time; If the decoding success rate is less than a preset threshold, the recent decoding failed barcode images are analyzed, and image quality features are evaluated; S4: Dynamic adjustment of image quality evaluation model weights according to the image quality features of the decoding failed images to obtain adjusted image quality evaluation models; S5: Calculation of the comprehensive quality score of each decoding failed barcode image using the adjusted image quality evaluation model, and selection of the barcode image with the highest comprehensive quality score as the optimal image; S6: Decoding of the optimal image, association of barcode information with package information, and uploading to a data tracing system if the decoding is successful; Step S5 comprises: S51: Calculation of the definition score, completeness score, and reflection interference degree score of each barcode image; S52: Weighted summation of the definition score, completeness score, and reflection interference degree score of each barcode image according to the adjusted definition score weight, adjusted completeness score weight, and adjusted reflection interference degree score weight to obtain the comprehensive quality score of each barcode image; S53: Sorting of the comprehensive quality scores of all barcode images, and selection of the barcode image with the highest comprehensive quality score as the optimal image; Step S51 comprises: S511: Extraction of the gray level co-occurrence matrix for each barcode image collected by the multi-angle barcode scanning device, and calculation of the energy, entropy, contrast, and uniformity four texture feature parameters according to the gray level co-occurrence matrix; S512: Calculation of the proportion of abnormal illumination pixels according to a preset illumination intensity threshold range, and determination of the existence of illumination abnormalities in the barcode image if the proportion of abnormal illumination pixels is greater than a preset abnormal illumination proportion threshold; S513: If the barcode image has illumination abnormalities, the definition score is calculated according to the energy and uniformity texture feature parameters of the barcode image, otherwise, the definition score is calculated according to the entropy and contrast texture feature parameters of the barcode image; S514: Barcode region segmentation of each barcode image by an image segmentation algorithm, and calculation of the ratio of the area of the segmented barcode region to the area of the original image as the completeness score; S515: Calculation of the number of highlight pixels in each barcode image, and calculation of the reflection interference degree score according to the ratio of the number of highlight pixels to the total number of image pixels; Step S6 comprises: S61: If the optimal image decoding fails, a preset number of sub-optimal images are selected in descending order of the comprehensive quality score of the barcode image. S62: For each of the suboptimal images, according to a preset decoding parameter adjustment strategy, based on the image sharpness score and the glare interference degree score, the exposure time and gain parameters of the decoder are adaptively adjusted to obtain adjusted decoding parameters; S63: The suboptimal images are decoded using the adjusted decoding parameters, if the decoding is successful, the barcode information is associated with the package information and uploaded to the data tracing system; otherwise, return to step S62 until all suboptimal images are decoded; S64: If all suboptimal images fail to decode, the optimal image and all suboptimal images are uploaded to an artificial auxiliary identification interface, and the decoding failure reason is recorded for subsequent model optimization.

2. A data trace method for a parcel sorting machine according to claim 1, wherein, The image quality evaluation model weight at least includes a sharpness score weight, a completeness score weight, and a glare interference degree score weight, and step S4 includes: S41: Calculate the area proportion of the glare area of each barcode image that fails to decode, if the area proportion of the glare area is greater than a preset glare area threshold, determine that the barcode image is a high-glare image; S42: Count the number of high-glare images in the barcode images that fail to decode recently, and calculate the high-glare image proportion; S43: If the high-glare image proportion is greater than a preset proportion threshold, reduce the glare interference degree score weight, and according to the reduced glare interference degree score weight, increase the sharpness score weight and the completeness score weight according to the initial proportion of the sharpness score weight and the completeness score weight, so that the sum of the adjusted image quality evaluation model weights is 1; S44: If the high-glare image proportion is less than or equal to the preset proportion threshold, maintain the image quality evaluation model weight unchanged.

3. A data trace method for a parcel sorting machine according to claim 2, wherein, Step S43 includes: S431: Set the glare adjustment step, the sharpness adjustment step, and the completeness adjustment step; S432: If the high-glare image proportion is greater than the preset proportion threshold, reduce the glare interference degree score weight according to the glare adjustment step to obtain the adjusted glare interference degree score weight; S433: According to the initial proportion of the sharpness score weight and the completeness score weight, and the sharpness adjustment step and the completeness adjustment step, calculate the sharpness score weight increment and the completeness score weight increment; S434: According to the sharpness score weight increment and the completeness score weight increment, increase the sharpness score weight and the completeness score weight respectively to obtain the adjusted sharpness score weight and the adjusted completeness score weight, so that the sum of the adjusted image quality evaluation model weights is 1.

4. A data trace method for a parcel sorting machine according to claim 3, wherein, Step S433 includes: S4331: According to the initial proportion of the sharpness score weight and the completeness score weight, calculate the sharpness adjustment coefficient and the completeness adjustment coefficient, wherein the sharpness adjustment coefficient is equal to the initial value of the sharpness score weight divided by the sharpness adjustment step, and the completeness adjustment coefficient is equal to the initial value of the completeness score weight divided by the completeness adjustment step; S4332: calculating a sharpness score weight increment and a completeness score weight increment according to the reflection adjustment step size and the sharpness adjustment coefficient and the completeness adjustment coefficient, wherein the sharpness score weight increment is equal to the reflection adjustment step size multiplied by the sharpness adjustment coefficient, and the completeness score weight increment is equal to the reflection adjustment step size multiplied by the completeness adjustment coefficient.

5. A data tracking method for a parcel sorting machine according to claim 1, wherein, Step S62 comprises: S621: calculating a target exposure time adjustment amount according to the image sharpness score and using linear mapping in a preset exposure time adjustment range, wherein the target exposure time adjustment amount is negatively correlated with the image sharpness score; S622: calculating a target gain parameter adjustment amount according to the image reflection interference degree score and using non-linear mapping in a preset gain parameter adjustment range, wherein the target gain parameter adjustment amount is negatively correlated with the image reflection interference degree score, and when the image reflection interference degree score exceeds a preset reflection threshold, the absolute value of the target gain parameter adjustment amount exponentially increases; S623: adding the current exposure time of the decoder to the target exposure time adjustment amount to obtain an adjusted exposure time, and adding the current gain parameter of the decoder to the target gain parameter adjustment amount to obtain an adjusted gain parameter, and obtaining an adjusted decoding parameter by using the adjusted exposure time and the adjusted gain parameter.

6. A data trace method for a parcel sorting machine according to claim 5, wherein, Step S623 comprises: S6231: judging whether the sum of the current exposure time of the decoder and the exposure time adjustment amount exceeds a preset exposure time range according to the exposure time adjustment amount, and if so, adjusting the exposure time of the decoder to the boundary value of the preset exposure time range, otherwise, taking the sum of the current exposure time of the decoder and the exposure time adjustment amount as the adjusted exposure time; S6232: judging whether the sum of the current gain parameter of the decoder and the gain parameter adjustment amount exceeds a preset gain parameter range according to the gain parameter adjustment amount, and if so, adjusting the gain parameter of the decoder to the boundary value of the preset gain parameter range, otherwise, taking the sum of the current gain parameter of the decoder and the gain parameter adjustment amount as the adjusted gain parameter; S6233: taking the adjusted exposure time and the adjusted gain parameter as the adjusted decoding parameter.

7. A data tracing apparatus for a parcel sorting machine, characterized in that, The device comprises: a barcode scanning module for acquiring a plurality of barcode images by using a multi-angle barcode scanning device in real time; a parameter initialization module for initializing the weight of the image quality evaluation model; a decoding monitoring module for decoding the plurality of barcode images and monitoring the decoding success rate of the barcode decoding in real time, and if the decoding success rate is less than a preset threshold, analyzing the image quality features of the recent decoding failed barcode images and obtaining the image quality features by evaluation; a dynamic weight adjustment module for dynamically adjusting the weight of the image quality evaluation model according to the image quality features of the decoding failed images to obtain an adjusted image quality evaluation model; Image optimization module: for using the adjusted image quality assessment model to calculate the comprehensive quality score of each barcode image that failed to decode, and selecting the barcode image with the highest comprehensive quality score as the optimal image; Data processing and uploading module: for decoding the optimal image, associating the barcode information with the package information if the decoding is successful, and uploading to the data tracing system.

Citation Information

Patent Citations

  • Bar code automatic identification method and system, storage medium and electronic equipment

    CN118396009A

  • Bar code automatic identification method

    CN119272786A