Target identification method and device, terminal equipment and computer readable storage medium

By calculating the overall and foreground offsets between image frames, combined with camera tracking status judgment and feature point processing, the problems of mistracking and missed tracking in target recognition in complex scenes are solved, improving the accuracy and reliability of target tracking.

CN116030096BActive Publication Date: 2025-12-30TP-LINK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310090503.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-13
Publication Date
2025-12-30
Estimated Expiration
2043-01-13

AI Technical Summary

Technical Problem

In complex tracking scenarios, existing technologies struggle to effectively identify and track targets, often resulting in false tracking and missed tracking, which reduces the reliability of target tracking.

Method used

By calculating the overall and foreground offsets between image frames, motion scores are calculated to identify and track targets. Combined with camera tracking status judgment and feature point culling and sparsification processing, the accuracy and reliability of target recognition are improved.

Benefits of technology

It effectively improves the accuracy and reliability of target recognition, avoids false tracking and missed tracking, and enhances the stability of target tracking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030096B_ABST
    Figure CN116030096B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of target tracking, and provides a target identification method and device, terminal equipment and computer readable storage medium, which comprises: when k frames of images are photographed by a camera in a tracking state, a first motion vector between every two adjacent image frames in the k frames of images is calculated, wherein the first motion vector represents a displacement of an image frame as a whole; a second motion vector between every two adjacent image frames and every first foreground in the k frames of images is calculated, wherein the second motion vector represents a displacement of a foreground part in an image frame; every first motion score of every first foreground in the k frames of images is calculated according to every first motion vector and every second motion vector; and a tracking target in the k frames of images is identified according to every first motion score of every first foreground in the k frames of images. Through the above method, the reliability of target identification can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of target tracking, and particularly relates to a target identification method and device, a terminal device and a computer readable storage medium. BACKGROUND

[0002] Target tracking technology based on computer vision refers to establishing the positional relationship of a target object in a continuous video sequence to obtain the complete motion trajectory of the target object. At present, target tracking technology has been widely applied, such as vehicle tracking in a traffic monitoring system, person tracking in a security monitoring system, and face / gesture tracking in an intelligent interaction system.

[0003] Generally, the tracking scene is relatively complex, and multiple objects can appear in the monitored video, so it is difficult to identify a tracking target from the multiple objects, which can easily lead to false tracking, missed tracking and the like, and reduces the reliability of target tracking. SUMMARY

[0004] The embodiments of the application provide a target identification method and device, a terminal device and a computer readable storage medium, which can effectively improve the reliability of target tracking.

[0005] In a first aspect, the embodiments of the application provide a target identification method, comprising:

[0006] When a camera shoots k frames of images in a tracking state, a first motion vector between each two adjacent image frames in the k frames of images is calculated, wherein the first motion vector represents the offset of the entire image frame, and k is an integer greater than 1;

[0007] A second motion vector between each two adjacent image frames and each first foreground in the k frames of images is calculated, and the second motion vector represents the offset of the foreground part in the image frame;

[0008] According to each first motion amount and each second motion amount, a first motion score of each first foreground in the k frames of images is calculated;

[0009] A tracking target in the k frames of images is identified according to each first motion score of each first foreground in the k frames of images.

[0010] In the embodiments of the application, the first motion score of each foreground is calculated by calculating the offset of the entire image frame and the foreground offset between each two adjacent image frames, and the first motion score is used to evaluate the consistency of the foreground and the entire image frame offset. Then, the tracking target is identified according to the first motion score, which is equivalent to identifying the tracking target according to the consistency of the motion direction of the foreground and the entire image frame. Through the above method, the accuracy and reliability of target identification can be effectively improved.

[0011] In a possible implementation manner of the first aspect, the calculating the second motion vector between each two adjacent image frames in the k-frame images of each first foreground comprises:

[0012] For each first foreground in the k-frame images, a first position point for representing the first foreground in the first image frame and a second position point for representing the first foreground in the second image frame are determined according to a position of a first detection box of the first foreground in the first image frame and a position of a second detection box of the first foreground in the second image frame, wherein the first image frame and the second image frame are two adjacent image frames in the k-frame images.

[0013] A first vector between the first position point and the second position point is calculated, and the first vector is the second motion vector.

[0014] By the method in the embodiments of the present application, the position points for representing the foreground are adaptively selected according to the positions of the same foreground in the first image frame and the second image frame, the position points not affected by the change of the detection box are used to represent the foreground position, and the calculation error of the foreground motion vector caused by the change of the detection box is effectively reduced.

[0015] In a possible implementation manner of the first aspect, the identifying the tracking target in the k-frame images according to each first motion score of each first foreground in the k-frame images comprises:

[0016] A first total score of all first motion scores corresponding to each first foreground in the k-frame images is calculated.

[0017] If the highest first total score is greater than a first threshold, the first foreground corresponding to the highest first total score is determined as the tracking target.

[0018] In the embodiments of the present application, since the first total score reflects the overall offset of the first foreground in the k-frame images, rather than the offset of a certain image frame, the tracking target is determined according to the first total score, the false detection caused by the high single first motion score can be effectively avoided, and the reliability of target identification is improved.

[0019] In a possible implementation manner of the first aspect, after the first total score of all first motion scores corresponding to each first foreground in the k-frame images is calculated, the method further comprises:

[0020] if the highest first total score is less than the first threshold, calculating a second motion score of each second foreground in an h-frame image, wherein the h-frame image is an image captured by the camera after capturing the k-frame image in the tracking state, and h is an integer greater than 1;

[0021] calculating a second total score of all second motion scores corresponding to each second foreground in the h-frame image;

[0022] if the highest second total score is greater than the first threshold, determining the second foreground corresponding to the highest second total score as the tracking target;

[0023] if the highest second total score is less than the first threshold, determining that it is a false tracking.

[0024] In the embodiments of the present application, when the tracking target appears in the later frames of the k-frame image, the correct recognition of the tracking target can be realized through the continuous recognition of the h-frame image captured after the k-frame image. Through the above method, the situation of missing detection is effectively avoided, thereby improving the reliability of target recognition.

