Target statistics method, device, electronic device and computer-readable storage medium

Through video stream detection and association, cross-line actions are used to distinguish the state of the target object, and the accuracy and cost reduction of product statistics in smart refrigerators are achieved, which solves the shortcomings of RFID and static photography recognition in the prior art, and is suitable for multi-view and complex scenarios. .

CN118365672BActive Publication Date: 2025-01-07SHANGHAI SHANGTANG INFORMATION TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410368898.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2025-01-07
Estimated Expiration
2044-03-28

AI Technical Summary

Technical Problem

Existing smart refrigerators rely on RFID recognition or static photography when stating products, which has the problem of time-consuming and laborious identification and error-proneness. Especially in fuzzy situations, it may lead to multiple deductions, and traditional dynamic refrigerators cannot obtain complete product purchase trajectory and information. , especially when multiple products are blocked or complex purchasing behaviors cannot be accurately counted.

Method used

By obtaining video streams, target detection and association, determining the trajectory and status information of the target object, using cross-line actions to distinguish the status of the target object, achieving accurate statistics of the target object in the statistical area, reducing statistical costs, and a wide range of applicable scenarios.

Benefits of technology

It improves the statistical accuracy of the target object, reduces statistical cost, is highly applicable, and can merge trajectories from different perspectives, improves the situation of occlusion or blind spots, and improves the integrity of the target object tracking trajectory.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365672B_ABST
    Figure CN118365672B_ABST
Patent Text Reader

Abstract

The present application discloses a target statistics method, device, electronic device and computer-readable storage medium. The target statistics method includes: obtaining a video stream collected for a statistical area; the video stream includes multiple continuous video frames containing target objects; performing target detection and association on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction; based on the moving direction of the target object and whether there is a cross-line action in the trajectory of the target object, the state information of the target object is determined; the cross-line action is that the target object is in a preset area within the statistical area; based on the state information of the target object, the target objects in the statistical area are counted. In this embodiment, the state information of the target object is distinguished according to the cross-line action and the moving direction of the target object, so as to count the number of target objects corresponding to each preset state, thereby improving the statistical accuracy of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of target statistics, and in particular to a target statistics method, device, electronic device and computer-readable storage medium. Background Art

[0002] In the smart refrigerators that are currently common in the market and use face-scanning payment, RFID (Radio-Frequency Identification) is often required for product counting or relies on static photography to identify products. RFID identification of products is time-consuming and labor-intensive, and static photography to identify products is relatively prone to errors. Static photography to identify products not only has certain restrictions on the placement of product categories, but also requires ensuring the distance between similar products. In addition, if there is a vague and difficult to judge situation, solutions that sacrifice the interests of the buyer, such as multiple deductions, are often used to end the entire purchase process. In addition, traditional dynamic refrigerators cannot obtain complete product purchase trajectories and information. When multiple products are blocked from each other during the purchase process and some complex purchase behaviors are encountered, accurate statistics are usually not possible. Summary of the invention

[0003] The present application at least provides a target statistics method, device, electronic device and computer-readable storage medium.

[0004] The first aspect of the present application provides a target statistics method, comprising:

[0005] Acquire a video stream collected for the statistical area; the video stream includes multiple continuous video frames containing the target object;

[0006] Target detection and association are performed on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction;

[0007] Determine the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area;

[0008] Based on the state information of the target objects, statistics are collected on the target objects in the statistical area.

[0009] Therefore, in this embodiment, the target object's crossing-line action is searched in the target object's trajectory, and the state information of the target object is distinguished according to the target object's crossing-line action and the target object's moving direction, so as to count the number of target objects corresponding to each preset state according to the target object's state information, thereby improving the statistical accuracy of the target object; compared with counting target objects based on disposable RFID tags, the target statistical method of this technical solution reduces the statistical cost, has a wide range of applicable scenarios, and has strong applicability.

[0010] In some embodiments, the moving direction of the target object includes a first direction and a second direction, the first direction is a direction from the inside of the statistical area to the outside; the second direction is a direction from the outside of the statistical area to the inside; the state information includes a sold state and a selling state;

[0011] Based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object, the state information of the target object is determined, including:

[0012] In response to the moving direction of the target object being the first direction and the trajectory of the target object having a line-crossing action, determining that the state information of the target object is a sold state;

[0013] In response to the moving direction of the target object being the second direction and the trajectory of the target object having a line-crossing action, it is determined that the state information of the target object is a sale state.

[0014] Therefore, in this embodiment, if the target object's crossing-line action is screened out in the trajectory, and the target object has moved from the inside to the outside of the statistical area, then the target object has completed the action of taking out the goods from the box, and the status information of the target object is determined to be the sold status.

[0015] In some embodiments, the target statistics method further includes:

[0016] Based on the trajectories of the target objects respectively contained in the video streams collected from different perspectives of the statistical area, it is determined whether the target objects contained in different video streams are the same target;

[0017] In response to the target objects contained in different video streams being the same target, the trajectories of the target objects in the different video streams are merged.

[0018] Therefore, in this embodiment, the trajectories of the target objects in the statistical areas collected from different perspectives are compared to determine the same target object in different perspectives, so as to merge the trajectories of the same target object in different perspectives, thereby improving the situation where the complete trajectory cannot be obtained when the target object is blocked or in a blind spot under a single perspective, and improving the integrity of the target object tracking trajectory.

[0019] In some embodiments, each video frame in the video stream is numbered;

[0020] Based on the trajectories of the target objects respectively contained in the video streams collected from different perspectives of the statistical area, determining whether the target objects contained in different video streams are the same target includes:

[0021] Extracting the number of the video frame corresponding to the line-crossing action of the target object from the trajectory of the target object;

[0022] In response to a number difference between a number of a video frame corresponding to a line-crossing action of a target object in one video stream and a number of a video frame corresponding to a line-crossing action of a target object in another video stream being less than a preset difference, two target objects corresponding to the number difference are grouped into a candidate matching pair;

[0023] Based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, it is determined whether the two target objects in the candidate matching pair are the same target.

[0024] Therefore, in this embodiment, candidate matching pairs are screened out by the numbers of the video frames corresponding to the line-crossing actions of the two target objects, and then whether the two target objects are the same target is determined based on the trajectory similarity and recognition similarity corresponding to the candidate matching pairs. The target objects captured from different perspectives are deduplicated to improve the target statistical accuracy.

