A method and system for counting goods in and out of warehouse based on target tracking

By calculating the matching deviation and light descriptor between the particles and the matching template, the necessity of template update is judged, which solves the problem of too fast or untimely updating of the matching template in the existing technology, and improves the accuracy and stability of the goods in and out process.

CN118396527BActive Publication Date: 2024-09-06INSPUR SMART SUPPLY CHAIN TECH (SHANDONG) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410850808.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-09-06
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

In existing target tracking methods, matching templates are updated too quickly or not in time, resulting in positioning errors and light environment differences, which affect the accuracy of the goods in and out process.

Method used

By calculating the matching deviation and light descriptor between particles and matching templates, we can determine the necessity of template updates, avoid unnecessary template updates, and ensure the accuracy of positioning analysis.

Benefits of technology

Effectively prevent positioning errors, avoid template updates that are too fast or untimely, and improve the accuracy and stability of the goods in and out process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118396527B
    Figure CN118396527B
Patent Text Reader

Abstract

The present invention relates to the field of data processing technology, and in particular to a method and system for inventory counting of goods in and out of a warehouse based on target tracking. The method comprises the steps of: collecting a video of goods; obtaining a matching template, obtaining all particles in the current cargo image, and calculating the matching deviation between the particles and the matching template; if the minimum matching deviation is less than a preset deviation threshold, obtaining the target cargo area in the currently processed cargo image; if the minimum matching deviation is greater than the preset deviation threshold, calculating the necessity of updating the template; if the necessity of updating the template is greater than the preset necessity threshold, updating the matching template, and performing positioning analysis using the updated matching template; if the necessity of updating the template is less than the preset update necessity threshold, restarting the positioning analysis from the current cargo image; completing the positioning analysis of the target cargo area of ​​each frame of the cargo image to assist in the early warning of inventory counting of goods in and out of the warehouse. The accuracy of positioning tracking is improved by adaptive template updating.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method and system for counting goods in and out of a warehouse based on target tracking. Background Art

[0002] In order to control the process of goods entering and leaving the warehouse, it is necessary to locate and analyze the goods. The target tracking method can realize real-time tracking of goods, and the target tracking method can be used to locate and analyze the goods.

[0003] The existing patent application document CN107749068A shows a method for implementing real-time target tracking by using a particle filter and a perceptual hash algorithm. In this document, a hash algorithm is combined with a particle filter algorithm to implement target tracking. However, the method in this document uses the newly located target object area in each frame image to update the matching template. Since the matching template is used as a matching reference to match and locate the target area in each frame image, when there is more information of non-target objects in the matching template, it is easy to cause positioning errors due to the problem of the matching template. Since there may be a small amount of positioning deviation in the newly located target area with positioning tracking, if the newly located target area is directly used as a matching template, the information of non-target objects caused by these small amounts of positioning deviations will be introduced into the matching template, and these matching templates that introduce non-target object information will affect the matching positioning analysis of the next frame image, thereby causing the newly located target object area in the next frame image to be more inaccurate, and the matching template is updated again using the inaccurate newly located target object area. As the matching template is continuously updated, the errors in the matching template will continue to accumulate, so that there will be a large amount of information about non-target objects in the matching template, which will lead to large deviations in the positioning analysis performed using the matching template. Therefore, from the above description, it can be seen that the method in this file has the phenomenon of too fast updating of the matching template. At the same time, as the object moves, the light in the environment where the object is located will change greatly. If the matching template is not updated, the light environment in the matching template and the current frame image will be very different, resulting in the inability to locate the target area in the current frame image using the matching template, so the matching template needs to be updated. Therefore, how to improve the accuracy of target tracking by solving the matching template update problem has become an urgent problem to be solved. Summary of the invention

[0004] In order to solve the matching template update problem, the present invention provides a method and system for inventory counting of goods in and out of warehouse based on target tracking.

[0005] In a first aspect, the present invention provides a method for counting goods in and out of a warehouse based on target tracking, which adopts the following technical solution:

[0006] A method for counting goods in and out of a warehouse based on target tracking comprises the following steps:

[0007] Collect cargo video;