[0025] In a possible implementation of the first aspect, the method further includes:

[0026] when the camera acquires a third image frame, performing matching processing on the third image frame and a reference image to obtain a matching result, wherein the reference image is an image captured by the camera in a non-tracking state;

[0027] if the matching result indicates that the third image frame matches the reference image, determining that the camera is in the non-tracking state;

[0028] if the matching result indicates that the third image frame does not match the reference image, determining that the camera is in the tracking state.

[0029] Through the method in the embodiments of the present application, the tracking state of the camera is identified before target recognition, and the target recognition process is triggered when the camera is in the tracking state. Through the above method, the situation of false recognition of the target when the camera is in the non-tracking state can be effectively avoided, and the reliability of target recognition is further improved.

[0030] In a possible implementation of the first aspect, the matching processing on the third image frame and the reference image to obtain a matching result includes:

[0031] obtaining a first local feature in the third image frame and a second local feature in the reference image;

[0032] eliminating foreground features in the first local feature to obtain the processed first local feature;

[0033] remove foreground features in the second local features to obtain processed second local features;

[0034] perform matching processing according to the processed first local features and the processed second local features to obtain the matching result.

[0035] In the embodiments of the present application, foreground feature points in the picture are removed before the matching processing, which is equivalent to that the remaining are background feature points. Since the background usually does not change or changes to a low degree, using the background feature points for picture registration is beneficial to improve the accuracy of picture registration.

[0036] In a possible implementation of the first aspect, the first local features include feature positions of a plurality of first feature points, and the second local features include feature positions and confidence levels of a plurality of second feature points.

[0037] The matching processing according to the processed first local features and the processed second local features to obtain the matching result includes:

[0038] According to the feature positions and the confidence levels of the plurality of second feature points, third feature points are selected from the plurality of second feature points, and the number of the third feature points is less than the number of the second feature points.

[0039] The first feature points and the third feature points are matched according to the feature positions of the first feature points and the feature positions of the third feature points to obtain the matching result.

[0040] In the embodiments of the present application, the feature sparsification processing is performed before the matching processing, and part of the feature points with high confidence levels are reserved. In this way, the false matching caused by the feature points with low confidence levels can be avoided, and the calculation amount can be reduced.

[0041] In a possible implementation of the first aspect, the matching processing of the first feature points and the third feature points according to the feature positions of the first feature points and the feature positions of the third feature points to obtain the matching result includes:

[0042] The position offset between the feature position of each first feature point and the feature position of each third feature point is calculated.

[0043] The number of first feature points corresponding to the position offset less than the second threshold value is counted.

[0044] If the number of the feature points is greater than a third threshold value, the matching result indicates that the third image frame is matched with the reference image.

[0045] If the number of the features is not greater than a third threshold, the matching result indicates that the third image frame is not matched with the reference image.

[0046] In a second aspect, an embodiment of the present application provides a target identification device, comprising:

[0047] A first calculation unit is configured to calculate a first motion vector between each two adjacent image frames in k image frames captured by the camera in a tracking state, wherein the first motion vector represents a displacement of an entire picture of the image frame, and the k is an integer greater than 1.

[0048] A second calculation unit is configured to calculate a second motion vector of each first foreground between each two adjacent image frames in the k image frames, wherein the second motion vector represents a displacement of the foreground part in the image frame.

[0049] A third calculation unit is configured to calculate a first motion score of each first foreground in the k image frames according to each first motion vector and each second motion vector.

[0050] A target identification unit is configured to identify a tracking target in the k image frames according to the first motion score of each first foreground in the k image frames.

[0051] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the target identification method in any one of the first aspect.

[0052] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the target identification method in any one of the first aspect.

[0053] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to perform the target identification method in any one of the first aspect.

[0054] It can be understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0056] Figure 1 is a flowchart of a target recognition method provided by the embodiments of the present application;

[0057] Figure 2 is a schematic diagram of a motion vector provided by the embodiments of the present application;

[0058] Figure 3 is a schematic diagram of a motion vector difference provided by the embodiments of the present application;

[0059] Figure 4 is a schematic diagram of a target recognition flow provided by the embodiments of the present application;

[0060] Figure 5 is a schematic diagram of a tracking album provided by the embodiments of the present application;

[0061] Figure 6 is a schematic diagram of a monitoring video provided by the embodiments of the present application;

[0062] Figure 7 is a structural block diagram of a target recognition device provided by the embodiments of the present application;

[0063] Figure 8 is a structural schematic diagram of a terminal device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0064] In the following description, specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. However, persons skilled in the art will understand that the present application can be practiced without these specific details. In other instances, well-known structures, devices, circuits, and methods have not been described in detail in order to avoid obscuring the present application.

[0065] It should be understood that when used in the specification and the appended claims of the present application, the term "comprising" indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0066] It should also be understood that the term “and / or” as used herein refers to any one of the associated listed items, optionally, additional items in some combinations, and all possible combinations of the associated listed items.

[0067] As used in the description of the application and the appended claims, the term “if’ can be interpreted to mean “when” or “upon” or “in response to determining” or “in response to detecting” depending on the context. Similarly, the phrase “if it is determined” or “if [a described condition or event] is detected” can be interpreted to mean “upon determining” or “in response to determining” or “upon detecting [the described condition or event]” or “in response to detecting [the described condition or event]”, depending on the context.

[0068] In addition, in the description of the application and the appended claims, the terms “first”, “second”, “third”, etc. are used only to distinguish descriptions, and cannot be understood as indicating or implying relative importance.

[0069] Reference in the specification to “one embodiment” or “some embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrases “in one embodiment”, “in some embodiments”, “in other embodiments”, “in additional embodiments”, etc. in various places in the specification are not necessarily all referring to the same embodiment, although they can. Rather, they mean “one or more but not all embodiments” unless otherwise specified.