[0025] In some embodiments, the trajectory includes position information of a plurality of consecutive detection boxes containing the target object in the video frame.

[0026] Before the step of determining whether two target objects in a candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, the step further includes:

[0027] Determine the moving direction of the target object based on the position information of the detection box in each video frame in the trajectory of the target object;

[0028] Determining whether two target objects in a candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects includes:

[0029] In response to the two target objects in the candidate matching pair having the same moving direction, it is determined whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects.

[0030] Therefore, in this embodiment, the moving direction of the target object is determined by the trajectory of the target object. After comparing the moving directions of the two target objects, it is determined whether to calculate the trajectory similarity and recognition similarity of the candidate matching pair, thereby improving the recognition accuracy of the target object in the candidate matching pair.

[0031] In some embodiments, a method for determining the trajectory similarity between the trajectories of the target objects in the candidate matching pair includes:

[0032] The similarities between each detection frame in the trajectory of one target object in the candidate matching pair and each detection frame in the trajectory of the other target object are added and averaged to obtain the trajectory similarity corresponding to the candidate matching pair.

[0033] Therefore, in this embodiment, similarity comparison is performed between the detection frames of each target object in the candidate matching pair to determine the trajectory similarity of the candidate matching pair, thereby improving the accuracy of the trajectory similarity.

[0034] In some embodiments, determining whether two target objects in a candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects includes:

[0035] Based on the weighted sum of the trajectory similarity between the target objects in the candidate matching pairs and the recognition similarity between the target objects, the final similarity corresponding to the candidate matching pairs is obtained;

[0036] In response to the final similarity corresponding to the candidate matching pair exceeding the preset similarity, it is determined that the two target objects in the candidate matching pair are the same target.

[0037] Therefore, in this embodiment, the probability that two target objects in a candidate matching pair are the same target is determined based on the weighted sum of trajectory similarity and recognition similarity, and the two target objects in a candidate matching pair whose final similarity exceeds a preset similarity are determined to be the same target, thereby improving recognition accuracy.

[0038] In some embodiments, determining whether two target objects in a candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects further includes:

[0039] In response to the final similarities respectively corresponding to a first target object in a video stream and at least two second target objects in another video stream exceeding a preset similarity, a second target object matching the first target object is selected from the at least two second target objects based on the Hungarian algorithm and the first target object;

[0040] It is determined that the first target object and the screened second target object are the same target.

[0041] Therefore, in this embodiment, the recognition accuracy of the target objects in the candidate matching pairs is further improved by using the Hungarian algorithm to match the first target object to the second target object that is closest to the first target object.

[0042] In some embodiments, each video frame in the video stream has a number; the target statistical method further includes:

[0043] A target object whose last state information is a sold state and whose trajectory has a line-crossing action is selected from the video stream as a reference target; the number of the video frame corresponding to the line-crossing action of the reference target is greater than the number of the video frame corresponding to the line-crossing action of other target objects in the video stream;

[0044] Selecting a preset number of video frames after a video frame corresponding to a line-crossing action of a reference target in a video stream as candidate video frames;

[0045] Comparing the trajectory of the target object contained in a preset number of candidate video frames with the trajectory of the reference target for similarity, and determining the similarity between the trajectory of the target object and the trajectory of the reference target;

[0046] In response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, the state information of the target object is updated to a sold state.

[0047] Therefore, in this embodiment, the trajectory of the reference target close in time domain is compared with the trajectory of the target object to determine the state information of the target object without line crossing action, so as to improve the accuracy of the state information of the target object.

[0048] In some embodiments, comparing the trajectory of the target object contained in a preset number of candidate video frames with the trajectory of the reference target for similarity, and determining the similarity between the trajectory of the target object and the trajectory of the reference target, includes:

[0049] Based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the corresponding candidate video frame, the similarity between the trajectory of the target object and the trajectory of the reference target is determined.

[0050] Therefore, in this embodiment, through the physical distance between the detection frame of the target object in the same candidate video frame and the detection frame of the reference target, it is possible to determine whether the moving direction of the target object is consistent with the moving direction of the reference target, as well as the distance difference between the physical positions of the target objects in each candidate video frame, thereby improving the accuracy of the trajectory similarity between the target object and the reference target, which in turn helps to improve the detection accuracy of the target object's state information.

[0051] In some embodiments, in response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, the state information of the target object is updated to a sold state, further comprising:

[0052] In response to the trajectory similarities between the trajectories of at least two target objects and the trajectory of the reference target respectively meeting the preset requirement, the target similarities between the target objects corresponding to the trajectory similarities meeting the preset requirement are calculated;

[0053] In response to the target similarity corresponding to the two target objects exceeding a preset value, determining the time domain coincidence corresponding to the two target objects based on the numbering sequences of the candidate video frames corresponding to the trajectories of the two target objects respectively;

[0054] In response to the time domain overlap not exceeding the threshold, the two target objects corresponding to the time domain overlap are determined to be the same target and the state information of the target is updated to a sold state.

[0055] Therefore, in this embodiment, by screening out target objects whose trajectory similarity meets the preset requirements, when the number of target objects is multiple, the numbering sequences of the trajectories of two target objects that may be the same target are compared. When the time domain overlap does not exceed the threshold, it indicates that the two target objects are the same target, so as to achieve the removal of the target objects and improve the statistical accuracy.

[0056] In some embodiments, in response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, the state information of the target object is updated to a sold state, further comprising:

[0057] In response to the target similarity corresponding to the two target objects not exceeding the preset value, the state information of the two target objects corresponding to the target similarity is updated to a sold state.

[0058] Therefore, in this embodiment, by screening out target objects whose trajectory similarity meets the preset requirements, when the target similarity corresponding to two target objects does not exceed the preset value, it indicates that the two target objects are different targets, so as to achieve the distinction between the target objects and improve the statistical accuracy.

[0059] In some embodiments, determining the similarity between the trajectory of the target object and the trajectory of the reference target based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the candidate video frame to which it belongs includes:

[0060] Determine whether the number of candidate video frames containing the target object among the preset number of candidate video frames reaches a threshold;