[0008] A preset matching template is obtained, and a target cargo area in a preset number of cargo image frames of the cargo video is obtained by using a target tracking algorithm based on the matching template; the next frame of the preset number of cargo image frames is used as the current cargo image, all particles in the current cargo image are obtained, and a matching deviation between the particles and the matching template is calculated;

[0009] If the minimum matching deviation is less than the preset deviation threshold, the target cargo area in the current cargo image is obtained; if the minimum matching deviation is greater than the preset deviation threshold, the light descriptor of the matching template and the target cargo area is calculated; the necessity of template update is calculated, and the necessity of template update is positively correlated with the monotonicity of the light descriptors of the target cargo area in all frames before the current cargo image in the frame sequence, and negatively correlated with the change amount of the light descriptors of the target cargo area in adjacent frames; if the necessity of template update is greater than the preset necessity threshold, the matching template is updated, and the updated matching template is used for positioning analysis, if the necessity of template update is less than the preset update necessity threshold, the positioning analysis is restarted from the current cargo image; the positioning analysis of the target cargo area of ​​each frame of the cargo image is completed to assist in the early warning of the inventory count of goods in and out of the warehouse.

[0010] The present invention accurately grasps the matching difference between particles and matching templates through matching deviation, so as to find problems in positioning early and prevent the occurrence of a large number of positioning errors. Further, when the matching difference is large, the template update is analyzed instead of real-time update to prevent the template from updating too quickly and introducing too much non-target information, thereby affecting the accuracy of positioning; at the same time, when the matching difference is large, the template update is analyzed to prevent the positioning deviation caused by untimely template update. Further, when the matching deviation is large, the template is not directly updated, but the cause of the deviation is further analyzed to prevent the phenomenon that the positioning error cannot be reduced by only updating the template. Further, when the matching deviation is large, the light descriptor is calculated to accurately describe the light brightness and light distribution, providing a basis for subsequent analysis of the cause of the matching deviation. Further, when the matching deviation is large, the necessity of template update is calculated to accurately determine the cause of the large matching deviation, providing a basis for subsequent accurate adjustment.

[0011] Preferably, the template update necessity satisfies the relationship:

[0012] ;

[0013] Arrange the data of one dimension in the light descriptors of all target cargo areas in frame order to obtain the light sequence of that dimension. Represents the slope of the i-th data in the ray sequence of the j-th dimension, represents the number of data in the ray sequence of the jth dimension, W represents the number of dimensions in the ray descriptor, They represent the number of data with slopes less than 0 and greater than 0 in the sliding window centered on the rth data in the ray sequence of the jth dimension, respectively. represents the preset length of the sliding window, represents the correlation of light changes between the target cargo area and the qth adjacent area in the cargo image of the tth frame, T represents the number of frames before the current cargo image, and X represents the necessity of template update.

[0014] The present invention accurately describes the changes in the light of the target cargo area of ​​all frames in the frame sequence by introducing the slope and the number of slopes greater than and less than 0 when calculating the necessity of template update. The changes in the light of the target cargo area of ​​all frames in the frame sequence can reflect whether the matching template has a lack of update, thereby providing a basis for timely template update. Furthermore, by introducing a light change correlation index to further determine whether the light change situation can be accurately described, the index describing the light change situation is further optimized, providing a basis for accurately determining the template update situation.

[0015] Preferably, the method for obtaining the light variation correlation includes:

[0016] The absolute value of the Pearson correlation coefficient between the light variation of the target cargo area in the t-th frame cargo image and the light variation of the q-th adjacent area in the t-th frame cargo image is taken as the light variation correlation between the target cargo area and the q-th adjacent area in the t-th frame cargo image, the light variation of the target cargo area in the t-th frame cargo image is the difference between the light descriptors of the target cargo area in the t-th frame cargo image and the previous frame cargo image, and the light variation of the q-th adjacent area in the t-th frame cargo image is the difference between the light descriptors of the t-th frame cargo image and the q-th adjacent area of ​​the target cargo area in the previous frame cargo image.

[0017] The present invention further verifies whether the index describing the light change situation is accurate by performing a correlation analysis on the light change amount of the target cargo area and the light change amount of the adjacent area, thereby assisting in correcting the index describing the light change situation.

[0018] Preferably, the calculating of the light descriptor of the matching template and the target cargo area includes:

[0019] A comprehensive mean vector is obtained by weighted calculation of the mean vectors of all single Gaussian models in the Gaussian mixture model of the filtered image of the matching template, a comprehensive distribution discrete feature is obtained by weighted calculation of the means of all elements in the covariance matrix of all single Gaussian models, a ratio of the cumulative sum of the data on the positive diagonal line of the covariance matrix to the cumulative sum of the data on the anti-diagonal line is used as a distribution shape feature, all distribution shape features are weightedly calculated to obtain a comprehensive distribution shape feature, a vector consisting of the comprehensive mean vector, the comprehensive distribution shape feature and the comprehensive distribution discrete feature is used as a light descriptor of the matching template, and a light descriptor of the target cargo area is obtained.

[0020] The present invention accurately describes the light distribution characteristics by analyzing the distribution shape, distribution discreteness, etc., providing a basis for accurately analyzing the light quantity.

[0021] Preferably, the weights for each weighted calculation are the weights of each single Gaussian model.

[0022] Preferably, the calculating the matching deviation between the particle and the matching template comprises:

[0023] The HOG features of the particle and the HOG features of the matching template are obtained, and the cosine similarity between the matching template and the HOG features of the particle is recorded as the HOG feature similarity between the matching template and the particle; the color statistical histogram of each channel image of the particle is obtained, the color statistical histogram of all channels is used to form the color statistical histogram of the particle, the color statistical histogram of the matching template is obtained, and the cosine similarity between the color statistical histogram of the particle and the color statistical histogram of the matching template is used as the color feature similarity between the particle and the matching template, the average of the color feature similarity and the HOG feature similarity is used as the comprehensive matching similarity, and the difference between one and the comprehensive matching similarity is used as the matching deviation between the particle and the matching template.

[0024] The present invention performs image matching through the two features of HOG feature and color feature, thereby preventing the matching error phenomenon caused by less information in a single feature.

[0025] Preferably, obtaining the target cargo area in the current cargo image includes:

[0026] The particle corresponding to the minimum matching deviation between the current cargo image and the matching template is taken as the target cargo area in the current cargo image.

[0027] Preferably, updating the matching template and performing positioning analysis using the updated matching template includes:

[0028] The matching deviation between each particle in the current cargo image and the updated matching template is calculated, and the particle corresponding to the minimum matching deviation between the current cargo image and the updated matching template is taken as the target cargo area in the current cargo image.

[0029] In a second aspect, the present invention provides a cargo in-and-out inventory counting system based on target tracking, which adopts the following technical solution:

[0030] A cargo in-and-out inventory counting system based on target tracking comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the above-mentioned cargo in-and-out inventory counting method based on target tracking is implemented.

[0031] By adopting the above technical solution, the above-mentioned method for counting goods in and out of the warehouse based on target tracking is generated into a computer program and stored in the memory to be loaded and executed by the processor, so that a terminal device is made according to the memory and the processor for easy use.

[0032] The present invention has the following technical effects:

[0033] Through matching deviation, the matching difference between particles and matching templates can be accurately grasped, so as to find problems in positioning early and prevent a large number of positioning errors. Furthermore, when the matching difference is large, the template update is analyzed instead of real-time update to prevent the template from updating too quickly, which will introduce too much non-target information and affect the accuracy of positioning; at the same time, when the matching difference is large, the template update is analyzed to prevent the positioning deviation caused by untimely template update.

[0034] Furthermore, when the matching deviation is large, the template is not directly updated, but the cause of the deviation is further analyzed, thereby preventing the phenomenon that the positioning error cannot be reduced by only updating the template.

[0035] Furthermore, when the matching deviation is large, the light brightness and light distribution are accurately described by calculating the light descriptor, providing a basis for subsequent analysis of the causes of the matching deviation.

[0036] Furthermore, when the matching deviation is large, the necessity of template update is calculated to accurately determine the cause of the large matching deviation, providing a basis for subsequent accurate adjustments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.

[0038] Figure 1 The present invention is a flowchart of a method for counting goods in and out of a warehouse based on target tracking in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0040] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.

[0041] The embodiment of the present invention discloses a method for counting goods in and out of a warehouse based on target tracking, referring to Figure 1 , comprising steps S1 to S5:

[0042] S1: Collect cargo video.

[0043] Specifically, a camera is used to shoot a video of the goods in the storage platform, which is recorded as the goods video.

[0044] S2: obtaining a preset matching template, and obtaining a target cargo area in a preset number of cargo image frames of the cargo video using a target tracking algorithm based on the matching template; taking the next frame of the preset number of cargo image frames as the current cargo image, obtaining all particles in the current cargo image, and calculating a matching deviation between the particles and the matching template.

[0045] S20: obtaining a preset matching template, and obtaining a target cargo area in a preset number of cargo image frames of the cargo video using a target tracking algorithm based on the matching template.

[0046] It should be noted that, in traditional cases, the target cargo area is manually selected in the first frame image as a matching template, or the target cargo area is identified in the first frame image as a matching template by image recognition. Since the time interval between the first preset number of frame images and the first frame image is short, and the distance the cargo moves is short, the light difference between the first preset number of frame images and the first frame image is small. Therefore, the light difference between the matching template obtained in the first frame image and the first preset number of frame images is small, and therefore, when tracking and analyzing the first preset number of frame images, there is no need to update the matching template.

[0047] Optionally, as an example, the matching template setting method includes:

[0048] The first frame of the cargo image in the cargo video is identified and analyzed using an image recognition algorithm to obtain the target cargo area in the first frame of the cargo image, and the target cargo area in the first frame of the cargo image is used as a preset matching template. The image recognition algorithm used in this embodiment is the yoloV10 network.

[0049] It should be noted that before the yoloV10 network is used for recognition analysis, the yoloV10 network needs to be trained using a data set. The method for obtaining the data set used in this embodiment is: manually labeling the cargo area in the cargo image collected historically, and then using the set consisting of all labeled cargo images as a data set. The method of training the yoloV10 network using a data set is a prior art and will not be repeated here.

[0050] Optionally, as an example, obtaining the target cargo area in a preset number of cargo image frames of the cargo video using a target tracking algorithm based on the matching template includes:

[0051] Based on the matching template, the particle filter algorithm is used to sequentially locate and analyze a preset number of frames of cargo images in the cargo video to obtain the target cargo area in the preset number of frames of cargo images.

[0052] S21: taking the next frame of the preset number of frames of cargo image as the current cargo image, obtaining all particles in the current cargo image, and calculating the matching deviation between the particles and the matching template.

[0053] S210: taking the next frame of the preset number of frames of cargo image as the current cargo image, obtaining all particles in the current cargo image, and obtaining all particles in the current cargo image.

[0054] Optionally, as an example, get all particles in the current cargo image, including:

[0055] Use the particle filtering algorithm to obtain all particles in the current cargo image.

[0056] It should be noted that using a particle filter algorithm to obtain all particles in the current cargo image is an existing technology and will not be described in detail here.

[0057] S211: Calculate the matching deviation between the particle and the matching template.

[0058] Optionally, as an example, calculating the matching deviation between the particle and the matching template includes:

[0059] Obtain the directional gradient histogram (HOG feature) of the image area corresponding to the particle, and obtain the HOG feature of the matching template. Calculate the cosine similarity between the matching template and the HOG feature of the particle and record it as the HOG feature similarity between the matching template and the particle.

[0060] All color values ​​in each channel image of the image area corresponding to the particle are counted to obtain the color statistical histogram of each channel image of the particle, and the statistical histogram composed of the color statistical histograms of all channel images is recorded as the color statistical histogram of the particle, and the color statistical histogram of the matching template is obtained. The cosine similarity between the color statistical histogram of the matching template and the color statistical histogram of the particle is used as the color feature similarity between the matching template and the particle. The average of the HOG feature similarity and the color feature similarity between the matching template and the particle is used as the comprehensive matching similarity between the matching template and the particle. The difference between the one and the comprehensive matching similarity is used as the matching deviation between the matching template and the particle.

[0061] S3: If the minimum matching deviation is less than the preset deviation threshold, the target cargo area in the current cargo image is obtained.

[0062] In this embodiment, the preset deviation threshold is 0.4 as an example for description. Other embodiments may take other values, and this embodiment does not make any specific limitation.