[0070] The target tracking technology based on computer vision refers to establishing the positional relationship of a target object in a continuous video sequence to obtain the complete motion trajectory of the target object. At present, the target tracking technology has been widely applied, such as vehicle tracking in a traffic monitoring system, person tracking in a security monitoring system, and face / gesture tracking in an intelligent interaction system, etc.

[0071] In some application scenarios, a user sets a tracking trigger area, and when an object enters the tracking trigger area, continuous tracking is triggered, that is, the camera is controlled to continuously track the object through rotation of a pan-tilt head until the object leaves the shooting range of the camera.

[0072] Generally, the tracking scene is relatively complex, and multiple objects can appear in the monitoring video, which makes it difficult to identify the tracking target from the multiple objects, and is prone to cause mis-tracking, missed tracking, etc., thereby reducing the reliability of target tracking.

[0073] For example, in a security application scenario, a target person is tracked. However, there are usually many persons in the scene, and these persons in the monitoring video can all become the foreground of the image, thereby affecting the tracking of the target person.

[0074] To solve the above problem, an embodiment of the present application provides a target identification method. In the embodiment of the present application, a tracking target is determined from a plurality of tracking objects according to the consistency of the motion direction of a picture in a monitoring video and the motion direction of each tracking object in the picture. Through the method in the embodiment of the present application, the reliability of target tracking can be effectively improved.

[0075] First, several data processing methods involved in the embodiment of the present application are introduced.

[0076] Method one, model training

[0077] In the embodiment of the present application, the models involved include a target detection model, a re-identification model and an image matching model. The target detection model is used to detect target objects in an image, and the output result includes a detection box corresponding to the target. The re-identification model is used to determine whether a specific target exists in a video sequence (such as associating targets in adjacent two frames, so that the same target has the same number). The image matching model is used to extract deep local features of an image. In some application scenarios, the target detection model and the re-identification model can constitute a target tracking model, which is used to realize target tracking.

[0078] Before executing the target identification method of the present application, the above models are trained in advance. In the process of executing the target identification method, the trained models are used for data processing, which can effectively improve the efficiency of target identification.

[0079] Collect monitoring videos under various scenes, multiple perspectives, various lighting conditions (such as direct sunlight, rainy days, night and fog, etc.) and various resolutions (such as using different resolution cameras to shoot). The collected monitoring videos are used as training data.

[0080] For the target detection model, the image frames in the collected monitoring video are labeled; for example, in a traffic monitoring scene, the foreground such as persons and vehicles in the image frames are labeled; in a security scene, different persons in the image frames are labeled; in an intelligent interaction scene, different faces / hand gestures are labeled. The labeled image frames are used to train the target detection model. Optionally, the labeled data of a public data set can also be added as a supplement to improve the adaptability of the target detection model to input data and reduce the risk of model overfitting caused by insufficient data.

[0081] For the re-identification model, the target in the image frame of the collected monitoring video is cropped, and the cropped images of the same target are stored in the same data set. For example, in a traffic monitoring scene, the cropped images of the same person or vehicle are stored in a data set; in a security scene, the cropped images of the same person are stored in a data set; in an intelligent interaction scene, the cropped images of the same face or the same gesture are stored in a data set. The re-identification model is trained by using the data set of the cropped images of the target. Optionally, the data set can also be subjected to data augmentation processing. For example, rotation, mirroring or random cropping, or by adding an occlusion object (such as a telegraph pole, a tree trunk, etc.) to improve the robustness of the model to various transformation scenes or various occlusion scenes.

[0082] For the image matching model, the background object in the image frame of the collected monitoring video is cropped, and the cropped images of the same background object are stored in the same data set. For example, in a traffic monitoring scene, the cropped images of the same road sign or building background object are stored in a data set. The image matching model is trained by using the data set of the cropped images of the background object. Optionally, landmark building data can also be added to improve the generalization ability of the image matching model. Optionally, an attention mechanism layer can be added to the image matching model, and a two-stage training method is adopted: the attention mechanism layer is frozen, and the convolution layer and the fully connected layer are unfrozen during training, so as to obtain a better classification accuracy; then the attention mechanism layer is unfrozen, the convolution layer and the fully connected layer are frozen, and the attention mechanism layer is trained alone, so as to further guide the network to pay attention to the direction, so that the model converges quickly.

[0083] Method two, foreground feature point elimination

[0084] The foreground feature point elimination process includes: extracting the deep local features (including the feature positions and confidence of each feature point) of the image to be processed according to the trained image matching model; obtaining the foreground position (the detection frame of the foreground) in the image to be processed according to the trained target detection model; and eliminating the feature points in the deep local features of the image to be processed that are located in the foreground detection frame.

[0085] For example, let the set of deep local features be Z = {z1, z2, … z n}. Let the set of feature points in the foreground detection frame be B = {b1, b2, … b m}. The set of retained deep local features is SAVE3, then:

[0086] z i = {pos i , thres i};

[0087]

[0088] pos i represents the feature position (such as pixel coordinates) of the i-th depth local feature point, thres i represents the confidence of the i-th depth local feature point.

[0089] Method three, feature sparsification

[0090] The process of feature sparsification is to sort the feature points within a certain range of each feature point according to the confidence, and retain a preset number of feature points with higher confidence. Optionally, the following steps are included: for each feature point, a circular region is determined with the feature point as the center and a preset length as the radius, the feature points in the circular region are sorted in descending order according to the confidence, and a preset number of feature points with higher confidence are retained.

[0091] It can be understood that the certain range of each feature point can be circular, matrix or other range, which is not specifically limited here.

[0092] Method four, picture registration

[0093] The picture registration process of the two adjacent image frames includes: extracting the respective depth local features of the two image frames according to the trained image matching model described above; then eliminating the foreground feature points in the respective depth local features of the two image frames according to the method in the above method two to obtain the respective remaining feature point sets SAVE1 and SAVE2 of the two image frames; matching the feature points in SAVE1 and SAVE2; and finally eliminating the outlier feature points in the matched feature points to reduce the false matching rate.