[0061] In response to the number of candidate video frames containing the target object reaching a threshold, the similarity between the trajectory of the target object and the trajectory of the reference target is determined based on the positional relationship between each detection box in the trajectory of the target object and the detection box of the reference target in the candidate video frame to which it belongs.

[0062] Therefore, in this embodiment, the risk of false detection is reduced by detecting the number of candidate video frames containing the target object in the candidate video frames; the accuracy of the trajectory similarity between the target object and the reference target is improved by comparing the detection frame of the target object in the candidate video frame with the detection frame of the reference target, which helps to improve the detection accuracy of the target object's state information.

[0063] A second aspect of the present application provides a target statistics device, comprising:

[0064] An acquisition module is used to acquire a video stream collected for a statistical area; the video stream includes multiple continuous video frames containing a target object;

[0065] A processing module, used for performing target detection and association on each video frame in the video stream to obtain the trajectory of each target object;

[0066] A determination module, used to determine the state information of the target object based on whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area;

[0067] The statistics module is used to collect statistics on the target objects in the statistics area based on the status information of the target objects.

[0068] A third aspect of the present application provides an electronic device, comprising a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the target statistical method in the first aspect.

[0069] A fourth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the target statistical method in the first aspect.

[0070] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here.

[0071] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0073] Figure 1 It is a flowchart of an embodiment of a target statistical method provided by the present application;

[0074] Figure 2 yes Figure 1 A schematic flow chart of an embodiment of step S3 in the target statistics method provided;

[0075] Figure 3 It is a flowchart of another embodiment of the target statistical method provided by the present application;

[0076] Figure 4 yes Figure 3 A flowchart of a specific embodiment of step S41 in the target statistics method provided;

[0077] Figure 5 It is a flowchart of another embodiment of the target statistical method provided by the present application;

[0078] Figure 6 It is a schematic diagram of the framework of an embodiment of a target counting device provided by the present application;

[0079] Figure 7 It is a schematic diagram of the framework of an embodiment of an electronic device provided by the present application;

[0080] Figure 8 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION

[0081] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0082] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0083] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0084] The present embodiment provides a target statistical method, which can be implemented by a server or a terminal alone, or by a server and a terminal in collaboration. In some embodiments, the terminal or server can implement the target statistical method provided by the embodiment of the present disclosure by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a client that supports virtual scenes, such as a game APP; it can also be a small program, that is, a program that only needs to be downloaded to a browser environment to run; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0085] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of a target statistical method provided by the present application.

[0086] In the embodiment of the present disclosure, a server is used as the execution subject and is applicable to unmanned retail boxes. The target statistics method may include the following steps.

[0087] S1: Acquire a video stream collected for a statistical area; the video stream includes multiple consecutive video frames containing a target object.

[0088] S2: Target detection and association are performed on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction.

[0089] S3: determining the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area.

[0090] S4: Based on the state information of the target objects, statistics are collected on the target objects in the statistical area.

[0091] In this embodiment, the target object's crossing-line action is searched in the target object's trajectory, and the state information of the target object is distinguished according to the target object's crossing-line action and the target object's moving direction, so as to count the number of target objects corresponding to each preset state according to the target object's state information, thereby improving the statistical accuracy of the target objects; compared with counting target objects based on disposable RFID tags, the target statistical method of this technical solution reduces the statistical cost, has a wide range of applicable scenarios, and has strong applicability.

[0092] In one embodiment, step S1 of obtaining a video stream collected for a statistical area specifically includes the following steps.

[0093] The image acquisition device is installed at multiple locations in the statistical area. In a specific embodiment, the image acquisition device is installed on the side of the retail box where the door is set. For example, the door of the retail box is set on the side wall of the box body, and the image acquisition device is installed at at least two viewing angles of the upper left, lower left, lower right and upper right of the side where the door of the retail box is set. The image acquisition device is fixedly installed.

[0094] The target object in the statistical area is simultaneously captured by image acquisition devices installed at different viewing angles, and each image acquisition device captures the position information of the target object in the statistical area to obtain a video stream. The video stream includes multiple continuous video frames containing the target object. The target object can be a commodity.

[0095] In one embodiment, step S2 performs target detection and association on each video frame in the video stream to obtain the trajectory of each target object, which specifically includes the following steps.

[0096] Specifically, by performing target detection on the video frames in the video stream, the detection frame and detection confidence of the target object in each video frame are obtained. The detection frame whose detection confidence reaches the preset confidence is retained. By performing target recognition on the target object in the detection frame, the recognition result of the target object is obtained, and the recognition result may include identity information.

[0097] The matching similarity between the detection frames containing the target object in different video frames in the video stream is taken as the first similarity, the similarity between the recognition results of the target object contained in the detection frames in different video frames is used to determine the second similarity, and the similarity between the detection frames is determined based on the sum of the first similarity and the second similarity between the detection frames in different video frames. The similarity exceeding the set threshold is retained, and the detection frame corresponding to the maximum similarity is selected for association, so that the detection frames of the target object in the video stream in each video frame are arranged and associated according to the time sequence, and then the trajectory of the target object is obtained. That is, the behavioral trajectory of picking up the goods can be obtained through this step. According to the position information of the center point of the detection frame of the target object in each video frame, the moving direction of the target object is determined. Among them, the moving direction includes a first direction and a second direction, the first direction is the direction from the inside of the statistical area to the outside; the second direction is the direction from the outside of the statistical area to the inside.

[0098] In a specific embodiment, in order to improve the detection accuracy, the video stream is input into the DeepSORT algorithm model, and the DeepSORT algorithm model outputs the trajectory of each target object in the video stream, the position information of the detection box of the target object in each video frame, and the recognition result of the target object.

[0099] In one embodiment, step S3 determines the state information of the target object based on whether there is a line-crossing action in the trajectory of the target object, and specifically includes the following steps.

[0100] See also Figure 2 , Figure 2 yes Figure 1 A flowchart of an embodiment of step S3 in the target statistics method is provided.

[0101] S31: In response to the moving direction of the target object being a first direction and the trajectory of the target object having a line-crossing action, determining that the state information of the target object is a sold state.