[0063] As an example, a method for acquiring a target cargo area in a current cargo image includes:

[0064] The particle corresponding to the minimum matching deviation between the current cargo image and the matching template is taken as the target cargo area in the current cargo image.

[0065] S4: If the minimum matching deviation is greater than a preset deviation threshold, the light descriptors of the matching template and the target cargo area are calculated; the necessity of template update is calculated, and the necessity of template update is positively correlated with the monotonicity of the light descriptors of the target cargo area in all frames before the current cargo image in the frame sequence, and negatively correlated with the change amount of the light descriptors of the target cargo area in adjacent frames; if the necessity of template update is greater than the preset necessity threshold, the matching template is updated, and the updated matching template is used for positioning analysis; if the necessity of template update is less than the preset update necessity threshold, the positioning analysis is restarted from the current cargo image.

[0066] S40: If the minimum matching deviation is greater than a preset deviation threshold, calculating the light descriptor of the matching template and the target cargo area.

[0067] It should be noted that when the light difference between the matching template and the target cargo area in the cargo image is large, the matching positioning will be inaccurate. The cargo image of the current positioning analysis has not yet located the target cargo area, so it is impossible to analyze the light difference between the target cargo area in the cargo image of the current positioning analysis and the matching template. However, the acquisition time interval between the cargo image of the current positioning analysis and the cargo image of the previous frame is small, the cargo movement distance between the two frames is small, and the light environment difference between the cargo in the time period between the two frames is small. Therefore, the target cargo area in the previous frame cargo image can be used to reflect the target cargo area in the cargo image of the current positioning analysis. Therefore, it is necessary to control the update of the matching template according to the light difference between the matching template and the target cargo area in the previous frame cargo image. Therefore, it is necessary to first describe the light conditions in the matching template and the target cargo area in the previous frame cargo image.

[0068] It should be further explained that, since light does not have structural features, structural features are features of objects that reflect light. Therefore, in order to accurately analyze the light features, it is necessary to remove the target cargo area of ​​the cargo image and the structural texture in the matching template.

[0069] Preferably, as an example, calculating the light descriptor of the matching template and the light descriptor of the target cargo area includes:

[0070] First, texture information in the target object region of the matching template and the analyzed image is removed to obtain an adjusted image of the matching template and an adjusted image of the target object region of the analyzed image.

[0071] Using a preset window Gaussian filter to filter the matching template to obtain an adjusted image of the matching template;

[0072] Similarly, an adjusted image of the target object region of the analyzed image is obtained.

[0073] In this embodiment, the preset window size is Other embodiments can be adjusted according to actual needs.

[0074] Then, the light descriptor of the matching template and the light descriptor of the target object region of the analyzed image are calculated according to the adjusted image of the matching template and the adjusted image of the target object region of the analyzed image.

[0075] It should be noted that since the light characteristics are mainly reflected in the light brightness and the position distribution of pixels with different light brightness, the light characteristics can be described through these two aspects.

[0076] The adjusted image of the matching template is converted from the RGB color space to the HSV color space, and the Gaussian mixture model is fitted using the brightness value and pixel coordinates of the adjusted image of the matching template to obtain the weights of each single Gaussian model in the Gaussian mixture model as well as the mean vector and covariance matrix of each single Gaussian model. Based on the weights of all single Gaussian models as the weights of the mean vectors of each single Gaussian model, the weighted sum of the mean vectors of all single Gaussian models is obtained by weighted summing up the comprehensive mean vector, the cumulative sum of all elements on the positive diagonal of the covariance matrix of each single Gaussian model is divided by the cumulative sum of all elements on the anti-diagonal to obtain the distribution shape features of each single Gaussian model, the weights of each single Gaussian model are used as the weights of the distribution shape features of each single Gaussian model, the weighted sum of the distribution shape features of all single Gaussian models is obtained to obtain the comprehensive distribution shape features, the cumulative sum of all elements in the covariance matrix of each single Gaussian model is used as the distribution discrete features of each single Gaussian model, the weights of each single Gaussian model are used as the weights of the distribution discrete features of each single Gaussian model, and the weighted sum of the distribution discrete features of all single Gaussian models is obtained to obtain the comprehensive distribution discrete features. The vector composed of the comprehensive mean vector, the comprehensive distribution shape feature and the comprehensive distribution discrete feature is recorded as the light descriptor of the matching template. Similarly, the light descriptor of the target cargo area in the analyzed image is obtained.