[0094] The matching method of the feature points in SAVE1 and SAVE2 can be: calculating the feature distance (such as Mahalanobis distance, cosine distance or Euclidean distance, etc.) between each feature point in SAVE1 and each feature point in SAVE2; and determining the feature points in SAVE1 and SAVE2 corresponding to the nearest feature distance as the matched feature points.

[0095] Existing technologies such as RANSAC algorithm can be used to eliminate outlier feature points, which are not specifically limited here.

[0096] The target recognition method provided by the embodiments of the present application will be described below.

[0097] Referring to Figure 1 is a flowchart of the target recognition method provided by the embodiments of the present application, which is an example and not a limitation, and the method can include the following steps:

[0098] S101, when the camera is in a tracking state and captures k frames of images, the first motion vector between every two adjacent image frames in the k frames of images is calculated.

[0099] wherein the first motion vector represents a shift of the whole picture of the image frame, and k is an integer greater than 1.

[0100] The steps S101-S104 in the embodiments of the present application are steps executed when the camera is in a tracking state. When the camera is in a non-tracking state, target recognition is not needed. Therefore, before S101, the tracking state of the camera needs to be identified first. The specific identification method can be referred to the description in the embodiments of the present application. Figure 4 The description in the embodiments of the present application is not repeated here.

[0101] After tracking starts, the picture taken by the camera rotating with the gimbal will continuously change, resulting in that the static object is considered as moving. Therefore, the motion vector cannot be directly calculated by the pixel coordinates of the foreground in the two adjacent frames. In order to solve the above problem, in the embodiments of the present application, the image registration is first performed on the two adjacent image frames, and then the shift of the registered picture is recorded as the first motion vector, and the shift of the registered foreground is recorded as the second motion vector. The image registration process can be referred to the description in the fourth method above, which is not repeated here.

[0102] In order to prevent the use of foreground features during image registration from causing the image registration accuracy to decrease, in the embodiments of the present application, the method in the third method above can be used to remove the foreground feature points in the picture before image registration. After the foreground feature points are removed, the remaining are background feature points. Since the background usually does not change or changes to a low degree, using the background feature points for image registration is beneficial to improve the accuracy of image registration.

[0103] In some application scenarios, the local texture of the image is relatively rich, i.e., there are many feature points in the image region. In this case, if all the feature points in the region are used for image registration, a large amount of computing resources will be consumed, and the efficiency of target recognition will be reduced. In order to solve this problem, in the embodiments of the present application, the method in the fourth method above can be used for feature sparsification processing before image registration, and only the feature points with high confidence are retained. Through this method, the mismatch caused by the feature points with low confidence can be avoided, and the amount of calculation can be reduced.

[0104] Exemplarily, for two adjacent image frames, the foreground feature points in each image frame are first removed by using the method in the third method above; then the remaining feature points are sparsified by using the fourth method above; and finally, the image registration is performed according to the sparsified feature points by using the method in the fifth method above.

[0105] Optionally, after the picture registration, S101 can comprise: determining, for each two adjacent image frames in the k frames of images, a third position point in a first image frame and a fourth position point in a second image frame; and calculating a second vector between the third position point and the fourth position point, the second vector being a first motion vector between the first image frame and the second image frame, wherein the first image frame and the second image frame are two adjacent image frames in the k frames of images.

[0106] It can be understood that the first image frame and the second image frame described above are two adjacent image frames after picture registration. For example, the position points described above can determine the center point of the first image frame as the third position point and the center point of the second image frame as the fourth position point.

[0107] For example, referring to Figure 2 is a schematic diagram of a motion vector provided by an embodiment of the present application. Figure 2 The left image in FIG. 1 represents a first image frame, Figure 2 The right image in FIG. 1 represents a second image frame, which is a subsequent image frame of the first image frame. Since the camera is in a tracking state, the center point A (third position point) in the first image frame moves to the A' point (A' is obtained by projecting A onto the second image frame) in the second image frame. The second vector BA' between the center point B (fourth position point) of the second image frame and the A' point can be calculated, and thus the first motion vector between the first image frame and the second image frame can be obtained.

[0108] S102, calculating a second motion vector between each two adjacent image frames in the k frames of images and each first foreground.

[0109] The second motion vector represents the offset of the foreground part in the image frame.

[0110] In the embodiment of the present application, the target detection model trained in the above manner one can be used to detect the foreground in the first image frame and the foreground in the second image frame. The output of the target detection model can include a detection frame and a number of each foreground. The same foreground corresponds to the same number.

[0111] In step S102, the second motion vector of the first foreground contained in the first image frame and the second image frame is calculated.

[0112] For example, the first image frame includes the first foreground 1 and 2, and the second image frame includes the first foreground 2 and 3. Since the first foreground 2 is included in both the first image frame and the second image frame, the second motion vector of the first foreground 2 between the first image frame and the second image frame is calculated.

[0113] In some embodiments, S102 can include: for each two adjacent image frames in the k-frame image, determining a first position point of a first foreground in a first image frame and a second position point of the first foreground in a second image frame; and calculating a first vector between the first position point and the second position point, the first vector being the second motion vector of the first foreground between the first image frame and the second image frame.

[0114] Optionally, the first position point and the second position point can be fixed position points. For example, the first position point can be the center of a detection box of the first foreground in the first image frame, and the second position point can be the center of a detection box of the first foreground in the second image frame.

[0115] Generally, the offset of a background image between two adjacent image frames is not large, and the first motion vector can be calculated using the center point of the first image frame and the center point of the second image frame. However, for a foreground image, the offset can be large. For example, the appearance and disappearance process of a person in a picture includes: not entering the picture -> part of the body enters the picture -> the whole body enters the picture -> part of the body leaves the picture -> the whole body leaves the picture. As the person moves, the position of the detection box of the foreground in the picture also changes. In this case, if the fixed first position point and the fixed second position point are still selected, it is easy to find that there is no corresponding second position point in the second image frame.