[0102] Specifically, the preset area of ​​the statistical area is determined by the template matching algorithm. The preset area of ​​the statistical area can also be set based on experience. The template of the box is pre-set. Template matching is one of the most representative methods in image recognition. It extracts several feature vectors from the video frame and compares them with the feature vectors corresponding to the box, calculates the distance between the image and the box feature vector, and uses the minimum distance method to determine the category.

[0103] In one embodiment, when the trajectory of the target object contains only one moving direction, for example, the moving direction in the trajectory of the target object is a first direction, and a cross-line action is detected in the trajectory of the target object, it indicates that the target object is taken out, and the state information of the target object is determined to be a sold state. For example, when a user takes the target object in a retail box and takes the target object out of the retail box, and the target object moves from the retail box to the outside of the retail box, the target object must pass through a preset area, that is, the moving direction of the target object is the first direction. And when the position information of the detection frame of the target object is detected in the trajectory of the target object and at least partially overlaps with the preset area, it is determined that there is a cross-line action in the trajectory of the target object, and the state information of the target object is determined to be a sold state.

[0104] In one embodiment, when the trajectory of the target object contains two moving directions, for example, the first moving direction in the trajectory of the target object is the second direction, and the second moving direction is the first direction, and two cross-line actions are detected in the trajectory of the target object, it indicates that the target object was put back and then taken out, and the status information of the target object is determined to be a sold status.

[0105] S32: In response to the moving direction of the target object being the second direction and the trajectory of the target object having a line-crossing action, determining that the state information of the target object is a sale state.

[0106] In one embodiment, when the trajectory of the target object contains only one moving direction, for example, the moving direction in the trajectory of the target object is the second direction, and a crossing-line action is detected in the trajectory of the target object, it indicates that the target object is put back, and the status information of the target object is determined to be on sale.

[0107] In one embodiment, when the trajectory of the target object contains two moving directions, for example, the first moving direction in the trajectory of the target object is a first direction, and the second moving direction is a second direction, and two cross-line actions are detected in the trajectory of the target object, it indicates that the target object was taken out and then put back, and the status information of the target object is determined to be on sale.

[0108] In this embodiment, if the target object's crossing-line action is screened out in the trajectory, and the target object has moved from the inside to the outside of the statistical area, the target object has completed the action of taking out the commodity from the box, and the state information of the target object is determined to be the sold state.

[0109] In one embodiment, the target statistical method further includes the following steps.

[0110] See also Figure 3 , Figure 3 It is a flowchart of another embodiment of the target statistical method provided by the present application.

[0111] S41: determining whether the target objects contained in different video streams are the same target based on the trajectories of the target objects contained in the video streams collected from different viewing angles of the statistical area.

[0112] Specifically, the trajectory includes position information of multiple continuous detection boxes containing the target object in the video frame.

[0113] In one embodiment, the video streams captured at different viewing angles include a first video stream and a second video stream, and the first video stream and the second video stream are captured by image capture devices installed at different viewing angles.

[0114] See also Figure 4 , Figure 4 yes Figure 3 A flowchart of a specific embodiment of step S41 in the target statistics method is provided.

[0115] S411: Extracting the numbers of the video frames corresponding to the line-crossing action of the target object from the trajectory of the target object.

[0116] Specifically, each video frame in the video stream has a number. Since the attribute information of the image acquisition devices is different, the video frames corresponding to the same action acquired by different image acquisition devices have different numbers.

[0117] In a specific embodiment, the number of the video frame corresponding to the line-crossing action of the target object extracted from the trajectory of the target object in the first video stream is the first number. The number of the video frame corresponding to the line-crossing action of the target object extracted from the trajectory of the target object in the second video frame is the second number.

[0118] The first number corresponding to each target object in the first video stream is calculated with the second number of each target object in the second video stream to obtain the corresponding number difference, and the number difference is compared with the preset difference to eliminate the target object pairs corresponding to the number difference exceeding the preset difference, thereby reducing the amount of calculation.

[0119] S412: In response to the difference between the numbers of the video frames corresponding to the line-crossing action of the target object in one video stream and the numbers of the video frames corresponding to the line-crossing action of the target object in another video stream being less than a preset difference, the two target objects corresponding to the number difference are grouped into a candidate matching pair.

[0120] In a specific embodiment, if the difference between the numbers of the video frames corresponding to the crossing-line action of the target object in one video stream and the numbers of the video frames corresponding to the crossing-line action of the target object in another video stream is less than a preset difference, it indicates that the two target objects corresponding to the number difference may be the same target, and the two target objects corresponding to the number difference are formed into a candidate matching pair.

[0121] Specifically, the candidate matching pairs are further screened according to the moving directions of the two target objects in the candidate matching pairs, thereby reducing the amount of subsequent calculations.

[0122] In response to the two target objects in the candidate matching pair having the same moving direction, it is determined whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects.

[0123] In this embodiment, the moving direction of the target object is determined by the trajectory of the target object. After comparing the moving directions of two target objects, it is determined whether to calculate the trajectory similarity and recognition similarity of the candidate matching pair, thereby improving the recognition accuracy of the target object in the candidate matching pair.

[0124] S413: Determine whether two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects.

[0125] Specifically, the similarities corresponding to each detection frame in the trajectory of one target object in the candidate matching pair and each detection frame in the trajectory of another target object are added and averaged to obtain the trajectory similarity corresponding to the candidate matching pair.

[0126] In this embodiment, similarity comparison is performed between the detection frames of each target object in the candidate matching pair to determine the trajectory similarity of the candidate matching pair, thereby improving the accuracy of the trajectory similarity.

[0127] Specifically, similarity matching is performed on the identity information of the target object in the candidate matching pair to obtain the recognition similarity of the candidate matching pair.

[0128] In one embodiment, a weighted sum is performed based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects to obtain a final similarity corresponding to the candidate matching pair; in response to the final similarity corresponding to the candidate matching pair exceeding a preset similarity, it is determined that the two target objects in the candidate matching pair are the same target.

[0129] In this embodiment, the probability that two target objects in a candidate matching pair are the same target is determined based on the weighted sum of trajectory similarity and recognition similarity, and the two target objects in a candidate matching pair whose final similarity exceeds a preset similarity are determined to be the same target, thereby improving recognition accuracy.

