A high-speed sorting method and system based on multi-target image recognition
Patent Information
- Application Number
- CN202410824623.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-06-25
AI Technical Summary
In high-speed sorting scenarios, traditional sorting methods have insufficient real-time performance and data conflicts and confusion caused by multiple packages entering the scanning area at the same time, resulting in recognition delays and sorting errors.
Using a method based on multi-target image recognition, the Canny edge detection algorithm is used to calculate the image sharpness score, select high-quality images for barcode recognition, and build an adaptive barcode recognition network and mask network, combined with the Siamese network for target tracking and pixel segmentation. Ensure independent information handling for each package.
It improves the accuracy and real-time performance of barcode recognition, solves the problem of data conflicts when multiple packages enter the scanning area at the same time, and ensures the efficiency and accuracy of the sorting system.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of parcel sorting, and in particular to a high-speed sorting method and system based on multi-target image recognition. Background Art
[0002] Intelligent high-speed sorting refers to the use of automated equipment and artificial intelligence algorithms in modern logistics systems to achieve high-speed and accurate sorting of items. The sorting process involves the identification, positioning, classification and destination allocation of items, aiming to improve sorting efficiency and save labor costs.
[0003] Although traditional sorting methods have achieved certain results, they still have some obvious drawbacks in high-speed sorting scenarios. First, due to the high speed of package movement in high-speed sorting scenarios, traditional barcode recognition methods are not real-time enough, and recognition delays or recognition failures may occur when objects are moving at high speeds; second, when multiple items enter the scanning area at the same time, traditional image recognition methods cannot distinguish and track the data of each package, resulting in data conflicts and confusion, and sorting errors. Summary of the invention
[0004] In view of this, the present invention aims to provide a high-speed sorting method and system based on multi-target image recognition, aiming to solve the problems of data conflict and lack of real-time performance caused by multiple packages entering the scanning area at the same time during high-speed sorting in traditional sorting methods.
[0005] A high-speed sorting method based on multi-target image recognition comprises the following steps:
[0006] S1: Collect the original sorting images of the target package and calculate the clarity score, and select the original sorting image with the highest clarity score as the image to be processed;
[0007] S2: Using the YOLOv8 network as the benchmark network to build an adaptive barcode recognition network, including: designing an adaptive threshold calculation method to dynamically adjust the threshold according to the confidence score of the barcode recognition box; and then using the adaptive threshold to replace the fixed threshold in the YOLOv8 network to obtain an adaptive barcode recognition network;
[0008] Then, an adaptive barcode recognition network is used to recognize the parcel barcode in the processed image; then, the image is cropped, grayed, and binarized to obtain the binarized barcode area;
[0009] S3: Using a barcode parsing algorithm, decode the binarized barcode area; verify the decoding result, and if the verification is correct, output the decoding result;
[0010] S4: Construct a Siamese network based on the image difference feature to track the target package and mark the decoding result on the original sorting image; construct a mask network to perform pixel segmentation on the original sorting image and output a mask binary image; combine the mask binary image with the original sorting image marked with the decoding result to obtain independent package information;
[0011] S5: According to the independent package information, control the sorting system to sort the packages.
[0012] Furthermore, the step S1 includes: setting the camera to a continuous shooting mode, and using The network performs target detection. After detecting the target package, it continuously takes 5 images of the target package on the conveyor belt to obtain the original sorting image of the target package; calculates the clarity scores of the 5 original sorting images, and selects the original sorting image with the highest clarity score as the image to be processed.
[0013] Furthermore, in step S1, the target detection is calculated as follows:
[0014] ;
[0015] in, For the detected target package, for Network operations, For input Images from the web;
[0016] The clarity score is calculated as:
[0017] ;
[0018] ;
[0019] in, is the binary image after Canny calculation. The pixel value at are the horizontal and vertical coordinates, For the Canny edge detection operation, The original sorted image is at coordinates The pixel value at ; is the pixel value of the edge position of the original image after edge detection;
[0020] ;
[0021] ;
[0022] ;
[0023] ;
[0024] in, is the gradient of the image edge in the horizontal direction, is the convolution operation, is the gradient of the image edge in the ordinate direction, is the pixel gradient amplitude, is the pixel gradient direction, is the inverse tangent function;
[0025] ;
[0026] ;
[0027] ;
[0028] in, is the average gradient of the image, N is the number of edge pixels, is the gradient amplitude of the i-th edge pixel, i is the index of the number of edge pixels, is the image gradient variance; is the clarity score of the jth image in the original sorted image, j is the image index, is the image average gradient of the jth image in the original sorted image, is the image gradient variance of the jth image in the original sorted image, is the set of image average gradients of the original sorted image, is the set of image gradient variances of the original sorted image, To obtain the minimum value, To obtain the maximum value operation.
[0029] Most traditional image selection methods simply select the first or last image, or select images based on timestamps, so the quality of the selected images cannot be ensured; especially in high-speed motion scenes, due to the fast movement of objects, some images will be very blurred and are not suitable for barcode recognition; the present invention processes 5 consecutively shot images by using the Canny edge detection algorithm, and then calculates the gradient information of each image to obtain the image clarity score, which provides high-quality input data for subsequent barcode recognition, improves the accuracy of barcode recognition, shortens the recognition time, and thus improves the processing speed of the entire sorting system.
[0030] Furthermore, the step S2 includes:
[0031] S21: Design an adaptive threshold calculation method, the calculation method is:
[0032] ;
[0033] in, is the adaptive threshold of the u-th bounding box, u is the bounding box index, is the minimum threshold among all bounding boxes, is the maximum threshold of all bounding boxes, is the confidence score of the u-th bounding box;
[0034] Use adaptive thresholds to replace the fixed thresholds in the YOLOv8 network to obtain an adaptive barcode recognition network;
[0035] Use the adaptive barcode recognition network to identify the package barcode in the image to be processed. The calculation method is:
[0036] ;
[0037] in, is the identified barcode bounding box, For adaptive barcode recognition network operation, is the image to be processed;
[0038] The YOLOv8 network is the 8th generation network in the YOLO (You Only Look Once) series. In step S2, the present invention constructs a barcode recognition module using an adaptive threshold, and dynamically adjusts the threshold according to the confidence score of each bounding box (i.e., the confidence of the model in the presence of a barcode in the bounding box). When the confidence score of the bounding box is high, a higher threshold is used, and vice versa, a lower threshold is used, so that the model can more flexibly cope with different barcode scenarios. The traditional barcode recognition algorithm uses a fixed threshold to select the optimal bounding box from the candidate bounding boxes. The fixed threshold is highly dependent on data quality, and the recognition accuracy rate will decrease when the barcode quality is uneven. Compared with the traditional method, the improvement of the present invention in step S21 reduces the dependence of the barcode recognition algorithm on data quality, and at the same time, the YOLOv8 network is used for barcode recognition, which has good real-time performance and can ensure efficient barcode recognition in high-speed sorting scenarios.
[0039] S22: Crop the parcel barcode area located by each barcode bounding box. The calculation method of cropping is:
[0040] ;
[0041] in, is the cropped barcode area. From the horizontal axis to The range of the vertical axis is to scope;
[0042] The cropped barcode area is grayed and binarized to obtain the binarized barcode area. The calculation method is:
[0043] ;
[0044] ;
[0045] in, is the barcode area after grayscale. is the pixel value of the barcode area in the red channel, is the pixel value of the barcode area in the green channel, is the pixel value of the barcode area in the blue channel, The horizontal and vertical coordinates of the barcode area after binarization are The pixel value at that time.
[0046] Step S22 effectively removes background noise and interference information by first cropping the barcode area and then graying and binarizing it, thereby improving the accuracy and robustness of barcode recognition. At the same time, by setting a specific coordinate range, the barcode area is accurately separated from the entire image, reducing the complexity and computational complexity of subsequent processing.
[0047] Furthermore, the step S3 comprises:
[0048] S31: inputting the binarized barcode region into a barcode parsing algorithm, analyzing the barcode type and decoding it, and converting the binarized barcode region into a corresponding number or character sequence;
[0049] For EAN-13 barcode, it contains 13 digits, which are divided into 6 digits on the left, a separator in the middle, 6 digits on the right and a check digit at the end. The barcode parsing algorithm will parse from left to right according to the EAN-13 encoding rules, and convert the stripes and spaces of different widths into corresponding numbers.
[0050] For CODE128 barcode, it supports ASCII character set and defines different subsets by different start and end characters. The barcode parsing algorithm first identifies the start character, determines the currently used subset, and then converts the binary barcode area into the corresponding ASCII character according to the encoding rules of the subset.
[0051] S32: Use the check digit of the barcode to check the decoding result;
[0052] S33: If the verification is correct, the decoding result is output; if the verification fails, the decoding is repeated. When the verification fails three times in a row, the barcode is marked as an error and the barcode image is recorded.
[0053] Furthermore, the step S4 comprises:
[0054] S41: Construct a Siamese network based on image difference features. The calculation method is:
[0055] ;
[0056] ;
[0057] ;
[0058] ;
[0059] ;
[0060] in, is the difference image, is the first original sorted image, is the second original sorted image, is the change difference feature, For convolutional neural network operations, is the shared parameter of the convolutional neural network, is the first difference feature, is the second difference feature, is the image difference feature;
[0061] The first original sorting image is an original sorting image at any moment, and the second original sorting image is an original sorting image at another moment after any moment;
[0062] For the target package sorting scenario, the environmental background of each frame is highly similar, and the difference lies in whether there is a target package on the conveyor belt, the type of target package, and the number of target packages. Through image difference, the algorithm can eliminate the interference of the same part of each frame, reduce the amount of calculation, and learn richer feature representations, including not only the static appearance information of the target package, but also its dynamic change information, which improves the feature expression ability of the algorithm.
[0063] In addition, since the color of the target package is similar to the color of some conveyor belts, the difference will be magnified through image difference, which is more conducive to the model to extract the boundary information of the target package, providing conditions for subsequent target package tracking and masking;
[0064] S42: construct a mask network for pixel segmentation of the target package image and outputting a mask binary image, wherein the mask binary image has the same size as the first original sorted image and the second original sorted image, and the pixels of the target package in the mask binary image are marked as 1, and other pixels are marked as 0. The calculation method of the mask network is:
[0065] ;
[0066] ;
[0067] ;
[0068] in, is the image feature after upsampling, is the upsampling operation, is the mask probability, is the sigmoid function, are the horizontal and vertical coordinate values of the mask binary image, for The mask probability at is the horizontal and vertical coordinates;
[0069] The mask network accurately identifies the pixel-level position of the target package in the input image through upsampling operations and convolutional neural network processing, and generates an independent mask binary image for each target package. In the output mask binary image, the pixels of the target package are marked as 1, while other irrelevant pixels are marked as 0. This precise positioning capability provides an important basis for subsequent target package tracking tasks.
[0070] In terms of data utilization, the mask binary image output by the mask network has the same size as the first original sorted image and the second original sorted image, and can be easily integrated with the target tracking algorithm;
[0071] S43: Use the Siamese network to track the target package, obtain the approximate position of the target package in the current frame, and mark the decoding result obtained in step S3 on the second original sorting image;
[0072] S44: The image difference features output by the Siamese network As the input of the mask network, the second original sorted image is pixel-segmented through the mask network, and the masked binary image is output;
[0073] S45: Channel-superimpose the masked binary image and the second original sorting image annotated with the decoding result to obtain independent package information.
[0074] When multiple packages are identified, the system can mask the target packages except the first one with the help of the mask network, give priority to the first package, and avoid confusion and sorting errors caused by processing multiple package information at the same time;
[0075] The combination of mask network and target tracking effectively improves the system's processing effect on multiple packages appearing in the image at the same time; the mask network can accurately identify and mask other target packages except the first package, providing a reliable data basis for target tracking; and target tracking can accurately track the location and movement trajectory of the first package, providing accurate information support for the sorting system;
[0076] Compared with traditional methods, which identify targets in chronological order and send information to the sorting system, the accuracy and stability of object recognition may be affected by many factors in high-speed sorting scenarios. The target recognition algorithm may not be able to simultaneously and accurately identify all objects in every frame of the image. If a frame fails to identify some packages, sorting errors will occur.
[0077] Furthermore, the step S5 comprises:
[0078] S51: Sending the independent package information to the control system in chronological order;
[0079] When the system recognizes multiple packages, it does not sort them immediately based on the recognition order, but temporarily stores the information of all recognized packages; if a package is not recognized in the first frame but is successfully recognized in the subsequent frames, its information is updated based on the trajectory information of the target package and the upper and lower position relationship of the latest recognized package in the image, and it is added to the list of packages to be sorted;
[0080] S52: The control system sends instructions to the sorting machine according to the sorting area of each package;
[0081] S53: After receiving the instruction from the control system, the sorting machine performs the sorting operation.
[0082] The present invention also provides a high-speed sorting system based on multi-target image recognition, comprising:
[0083] Processing image selection module: collects the original sorting images of the target package and calculates the clarity score, and selects the original sorting image with the highest clarity score as the image to be processed;
[0084] Adaptive barcode recognition module: Build an adaptive barcode recognition network to recognize and cut the parcel barcode in the image to be processed, and then grayscale and binarize it to obtain the binarized barcode area;
[0085] Barcode parsing module: uses barcode parsing algorithm to decode the binary barcode area; verifies the decoding result, and outputs the decoding result if the verification is correct;
[0086] Target tracking and mask module: A Siamese network is constructed based on image difference features to track the target package and annotate the decoding results on the original sorting image; a mask network is constructed to perform pixel segmentation on the original sorting image and output a masked binary image; the masked binary image is combined with the original sorting image annotated with the decoding results to obtain independent package information.
[0087] Compared with the prior art, the advantages of the present invention are:
[0088] (1) In terms of the overall solution, the present invention proposes a clarity score and uses it to select images to be processed; on this basis, an adaptive barcode recognition network, target tracking and mask network are constructed to independently track the information of each package, and the sorting system is controlled to perform high-speed sorting based on this information, thereby improving the real-time performance of the high-speed sorting algorithm and solving the problem of data conflicts when multiple packages enter the scanning area at the same time, which in turn leads to sorting errors.
[0089] (2) In terms of algorithm improvement, the present invention combines the Canny edge detection algorithm with gradient calculation to obtain the clarity score of the image, which provides high-quality input data for subsequent barcode recognition and improves the accuracy of barcode recognition. In view of the characteristics of fast package movement and high real-time requirements in high-speed sorting scenarios, an adaptive barcode recognition network is constructed, which improves the recognition speed and accuracy by adaptively adjusting the threshold of the bounding box confidence, and solves the recognition delay problem of traditional barcode recognition methods in high-speed movement.
[0090] (3) Regarding multi-package data conflicts, the present invention proposes a target tracking and mask network to track the movement trajectory of each package in real time and generate an independent mask image for it, thereby accurately distinguishing the information of each package and avoiding data conflicts and confusion caused by multiple packages entering the scanning area at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] Figure 1 A schematic flow chart of a high-speed sorting method based on multi-target image recognition provided by the present invention.
[0092] Figure 2 This is a flow chart of the algorithm for image selection and barcode recognition provided by the present invention.
[0093] Figure 3 This is a flow chart of the image difference feature fusion algorithm provided by the present invention. DETAILED DESCRIPTION
[0094] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0095] Embodiment 1: A high-speed sorting method based on multi-target image recognition, such as Figure 1 As shown, the following steps are included:
[0096] S1: Collect the original sorting images of the target package and calculate the clarity score, and select the original sorting image with the highest clarity score as the image to be processed, such as Figure 2 As shown;
[0097] S11: Set the camera to continuous shooting mode. When the package passes through the conveyor belt, The network performs target detection. After detecting the target package, it continuously takes 5 images of the target package on the conveyor belt to obtain the original sorting image of the target package.
[0098] The calculation method of target detection is:
[0099] ;
[0100] in, For the detected target package, for Network operations, For input Images from the web;
[0101] S12: Calculate the clarity scores of the five original sorted images, and select the original sorted image with the highest clarity score as the image to be processed;
[0102] The clarity score is calculated as:
[0103] ;
[0104] ;
[0105] in, is the binary image after Canny calculation. The pixel value at are the horizontal and vertical coordinates, For the Canny edge detection operation, The original sorted image is at coordinates The pixel value at ; is the pixel value of the edge position of the original image after edge detection;
[0106] ;
[0107] ;
[0108] ;
[0109] ;
[0110] in, is the gradient of the image edge in the horizontal direction, is the convolution operation, is the gradient of the image edge in the ordinate direction, is the pixel gradient amplitude, is the pixel gradient direction, is the inverse tangent function;
[0111] ;
[0112] ;
[0113] ;
[0114] in, is the average gradient of the image, N is the number of edge pixels, is the gradient amplitude of the i-th edge pixel, i is the index of the number of edge pixels, is the image gradient variance; is the clarity score of the jth image in the original sorted image, j is the image index, is the image average gradient of the jth image in the original sorted image, is the image gradient variance of the jth image in the original sorted image, is the set of image average gradients of the original sorted image, is the set of image gradient variances of the original sorted image, To obtain the minimum value, To obtain the maximum value operation.
[0115] Most traditional image selection methods simply select the first or last image, or select images based on timestamps, so the quality of the selected images cannot be ensured; especially in high-speed motion scenes, due to the fast movement of objects, some images will be very blurred and are not suitable for barcode recognition; the present invention processes 5 consecutively shot images by using the Canny edge detection algorithm, and then calculates the gradient information of each image to obtain the image clarity score, which provides high-quality input data for subsequent barcode recognition, improves the accuracy of barcode recognition, shortens the recognition time, and thus improves the processing speed of the entire sorting system.
[0116] S2: Using the YOLOv8 network as the benchmark network to build an adaptive barcode recognition network, including: designing an adaptive threshold calculation method to dynamically adjust the threshold according to the confidence score of the barcode recognition box; and then using the adaptive threshold to replace the fixed threshold in the YOLOv8 network to obtain an adaptive barcode recognition network;
[0117] Then, an adaptive barcode recognition network is used to recognize the parcel barcode in the processed image; then, the image is cropped, grayed, and binarized to obtain the binarized barcode area;
[0118] S21: Design an adaptive threshold calculation method, the calculation method is:
[0119] ;
[0120] in, is the adaptive threshold of the u-th bounding box, u is the bounding box index, is the minimum threshold among all bounding boxes, is the maximum threshold of all bounding boxes, is the confidence score of the u-th bounding box;
[0121] Use adaptive thresholds to replace the fixed thresholds in the YOLOv8 network to obtain an adaptive barcode recognition network;
[0122] Use the adaptive barcode recognition network to identify the package barcode in the image to be processed. The calculation method is:
[0123] ;
[0124] in, is the identified barcode bounding box, For adaptive barcode recognition network operation, is the image to be processed;
[0125] The YOLOv8 network is the 8th generation network in the YOLO (You Only Look Once) series;
[0126] In step S2, the present invention constructs a barcode recognition module using an adaptive threshold, and dynamically adjusts the threshold according to the confidence score of each bounding box (i.e., the confidence of the model in the existence of the barcode in the bounding box). When the confidence score of the bounding box is high, a higher threshold is used, and vice versa, a lower threshold is used, so that the model can more flexibly cope with different barcode scenarios; while the traditional barcode recognition algorithm uses a fixed threshold to select the optimal bounding box from the candidate bounding boxes, and the fixed threshold is highly dependent on the data quality. For the situation where the barcode quality is uneven, the recognition accuracy rate will decrease; compared with the traditional method, the improvement of the present invention in step S21 reduces the dependence of the barcode recognition algorithm on the data quality, and at the same time adopts the YOLOv8 network for barcode recognition, which has good real-time performance and can ensure that efficient barcode recognition can be achieved in high-speed sorting scenarios;
[0127] S22: Crop the parcel barcode area located by each barcode bounding box. The calculation method of cropping is:
[0128] ;
[0129] in, is the cropped barcode area. From the horizontal axis to The range of the vertical axis is from to scope;
[0130] The cropped barcode area is grayed and binarized to obtain the binarized barcode area. The calculation method is:
[0131] ;
[0132] ;
[0133] in, is the barcode area after grayscale. is the pixel value of the barcode area in the red channel, is the pixel value of the barcode area in the green channel, is the pixel value of the barcode area in the blue channel, The horizontal and vertical coordinates of the barcode area after binarization are The pixel value at that time.
[0134] Step S22 effectively removes background noise and interference information by first cropping the barcode area and then graying and binarizing it, thereby improving the accuracy and robustness of barcode recognition. At the same time, by setting a specific coordinate range, the barcode area is accurately separated from the entire image, reducing the complexity and computational complexity of subsequent processing.
[0135] S3: Using a barcode parsing algorithm, decode the binarized barcode area; verify the decoding result, and if the verification is correct, output the decoding result;
[0136] S31: inputting the binarized barcode region into a barcode parsing algorithm, analyzing the barcode type and decoding it, and converting the binarized barcode region into a corresponding number or character sequence;
[0137] For EAN-13 barcode, it contains 13 digits, which are divided into 6 digits on the left, a separator in the middle, 6 digits on the right and a check digit at the end. The barcode parsing algorithm will parse from left to right according to the EAN-13 encoding rules, and convert the stripes and spaces of different widths into corresponding numbers.
[0138] For CODE128 barcode, it supports ASCII character set and defines different subsets by different start and end characters. The barcode parsing algorithm first identifies the start character, determines the currently used subset, and then converts the binary barcode area into the corresponding ASCII character according to the encoding rules of the subset.
[0139] S32: Use the check digit of the barcode to check the decoding result;
[0140] For example, the check digit of an EAN-13 barcode is calculated using the following steps:
[0141] Number the numbers in the barcode from right to left (excluding the check digit) to get a sequence of numbers;
[0142] Multiply the odd-numbered numbers by 3, and leave the even-numbered numbers unchanged;
[0143] Add all the numbers obtained in step 2 to get a sum;
[0144] Subtract the sum in step 3 from 10 and divide it by 10. The result is the check digit. If the remainder is 0, the check digit is 0. If the remainder is 10, the check digit is also 0 (because EAN-13 has only one check digit).
[0145] S33: If the verification is correct, the decoding result is output; if the verification fails, the decoding is repeated. When the verification fails three times in a row, the barcode is marked as an error and the barcode image is recorded.
[0146] S4: Construct a Siamese network based on the image difference feature to track the target package and mark the decoding result on the original sorting image; construct a mask network to perform pixel segmentation on the original sorting image and output a mask binary image; combine the mask binary image with the original sorting image marked with the decoding result to obtain independent package information;
[0147] S41: Construct a Siamese network by combining image difference features, such as Figure 3 As shown, the calculation method is:
[0148] ;
[0149] ;
[0150] ;
[0151] ;
[0152] ;
[0153] in, is the difference image, is the first original sorted image, is the second original sorted image, is the change difference feature, For convolutional neural network operations, is the shared parameter of the convolutional neural network, is the first difference feature, is the second difference feature, is the image difference feature;
[0154] The first original sorting image is an original sorting image at any moment, and the second original sorting image is an original sorting image at another moment after any moment;
[0155] For the target package sorting scenario, the environmental background of each frame is highly similar, and the difference lies in whether there is a target package on the conveyor belt, the type of target package, and the number of target packages. Through image difference, the algorithm can eliminate the interference of the same part of each frame, reduce the amount of calculation, and learn richer feature representations, including not only the static appearance information of the target package, but also its dynamic change information, which improves the feature expression ability of the algorithm.
[0156] In addition, since the color of the target package is similar to the color of some conveyor belts, the difference will be magnified through image difference, which is more conducive to the model to extract the boundary information of the target package, providing conditions for subsequent target package tracking and masking;
[0157] S42: construct a mask network for pixel segmentation of the target package image and outputting a mask binary image, wherein the mask binary image has the same size as the first original sorted image and the second original sorted image, and the pixels of the target package in the mask binary image are marked as 1, and other pixels are marked as 0. The calculation method of the mask network is:
[0158] ;
[0159] ;
[0160] ;
[0161] in, is the image feature after upsampling, is the upsampling operation, is the mask probability, is the sigmoid function, are the horizontal and vertical coordinate values of the mask binary image, for The mask probability at is the horizontal and vertical coordinates;
[0162] The mask network accurately identifies the pixel-level position of the target package in the input image through upsampling operations and convolutional neural network processing, and generates an independent mask binary image for each target package. In the output mask binary image, the pixels of the target package are marked as 1, while other irrelevant pixels are marked as 0. This precise positioning capability provides an important basis for subsequent target package tracking tasks.
[0163] In terms of data utilization, the mask binary image output by the mask network has the same size as the first original sorted image and the second original sorted image, and can be easily integrated with the target tracking algorithm;
[0164] S43: Use the Siamese network to track the target package, obtain the approximate position of the target package in the current frame, and mark the decoding result obtained in step S3 on the second original sorting image;
[0165] S44: The image difference features output by the Siamese network As the input of the mask network, the second original sorted image is pixel-segmented through the mask network to obtain a masked binary image;
[0166] S45: Channel-superimpose the masked binary image and the second original sorting image annotated with the decoding result to obtain independent package information.
[0167] The barcode decoding result, as part of the independent package information, corresponds one-to-one with the target package in the second original sorting image. When multiple packages are identified, the system can mask the target packages except the first package with the help of the mask network, give priority to the first package, and avoid confusion and sorting errors caused by processing multiple package information at the same time;
[0168] The combination of mask network and target tracking effectively improves the system's processing effect on multiple packages appearing in the image at the same time; the mask network can accurately identify and mask other target packages except the first package, providing a reliable data basis for target tracking; and target tracking can accurately track the location and movement trajectory of the first package, providing accurate information support for the sorting system;
[0169] Compared with traditional methods, which identify targets in chronological order and send information to the sorting system, the accuracy and stability of object recognition may be affected by many factors in high-speed sorting scenarios. The target recognition algorithm may not be able to simultaneously and accurately identify all objects in every frame of the image. If a frame fails to identify some packages, sorting errors will occur.
[0170] For example, suppose that on a high-speed sorting line, a camera captures an image containing target package a and target package b, where target package a appears in the picture first and target package b appears in the picture later; according to the logic of the line and the preset processing flow, the system needs to first identify the two target packages and then sort them to the correct location;
[0171] However, due to various reasons, such as uneven lighting and dirt on target package a, the target recognition algorithm only recognized target package b in this frame, but failed to recognize target package a;
[0172] If the sorting system only processes the target packages in the order in which they are identified, that is, "the first identified ones are sorted first", then in this example, the system will sort the target package b first and ignore the existence of the target package a, resulting in sorting errors.
[0173] S5: According to the independent package information, control the sorting system to sort the packages.
[0174] S51: Sending the independent package information to the control system in chronological order;
[0175] When the system recognizes multiple packages, it does not sort them immediately based on the recognition order, but temporarily stores the information of all recognized packages; if a package is not recognized in the first frame but is successfully recognized in the subsequent frames, its information is updated based on the trajectory information of the target package and the upper and lower position relationship of the latest recognized package in the image, and it is added to the list of packages to be sorted;
[0176] For example, if target package a is not recognized in the first frame but is successfully recognized in the subsequent frames, and target package b is successfully recognized in the first frame, then when target package a is successfully recognized, the system will update the information of target package a based on the position of target package a in the current frame, combined with the trajectory information provided by the target tracking algorithm and the upper and lower position relationship of target package a and target package b in the image; if target package a is closer to the assembly line exit than target package b, the information of target package a will be updated before target package b, and target package a will be sorted first;
[0177] S52: The control system sends instructions to the sorting machine according to the sorting area of each package;
[0178] S53: After receiving the instruction from the control system, the sorting machine performs the sorting operation.
[0179] The present invention is particularly suitable for scenarios with huge sorting volumes and high requirements for sorting speed. By introducing target tracking and mask networks, the present invention can significantly improve sorting efficiency, reduce sorting error rates, and ensure efficient, accurate, and reliable performance in high-speed, large-scale sorting tasks.
[0180] Embodiment 2:
[0181] A high-speed sorting system based on multi-target image recognition, used to implement the high-speed sorting method based on multi-target image recognition, comprising:
[0182] Processing image selection module: collects the original sorting images of the target package and calculates the clarity score, and selects the original sorting image with the highest clarity score as the image to be processed;
[0183] Adaptive barcode recognition module: Build an adaptive barcode recognition network to recognize and cut the parcel barcode in the image to be processed, and then grayscale and binarize it to obtain the binarized barcode area;
[0184] Barcode parsing module: uses barcode parsing algorithm to decode the binary barcode area; verifies the decoding result, and outputs the decoding result if the verification is correct;
[0185] Target tracking and mask module: Combine image difference features to build a Siamese network to track the target package and mark the decoding results on the original sorting image; build a mask network to perform pixel segmentation on the original sorting image and output a mask binary image; combine the mask binary image with the original sorting image marked with the decoding results to obtain independent package information;
[0186] Sorting control module: controls the sorting system to sort packages according to independent package information.
[0187] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. And the terms "including", "comprising" or any other variants thereof in this article are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "including a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0188] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0189] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A high-speed sorting method based on multi-target image recognition, characterized in that: The following steps are involved: S1: Collect the original sorting images of the target package and calculate the clarity score, and select the original sorting image with the highest clarity score as the image to be processed; S2: Using the YOLOv8 network as the benchmark network to build an adaptive barcode recognition network, including: designing an adaptive threshold calculation method to dynamically adjust the threshold according to the confidence score of the barcode recognition box; and then using the adaptive threshold to replace the fixed threshold in the YOLOv8 network to obtain an adaptive barcode recognition network; Then, an adaptive barcode recognition network is used to recognize the parcel barcode in the processed image; then, the image is cropped, grayed, and binarized to obtain the binarized barcode area; The step S2 comprises: S21: Design an adaptive threshold calculation method, the calculation method is: ; in, is the adaptive threshold of the u-th bounding box, u is the bounding box index, is the minimum threshold among all bounding boxes, is the maximum threshold of all bounding boxes, is the confidence score of the u-th bounding box; Use adaptive thresholds to replace the fixed thresholds in the YOLOv8 network to obtain an adaptive barcode recognition network; Use the adaptive barcode recognition network to identify the package barcode in the image to be processed. The calculation method is: ; in, is the identified barcode bounding box, For adaptive barcode recognition network operation, is the image to be processed; S22: Crop the parcel barcode area located by each barcode bounding box. The calculation method of cropping is: ; in, is the cropped barcode area. From the horizontal axis to The range of the vertical axis is from to scope; The cropped barcode area is grayed and binarized to obtain the binarized barcode area. The calculation method is: ; ; in, is the barcode area after grayscale. is the pixel value of the barcode area in the red channel, is the pixel value of the barcode area in the green channel, is the pixel value of the barcode area in the blue channel, The horizontal and vertical coordinates of the barcode area after binarization are The pixel value at time ; S3: Using a barcode parsing algorithm, decode the binarized barcode area; verify the decoding result, and if the verification is correct, output the decoding result; S4: Construct a Siamese network based on the image difference feature to track the target package and mark the decoding result on the original sorting image; construct a mask network to perform pixel segmentation on the original sorting image and output a mask binary image; combine the mask binary image with the original sorting image marked with the decoding result to obtain independent package information; The step S4 comprises: S41: Construct a Siamese network based on image difference features. The calculation method is: ; ; ; ; ; in, is the difference image, is the first original sorted image, is the second original sorted image, is the change difference feature, For convolutional neural network operations, is the shared parameter of the convolutional neural network, is the first difference feature, is the second difference feature, is the image difference feature; S42: construct a mask network for pixel segmentation of the target package image and outputting a mask binary image, wherein the mask binary image has the same size as the first original sorted image and the second original sorted image, and the pixels of the target package in the mask binary image are marked as 1, and other pixels are marked as 0. The calculation method of the mask network is: ; ; ; in, is the image feature after upsampling, is the upsampling operation, is the mask probability, is the sigmoid function, are the horizontal and vertical coordinate values of the mask binary image, for The mask probability at is the horizontal and vertical coordinates; S43: Use the Siamese network to track the target package, obtain the position of the target package in the current frame, and mark the decoding result obtained in step S3 on the second original sorting image; S44: The image difference features output by the Siamese network As the input of the mask network, the second original sorted image is pixel-segmented through the mask network, and the masked binary image is output; S45: Channel-superimposing the mask binary image and the second original sorting image with the decoding result annotation to obtain independent package information; S5: According to the independent package information, control the sorting system to sort the packages.
2. The high-speed sorting method based on multi-target image recognition according to claim 1 is characterized in that: The step S1 includes: setting the camera to a continuous shooting mode, and using The network performs target detection. After detecting the target package, it continuously takes 5 images of the target package on the conveyor belt to obtain the original sorting image of the target package; calculates the clarity scores of the 5 original sorting images, and selects the original sorting image with the highest clarity score as the image to be processed.
3. The high-speed sorting method based on multi-target image recognition according to claim 2 is characterized in that: In step S1, the calculation method of target detection is: ; in, For the detected target package, for Network operations, For input Images from the web; The clarity score is calculated as: ; ; in, is the binary image after Canny calculation. The pixel value at are the horizontal and vertical coordinates, For the Canny edge detection operation, The original sorted image is at coordinates The pixel value at ; is the pixel value of the edge position of the original image after edge detection; ; ; ; ; in, is the gradient of the image edge in the horizontal direction, is the convolution operation, is the gradient of the image edge in the ordinate direction, is the pixel gradient amplitude, is the pixel gradient direction, is the inverse tangent function; ; ; ; in, is the average gradient of the image, N is the number of edge pixels, is the gradient amplitude of the i-th edge pixel, i is the index of the number of edge pixels, is the image gradient variance; is the clarity score of the jth image in the original sorted image, j is the image index, is the image average gradient of the jth image in the original sorted image, is the image gradient variance of the jth image in the original sorted image, is the set of image average gradients of the original sorted image, is the set of image gradient variances of the original sorted image, To obtain the minimum value, To obtain the maximum value operation.
4. The high-speed sorting method based on multi-target image recognition according to claim 1 is characterized in that: The step S3 comprises: S31: inputting the binarized barcode region into a barcode parsing algorithm, analyzing the barcode type and decoding it, and converting the binarized barcode region into a corresponding number or character sequence; S32: Use the check digit of the barcode to check the decoding result; S33: If the verification is correct, the decoding result is output; if the verification fails, the decoding is repeated. When the verification fails three times in a row, the barcode is marked as an error and the barcode image is recorded.
5. The high-speed sorting method based on multi-target image recognition according to claim 1 is characterized in that: The step S5 comprises: S51: Sending the independent package information to the control system in chronological order; S52: The control system sends instructions to the sorting machine according to the sorting area of each package; S53: After receiving the instruction from the control system, the sorting machine performs the sorting operation.
6. A high-speed sorting system based on multi-target image recognition, to implement the high-speed sorting method based on multi-target image recognition as claimed in any one of claims 1 to 5, characterized in that: include: Processing image selection module: collects the original sorting images of the target package and calculates the clarity score, and selects the original sorting image with the highest clarity score as the image to be processed; Adaptive barcode recognition module: Build an adaptive barcode recognition network to recognize and cut the parcel barcode in the image to be processed, and then grayscale and binarize it to obtain the binarized barcode area; Barcode parsing module: uses barcode parsing algorithm to decode the binary barcode area; verifies the decoding result, and outputs the decoding result if the verification is correct; Target tracking and masking module: Construct a Siamese network based on image difference features to track the target package and mark the decoding results on the original sorting image; Construct a mask network to perform pixel segmentation on the original sorted image and output a masked binary image; Combine the masked binary image with the original sorting image annotated with the decoding results to obtain the independent package information; Sorting control module: controls the sorting system to sort packages according to independent package information.
Citation Information
Patent Citations
Image detection method and device and storage medium thereof
CN114118114A
Parcel deviation identification method and device, equipment and storage medium
CN114529863A
Vehicle tracking and license plate recognition joint detection method based on improved YOLOv8
CN116740124A
Cigarette tip two-dimensional code identification method
CN117556847A
Barcode Image Recognition System and Associated Method for Hand-Held Device
US20110309138A1