[0116] To solve the above problem, in the embodiments of the present application, S102 can include: for each first foreground in the k-frame image, determining a first position point for representing the first foreground in a first image frame and a second position point for representing the first foreground in a second image frame according to the position of a first detection box of the first foreground in the first image frame and the position of a second detection box of the first foreground in the second image frame, wherein the first image frame and the second image frame are two adjacent image frames in the k-frame image; and calculating a first vector between the first position point and the second position point, the first vector being the second motion vector.

[0117] Taking a rectangular detection box as an example, specifically, several key points on the detection box are extracted, such as the top-left corner vertex, the bottom-left corner vertex, the top-right corner vertex, the bottom-right corner vertex, the left boundary midpoint, the right boundary midpoint, the upper boundary midpoint and the lower boundary midpoint. When calculating the second motion vector, the following judgment is made:

[0118] 1) If the distance between the detection box of the same first foreground in the first image frame and the second image frame and the picture edge is greater than a preset threshold, it indicates that the first foreground is not at the picture edge, and the center point of the detection box of the first foreground is used to calculate the second motion vector.

[0119] 2) If the two boundaries of the detection box of the same first foreground in the first image frame or the second image frame are at the edge of the image, that is, the distance between the two boundaries and their respective nearest edge of the image is less than a preset threshold, then the second motion vector is calculated using the key points on the other two boundaries of the detection box. For example, if the upper and left boundaries of the detection box are at the edge of the image, then the second motion vector is calculated using the midpoint of the right boundary and the lower right corner vertex of the detection box; if the upper and lower boundaries of the detection box are at the edge of the image, then the second motion vector is calculated using the midpoint of the left boundary or the midpoint of the right boundary of the detection box.

[0120] 3) If the three boundaries of the detection box of the same first foreground in the first image frame or the second image frame are at the edge of the screen, that is, the distance of the three boundaries from their respective nearest screen edges is less than a preset threshold, then the second motion vector is calculated using the other boundary point of the detection box that is not at the edge of the screen. For example, if the upper boundary, right boundary and lower boundary of the detection box are all located at the edge of the screen, then the second motion vector is calculated using the midpoint of the left boundary of the detection box.

[0121] By using the above method, the position point used to represent the foreground is adaptively selected based on the position of the same foreground in the first image frame and the second image frame. The position point is used to represent the foreground position without being affected by the change of the foreground detection box, which effectively reduces the calculation error of the foreground motion vector caused by the change of the detection box.

[0122] The method for calculating the second motion vector is the same as that for calculating the first motion vector, and will not be repeated here.

[0123] S103, calculate each first motion score for each first foreground element in the k-frame image based on each first motion quantity and each second motion quantity.

[0124] In this embodiment, the motion score is used to represent the consistency between the offset of the entire image and the offset of the foreground portion.

[0125] See Figure 3 This is a schematic diagram of the motion vector difference provided in an embodiment of this application. For example... Figure 3 As shown, the first motion vector is The second motion vector is Can This is recorded as the first motion score. For a vector, Representing vectors The smaller the length of this vector, i.e., the smaller the first motion fraction, the higher the similarity between the offset of the entire image and the offset of the foreground part. It can also be... This is denoted as the first motion score. In this case, the larger the first motion score, the higher the similarity between the offset of the entire image and the offset of the foreground portion. It should be noted that in the following embodiments of this application, the example of a larger first motion score indicating a higher similarity between the offset of the entire image and the offset of the foreground portion is used for illustration.

[0126] S104, Identify the tracking target in the k-frame images based on each first motion score of each first foreground in the k-frame images.

[0127] Since the first motion score is calculated once for every two adjacent image frames, for k frames, each first foreground corresponds to at least one first motion score. For example, suppose k = 3, and the first image frame includes first foregrounds 1 and 2, the second image frame includes first foregrounds 1, 2, and 3, and the third image frame includes first foregrounds 2 and 3. For the first and second image frames, the first motion score a1 of first foreground 1 and the first motion score a2 of first foreground 2 are calculated; for the second and third image frames, the first motion score b1 of first foreground 2 and the first motion score b2 of first foreground 3 are calculated.

[0128] In one implementation, S104 includes: determining the first foreground corresponding to the highest first motion score as the tracking target. Continuing the above example, assuming that the highest first motion score among a1, a2, b1, and b2 is a1, then the first foreground 1 corresponding to a1 is determined as the tracking target.

[0129] However, as the example above shows, all three image frames contain the first foreground 2, which is very likely the tracked target, inconsistent with the identified tracked target. For example, in some application scenarios, a non-tracked target may only appear in two adjacent image frames, and the offset of this non-tracked target is highly similar to the overall offset of the image, potentially exceeding the first score corresponding to the actual tracked target. In such cases, sorting based solely on the first motion score of a single instance could lead to false detections.

[0130] To address the aforementioned problem, in another implementation, S104 includes:

[0131] Calculate the first total score of all first motion scores corresponding to each first foreground in the k-frame images; if the highest first total score is greater than a first threshold, then the first foreground corresponding to the highest first total score is determined as the tracking target.

[0132] Continuing with the example above, calculate the first total score for the first foreground 1, i.e., a1; calculate the first total score for the first foreground 2, i.e., a2+b1; and calculate the first total score for the first foreground 3, i.e., b2.

[0133] Since the first total score reflects the overall offset of the first foreground in k frames, rather than the offset of a single image frame, determining the tracking target based on the first total score can effectively avoid false detections caused by a high first motion score in a single instance, thereby improving the reliability of target recognition.

[0134] Optionally, if the highest first total score is less than the first threshold, it is determined to be a false tracking.

[0135] In practical applications, the following situations may occur: the target being tracked appears in the later frames of the k-frame image. If this is judged as a false tracking, it is easy to miss the detection.

[0136] To prevent missed detections, optionally, if the highest first total score is less than a first threshold, then calculate the second motion score for each second foreground in h frames of images, where h frames are images captured by the camera in tracking mode after capturing k frames, and h is an integer greater than 1; calculate the second total score for all second motion scores corresponding to each second foreground in h frames of images; if the highest second total score is greater than the first threshold, then determine the second foreground corresponding to the highest second total score as the tracking target; if the highest second total score is less than the first threshold, then determine it as mistracking.