[0130] In this embodiment, candidate matching pairs are screened out by the numbers of the video frames corresponding to the line-crossing actions of the two target objects, and then based on the trajectory similarity and recognition similarity corresponding to the candidate matching pairs, it is determined whether the two target objects are the same target, and the target objects captured from different perspectives are deduplicated to improve the target statistical accuracy.

[0131] In one embodiment, in response to the final similarities corresponding to a first target object in a video stream and at least two second target objects in another video stream respectively exceeding a preset similarity, a second target object matching the first target object is screened out from the at least two second target objects based on the Hungarian algorithm and the first target object; and it is determined that the first target object and the screened second target object are the same target.

[0132] In this embodiment, the recognition accuracy of the target objects in the candidate matching pairs is further improved by using the Hungarian algorithm to match the first target object to the second target object that is closest to the first target object.

[0133] S42: In response to the target objects included in different video streams being the same target, merging the trajectories of the target objects in different video streams.

[0134] Specifically, when it is determined that the two target objects in the candidate matching pair are the same target, the trajectory of the target object in the first video stream is merged with the trajectory of the target object in the second video stream to obtain updated trajectory information of the target object. Further, the target object can be added to the global purchase commodity table for statistics.

[0135] In one embodiment, when two target objects in a candidate matching pair are not the same target, it is further determined whether the target object in the candidate matching pair is the same target as other target objects in video streams from different perspectives. If the target object is not the same target as all target objects in video streams from different perspectives, the target object is directly added to the global purchase commodity table for statistics.

[0136] In this embodiment, the trajectories of the target objects in the statistical areas collected from different perspectives are compared to determine the same target object in different perspectives, so as to merge the trajectories of the same target object in different perspectives, thereby improving the situation where the complete trajectory cannot be obtained when the target object is blocked or in a blind spot under a single perspective, and improving the integrity of the target object tracking trajectory.

[0137] In another specific embodiment, when the last status information in the video stream is a sold status and the trajectory of a target object with a cross-line action is followed by trajectories of other target objects without cross-line action, it is necessary to further analyze the status information of the target object according to the trajectory of the target object to determine the status information of the target object. The specific steps are as follows.

[0138] See also Figure 5 , Figure 5 It is a flowchart of another embodiment of the target statistical method provided by the present application.

[0139] S51: Selecting a target object whose last status information is sold and whose trajectory has a line-crossing action from the video stream as a reference target; the number of the video frame corresponding to the line-crossing action of the reference target is greater than the number of the video frame corresponding to the line-crossing action of other target objects in the video stream.

[0140] Specifically, the target object whose last state information is sold is selected from the video stream as the reference target. No line-crossing action is detected in the trajectories of other target objects after the reference target in the video stream. The video frame corresponding to the line-crossing action of the reference target and the video frame number are extracted and recorded as t.

[0141] S52: Selecting a preset number of video frames after the video frame corresponding to the line-crossing action of the reference target in the video stream as candidate video frames.

[0142] Specifically, a preset number of video frames after the video frame corresponding to the line-crossing action of the reference target in the video stream are extracted as candidate video frames, wherein the preset number can be set to 10 frames, 50 frames, etc.

[0143] In one embodiment, it is determined whether the number of candidate video frames containing the target object in a preset number of candidate video frames reaches a threshold; in response to the number of candidate video frames containing the target object reaching the threshold, a similarity comparison is performed between the trajectory of the target object contained in the preset number of candidate video frames and the trajectory of the reference target.

[0144] In this embodiment, the risk of false detection is reduced by detecting the number of candidate video frames containing the target object in the candidate video frames; the accuracy of the trajectory similarity between the target object and the reference target is improved by comparing the detection frame of the target object in the candidate video frame with the detection frame of the reference target, which helps to improve the detection accuracy of the state information of the target object.

[0145] S53: performing a similarity comparison between the trajectory of the target object contained in a preset number of candidate video frames and the trajectory of the reference target to determine the similarity between the trajectory of the target object and the trajectory of the reference target.

[0146] Specifically, based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the corresponding candidate video frame, the similarity between the trajectory of the target object and the trajectory of the reference target is determined.

[0147] In this embodiment, the physical distance between the detection frame of the target object in the same candidate video frame and the detection frame of the reference target can be used to determine whether the moving direction of the target object is consistent with the moving direction of the reference target, as well as the distance difference between the physical positions of the target objects in each candidate video frame, thereby improving the accuracy of the trajectory similarity between the target object and the reference target, which in turn helps to improve the detection accuracy of the target object's state information.

[0148] S54: In response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, the state information of the target object is updated to a sold state.

[0149] In one embodiment, in response to the trajectory similarity between only one target object and the reference object reaching a preset requirement, the state information of the target object is updated to a sold state.

[0150] When the trajectory similarities between the trajectories of at least two target objects and the trajectory of the reference target respectively meet the preset requirements, the trajectories of the target objects need to be deduplicated and identified to determine the number of target objects and the status of the target objects.

[0151] In one embodiment, in response to the trajectory similarities between the trajectories of at least two target objects and the trajectory of the reference target respectively meeting a preset requirement, a target similarity between the target objects corresponding to the trajectory similarity meeting the preset requirement is calculated.

[0152] In one embodiment, in response to the target similarity corresponding to the two target objects exceeding a preset value, the temporal overlap corresponding to the two target objects is determined based on the numbering sequences of the candidate video frames corresponding to the trajectories of the two target objects.

[0153] In response to the time domain overlap not exceeding the threshold, the two target objects corresponding to the time domain overlap are determined to be the same target and the state information of the target is updated to a sold state.

[0154] In this embodiment, by screening out target objects whose trajectory similarity meets the preset requirements, when the number of target objects is multiple, the numbering sequences of the trajectories of two target objects that may be the same target are compared. When the time domain overlap does not exceed the threshold, it indicates that the two target objects are the same target, so as to achieve the removal of the target objects and improve the statistical accuracy.

[0155] In response to the target similarity corresponding to the two target objects not exceeding the preset value, the state information of the two target objects corresponding to the target similarity is updated to a sold state.

[0156] In this embodiment, target objects whose trajectory similarity meets the preset requirement are screened out. When the target similarity corresponding to two target objects does not exceed the preset value, it indicates that the two target objects are different targets, so as to achieve the distinction between the target objects and improve the statistical accuracy.

[0157] Through the above steps, the status information of each target object in the statistical area can be obtained.

