Object tracking method, device, storage medium and electronic device
By determining candidates and predicting image frames in the target frame image and determining the target area and target image frame, the problem of low target tracking accuracy in the prior art is solved, and a higher tracking accuracy is achieved.
Patent Information
- Application Number
- CN202210074892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-21
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-01-21
AI Technical Summary
In the prior art, the tracking accuracy of the target object is low, especially when the target motion state changes drastically.
By determining the candidate image box and the predicted image box in the target frame image, the target area is determined based on the predicted image box, and the target image box of the target object is determined from the plurality of candidate image boxes.
It improves the tracking accuracy of the target object and can track the target object more accurately when the target motion state changes.
Smart Images

Figure CN114419100B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of artificial intelligence, and in particular, to a method, device, storage medium and electronic device for tracking an object. Background Art
[0002] In the related art, when tracking a target, if the motion state of the target changes dramatically, it will cause tracking failure or tracking error.
[0003] It can be seen that the related technology has the problem of low target tracking accuracy.
[0004] Currently, no effective solution has been proposed for the above-mentioned problems existing in the related technologies. Summary of the invention
[0005] Embodiments of the present invention provide a method, device, storage medium and electronic device for tracking an object, so as to at least solve the problem of low accuracy of tracking a target in the related art.
[0006] According to one embodiment of the present invention, a method for tracking an object is provided, comprising: determining each candidate image frame included in a target frame image, and determining a first probability that each of the candidate image frames is an image frame for identifying a target object; in a case where the first probabilities are all less than a predetermined threshold, determining a predicted image frame included in the target frame image, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and adjacent to the target frame image; determining a target area based on the predicted image frame, wherein the target area includes a plurality of first image frames, and the predicted image frame is located in the target area; and determining a target image frame of the target object based on the plurality of first image frames.
[0007] According to another embodiment of the present invention, there is provided an object tracking device, comprising: determining each candidate image frame included in a target frame image, and determining a first probability that each candidate image frame is an image frame for identifying a target object, to obtain a plurality of the first probabilities; in a case where the plurality of the first probabilities are all less than a predetermined threshold, determining a predicted image frame included in the target frame image, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and adjacent to the target frame image; determining a target area based on the predicted image frame, wherein the target area includes a plurality of first image frames and the predicted image frame is located in the target area; and determining a target image frame of the target object based on the plurality of the first image frames.
[0008] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.
[0009] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0010] Through the present invention, each candidate image frame included in the target frame image is determined, and the first probability of each candidate image frame being an image frame for identifying the target object is determined. When the first probabilities are all less than a predetermined threshold, the predicted image frame included in the target frame image is determined, and a target area including multiple first image frames is determined according to the predicted image frame, and the target image frame of the target object is determined according to the multiple first image frames. Since the predicted image frame of the target object in the target frame image can be predicted according to the image adjacent to the target frame image collected before the target frame image, the target area is determined according to the predicted image frame, and then the target image frame is determined according to the multiple first image frames in the target area, that is, when tracking the target object, more image frames can be determined by the predicted image frame, and the target image frame can be determined from the multiple image frames. Therefore, the problem of low target tracking accuracy existing in the related art can be solved, and the effect of improving the target tracking accuracy can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a hardware structure block diagram of a mobile terminal of an object tracking method according to an embodiment of the present invention;
[0012] Figure 2 is a flowchart of a method for tracking an object according to an embodiment of the present invention;
[0013] Figure 3 is a flow chart of a method for tracking an object according to a specific embodiment of the present invention;
[0014] Figure 4 is an example diagram of a method for tracking an object according to a specific embodiment of the present invention;
[0015] Figure 5 is a structural block diagram of a device for tracking an object according to an embodiment of the present invention. DETAILED DESCRIPTION
[0016] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.
[0017] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0018] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of an object tracking method according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0019] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the object tracking method in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0020] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0021] In this embodiment, a method for tracking an object is provided. Figure 2 is a flowchart of a method for tracking an object according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0022] Step S202, determining each candidate image frame included in the target frame image, and determining a first probability that each candidate image frame is an image frame for identifying a target object;
[0023] Step S204, when the first probabilities are all less than a predetermined threshold, determining a predicted image frame included in the target frame image, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and adjacent to the target frame image;
[0024] Step S206, determining a target area based on the predicted image frame, wherein the target area includes a plurality of first image frames, and the predicted image frame is located in the target area;
[0025] Step S208: determining a target image frame of the target object based on the plurality of first image frames.
[0026] In the above embodiment, the target frame image and the predicted image may be images captured by the camera device. After the target frame image is acquired, when the target object fails to be tracked in the target frame image, that is, when the position of the target object cannot be accurately determined in the target frame image, the target frame image may be identified and the candidate image frame included in the target frame image may be determined. That is, when analyzing the target frame image, if it is determined that the regional image of the sub-region of the target frame image may be the target object, the regional image is framed with the candidate image frame to obtain the candidate image frame. And determine the first probability that each candidate image frame is an image frame for identifying the target object. When there are multiple candidate image frames, multiple first probabilities can be obtained, and when there is one candidate image frame, one first probability can be obtained, that is, the first probability can be one or more. If the first probabilities are all less than a predetermined threshold (that is, when the first probability is one, one first probability is less than the predetermined threshold, or, when the first probability is multiple, multiple first probabilities are all less than the predetermined threshold), the target area determined by the predicted image frame is determined. The target image frame is determined from the target area. Among them, the target object can be a person, a vehicle, an object, etc.
[0027] In the above embodiment, the first probability can be determined based on the discriminant model of the binary classification principle, and a predetermined threshold T of whether the candidate image frame belongs to the target object to be tracked can be set in the discriminant model based on the binary classification principle. When the highest probability value in the set of candidate image frames extracted from the target image frame is lower than the predetermined threshold, a correction strategy can be triggered to change the tracking state of the target object from the normal state s1 to the lost state s2. Then, the target area is determined based on the predicted image frame, and the target image frame is determined based on the multiple first image frames included in the target area.
[0028] In the above embodiment, the predicted image may be one or more frames of images adjacent to the target frame image that are acquired before the target frame image. In the predicted image, the target object can be tracked, that is, the image frame of the target object has been determined in the predicted image. When the predicted image is one frame, the predicted image may be the previous frame of the target frame image. When the predicted image is multiple frames, the predicted image may be the previous multiple frames of the target frame image. The predicted image frame in the target frame image can be comprehensively predicted based on the multiple frames.
[0029] Optionally, the executor of the above steps may be a background processor, or other devices with similar processing capabilities, or a machine that integrates at least an image acquisition device and a data processing device, wherein the image acquisition device may include a graphics acquisition module such as a camera, and the data processing device may include a computer, a mobile phone or other terminal, but is not limited thereto.
[0030] Through the present invention, each candidate image frame included in the target frame image is determined, and the first probability of each candidate image frame being an image frame for identifying the target object is determined. When the first probabilities are all less than a predetermined threshold, the predicted image frame included in the target frame image is determined, and a target area including multiple first image frames is determined according to the predicted image frame, and the target image frame of the target object is determined according to the multiple first image frames. Since the predicted image frame of the target object in the target frame image can be predicted according to the image adjacent to the target frame image collected before the target frame image, the target area is determined according to the predicted image frame, and then the target image frame is determined according to the multiple first image frames in the target area, that is, when tracking the target object, more image frames can be determined by the predicted image frame, and the target image frame can be determined from the multiple image frames. Therefore, the problem of low target tracking accuracy existing in the related art can be solved, and the effect of improving the target tracking accuracy can be achieved.
[0031] In an exemplary embodiment, determining the target area based on the predicted image frame includes: expanding outward from the predicted image frame to establish N×M first image frames, wherein the predicted image frame is included in the N×M first image frames, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 2; and determining the area corresponding to the N×M first image frames as the target area. In this embodiment, when determining the target area based on the predicted image frame, the predicted image frame can be expanded outward to establish N×M first image frames. Wherein, N and M can be integers greater than or equal to 2. N and M can be equal or unequal. When expanding, the image frames located above, below, right below, right below, and right of the predicted image frame and the predicted image frame can be determined as the first image frame, that is, the target area is the area corresponding to the first image frame of 2×3. The image frames and the predicted image frames located above, below, left below, left below, and left of the predicted image frame can also be determined as the target area. It is also possible to expand outward with the predicted target area as the center to obtain a target area of 3×3, 5×5, 7×7, etc. The size of each first image frame may be the same as or different from the size of the predicted image frame. It should be noted that the above N×M is only an exemplary description, and N×M may also be 2×2, 4×4, 2×4, 3×6, which is not limited in the present invention.
[0032] In an exemplary embodiment, determining the target image frame of the target object based on multiple first image frames includes: determining the second probability that each first image frame is the image frame of the target object to obtain multiple second probabilities; when multiple second probabilities are all less than the predetermined threshold, converting the image of the target area into an image of a predetermined format to obtain a converted image; determining the circumscribed image frame of each continuous line included in the edge line set of the converted image; and determining the target image frame based on the circumscribed image frame. In this embodiment, when determining the target image frame of the target object based on multiple first image frames, the second probability that each first image frame is the image frame of the target object can be determined, and when the second probabilities are all less than the predetermined threshold, the image of the target area is converted into an image of a predetermined format to obtain a converted image. The predetermined format can be a grayscale format, that is, when the second probabilities are all less than the predetermined threshold, the image of the target area can be converted into a grayscale image.
[0033] In the above embodiment, after the conversion image is obtained, the non-connected lines included in the edge line set of the conversion image are removed, the circumscribed image frame of each continuous line included in the edge line set is determined, and the target image frame is determined according to the circumscribed image frame.
[0034] In the above embodiment, the image frame M can be predicted t-1* is the center, and a 3×3 grid area is constructed at the same position in the target image frame t to obtain the target area. The second probability S of each first image frame is calculated. If the second probability of each first image frame is less than the predetermined threshold T, the color image in the entire target area is converted into a grayscale image, and then the edge detection algorithm is used to obtain the edge line set, and the circumscribed rectangle of each continuous line in the target area is obtained. The target image frame is determined according to the circumscribed image frame. Among them, the circumscribed image frame can be one or more. When there is one circumscribed image frame, the circumscribed image frame can be determined as the target image frame.
[0035] In an exemplary embodiment, when there are multiple external image frames, determining the target image frame based on the external image frames includes: determining a sequence of external image frames obtained by sorting the multiple external image frames in order of area from large to small; determining the first first number of second image frames included in the sequence of external image frames; and determining the target image frame based on the second image frames. In this embodiment, multiple external image frames may be sorted in order of area from large to small to obtain an external image frame sequence, determining the first first number of second image frames in the sequence of external image frames, and determining the target image frame based on the second image frames. The first number may be 2, 3, etc.
[0036] In an exemplary embodiment, determining the target image frame based on the second image frame includes: determining the first coordinates of the first target point of each second image frame to obtain the first coordinates of the first quantity; determining the average of the first coordinates of the first quantity to obtain the second coordinate; determining the average of the side lengths of the first quantity of the second image frames to obtain the first average side length; determining the image frame with the point corresponding to the second coordinate as the first target point and the first average side length as the side length as the target image frame. In this embodiment, the first coordinates of the first target point of each second image frame can be determined to obtain the first coordinates of the first quantity. Determine the average of the first coordinates of the first quantity to obtain the second coordinate. Among them, the x coordinate of the second coordinate is the average of the x coordinates of the first coordinates of the first quantity, and the y coordinate of the second coordinate is the average of the y coordinates of the first coordinates of the first quantity.
[0037] In the above embodiment, the average value of the side lengths of the first number of second image frames can also be determined to obtain a first average side length, wherein the length included in the first average side length can be the average value of the lengths of the first number of second image frames, and the width included in the first average side length can be the average value of the widths of the first number of second image frames.
[0038] In the above embodiment, after determining the second coordinate and the first average side length, the point corresponding to the second coordinate can be used as the first target point, and the image frame can be determined with the first average side length as the side length, and the image frame can be determined as the target image frame. The first target point can be the center point of the image frame or any point among the four vertices. For example, when the first target point is the upper left corner vertex, the image frame with the point corresponding to the second coordinate as the upper left corner point and the first average side length as the side length can be determined as the target image frame.
[0039] In an exemplary embodiment, after determining the second probability that each of the first image frames is an image frame of the target object to obtain a plurality of the second probabilities, the method further includes: when there is a probability greater than the predetermined threshold among the plurality of the second probabilities, determining a second number of third probabilities included in the plurality of the second probabilities, wherein each probability included in the third probability is greater than other probabilities included in the second probability except the third probability; when the third probabilities of the second number are all greater than the predetermined threshold, determining the target image frame based on the third image frames corresponding to the third probabilities of the second number; when the third probabilities of the second number include only one fourth probability greater than the predetermined threshold, determining the image frame corresponding to the fourth probability as the target image frame. In this embodiment, when there is a probability greater than the predetermined threshold among the plurality of the second probabilities, determining the largest second number of third probabilities among the second probabilities, and when the third probabilities are all greater than the predetermined threshold, determining the target image frame based on the third image frame corresponding to the third probability of the second number. When the third probabilities of the second number include only one fourth probability greater than the predetermined threshold, determining the image frame corresponding to the fourth probability as the target image frame. The second number can be 2, 3, etc., and the present invention is not limited thereto.
[0040] In an exemplary embodiment, determining the target image frame based on the third image frames corresponding to the third probability of the second number includes: determining the second coordinates of the second target point of each of the third image frames to obtain the third coordinates of the second number; determining the average value of the third coordinates of the second number to obtain the fourth coordinate; determining the average value of the side lengths of the third image frames of the second number to obtain the second average side length; determining the image frame with the point corresponding to the fourth coordinate as the second target point and the second average side length as the side length as the target image frame. In this embodiment, when the third probabilities of the second number are all greater than a predetermined threshold, the second coordinates of the second target point of each third image frame are determined to obtain the third coordinates of the second number, and the average value of the third coordinates of the second number is determined to obtain the fourth coordinate. Wherein, the x coordinate of the fourth coordinate is the average value of the x coordinates of the third coordinates of the second number, and the y coordinate of the fourth coordinate is the average value of the y coordinates of the third coordinates of the second number.
[0041] In the above embodiment, the average value of the side lengths of the second number of third image frames is also determined to obtain a second average side length, wherein the length included in the second average side length may be the average value of the lengths of the second number of third image frames, and the width included in the second average side length may be the average value of the widths of the second number of third image frames.
[0042] In the above embodiment, after the fourth coordinate and the second average side length are determined, the point corresponding to the fourth coordinate can be used as the second target point, and the image frame can be determined with the second average side length as the side length, and the image frame can be determined as the target image frame. The second target point can be the center point of the image frame or any point among the four vertices. For example, when the second target point is the upper left corner vertex, the image frame with the point corresponding to the fourth coordinate as the upper left corner point and the second average side length as the side length can be determined as the target image frame.
[0043] The object tracking method is described below in conjunction with a specific implementation method:
[0044] Figure 3 is a flow chart of a method for tracking an object according to a specific embodiment of the present invention. Figure 3 As shown, the process includes:
[0045] Step S302: The previous frame is tracked normally, and prediction is performed after obtaining the next frame.
[0046] Step S304, determine whether the loss of the target triggers an abnormal event. If the judgment result is yes, execute step S306, if the judgment result is no, execute step S318.
[0047] Step S306, centering on the prediction result of the previous frame, establishing a network in the frame where the target has been determined to be lost, and evaluating the probability (corresponding to the second probability) that each grid (corresponding to the first image frame) belongs to the target (corresponding to the target object).
[0048] Step S308, determine whether the probability values of all grids are less than a certain threshold (corresponding to the above-mentioned predetermined threshold). If the judgment result is yes, execute step S310, and if the judgment result is no, execute step S316.
[0049] Step S310, graying the color image in the grid area and then using the Canny edge detection operator.
[0050] Step S312, obtaining the circumscribed rectangle of the edge in the network area (corresponding to the circumscribed image frame mentioned above).
[0051] Step S314: Estimate the target position (corresponding to the above-mentioned target image frame) in the current frame using the set of circumscribed rectangles (corresponding to multiple circumscribed image frames).
[0052] Step S316: Directly estimate the target position using the network individuals with probability values greater than a predetermined threshold.
[0053] Step S318: Train and adjust the tracking model using the corrected target state information.
[0054] Figure 4 It is an example diagram of the object tracking method according to a specific embodiment of the present invention. As Figure 4 shown, the process includes:
[0055] (1) Set the probability threshold T for the candidate image to belong to the tracking target in the discriminant model based on the binary classification principle. When the highest probability value in the set of candidate images extracted in the t-th frame is lower than this threshold, trigger the correction strategy, that is, the tracking state changes from the normal state s1 to the lost state s2, and enter step (2).
[0056] (2) According to the predicted target box M in the (t - 1)-th frame in the current frame t t-1 * as the center, construct a 3×3 grid area at the same position in the current frame t, as shown in state s3. Calculate the probability score S for each grid in s3. If the score of each grid is less than the threshold T, enter step (4); otherwise, enter step (3).
[0057] (3) Select the two grids m with the highest probability scores in state s7 ta , m tb and S(m ta ) ≥ S(m tb ). If S(m ta ) ≥ T and S(m tb ) ≥ T, then the corrected prediction result M t * = (m ta + m tb ) / 2. If S(m ta ) ≥ T and S(m tb ) < T, then the corrected prediction result M t * = m ta , and enter step (6).
[0058] (4) After converting the color image in the entire grid area to a grayscale image, that is, converting state s3 to s4, then use the edge detection algorithm to obtain the set of edge lines, and obtain the circumscribed rectangle of each continuous line in the grid area to construct the set of circumscribed rectangles, that is, state s5, and enter step (5).
[0059] (5) Select the two largest bounding rectangles B from the bounding rectangle set extracted in state s6 ta and B tb , then the prediction result M in the current frame t t *=(B ta +B tb ) / 2, go to step (6).
[0060] (6) The tracking model of the abnormal t frame image is corrected, and then the corrected target position frame is used in s8 to extract the target features and then train and adjust the tracking model.
[0061] In the aforementioned embodiment, after the tracking target is lost, the coordinate information predicted by the previous frame of the image is used to establish a 3x3 grid search area around the original target position in the current lost frame, and then the current discriminant model is used to evaluate each sub-area. After the grid search area is formed, the geometric features of the tracking target are taken into account while utilizing the discrimination ability of the existing model, thereby improving the efficiency and accuracy of the target search. The method of estimating the geometric features of the target using a set of local circumscribed rectangles after edge detection is simple and efficient, which improves the stability and effectiveness of the correction method. Combining the edge detection operator and the gridded convolutional neural network evaluation strategy can significantly improve the tracking algorithm's ability to reposition after the target's motion state changes dramatically and is lost, thereby improving the stability of the tracker. The lightweight model can be transplanted into any deep tracking framework based on the principle of target background classification. In addition, the flexibility of this technology allows it to be easily embedded in a deep tracking framework without introducing additional learning parameters to maintain the end-to-end characteristics of the model.
[0062] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0063] In this embodiment, a device for tracking an object is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0064] Figure 5 is a structural block diagram of an object tracking device according to an embodiment of the present invention. Figure 5 As shown, the device comprises:
[0065] A first determination module 52, configured to determine each candidate image frame included in the target frame image, and determine a first probability that each candidate image frame is an image frame for identifying a target object;
[0066] A second determination module 54 is configured to determine a predicted image frame included in the target frame image when the first probabilities are all less than a predetermined threshold, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and is adjacent to the target frame image;
[0067] A third determination module 56, configured to determine a target region based on the predicted image frame, wherein the target region includes a plurality of first image frames, and the predicted image frame is located in the target region;
[0068] The fourth determining module 58 is configured to determine a target image frame of the target object based on the plurality of first image frames.
[0069] In an exemplary embodiment, the third determination module 56 can determine the target area based on the predicted image frame in the following manner: expand outward from the predicted image frame to establish N×M first image frames, wherein the N×M first image frames include the predicted image frame, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 2; and determine the area corresponding to the N×M first image frames as the target area.
[0070] In an exemplary embodiment, the fourth determination module 58 can determine the target image frame of the target object based on multiple first image frames in the following manner: determine the second probability that each of the first image frames is the image frame of the target object to obtain multiple second probabilities; when multiple second probabilities are all less than the predetermined threshold, convert the image of the target area into an image in a predetermined format to obtain a converted image; determine the circumscribed image frame of each continuous line included in the edge line set of the converted image; and determine the target image frame based on the circumscribed image frame.
[0071] In an exemplary embodiment, when there are multiple external image frames, the fourth determination module 58 can determine the target image frame based on the external image frame in the following manner: determine a sequence of external image frames obtained by sorting the multiple external image frames in order of area from large to small; determine the first first number of second image frames included in the sequence of external image frames; and determine the target image frame based on the second image frames.
[0072] In an exemplary embodiment, the fourth determination module 58 can determine the target image frame based on the second image frame in the following manner: determine the first coordinates of the first target point of each of the second image frames to obtain the first number of first coordinates; determine the average value of the first number of first coordinates to obtain the second coordinates; determine the average value of the side lengths of the first number of second image frames to obtain a first average side length; and determine the image frame with the point corresponding to the second coordinate as the first target point and the first average side length as the side length as the target image frame.
[0073] In an exemplary embodiment, the device can be used to determine the second probability that each of the first image frames is an image frame of the target object to obtain a plurality of the second probabilities, and then, when there is a probability greater than the predetermined threshold among the plurality of the second probabilities, determine a second number of third probabilities included in the plurality of the second probabilities, wherein each probability included in the third probability is greater than other probabilities included in the second probabilities except the third probability; when the third probabilities of the second number are all greater than the predetermined threshold, determine the target image frame based on the third image frame corresponding to the third probabilities of the second number; when the third probabilities of the second number include only one fourth probability greater than the predetermined threshold, determine the image frame corresponding to the fourth probability as the target image frame.
[0074] In an exemplary embodiment, the device can determine the target image frame based on the third image frames corresponding to the third probability of the second number in the following manner: determine the second coordinates of the second target point of each of the third image frames to obtain the third coordinates of the second number; determine the average value of the third coordinates of the second number to obtain the fourth coordinate; determine the average value of the side lengths of the second number of third image frames to obtain the second average side length; and determine the image frame with the point corresponding to the fourth coordinate as the second target point and the second average side length as the side length as the target image frame.
[0075] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0076] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.
[0077] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.
[0078] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0079] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0080] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0081] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0082] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for tracking an object, characterized in that: include: Determine each candidate image frame included in the target frame image, and determine a first probability that each candidate image frame is an image frame for identifying a target object; In the case where the first probabilities are all less than a predetermined threshold, determining a predicted image frame included in the target frame image, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and is adjacent to the target frame image; Determine a target area based on the predicted image frame, wherein the target area includes a plurality of first image frames, and the predicted image frame is located in the target area; determining a target image frame of the target object based on a plurality of the first image frames; Determining the target area based on the predicted image frame includes: establishing N×M first image frames by expanding outward from the predicted image frame, wherein the N×M first image frames include the predicted image frame, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 2; and determining an area corresponding to the N×M first image frames as the target area; Determining the target image frame of the target object based on multiple first image frames includes: determining a second probability that each of the first image frames is the image frame of the target object to obtain multiple second probabilities; when multiple second probabilities are all less than the predetermined threshold, converting the image of the target area into an image in a predetermined format to obtain a converted image; determining a circumscribed image frame for each continuous line included in an edge line set of the converted image; and determining the target image frame based on the circumscribed image frame.
2. The method according to claim 1, characterized in that When there are multiple external image frames, determining the target image frame based on the external image frames includes: Determine a sequence of external image frames obtained by sorting the plurality of external image frames in descending order of area; Determine a first number of second image frames included in the circumscribed image frame sequence; The target image frame is determined based on the second image frame.
3. The method according to claim 2, characterized in that Determining the target image frame based on the second image frame includes: Determine the first coordinates of the first target point of each of the second image frames to obtain the first coordinates of the first number; determining an average of the first coordinates of the first quantity to obtain a second coordinate; Determine an average of the side lengths of the first number of the second image frames to obtain a first average side length; The point corresponding to the second coordinate is taken as the first target point, and the image frame with the first average side length as the side length is determined as the target image frame.
4. The method according to claim 1, characterized in that: After determining the second probability that each of the first image frames is an image frame of the target object to obtain a plurality of the second probabilities, the method further includes: In the case that there is a probability greater than the predetermined threshold among the plurality of second probabilities, determining a second number of third probabilities included in the plurality of second probabilities, wherein each probability included in the third probabilities is greater than other probabilities included in the second probabilities except the third probability; In a case where the third probabilities of the second quantities are all greater than the predetermined threshold, determining the target image frame based on third image frames corresponding to the third probabilities of the second quantity; In the case that the second number of third probabilities includes only one fourth probability greater than the predetermined threshold, the image frame corresponding to the fourth probability is determined as the target image frame.
5. The method according to claim 4, characterized in that Determining the target image frame based on the third image frames corresponding to the third probabilities of the second number includes: Determine the second coordinates of the second target point of each of the third image frames to obtain the third coordinates of the second number; determining an average of the third coordinates of the second quantity to obtain a fourth coordinate; Determine an average value of the side lengths of the second number of the third image frames to obtain a second average side length; The point corresponding to the fourth coordinate is determined as the second target point, and the image frame with the second average side length as the side length is determined as the target image frame.
6. A tracking device for an object, characterized in that: include: A first determination module is used to determine each candidate image frame included in the target frame image, and determine a first probability that each candidate image frame is an image frame for identifying a target object, so as to obtain a plurality of first probabilities; a second determination module, configured to determine a predicted image frame included in the target frame image when the plurality of first probabilities are all less than a predetermined threshold, wherein the predicted image frame is an image frame determined based on a predicted image, and the predicted image is an image acquired before the target frame image and adjacent to the target frame image; A third determination module is used to determine a target area based on the predicted image frame, wherein the target area includes a plurality of first image frames, and the predicted image frame is located in the target area; A fourth determining module, configured to determine a target image frame of the target object based on a plurality of the first image frames; The third determination module determines the target area based on the predicted image frame in the following manner: expanding outward from the predicted image frame to establish N×M first image frames, wherein the N×M first image frames include the predicted image frame, N is an integer greater than or equal to 2, and M is an integer greater than or equal to 2; and determining the area corresponding to the N×M first image frames as the target area; The fourth determination module determines the target image frame of the target object based on multiple first image frames in the following manner: determining the second probability that each of the first image frames is the image frame of the target object to obtain multiple second probabilities; when multiple second probabilities are all less than the predetermined threshold, converting the image of the target area into an image in a predetermined format to obtain a converted image; determining the circumscribed image frame of each continuous line included in the edge line set of the converted image; and determining the target image frame based on the circumscribed image frame.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 5 when executed by a processor.
8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Target tracking method and device
CN109671103A
Face tracking method, device and equipment and storage medium
CN110705478A