[0137] The method for calculating the second motion score of each second foreground element in the h-frame image is the same as that in S101-S103 above, and the method for calculating the second total score is the same as that in S104 above. For details, please refer to the description in the above embodiments, which will not be repeated here.

[0138] When the target appears in the later frames of the k-frame image, it can be correctly identified by continuing to identify the target in the h-frame images taken after the k-frame image. This method effectively avoids missed detections, thereby improving the reliability of target identification.

[0139] It should be noted that in the embodiments of this application, k-frame images refer to k consecutive image frames, and h-frame images refer to h consecutive image frames.

[0140] In the embodiments shown in S101-S104 above, by calculating the overall offset and foreground offset between every two adjacent image frames, a first motion score is calculated for each foreground element. This first motion score is used to evaluate the offset consistency between the foreground and the overall image. The tracking target is then identified based on the first motion score, which is equivalent to identifying the tracking target based on the consistency of the motion direction between the foreground and the overall image. This method effectively improves the accuracy and reliability of target recognition.

[0141] As described in S101, S101-S104 are executed while the camera is in tracking mode. The target recognition method provided in this application embodiment also includes a tracking state determination process. For example, see... Figure 4 This is a schematic diagram of the target recognition process provided in an embodiment of this application. It is intended as an example and not a limitation. Figure 4 As shown, the target recognition process may include the following steps:

[0142] S401: Each time the camera detects an image frame, it determines the current tracking status of the camera based on that image frame.

[0143] S402, if the current camera is in a non-tracking state, continue to acquire the next image frame.

[0144] S403, If the current camera is in tracking mode, increment the value of i by one.

[0145] S404, determine whether the current value of i has reached the preset value.

[0146] If the current value of i reaches the preset value K, then the steps in S101-S104 above are executed.

[0147] If the current value of i has not reached the preset value K, then continue to acquire the next image frame.

[0148] In another implementation, after S403, when the camera is in tracking mode and two frames of images are acquired, the steps in S101-S103 are executed; then, each time a new frame of image is acquired, the steps in S101-S103 are executed once. When i reaches a preset value, the step in S104 is executed.

[0149] In some embodiments, the process of determining the tracking status may include:

[0150] When the camera acquires the third image frame, it performs matching processing based on the third image frame and the reference image to obtain a matching result, wherein the reference image is an image captured by the camera in a non-tracking state;

[0151] If the matching result indicates that the third image frame matches the reference image, then the camera is determined to be in a non-tracking state;

[0152] If the matching result indicates that the third image frame does not match the reference image, then the camera is determined to be in tracking mode.

[0153] It is understood that the third image frame in this embodiment can be any frame of image acquired by the camera. In other words, the third image frame is the current image frame to be processed. For example, if the current image frame to be processed is the t-th image frame, then the t-th image frame is the third image frame. If the t-th image frame does not match the reference image, then the t-th image frame is recorded as a frame captured by the camera in tracking mode. Then, the next image frame, i.e., the (t+1)-th image frame, is processed. When the number of image frames captured by the camera in tracking mode reaches k, the above-described methods S101-S104 are used for processing.

[0154] The reference image can be the first image taken by the camera when it is not tracking.

[0155] To ensure the accuracy of the matching process, optionally, the matching process between the third image frame and the reference image includes the following steps:

[0156] Obtain the first local feature in the third image frame and the second local feature in the reference image;

[0157] Remove the foreground features from the first local features to obtain the processed first local features;

[0158] Remove the foreground features from the second local features to obtain the processed second local features;

[0159] The matching result is obtained by performing matching processing based on the processed first local feature and the processed second local feature.

[0160] Local features can be obtained using the image matching model trained in Method 1 above. Foreground features can be removed using the method described in Method 2 above. See the descriptions in the above embodiments for details, which will not be repeated here.

[0161] Optionally, the first local feature includes the feature positions of each of a plurality of first feature points, and the second local feature includes the feature positions and confidence levels of each of a plurality of second feature points. Accordingly, the step of performing matching processing based on the processed first local feature and the processed second local feature may include:

[0162] Based on the feature positions and confidence levels of each of the multiple second feature points, a third feature point is selected from the multiple second feature points, wherein the number of the third feature points is less than the number of the second feature points;

[0163] Based on the feature positions of the first feature point and the third feature point, a matching process is performed on the first feature point and the third feature point to obtain the matching result.

[0164] The method for selecting the third feature point can be processed using the method described in Method 3 above. For details, please refer to the description of Method 3 in the above embodiments, which will not be repeated here.

[0165] Generally, if an image has rich local texture, then that region typically has many local features. However, not all local features can be effectively matched. Local features with high confidence generally have better matching results, while local features with low confidence may result in mismatches. Moreover, the more features there are, the more computational resources are consumed, the longer the computation wait time, and the larger the memory usage. In this embodiment, a third feature point is selected from multiple second feature points based on their respective feature positions and confidence levels, and the number of third feature points is less than the number of second feature points. This is equivalent to performing feature sparsification on the local features. While maintaining the density of local features with high confidence, it thins out local features with low confidence, effectively reducing feature mismatches, while also reducing computational resource consumption and improving computational efficiency and memory utilization.

[0166] Optionally, the step of matching the first feature point and the third feature point based on the feature positions of the first feature point and the third feature point may include:

[0167] Calculate the positional offset between the feature position of each first feature point and the feature position of each third feature point;

[0168] Count the number of features of the first feature point corresponding to a position offset less than the second threshold;

[0169] If the number of features is greater than the third threshold, then the matching result indicates that the third image frame matches the reference image;

[0170] If the number of features is not greater than the third threshold, then the matching result indicates that the third image frame does not match the reference image.

[0171] For example, the i-th feature in the reference image is fbi (the first feature point), with pixel coordinates (xbi, ybi) (the feature position of the first feature point), and the j-th feature in the third image frame is fmj (the third feature point), with pixel coordinates (xmi, ymi) (the feature position of the third feature point). If |xb i -xm i |≤P, and|yb i -ym i If |≤P, then the positional offset between fbi and fmi is determined to be less than the second threshold P.