[0158] In one embodiment, step S4 of performing statistics on the target objects in the statistical area based on the state information of the target objects specifically includes the following steps.

[0159] Specifically, the identity information of each target object can be obtained through the above steps, and the target objects collected by different video streams are matched to remove duplicate target objects in the statistical area collected by different video streams to obtain the target objects contained in the statistical area.

[0160] Based on the status information of each target object in the statistical area, the status information of the target object is compared with the preset status. In response to the status information of the target object being consistent with the preset status, the number of target objects corresponding to the preset status is accumulated by 1. The preset status includes two types: on sale status and sold status.

[0161] In one embodiment, the trajectory of each target object serves as a purchase record of the target object.

[0162] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.

[0163] See also Figure 6 , Figure 7 It is a schematic diagram of the framework of an embodiment of a target counting device provided by the present application.

[0164] This embodiment provides a target statistics device 60 , which includes an acquisition module 61 , a processing module 62 , a determination module 63 and a statistics module 64 .

[0165] The acquisition module 61 is used to acquire a video stream collected for a statistical area; the video stream includes multiple consecutive video frames containing a target object.

[0166] The processing module 62 is used to perform target detection and association on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction.

[0167] The determination module 63 is used to determine the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area.

[0168] The statistics module 64 is used to collect statistics on the target objects in the statistics area based on the state information of the target objects.

[0169] Therefore, in this embodiment, the target object's crossing-line action is searched in the target object's trajectory, and the state information of the target object is distinguished according to the target object's crossing-line action and the target object's moving direction, so as to count the number of target objects corresponding to each preset state according to the target object's state information, thereby improving the statistical accuracy of the target object; compared with counting target objects based on disposable RFID tags, the target statistical method of this technical solution reduces the statistical cost, has a wide range of applicable scenarios, and has strong applicability.

[0170] In some embodiments, the determination module 63 is further used to determine that the state information of the target object is a sold state in response to the target object's moving direction being a first direction and the target object's trajectory having a cross-line action; and to determine that the state information of the target object is a sold state in response to the target object's moving direction being a second direction and the target object's trajectory having a cross-line action. The target object's moving direction includes a first direction and a second direction, the first direction being a direction from the inside of the statistical area to the outside; the second direction being a direction from the outside of the statistical area to the inside; and the state information includes a sold state and a sold state.

[0171] Therefore, in this embodiment, if the target object's crossing-line action is screened out in the trajectory, and the target object has moved from the inside to the outside of the statistical area, then the target object has completed the action of taking out the commodity from the box, and the status information of the target object is determined to be the sold status.

[0172] In some embodiments, the determination module 63 is also used to determine whether the target objects contained in different video streams are the same target based on the trajectories of the target objects contained in the video streams captured from different perspectives of the statistical area; in response to the target objects contained in different video streams being the same target, the trajectories of the target objects in different video streams are merged.

[0173] Therefore, in this embodiment, the trajectories of the target objects in the statistical areas collected from different perspectives are compared to determine the same target object in different perspectives, so as to merge the trajectories of the same target object in different perspectives, thereby improving the situation where the complete trajectory cannot be obtained when the target object is blocked or in a blind spot under a single perspective, and improving the integrity of the target object tracking trajectory.

[0174] In some embodiments, each video frame in a video stream is numbered.

[0175] The determination module 63 is also used to extract the number of the video frame corresponding to the target object's crossing-line action from the trajectory of the target object; in response to the number difference between the number of the video frame corresponding to the target object's crossing-line action in one video stream and the number of the video frame corresponding to the target object's crossing-line action in another video stream being less than a preset difference, the two target objects corresponding to the number difference are formed into a candidate matching pair; based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, determine whether the two target objects in the candidate matching pair are the same target.

[0176] Therefore, in this embodiment, candidate matching pairs are screened out by the numbers of the video frames corresponding to the line-crossing actions of the two target objects, and then whether the two target objects are the same target is determined based on the trajectory similarity and recognition similarity corresponding to the candidate matching pairs. The target objects captured from different perspectives are deduplicated to improve the target statistical accuracy.

[0177] In some embodiments, the track includes position information of a plurality of consecutive detection boxes containing the target object in the video frame.

[0178] The determination module 63 is also used to determine the moving direction of the target object based on the position information of the detection box in each video frame in the trajectory of the target object; in response to the consistency of the moving directions of the two target objects in the candidate matching pair, it is determined whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects.

[0179] Therefore, in this embodiment, the moving direction of the target object is determined by the trajectory of the target object. After comparing the moving directions of the two target objects, it is determined whether to calculate the trajectory similarity and recognition similarity of the candidate matching pair, thereby improving the recognition accuracy of the target object in the candidate matching pair.

[0180] In some embodiments, the determination module 63 is further used to sum and average the similarities corresponding to each detection box in the trajectory of one target object in the candidate matching pair and each detection box in the trajectory of another target object to obtain the trajectory similarity corresponding to the candidate matching pair.

[0181] Therefore, in this embodiment, similarity comparison is performed between the detection frames of each target object in the candidate matching pair to determine the trajectory similarity of the candidate matching pair, thereby improving the accuracy of the trajectory similarity.

[0182] In some embodiments, the determination module 63 is further used to perform a weighted sum based on the trajectory similarity between the trajectories of the target objects in the candidate matching pairs and the recognition similarity between the target objects to obtain a final similarity corresponding to the candidate matching pairs;

[0183] In response to the final similarity corresponding to the candidate matching pair exceeding the preset similarity, it is determined that the two target objects in the candidate matching pair are the same target.

[0184] Therefore, in this embodiment, the probability that two target objects in a candidate matching pair are the same target is determined based on the weighted sum of trajectory similarity and recognition similarity, and the two target objects in a candidate matching pair whose final similarity exceeds a preset similarity are determined to be the same target, thereby improving recognition accuracy.

[0185] In some embodiments, the determination module 63 is also used to select a second target object that matches the first target object from at least two second target objects based on the Hungarian algorithm and the first target object in response to the final similarities corresponding to a first target object in a video stream and at least two second target objects in another video stream exceeding a preset similarity; and determine that the first target object and the selected second target object are the same target.

[0186] Therefore, in this embodiment, the recognition accuracy of the target objects in the candidate matching pairs is further improved by using the Hungarian algorithm to match the first target object to the second target object that is closest to the first target object.

