CN-122023819-A - Tobacco fertilizer ex-warehouse continuous image counting method and system
Abstract
The invention discloses a tobacco fertilizer warehouse-out continuous image counting method and system. The method comprises the steps of obtaining a target image and determining first boundary data, determining a reference image of a tobacco fertilizer packaging bag, retrieving a similar threshold image in the target image or a preset size frame, detecting and identifying obstacles in a preset boundary range, fitting and restoring to obtain third boundary data according to the types of the obstacles, comparing the similarity of the third boundary data with the second boundary data in the reference image to judge the usability of the image, distributing identification codes through cosine distances of adjacent images, storing original third boundary data for each identification code, collecting and fitting and restoring the verification target image when the number of images with the same identification codes reaches a preset verification number threshold value, and comparing and verifying the difference between the third boundary data and the original third boundary data. The invention obviously improves the automation level and reliability of the ex-warehouse counting of different types of tobacco fertilizers, and is suitable for intelligent management of tobacco supply chains.
Inventors
- SHEN WANG
- HE XIANGCHUN
- WANG HAIJUN
- XIAO HEYOU
- ZENG NA
- LIU LINQIANG
- LIN BEI
- DING HONG
- YAO XUEMEI
Assignees
- 湖南省烟草公司邵阳市公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251223
Claims (8)
- 1. The continuous image counting method for the tobacco fertilizer delivery is characterized by comprising the following steps of: acquiring at least one target image, and determining first boundary data of the target image; Determining a reference image of a tobacco fertilizer packaging bag, retrieving whether a target image exists or whether a similar threshold image of the target image in a preset size frame exists or not from the reference image, and determining whether an identification obstacle exists or not in a preset boundary range of the target image, wherein the identification obstacle comprises pollution of tobacco leaves in a tobacco storage area to the fertilizer packaging bag and surface dirt or fold damage caused by fertilizer transportation; if the similarity is smaller than a preset similarity threshold, determining that the target image is an unavailable counting image; if the similarity is not smaller than a preset similarity threshold, determining that the target image is an available counting image; according to the sequence of the target image acquisition, calculating cosine distance values between two adjacent target images, and if the cosine distance values are smaller than a preset interval threshold value, distributing the same identification codes for the two adjacent target images; Storing corresponding original third boundary data for each identification code; For each target image with an identification code, taking an image of the target image at a next time stamp position as a verification target image, wherein the image of the next time stamp position is a next acquired image of the target image in a time sequence; Based on the verification target image, whether the recognition obstacle exists or not is determined again, and fitting and restoring are carried out to obtain verification third boundary data; Comparing the difference between the verification third boundary data and the original third boundary data, and if the difference is not smaller than a verification difference threshold, adjusting the preset similarity threshold and re-executing boundary data fitting, wherein the verification difference threshold is a preset boundary data difference allowable upper limit value; determining the number of tobacco fertilizer packaging bags based on the verified boundary data; acquiring a plurality of target images with the same identification code and acquisition time of each target image; And determining the residence time of the tobacco fertilizer packaging bag at the image acquisition position based on the acquisition time of each target image.
- 2. The method according to claim 1, wherein after comparing the difference between the verified third boundary data and the original third boundary data, if the difference is not less than a verified difference threshold, the step of feedback adjustment is performed: inputting the difference into an adaptive filter, and adjusting the preset similarity threshold; If the difference is smaller than a verification difference threshold, confirming that the original third boundary data is valid; and if the difference is not smaller than a verification difference threshold, updating the original third boundary data based on the verification third boundary data, and feeding the updated boundary data back to training parameters of the image counting model.
- 3. The tobacco fertilizer shipment continuous image counting method according to claim 1, characterized in that the size of the preset size frame is adjusted based on the standard size of the tobacco fertilizer packaging bag, the width of the preset size frame is 1.2 times of the standard width, and the height is 1.1 times of the standard height.
- 4. The tobacco fertilizer ex-warehouse continuous image counting method according to claim 1, wherein the similarity of the third boundary data and the second boundary data is compared, and a normalized cross-correlation algorithm is adopted to calculate a similarity value of a boundary profile.
- 5. The tobacco fertilizer shipment continuous image counting method according to claim 1, characterized in that the reference image is a pre-stored tobacco fertilizer package standard image, and the second boundary data is predefined boundary profile data of a tobacco fertilizer package in the reference image.
- 6. The tobacco fertiliser ex-warehouse continuous image counting method according to claim 1, characterized in that the image counting model is trained by: acquiring at least one target sample image and determining first boundary sample data of the target sample image; determining a reference sample image of a tobacco fertilizer packaging bag, retrieving whether the target sample image or a similar threshold sample image of the target sample image in a sample frame with a preset size exists in the reference sample image, and determining whether an identification obstacle sample exists in a preset boundary sample range of the target sample image; According to the type of the identified obstacle sample, fitting and restoring to obtain third boundary sample data of the similarity threshold sample image, and comparing similarity sample values of the third boundary sample data and second boundary sample data of the tobacco fertilizer packaging bag in the reference sample image; And if the similarity sample value is not smaller than a preset similarity threshold value, taking the target sample image as an input characteristic, taking the number of target sample objects corresponding to the at least one target sample image as an output characteristic, and inputting the number of target sample objects into the constructed deep learning network model to obtain the image counting model.
- 7. A tobacco fertiliser ex-warehouse image counting system, characterized in that the system comprises a data storage device and a counting device configured to perform the counting method according to any one of claims 1 to 6; The data storage device is used for storing the target image, the first boundary data, the second boundary data, the detection result of the identification obstacle, the image counting model and the identification code; The counting device includes: The image acquisition module is used for acquiring at least one target image; The boundary determining module is used for determining first boundary data of the target image; The system comprises a reference image of a tobacco fertilizer packaging bag, an obstacle detection module, a usable counting image mark, a matching and restoring module and a matching and restoring module, wherein the reference image is used for determining whether a target image exists or not or whether a similar threshold image of the target image in a preset size frame exists in the reference image, and determining whether an identification obstacle exists or not in a preset boundary range of the target image; the distance detection module is used for detecting whether a vertical distance smaller than a vertical distance threshold exists in a plurality of vertical distances between the second boundary data and the first boundary data or not if the available counter image mark is received; the counting model module is used for inputting the target image into a pre-trained image counting model if the vertical distance smaller than the vertical distance threshold value does not exist; the identification distribution module is used for calculating cosine distance values between two adjacent target images according to the sequence of the target image acquisition, and distributing the same identification codes for the two adjacent target images if the cosine distance values are smaller than a preset interval threshold value; The verification execution module is used for storing corresponding original third boundary data for each identification code, taking an image of the target image at a next time stamp position as a verification target image for each target image with the identification code, wherein the image of the next time stamp position is a next acquired image of the target image in a time sequence, restoring the verification third boundary data based on the fitting of the verification target image, comparing the difference between the verification third boundary data and the original third boundary data, and adjusting the preset similarity threshold if the difference is not smaller than a verification difference threshold; the quantity determining module is used for determining the quantity of the tobacco fertilizer packaging bags based on the verified boundary data; And the time analysis module is used for acquiring a plurality of target images with the same identification code and the acquisition time of each target image, and determining the residence time of the tobacco fertilizer packaging bag at the image acquisition position based on the acquisition time of each target image.
- 8. The counting system of claim 7, wherein the obstacle detection module comprises: the pollution identification sub-module is used for identifying a tobacco leaf pollution area through an image segmentation algorithm and carrying out characteristic matching based on a tobacco leaf characteristic database so as to remove pollution; a smudge detection sub-module for detecting a smudge area of the surface by texture analysis; the damage identification sub-module is used for identifying the fold damage area through an edge detection algorithm; and if any one of the pollution identification sub-module, the pollution detection sub-module or the breakage identification sub-module outputs a detection result, the obstacle detection module judges that an identification obstacle exists.
Description
Tobacco fertilizer ex-warehouse continuous image counting method and system Technical Field The invention relates to the technical field of machine vision, in particular to a tobacco fertilizer warehouse-out continuous image counting method and system. Background In tobacco industry supply chain management, automated counting of fertilizer delivery links is critical to accurate inventory control. Although the traditional image counting technology is applied to general object statistics, the traditional image counting technology is not optimized for the specificity of the tobacco storage environment, so that the applicability is limited in complex scenes. The tobacco storage area has a large number of scattered leaves, which are easy to be attached to the surface of the fertilizer packaging bag to form pollution, and meanwhile, jolt in the fertilizer transportation process is easy to cause the surface of the packaging bag to be dirty, wrinkled or damaged. These factors severely interfere with image recognition, causing boundary blurring and characteristic distortion, making it difficult for the existing counting method to distinguish effective packaging bags from interfering areas. The prior art lacks a systematic detection mechanism for tobacco specific barriers, can not effectively eliminate blade pollution interference, and is difficult to identify surface anomalies caused by transportation damage, so that the misjudgment rate of ex-warehouse counting is high, and a robust counting scheme specially designed for tobacco fertilizer scenes is needed. Aiming at the problems, the invention provides a tobacco fertilizer ex-warehouse continuous image counting method and a system. Disclosure of Invention Aiming at the problems, the invention provides a tobacco fertilizer ex-warehouse continuous image counting method and a system. In a first aspect of the invention, there is provided a tobacco fertiliser delivery continuous image counting method comprising the steps of: acquiring at least one target image, and determining first boundary data of the target image; Determining a reference image of a tobacco fertilizer packaging bag, retrieving whether a target image exists or whether a similar threshold image of the target image in a preset size frame exists or not from the reference image, and determining whether an identification obstacle exists or not in a preset boundary range of the target image, wherein the identification obstacle comprises pollution of tobacco leaves in a tobacco storage area to the fertilizer packaging bag and surface dirt or fold damage caused by fertilizer transportation; if the similarity is smaller than a preset similarity threshold, determining that the target image is an unavailable counting image; if the similarity is not smaller than a preset similarity threshold, determining that the target image is an available counting image; according to the sequence of the target image acquisition, calculating cosine distance values between two adjacent target images, and if the cosine distance values are smaller than a preset interval threshold value, distributing the same identification codes for the two adjacent target images; Storing corresponding original third boundary data for each identification code; For each target image with an identification code, taking an image of the target image at a next time stamp position as a verification target image, wherein the image of the next time stamp position is a next acquired image of the target image in a time sequence; Based on the verification target image, whether the recognition obstacle exists or not is determined again, and fitting and restoring are carried out to obtain verification third boundary data; Comparing the difference between the verification third boundary data and the original third boundary data, and if the difference is not smaller than a verification difference threshold, adjusting the preset similarity threshold and re-executing boundary data fitting, wherein the verification difference threshold is a preset boundary data difference allowable upper limit value; determining the number of tobacco fertilizer packaging bags based on the verified boundary data; acquiring a plurality of target images with the same identification code and acquisition time of each target image; And determining the residence time of the tobacco fertilizer packaging bag at the image acquisition position based on the acquisition time of each target image. As a preferred mode, after comparing the difference between the verified third boundary data and the original third boundary data, if the difference is not smaller than a verified difference threshold, executing a feedback adjustment step: inputting the difference into an adaptive filter, and adjusting the preset similarity threshold; If the difference is smaller than a verification difference threshold, confirming that the original third boundary data is valid; and if the difference is not smaller tha