[0172] The method described in this application identifies the camera tracking status before target recognition; the target recognition process is then triggered only when the camera is in tracking mode. This method effectively avoids misidentification of targets when the camera is not tracking, further improving the reliability of target recognition.

[0173] In some application scenarios, in order to facilitate users to view the tracking results, the tracking results can be output after executing the method in the above embodiments and identifying the tracking target.

[0174] In one implementation, the album containing the tracked target can be output. For example, see [link to example]. Figure 5 This is a schematic diagram of the tracking album provided in an embodiment of this application. Figure 5 As shown, if a tracking target is identified within each tracking period, screenshots of the tracking target in each image frame within that tracking period are saved, forming a tracking album for each tracking period. Users can select a tracking period to download and view the corresponding tracking target.

[0175] In another implementation, tracking status can be annotated in the monitoring video. If the matching result of an image frame with the reference image indicates that the current camera is in a non-tracking state, then that image frame is marked with a first annotation; if the matching result of an image frame with the reference image indicates that the current camera is in a tracking state, then that image frame is marked with a second annotation. Based on the first and second annotations, users can quickly find videos in the tracking state. For an example, see [link to example]. Figure 6 This is a schematic diagram of the monitoring video provided in an embodiment of this application. Figure 6 As shown, the black progress bar represents the video in non-tracking mode, and the white progress bar represents the video in tracking mode.

[0176] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0177] Corresponding to the target recognition method described in the above embodiments, Figure 7 This is a structural block diagram of the target recognition device provided in the embodiments of this application. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0178] Reference Figure 7 The device includes:

[0179] The first calculation unit 71 is used to calculate the first motion vector between every two adjacent image frames in the k-frame images when the camera captures k frames in the tracking state, wherein the first motion vector represents the offset of the overall image frame, and k is an integer greater than 1.

[0180] The second calculation unit 72 is used to calculate the second motion vector of each first foreground between every two adjacent image frames in the k-frame image, where the second motion vector represents the offset of the foreground portion in the image frame.

[0181] The third calculation unit 73 is used to calculate each first motion score of each first foreground in the k-frame image based on each first motion quantity and each second motion quantity.

[0182] The target recognition unit 74 is used to identify the tracking target in the k-frame images based on each first motion score of each first foreground in the k-frame images.

[0183] Optionally, the second computing unit 72 is also used for:

[0184] For each of the first foregrounds in the k-frame images, based on the position of the first detection box of the first foreground in the first image frame and the position of the second detection box of the first foreground in the second image frame, a first position point in the first image frame and a second position point in the second image frame are determined, wherein the first image frame and the second image frame are two adjacent image frames in the k-frame images.

[0185] Calculate a first vector between the first position point and the second position point, where the first vector is the second motion vector.

[0186] Optionally, the third computing unit 73 is also used for:

[0187] Calculate the first total score of all first motion scores corresponding to each of the first foreground elements in the k-frame images;

[0188] If the highest first total score is greater than the first threshold, then the first foreground corresponding to the highest first total score is determined as the tracking target;

[0189] If the highest first total score is less than the first threshold, then the second motion score of each second foreground in h frames is calculated, where h frames are images captured by the camera in tracking mode after capturing k frames, and h is an integer greater than 1.

[0190] Calculate the second total score of all second motion scores corresponding to each second foreground in the h-frame image;

[0191] If the highest second total score is greater than the first threshold, then the second foreground corresponding to the highest second total score is determined as the tracking target;

[0192] If the highest second total score is less than the first threshold, it is determined to be a false tracking.

[0193] Optionally, device 7 also includes:

[0194] The state recognition unit 75 is used to, when the camera acquires a third image frame, perform matching processing on the third image frame and a reference image to obtain a matching result, wherein the reference image is an image captured by the camera in a non-tracking state; if the matching result indicates that the third image frame matches the reference image, then the camera is determined to be in a non-tracking state; if the matching result indicates that the third image frame does not match the reference image, then the camera is determined to be in a tracking state.

[0195] Optionally, the state recognition unit 75 is also used for:

[0196] Obtain the first local feature in the third image frame and the second local feature in the reference image;

[0197] Remove the foreground features from the first local features to obtain the processed first local features;

[0198] Remove the foreground features from the second local features to obtain the processed second local features;

[0199] The matching result is obtained by performing matching processing based on the processed first local feature and the processed second local feature.

[0200] Optionally, the first local feature includes the feature positions of each of the multiple first feature points, and the second local feature includes the feature positions and confidence levels of each of the multiple second feature points.

[0201] Accordingly, the state recognition unit 75 is also used for:

[0202] Based on the feature positions and confidence levels of each of the multiple second feature points, a third feature point is selected from the multiple second feature points, wherein the number of the third feature points is less than the number of the second feature points;

[0203] Based on the feature positions of the first feature point and the third feature point, a matching process is performed on the first feature point and the third feature point to obtain the matching result.

[0204] Optionally, the state recognition unit 75 is also used for:

[0205] Calculate the positional offset between the feature position of each first feature point and the feature position of each third feature point;

[0206] Count the number of features of the first feature point corresponding to a position offset less than the second threshold;

[0207] If the number of features is greater than the third threshold, then the matching result indicates that the third image frame matches the reference image;

[0208] If the number of features is not greater than the third threshold, then the matching result indicates that the third image frame does not match the reference image.

[0209] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.

[0210] in addition, Figure 7 The target identification device shown can be a software unit, hardware unit, or a combination of software and hardware built into an existing terminal device, or it can be integrated into the terminal device as an independent component, or it can exist as an independent terminal device.