[0187] In some embodiments, the determination module 63 is also used to select from the video stream a target object whose last status information is a sold status and whose trajectory has a cross-line action as a reference target; the number of the video frame corresponding to the cross-line action of the reference target is greater than the number of the video frame corresponding to the cross-line action of other target objects in the video stream; a preset number of video frames after the video frame corresponding to the cross-line action of the reference target in the video stream are selected as candidate video frames; the trajectory of the target object contained in the preset number of candidate video frames is compared with the trajectory of the reference target for similarity, and the similarity between the trajectory of the target object and the trajectory of the reference target is determined; in response to the similarity between the trajectory of the target object and the trajectory of the reference target reaching a preset requirement, the status information of the target object is updated to a sold status.

[0188] Therefore, in this embodiment, the trajectory of the reference target close in time domain is compared with the trajectory of the target object to determine the state information of the target object without line crossing action, so as to improve the accuracy of the state information of the target object.

[0189] In some embodiments, the determination module 63 is further used to determine the similarity between the trajectory of the target object and the trajectory of the reference target based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the candidate video frame to which it belongs.

[0190] Therefore, in this embodiment, through the physical distance between the detection frame of the target object in the same candidate video frame and the detection frame of the reference target, it is possible to determine whether the moving direction of the target object is consistent with the moving direction of the reference target, as well as the distance difference between the physical positions of the target objects in each candidate video frame, thereby improving the accuracy of the trajectory similarity between the target object and the reference target, which in turn helps to improve the detection accuracy of the target object's state information.

[0191] In some embodiments, the determination module 63 is also used to, in response to the trajectory similarities between the trajectories of at least two target objects and the trajectory of the reference target meeting preset requirements, calculate the target similarity between the target objects corresponding to the trajectory similarity that meets the preset requirements; in response to the target similarity corresponding to the two target objects exceeding a preset value, determine the time domain overlap corresponding to the two target objects based on the numbering sequence of the candidate video frames corresponding to the trajectories of the two target objects; in response to the time domain overlap not exceeding a threshold, determine the two target objects corresponding to the time domain overlap as the same target and update the target status information to a sold status.

[0192] Therefore, in this embodiment, by screening out target objects whose trajectory similarity meets the preset requirements, when the number of target objects is multiple, the numbering sequences of the trajectories of two target objects that may be the same target are compared. When the time domain overlap does not exceed the threshold, it indicates that the two target objects are the same target, so as to achieve the removal of the target objects and improve the statistical accuracy.

[0193] In some embodiments, the determination module 63 is further configured to update the status information of the two target objects corresponding to the target similarity to a sold status in response to the target similarity corresponding to the two target objects not exceeding a preset value.

[0194] Therefore, in this embodiment, by screening out target objects whose trajectory similarity meets the preset requirements, when the target similarity corresponding to two target objects does not exceed the preset value, it indicates that the two target objects are different targets, so as to achieve the distinction between the target objects and improve the statistical accuracy.

[0195] In some embodiments, the determination module 63 is also used to determine whether the number of candidate video frames containing the target object in a preset number of candidate video frames reaches a threshold; in response to the number of candidate video frames containing the target object reaching the threshold, the similarity between the trajectory of the target object and the trajectory of the reference target is determined based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the candidate video frame to which it belongs.

[0196] Therefore, in this embodiment, the risk of false detection is reduced by detecting the number of candidate video frames containing the target object in the candidate video frames; the accuracy of the trajectory similarity between the target object and the reference target is improved by comparing the detection frame of the target object in the candidate video frame with the detection frame of the reference target, which helps to improve the detection accuracy of the target object's state information.

[0197] See also Figure 7 , Figure 7 It is a schematic diagram of the framework of an embodiment of an electronic device provided by the present application.

[0198] The electronic device 80 includes a memory 81 and a processor 82 coupled to each other, and the processor 82 is used to execute program instructions stored in the memory 81 to implement the steps in any of the above-mentioned target statistical method embodiments. In a specific implementation scenario, the electronic device 80 may include, but is not limited to: a microcomputer, a server, and in addition, the electronic device 80 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0199] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps in any of the above-mentioned target statistical method embodiments. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.

[0200] The above scheme is a target statistics method, comprising: obtaining a video stream collected for a statistical area; the video stream includes multiple continuous video frames containing target objects; performing target detection and association on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction; based on the moving direction of the target object and whether there is a cross-line action in the trajectory of the target object, determining the state information of the target object; the cross-line action is that the target object is in a preset area within the statistical area; based on the state information of the target object, statistics are performed on the target objects in the statistical area.

[0201] See also Figure 8 , Figure 8 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present application.

[0202] The computer-readable storage medium 90 stores program instructions 901 that can be executed by a processor, and the program instructions 901 are used to implement the steps in any of the above-mentioned target statistical method embodiments.

[0203] The above scheme is a target statistics method, comprising: obtaining a video stream collected for a statistical area; the video stream includes multiple continuous video frames containing target objects; performing target detection and association on each video frame in the video stream to obtain the trajectory of each target object; the trajectory of the target object has a corresponding moving direction; based on the moving direction of the target object and whether there is a cross-line action in the trajectory of the target object, determining the state information of the target object; the cross-line action is that the target object is in a preset area within the statistical area; based on the state information of the target object, statistics are performed on the target objects in the statistical area.

[0204] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0205] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0206] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0207] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0208] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A target statistical method, characterized in that: include: Acquire a video stream collected for the statistical area; the video stream includes multiple consecutive video frames containing the target object; Performing target detection and association on each of the video frames in the video stream to obtain a trajectory of each of the target objects; The trajectory of the target object has a corresponding moving direction; Based on the trajectories of the target objects respectively contained in the video streams acquired from different perspectives of the statistical area, determining whether the target objects contained in different video streams are the same target; Each of the video frames in the video stream has a number; Determine the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area; Based on the state information of the target object, statistics are collected on the target object in the statistical area; Wherein, based on the trajectories of the target objects respectively contained in the video streams acquired from different perspectives of the statistical area, determining whether the target objects contained in different video streams are the same target includes: Extracting the serial number of the video frame corresponding to the line-crossing action of the target object from the trajectory of the target object; In response to a number difference between the number of the video frame corresponding to the line-crossing action of the target object in one video stream and the number of the video frame corresponding to the line-crossing action of the target object in another video stream being less than a preset difference, the two target objects corresponding to the number difference are grouped into a candidate matching pair; Based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, it is determined whether the two target objects in the candidate matching pair are the same target.