[0077] It should be noted that the comprehensive mean vector in the light descriptor can reflect the overall brightness of the light and the concentrated position of the pixels of most brightness. The comprehensive distribution shape feature and comprehensive distribution discreteness feature in the light descriptor respectively reflect the distribution shape of the concentrated brightness data and the brightness difference of different pixels. Therefore, the light descriptor can more comprehensively reflect the light characteristics.

[0078] S41: Calculate template update necessity.

[0079] It should be noted that sometimes the matching deviation is relatively large, which does not mean that the template needs to be updated, but may be caused by positioning errors. Therefore, the factors causing the large matching deviation are analyzed. If the factor causing the large matching deviation is that the template needs to be updated, the positioning accuracy is increased by updating the template. If the factor causing the large matching deviation is positioning error, the target goods need to be identified to reacquire the target goods area. Since the movement of the goods is continuously changing, and the image acquisition interval in adjacent frames is small, the spatial position difference of the goods in adjacent frames is small, and therefore the light difference in the space where the goods are located in adjacent frames is small. Therefore, the light of the target goods area in adjacent frames is gradual, not sudden. At the same time, positioning errors may misjudge any area in the goods image as the target goods area, so the position change of the target goods area in the time sequence obtained when the positioning error occurs does not have a gradual feature, so when the positioning error occurs, the light change of the target goods area in adjacent frames has a sudden feature.

[0080] Preferably, as an example, calculating the necessity of template update includes:

[0081]

[0082] The sequence obtained by arranging the data of one dimension in the light descriptors of all target cargo areas in frame order is recorded as the light sequence of this dimension. It represents the slope of the i-th data in the light sequence of the j-th dimension. The larger the value is, the greater the light change of the target cargo area in adjacent frames described by the data of this dimension is. Therefore, the light change of the target cargo area does not have a gradual feature in the frame sequence, but has a sudden change feature. Therefore, the reason for the large matching deviation is that the possibility of positioning error is greater, and the possibility of untimely template update is smaller. represents the number of data in the ray sequence of the jth dimension, and W represents the number of dimensions in the ray descriptor. It represents the number of data with a slope less than 0 in the sliding window centered on the rth data in the ray sequence of the jth dimension. It represents the number of data with a slope greater than 0 in the sliding window centered on the rth data in the ray sequence of the jth dimension. It reflects the monotonic change of data in the sliding window centered on the rth data in the light sequence of the jth dimension. The larger the value, the greater the degree of monotonic change of data in the sliding window centered on the rth data in the light sequence of the jth dimension. Since light is generally a process of gradually changing or gradually dimming, it will not be bright and dark at the same time, so light generally changes monotonically. Therefore, when only the light in the target cargo area changes monotonically, it means that the reason for the large matching deviation is more likely to be the untimely template update, and the possibility of positioning error is smaller. L represents the preset length of the sliding window. This embodiment takes L as 21 as an example for description. Other embodiments can take other values, and this embodiment does not make specific restrictions. max() represents the maximum value acquisition function. Represents the correlation of light changes between the target cargo area and the qth adjacent area in the t-th frame cargo image, the light change correlation is the absolute value of the Pearson correlation coefficient of the light change amount of the target cargo area in the t-th frame cargo image and the light change amount of the qth adjacent area in the t-th frame cargo image. The light change correlation of the target cargo area in the t-th frame cargo image is the difference between the light descriptors of the target cargo area in the t-th frame cargo image and the previous frame cargo image, the light change amount of the qth adjacent area in the t-th frame cargo image is the difference between the light descriptors of the target cargo area in the t-th frame cargo image and the previous frame cargo image. Since the light changes in local areas are correlated, the light changes in the target cargo area in adjacent frames are correlated with the light changes in adjacent areas, and thus it can be used to describe the characteristics of light changes. Further verification can more accurately reflect the main factors causing matching differences, so as to more accurately obtain the necessity of updating the matching template. norm() represents the linear normalization method, T represents the number of frames before the current cargo image, and X represents the necessity of template update.