[0211] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0212] Figure 8 This is a schematic diagram of the structure of the terminal device provided in the embodiments of this application. For example... Figure 8 As shown, the terminal device 8 of this embodiment includes: at least one processor 80 ( Figure 8 (Only one is shown) a processor, a memory 81, and a computer program 82 stored in the memory 81 and executable on the at least one processor 80, which, when executing the computer program 82, implements the steps in any of the above-described target recognition method embodiments.

[0213] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. This terminal device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 8 This is merely an example of terminal device 8 and does not constitute a limitation on terminal device 8. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0214] The processor 80 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0215] In some embodiments, the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or memory of the terminal device 8. In other embodiments, the memory 81 may be an external storage device of the terminal device 8, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the terminal device 8. Furthermore, the memory 81 may include both internal and external storage units of the terminal device 8. The memory 81 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 81 can also be used to temporarily store data that has been output or will be output.

[0216] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the steps in the above-described method embodiments.

[0217] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments.

[0218] If the integrated unit is implemented as 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0219] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0220] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0221] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0222] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0223] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A target recognition method characterized by, The method comprises the following steps: When the camera shoots k frames of images in a tracking state, a first motion vector between each two adjacent image frames in the k frames of images is calculated, wherein the first motion vector represents the offset of the entire image frame, and k is an integer greater than 1; A second motion vector between each two adjacent image frames in the k frames of images and each first foreground is calculated, wherein the second motion vector represents the offset of the foreground part in the image frame; According to each first motion vector and each second motion vector, a first motion score of each first foreground in the k frames of images is calculated; According to each first motion score of each first foreground in the k frames of images, a tracking target in the k frames of images is identified; The method further comprises the following steps: For each first foreground in the k frames of images, a first position point in a first image frame for representing the first foreground and a second position point in a second image frame for representing the first foreground are determined according to the position of the first detection box of the first foreground in the first image frame and the position of the second detection box of the first foreground in the second image frame, wherein the first image frame and the second image frame are two adjacent image frames in the k frames of images; A first vector between the first position point and the second position point is calculated, and the first vector is the second motion vector; The method further comprises the following steps: A first total score of all first motion scores corresponding to each first foreground in the k frames of images is calculated; If the highest first total score is greater than a first threshold value, the first foreground corresponding to the highest first total score is determined as the tracking target.

2. The object recognition method of claim 1, wherein, After the first total score of all first motion scores corresponding to each first foreground in the k frames of images is calculated, the method further comprises the following steps: If the highest first total score is less than the first threshold value, a second motion score of each second foreground in h frames of images is calculated, wherein the h frames of images are images shot by the camera in a tracking state after the k frames of images are shot, and h is an integer greater than 1; A second total score of all second motion scores corresponding to each second foreground in the h frames of images is calculated; If the highest second total score is greater than the first threshold value, the second foreground corresponding to the highest second total score is determined as the tracking target; If the highest second total score is less than the first threshold value, it is determined as a false tracking.

3. The object recognition method of claim 1, wherein, The method further comprises the following steps: When the camera obtains a third image frame, a matching process is performed according to the third image frame and a reference image to obtain a matching result, wherein the reference image is an image shot by the camera in a non-tracking state; If the matching result indicates that the third image frame matches the reference image, it is determined that the camera is in a non-tracking state. If the matching result indicates that the third image frame is not matched with the reference image, it is determined that the camera is in a tracking state.

4. The object recognition method of claim 3, wherein, The matching processing is performed according to the third image frame and the reference image to obtain a matching result, including: obtaining first local features in the third image frame and second local features in the reference image; eliminating foreground features in the first local features to obtain processed first local features; eliminating foreground features in the second local features to obtain processed second local features; performing matching processing according to the processed first local features and the processed second local features to obtain the matching result.

5. The object recognition method of claim 4, wherein, The first local features include feature positions of a plurality of first feature points, and the second local features include feature positions and confidence levels of a plurality of second feature points; The matching processing is performed according to the processed first local features and the processed second local features to obtain the matching result, including: screening third feature points from the plurality of second feature points according to the feature positions and the confidence levels of the plurality of second feature points, the number of the third feature points being less than the number of the second feature points; performing matching processing on the first feature points and the third feature points according to the feature positions of the first feature points and the feature positions of the third feature points to obtain the matching result.

6. The object recognition method of claim 5, wherein, The matching processing is performed according to the feature positions of the first feature points and the feature positions of the third feature points to obtain the matching result, including: calculating a position offset between the feature position of each first feature point and the feature position of each third feature point; counting a feature number of first feature points corresponding to the position offset less than a second threshold value; if the feature number is greater than a third threshold value, the matching result indicates that the third image frame is matched with the reference image; if the feature number is not greater than the third threshold value, the matching result indicates that the third image frame is not matched with the reference image.

7. A target recognition device, characterized by including: a first calculation unit configured to calculate a first motion vector between each two adjacent image frames in k frames of images when a camera is in a tracking state, wherein the first motion vector represents an offset of an image frame as a whole, and k is an integer greater than 1; a second calculation unit configured to calculate a second motion vector between each two adjacent image frames in the k frames of images, the second motion vector representing an offset of a foreground part in an image frame; a third calculation unit configured to calculate a first motion score of each first foreground in the k frames of images according to each first motion vector and each second motion vector; a target recognition unit configured to recognize a tracking target in the k frames of images according to the first motion score of each first foreground in the k frames of images; wherein the second calculation unit is further configured to: For each of the first foregrounds in the k-frame images, a first position point in a first image frame for representing the first foreground and a second position point in a second image frame for representing the first foreground are determined according to a position of a first detection box of the first foreground in the first image frame and a position of a second detection box of the first foreground in the second image frame, wherein the first image frame and the second image frame are two adjacent image frames in the k-frame images; a first vector between the first position point and the second position point is calculated, and the first vector is the second motion vector; wherein the target recognition unit is further configured to: a first total score of all first motion scores corresponding to each of the first foregrounds in the k-frame images is calculated; if the highest first total score is greater than a first threshold, a first foreground corresponding to the highest first total score is determined as the tracking target.

8. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the method in any one of claims 1 to 6.

9. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 8. The computer program is executed by the processor to implement the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Target person following method, computer readable storage medium and robot

    CN112069879A

  • Tracking method, tracking device, terminal equipment and readable storage medium

    CN112330715A