2. The target statistical method according to claim 1, characterized in that: The moving direction of the target object includes a first direction and a second direction, the first direction is a direction from the inside of the statistical area to the outside; the second direction is a direction from the outside of the statistical area to the inside; the state information includes a sold state and a selling state; The determining the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object includes: In response to the moving direction of the target object being the first direction and the trajectory of the target object having the line-crossing action, determining that the state information of the target object is the sold state; In response to the moving direction of the target object being the second direction and the trajectory of the target object having the line-crossing action, it is determined that the state information of the target object is the on-sale state.

3. The target statistical method according to claim 2, characterized in that: The target statistical method also includes: In response to the target objects contained in different video streams being the same target, the trajectories of the target objects in different video streams are merged.

4. The target statistical method according to claim 3, characterized in that: The trajectory includes position information of a plurality of continuous detection boxes containing the target object in the video frame, Before the step of determining whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, the step further includes: Determining a moving direction of the target object based on position information of the detection frame in each of the video frames in the trajectory of the target object; The determining whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects includes: In response to the two target objects in the candidate matching pair having the same moving direction, it is determined whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects.

5. The target statistical method according to claim 3, characterized in that: The determining whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects includes: Obtaining a final similarity corresponding to the candidate matching pair based on a weighted sum of the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects; In response to the final similarity corresponding to the candidate matching pair exceeding the preset similarity, it is determined that the two target objects in the candidate matching pair are the same target.

6. The target statistical method according to claim 5, characterized in that: The determining whether the two target objects in the candidate matching pair are the same target based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects further includes: In response to the final similarities respectively corresponding to a first target object in a video stream and at least two second target objects in another video stream exceeding the preset similarity, a second target object matching the first target object is selected from the at least two second target objects based on the Hungarian algorithm and the first target object; It is determined that the first target object and the screened second target object are the same target.

7. The target counting method according to any one of claims 1 to 6, characterized in that: Each of the video frames in the video stream has a number; The target statistical method further includes: The last target object whose status information is a sold status and whose trajectory has a line-crossing action is selected from the video stream as a reference target; the number of the video frame corresponding to the line-crossing action of the reference target is greater than the number of the video frame corresponding to the line-crossing action of other target objects in the video stream; Selecting a preset number of video frames after the video frame corresponding to the line-crossing action of the reference target in the video stream as candidate video frames; Performing a similarity comparison between the trajectory of the target object contained in the preset number of candidate video frames and the trajectory of the reference target to determine the similarity between the trajectory of the target object and the trajectory of the reference target; In response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, the state information of the target object is updated to a sold state.

8. The target statistical method according to claim 7, characterized in that: The comparing the trajectory of the target object contained in the preset number of candidate video frames with the trajectory of the reference target to determine the similarity between the trajectory of the target object and the trajectory of the reference target includes: Based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the candidate video frame to which it belongs, the similarity between the trajectory of the target object and the trajectory of the reference target is determined.

9. The target statistical method according to claim 7, characterized in that: In response to the similarity between the trajectory of the target object and the trajectory of the reference object reaching a preset requirement, updating the state information of the target object to a sold state, further comprising: In response to the trajectory similarities between the trajectories of at least two of the target objects and the trajectory of the reference object respectively meeting the preset requirement, the target similarities between the target objects corresponding to the trajectory similarities meeting the preset requirement are calculated; In response to the target similarity corresponding to the two target objects exceeding a preset value, determining the temporal overlap corresponding to the two target objects based on the numbering sequences of the candidate video frames respectively corresponding to the trajectories of the two target objects; In response to the time domain overlap not exceeding a threshold, the two target objects corresponding to the time domain overlap are determined to be the same target and the state information of the target is updated to a sold state.

10. The target statistical method according to claim 8, characterized in that: The determining the similarity between the trajectory of the target object and the trajectory of the reference target based on the positional relationship between each detection frame in the trajectory of the target object and the detection frame of the reference target in the candidate video frame to which it belongs, comprises: Determine whether the number of the preset number of candidate video frames containing the target object reaches a threshold; In response to the number of candidate video frames containing the target object reaching a threshold, the similarity between the trajectory of the target object and the trajectory of the reference target is determined based on the positional relationship between each detection box in the trajectory of the target object and the detection box of the reference target in the candidate video frame to which it belongs.

11. A target counting device, characterized in that: include: An acquisition module, used for acquiring a video stream collected for a statistical area; the video stream includes a plurality of continuous video frames containing a target object; A processing module, used for performing target detection and association on each of the video frames in the video stream to obtain a trajectory of each of the target objects; The trajectory of the target object has a corresponding moving direction; it is also used to determine whether the target objects contained in different video streams are the same target based on the trajectories of the target objects respectively contained in the video streams collected from different perspectives of the statistical area; each of the video frames in the video stream has a number; wherein the processing module is also used to extract the number of the video frame corresponding to the line-crossing action of the target object from the trajectory of the target object; in response to the number difference between the number of the video frame corresponding to the line-crossing action of the target object in one video stream and the number of the video frame corresponding to the line-crossing action of the target object in another video stream being less than a preset difference, the two target objects corresponding to the number difference are formed into a candidate matching pair; based on the trajectory similarity between the trajectories of the target objects in the candidate matching pair and the recognition similarity between the target objects, it is determined whether the two target objects in the candidate matching pair are the same target; A determination module, configured to determine the state information of the target object based on the moving direction of the target object and whether there is a line-crossing action in the trajectory of the target object; the line-crossing action is that the target object is in a preset area within the statistical area; The statistics module is used to collect statistics on the target objects in the statistics area based on the status information of the target objects.

12. An electronic device, characterized in that: The invention comprises a memory and a processor coupled to each other, wherein the processor is used to execute program instructions stored in the memory to implement the steps of the target statistical method according to any one of claims 1 to 10.

13. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the target statistical method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Self-service transaction method and device, electronic equipment and storage medium

    CN113901955A