[0083] Furthermore, the above embodiments involve adjacent areas of the target cargo area. The following is a description of determining the adjacent areas of the target cargo area, including:

[0084] Take the target cargo area as the basic unit and obtain it with the target cargo area as the center basic units, and the other basic units except the basic unit at the center position among all the basic units obtained are used as the adjacent areas of the target cargo area.

[0085] S42: If the template update necessity is greater than a preset necessity threshold, the matching template is updated, and the updated matching template is used for positioning analysis.

[0086] S420: If the template update necessity is greater than a preset necessity threshold, the matching template is updated.

[0087] It should be noted that the greater the necessity of template update, the more likely the matching difference is caused by untimely template update, and thus the accuracy of matching positioning needs to be improved by template update.

[0088] Optionally, as an example, the necessity threshold is preset, including:

[0089] This embodiment is described by taking the preset necessity threshold of 0.7 as an example. Other embodiments may take other values, and this embodiment does not make any specific limitation.

[0090] Optionally, as an example, the matching template is updated, including:

[0091] The target cargo area in the cargo image of the previous frame of the current cargo image is used as the updated matching template.

[0092] S421: Perform positioning analysis using the updated matching template.

[0093] Optionally, as an example, positioning analysis is performed using the updated matching template, including: calculating the matching deviation between each particle in the current cargo image and the updated matching template, and taking the particle in the current cargo image corresponding to the minimum matching deviation with the updated matching template as the target cargo area in the current cargo image.

[0094] S43: If the template update necessity is less than the preset update necessity threshold, restart the positioning analysis from the current cargo image.

[0095] It should be noted that the less necessary the template update is, the more likely the matching difference is not caused by untimely template update, but by positioning errors. In other words, the currently located target cargo area is not the location of the target cargo, and the target cargo area needs to be re-identified in the cargo image.

[0096] Optionally, as an example, restarting the positioning analysis from the current cargo image includes: restarting the positioning analysis from the current cargo image according to the method in steps S2-S42.

[0097] S5: Complete the positioning analysis of the target cargo area in each frame of cargo image to assist in the inventory warning of cargo in and out of the warehouse.

[0098] S50: completing the positioning analysis of the target cargo area of ​​each frame of cargo image.

[0099] Optionally, as an example, completing the positioning analysis of the target cargo area of ​​each cargo image frame includes:

[0100] According to the method in steps S2-S4, the target cargo area in each frame of cargo image is obtained through positioning analysis.

[0101] S51: To assist in the inventory and early warning of goods entering and leaving the warehouse.

[0102] The preset activity range corresponding to the target cargo is obtained, and an early warning is issued when the target cargo area in each frame of cargo image exceeds the preset activity range.

[0103] It should be noted that the preset activity range is the activity range previously set for the target goods according to the pledge status of the target goods, and this range has been set in advance.

[0104] An embodiment of the present invention also discloses a cargo in-and-out inventory counting system based on target tracking, comprising a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a cargo in-and-out inventory counting method based on target tracking according to the present invention is implemented.

[0105] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.

[0106] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory, a dynamic random access memory, a static random access memory, an enhanced dynamic random access memory, a high bandwidth memory, a hybrid storage cube, etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.

[0107] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.

[0108] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for counting goods in and out of warehouse based on target tracking, characterized in that: Includes steps: Collect cargo video; A preset matching template is obtained, and a target cargo area in a preset number of cargo image frames of a cargo video is obtained by using a target tracking algorithm based on the matching template; the next frame of the preset number of cargo image frames is used as a current cargo image, all particles in the current cargo image are obtained, and a matching deviation between the particles and the matching template is calculated. The method for obtaining the matching deviation includes: Obtain the HOG features of the particle and the HOG features of the matching template, and record the cosine similarity between the matching template and the HOG features of the particle as the HOG feature similarity between the matching template and the particle; obtain the color statistical histogram of each channel image of the particle, form the color statistical histogram of the particle with the color statistical histogram of all channels, obtain the color statistical histogram of the matching template, and use the cosine similarity between the color statistical histogram of the particle and the color statistical histogram of the matching template as the color feature similarity between the particle and the matching template, use the average of the color feature similarity and the HOG feature similarity as the comprehensive matching similarity, and use the difference between one and the comprehensive matching similarity as the matching deviation between the particle and the matching template; If the minimum matching deviation is less than the preset deviation threshold, the target cargo area in the current cargo image is obtained; if the minimum matching deviation is greater than the preset deviation threshold, the light descriptor of the matching template and the target cargo area is calculated, and the method for obtaining the light descriptor includes: A comprehensive mean vector is obtained by weighted calculation of the mean vectors of all single Gaussian models in the Gaussian mixture model of the filtered image of the matching template, a comprehensive distribution discrete feature is obtained by weighted calculation of the means of all elements in the covariance matrix of all single Gaussian models, a distribution shape feature is taken as the ratio of the cumulative sum of the data on the positive diagonal line of the covariance matrix to the cumulative sum of the data on the anti-diagonal line, all the distribution shape features are weightedly calculated to obtain a comprehensive distribution shape feature, a vector consisting of the comprehensive mean vector, the comprehensive distribution shape feature and the comprehensive distribution discrete feature is taken as the light descriptor of the matching template, and a light descriptor of the target cargo area is obtained; The template update necessity is calculated, and the template update necessity satisfies the relationship: ; Arrange the data of one dimension in the light descriptors of all target cargo areas in frame order to obtain the light sequence of that dimension. Represents the slope of the i-th data in the ray sequence of the j-th dimension, represents the number of data in the ray sequence of the jth dimension, W represents the number of dimensions in the ray descriptor, They represent the number of data with slopes less than 0 and greater than 0 in the sliding window centered on the rth data in the ray sequence of the jth dimension, respectively. represents the preset length of the sliding window, Indicates the target cargo area in the cargo image of the tth frame and the The correlation of light changes in adjacent areas, Indicates the number of frames before the current cargo image. Indicates the necessity of template update; If the necessity of template update is greater than the preset necessity threshold, the matching template is updated and the updated matching template is used for positioning analysis. If the necessity of template update is less than the preset update necessity threshold, the positioning analysis is restarted from the current cargo image. The positioning analysis of the target cargo area of ​​each frame of cargo image is completed to assist in the inventory warning of cargo in and out of the warehouse.

2. A method for counting goods in and out of a warehouse based on target tracking according to claim 1, characterized in that: The method for obtaining the light variation correlation includes: The absolute value of the Pearson correlation coefficient between the light variation of the target cargo area in the t-th frame cargo image and the light variation of the q-th adjacent area in the t-th frame cargo image is taken as the light variation correlation between the target cargo area and the q-th adjacent area in the t-th frame cargo image, the light variation of the target cargo area in the t-th frame cargo image is the difference between the light descriptors of the target cargo area in the t-th frame cargo image and the previous frame cargo image, and the light variation of the q-th adjacent area in the t-th frame cargo image is the difference between the light descriptors of the t-th frame cargo image and the q-th adjacent area of ​​the target cargo area in the previous frame cargo image.

3. The method for counting goods in and out of a warehouse based on target tracking according to claim 1 is characterized in that: The weight used in each weighted calculation is the weight of each single Gaussian model.

4. The method for counting goods in and out of a warehouse based on target tracking according to claim 1 is characterized in that: The step of obtaining the target cargo area in the current cargo image includes: The particle corresponding to the minimum matching deviation between the current cargo image and the matching template is taken as the target cargo area in the current cargo image.

5. The method for counting goods in and out of a warehouse based on target tracking according to claim 1 is characterized in that: The updating of the matching template and performing positioning analysis using the updated matching template includes: The matching deviation between each particle in the current cargo image and the updated matching template is calculated, and the particle corresponding to the minimum matching deviation between the current cargo image and the updated matching template is taken as the target cargo area in the current cargo image.

6. A cargo in-and-out inventory system based on target tracking, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a method for counting goods in and out of a warehouse based on target tracking according to any one of claims 1 to 5 is implemented.

Citation Information

Cited By

  • Batch cargo proofreading and early warning method and system for gate-type channel machine

    CN119671460A

  • Batch cargo proofreading and early warning method and system for portal channel machines

    CN119671460B