WO2022194157A1 - Target tracking method and apparatus, device and medium - Google Patents

Target tracking method and apparatus, device and medium Download PDF

Info

Publication number
WO2022194157A1
WO2022194157A1 PCT/CN2022/080977 CN2022080977W WO2022194157A1 WO 2022194157 A1 WO2022194157 A1 WO 2022194157A1 CN 2022080977 W CN2022080977 W CN 2022080977W WO 2022194157 A1 WO2022194157 A1 WO 2022194157A1
Authority
WO
WIPO (PCT)
Prior art keywords
video frame
target
position information
target area
video
Prior art date
Application number
PCT/CN2022/080977
Other languages
French (fr)
Chinese (zh)
Inventor
郭亨凯
杜思聪
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2022194157A1 publication Critical patent/WO2022194157A1/en
Priority to US18/468,647 priority Critical patent/US20240005552A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20164Salient point detection; Corner detection

Definitions

  • the present disclosure relates to the technical field of video processing, and in particular, to a target tracking method, apparatus, device and medium.
  • the present disclosure provides a target tracking method, apparatus, device and medium.
  • the embodiment of the present disclosure provides a target tracking method, the method includes:
  • Fitting the target feature points to obtain second position information of the target area in the second video frame
  • Embodiments of the present disclosure also provide a target tracking device, the device comprising:
  • a first position module for extracting the first video frame in the target video, and determining the first position information of the target area in the first video frame;
  • a tracking module configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. Video frames adjacent to the video frame;
  • a second position module configured to fit the target feature points to obtain second position information of the target area in the second video frame.
  • An embodiment of the present disclosure further provides an electronic device, the electronic device includes: a processor; a memory for storing instructions executable by the processor; the processor for reading the memory from the memory The instructions can be executed, and the instructions can be executed to implement the target tracking method provided by the embodiments of the present disclosure.
  • An embodiment of the present disclosure further provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program is used to execute the target tracking method provided by the embodiment of the present disclosure.
  • Embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the target tracking method provided by the embodiments of the present disclosure.
  • An embodiment of the present disclosure also provides a computer program, where the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor, implements the target tracking method provided by the embodiment of the present disclosure.
  • the target tracking solution provided by the embodiment of the present disclosure extracts the first video frame in the target video, and determines the first video frame of the target area in the first video frame. position information; perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; The target feature points are fitted to obtain second position information of the target area in the second video frame.
  • the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
  • FIG. 1 is a schematic flowchart of a target tracking method according to an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of another target tracking method provided by an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of a target tracking provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of a target tracking device according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the term “including” and variations thereof are open-ended inclusions, ie, "including but not limited to”.
  • the term “based on” is “based at least in part on.”
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one additional embodiment”; the term “some embodiments” means “at least some embodiments”. Relevant definitions of other terms will be given in the description below.
  • FIG. 1 is a schematic flowchart of a target tracking method according to an embodiment of the present disclosure.
  • the method may be executed by a target tracking apparatus, where the apparatus may be implemented by software and/or hardware, and may generally be integrated in an electronic device.
  • the method includes:
  • Step 101 Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame.
  • the target video may be any video that needs to be detected and tracked, may be a video captured by a device with a video capture function, or may be a video obtained from the Internet or other devices, which is not limited in detail.
  • a video frame is also called an image frame, which can be the smallest unit that composes a video.
  • the first video frame can be any video frame in the target video. video frame as an example.
  • the target area refers to an area with a preset shape. In the video, it can be the area where an object with a preset shape is located.
  • the preset shape is not limited.
  • the preset shape can include an ellipse, a circle, and a rectangle.
  • the target area can be the area where the elliptical object is located.
  • the first video frame may be extracted from the target video, and a preset detection algorithm is used to detect the target area of the first video frame, and determine the No. 1 position of the target area in the first video frame. a location information.
  • the above-mentioned preset detection algorithm may be a deep learning-based detection algorithm or a contour detection algorithm, etc., which may be determined according to the actual situation.
  • the preset detection algorithm may be any ellipse detection algorithm, and an ellipse detection algorithm is used.
  • the detection algorithm performs contour detection on the first video frame, and then fits the elliptical contour obtained by the contour detection to obtain the position information of the target area in the first video frame.
  • the first position information may be information that can represent the position of the target area in the first video frame, and may specifically include information such as vertex coordinates and center point coordinates of the target area in the first video frame.
  • Step 102 Perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein the second video frame is an adjacent video frame of the first video frame in the target video.
  • the second video frame refers to a video frame adjacent to the first video frame in the target video, which may be the next video frame in time sequence.
  • the initial feature points may be points obtained by sampling the contour of the target area in the first video frame.
  • determining the initial feature point according to the first position information includes: sampling the edge contour of the target area in the first video frame according to the first position information to determine the initial feature point.
  • sampling the edge contour of the target area in the first video frame according to the first position information, and determining the initial feature points including: when the target area is an elliptical area, according to the first position information, the target area is in polar coordinates.
  • the preset polar angle interval may be set according to actual conditions, for example, the preset polar angle interval may be set to 5 degrees.
  • the target area in the first video frame may be sampled based on the first location information determined above, and then the initial feature points may be determined. Taking the target area as an elliptical area as an example, the The ellipse equation of the elliptical region of a video frame is expressed in polar coordinates to obtain the ellipse outline, and sampling is performed on the ellipse outline according to the preset polar angle interval, and a feature point is collected at each preset polar angle interval to obtain a plurality of initial Feature points. After that, in the second video frame, the optical flow tracking algorithm is used to track the initial feature points obtained by the above sampling, and the feature points that are successfully tracked are reserved as the target feature points, and the feature points that fail to be tracked are eliminated.
  • Step 103 Fit the target feature points to obtain second position information of the target area in the second video frame.
  • fitting the target area based on the target feature points, and determining the second position information of the target area in the second video frame including: if the coverage area of the target feature points on the edge contour of the target area is greater than or equal to a predetermined If the range is set, the target feature points are fitted to obtain the second position information of the target area in the second video frame.
  • the preset range refers to a preset range that satisfies the shape of the target area, which may be set according to actual conditions.
  • the preset range may be 3/4 of the entire range of the edge contour.
  • the target area is an elliptical area
  • a random sampling consistency (Random Sample Consensus, RANSAC) algorithm is used to perform ellipse fitting. , that is, 5 points are randomly selected from the target feature points each time, and the number of interior point sets in these 5 points is judged until the largest interior point set is found, and the 5 points corresponding to the maximum interior point set are used for ellipse fitting.
  • the interior point set refers to the set of points on the contour of the ellipse.
  • the target tracking method may further include: if the coverage of the target feature points on the edge contour of the target area is smaller than the preset range, determining that the target area is in the second video frame by detecting the second video frame the second location information.
  • a preset detection algorithm can be used to re-detect the second video frame to determine the second position information of the target area.
  • the above-mentioned preset detection algorithm may be implemented by detecting the second video frame, and may be a deep learning-based detection algorithm or a contour detection algorithm, etc., which is not limited in particular.
  • the second video frame can be determined as the new first video frame and the third video frame adjacent to the second video frame can be determined as the new first video frame. For two video frames, go back to step 102 until the determination of the position of the target area of each video frame in the video is completed.
  • the target tracking solution extracts the first video frame in the target video, and determines the first position information of the target area in the first video frame;
  • the frame is subjected to optical flow tracking to obtain target feature points; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; the target feature points are fitted to obtain the first video frame of the target area in the second video frame.
  • Location information By adopting the above technical solution, on the basis of detecting the target area of one video frame of the video, the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
  • the method further includes: determining a change parameter of the second video frame relative to the first video frame; initial features determined according to the first position information Perform optical flow tracking on the second video frame to obtain the target feature point, including: if it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, performing the initial feature point determined according to the first position information to the second video frame. Perform optical flow tracking to obtain target feature points.
  • the multiplexing condition is that the change parameter is less than or equal to the change threshold.
  • the transformation parameter refers to a parameter representing the change of the second video frame relative to the first video frame.
  • the multiplexing condition refers to a specific judging condition for determining whether the first video frame can be multiplexed by the second video frame to the position of the target area.
  • the change threshold refers to a preset threshold, which can be set according to the actual situation. For example, when the change parameter is represented by the movement information of the feature points in the second video frame relative to the corresponding feature points in the first video frame, the transformation threshold can be Distance threshold, set to 0.8.
  • the change parameter may be compared with the change threshold, and if it is determined that the change parameter is greater than the change threshold, it may be determined that the second video frame does not meet the multiplexing condition , re-tracking is required, and optical flow tracking is performed on the second video frame based on the initial feature point determined according to the first position information to obtain the target feature point; otherwise, it is determined that the second video frame satisfies the multiplexing condition.
  • determining a change parameter of the second video frame relative to the first video frame includes: extracting a first feature point in the first video frame; performing optical flow tracking on the second video frame according to the first feature point, A second feature point is determined, and a moving distance between the second feature point and the first feature point is determined as a change parameter.
  • the above-mentioned first feature point may be a corner point detected on the first video frame by adopting an accelerated segmentation test (Features From Accelerated Segment Test, FAST) corner detection algorithm, and a corner point refers to an extreme point, that is, in a certain aspect Attributes that stand out in particular.
  • the detected object may be the entire first video frame, or may only be the above-mentioned target area, which is not particularly limited.
  • the FAST corner detection algorithm can be used to extract the first feature point for the first video frame, and the first feature point can be used as the input of the KLT (Kanade Lucas Tomasi) optical flow tracking algorithm to obtain the output of the second feature of successful tracking. Then, since the number of the first feature point and the second feature point can be multiple, the average value of the moving distance of the first feature point and the second whole point can be calculated, and the average value of the moving distance is determined as the transformation parameter.
  • KLT Kanade Lucas Tomasi
  • the target tracking method may further include: if it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, determining the first position information as the second position information of the target area in the second video frame. If it is determined that the change parameter is less than or equal to the change threshold, it means that the current camera is basically in a stationary state, the positions of the target areas of two adjacent video frames are similar, and the second video frame satisfies the multiplexing condition, and the first position information can be assigned to the first position information.
  • the two video frames that is, the location information of the target area in the first video frame and the second video frame are the same.
  • the above-mentioned feature point tracking and fitting are used to realize the determination of the position of the target area;
  • the change or difference between two adjacent video frames in the video is small, the similarity between the two video frames is high, and the next video frame can directly reuse the position information of the target area of the previous video frame without redoing
  • the detection saves the workload and improves the computing efficiency.
  • FIG. 2 is a schematic flowchart of another target tracking method provided by an embodiment of the present disclosure. On the basis of the foregoing embodiment, this embodiment further optimizes the foregoing target tracking method. As shown in Figure 2, the method includes:
  • Step 201 Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame.
  • Step 202 Extract the first feature point in the first video frame.
  • Step 203 Perform optical flow tracking on the second video frame according to the first feature point, determine the second feature point, and determine the moving distance between the second feature point and the first feature point as a change parameter.
  • the second video frame is an adjacent video frame of the first video frame in the target video.
  • Step 204 Determine whether the second video frame satisfies the multiplexing condition based on the change parameter, if yes, go to Step 210; otherwise, go to Step 205.
  • the multiplexing condition is that the change parameter is less than or equal to the change threshold. If the change parameter is greater than the change threshold, it is determined that the second video frame does not meet the multiplexing condition, and step 205 is executed; otherwise, it is determined that the second video frame meets the multiplexing condition, and step 210 is executed.
  • Step 205 Sampling the edge contour of the target area in the first video frame according to the first position information to determine initial feature points.
  • sampling the edge contour of the target area in the first video frame according to the first position information, and determining the initial feature points including: when the target area is an elliptical area, according to the first position information, the target area is in polar coordinates.
  • Step 206 Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points.
  • Step 207 Check whether the coverage range of the target feature point on the edge contour of the target area is greater than or equal to the preset range, if so, go to Step 208; otherwise, go to Step 209.
  • step 208 is performed; otherwise, step 209 is performed.
  • Step 208 Fit the target feature points to obtain second position information of the target area in the second video frame.
  • Step 209 Determine the second position information of the target area in the second video frame by detecting the second video frame.
  • Step 210 Determine the first position information as the second position information of the target area in the second video frame.
  • FIG. 3 is a schematic diagram of a target tracking provided by an embodiment of the present disclosure.
  • the tracking process for a video may include: Step 21 , performing ellipse detection on the previous frame.
  • the previous frame may be the first frame of the video.
  • any ellipse detection method may be used for detection to determine the ellipse position of the previous frame.
  • Step 22 Whether the current frame stillness detection is passed, if yes, go to Step 26; otherwise, go to Step 23.
  • FAST corner detection is performed on the previous frame
  • KLT optical flow tracking is performed on the current frame based on the corners of the previous frame.
  • Step 23 Sampling the circular polar angle, and track the sampling points.
  • Step 24 Determine whether the sampling point range meets the requirements, if yes, go to Step 25; otherwise, go to Step 27. If the distribution of successfully tracked points on the circumference of the ellipse is greater than 3/4 of the circumference of the ellipse, it is determined that the sampling point range meets the requirements, and step 25 is performed.
  • step 27 is executed.
  • Step 25 RANSAC fitting.
  • the ellipse fitting is performed according to the feature points, and the ellipse fitting is done by RANSAC, that is, 5 points are randomly sampled from the point set each time until the ellipse model with the largest inner point set is found.
  • Step 26 The current frame ends and the next frame begins.
  • the optical flow tracking of feature points, the still detection of video frame sequences and the quality discrimination of ellipse tracking can be used to quickly and accurately complete the ellipse tracking of each image frame in the video, and it is not necessary to detect each video frame. , reducing the amount of calculation and ensuring the real-time performance of target tracking.
  • the target tracking solution extracts the first video frame in the target video, and determines the first position information of the target area in the first video frame;
  • the frame is subjected to optical flow tracking to obtain target feature points; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; the target feature points are fitted to obtain the first video frame of the target area in the second video frame.
  • Location information By adopting the above technical solution, on the basis of detecting the target area of one video frame of the video, the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
  • FIG. 4 is a schematic structural diagram of a target tracking apparatus provided by an embodiment of the present disclosure.
  • the apparatus may be implemented by software and/or hardware, and may generally be integrated into an electronic device.
  • the device includes:
  • the first position module 301 is used to extract the first video frame in the target video, and determine the first position information of the target area in the first video frame;
  • a tracking module 302 configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information, to obtain a target feature point; wherein, the second video frame is the first video frame in the target video.
  • the second position module 303 is configured to fit the target feature points to obtain second position information of the target area in the second video frame.
  • the tracking module 302 is used for:
  • the edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
  • the tracking module 302 is used for:
  • an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
  • the second location module 303 is used for:
  • the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
  • the device further includes a detection module for:
  • the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
  • the device further includes a multiplexing judging module, configured to: after determining the first position information of the target area in the first video frame,
  • the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
  • the multiplexing judgment module is specifically used for:
  • the multiplexing condition is that the change parameter is less than or equal to a change threshold.
  • the device also includes a multiplexing module for:
  • the first position information is determined as the second position information of the target area in the second video frame.
  • the target tracking device provided by the embodiment of the present disclosure can execute the target tracking method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
  • An embodiment of the present disclosure also provides a computer program product, including a computer program/instruction, when the computer program/instruction is executed by a processor, the target tracking method provided by any embodiment of the present disclosure is implemented.
  • FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring specifically to FIG. 5 below, it shows a schematic structural diagram of an electronic device 400 suitable for implementing an embodiment of the present disclosure.
  • the electronic device 400 in the embodiment of the present disclosure may include, but is not limited to, such as a mobile phone, a notebook computer, a digital broadcast receiver, a Personal Digital Assistant (PDA), a PAD (tablet computer), a portable multimedia player (Portable Media Player, PMP), in-vehicle terminals (eg, in-vehicle navigation terminals), etc., and stationary terminals such as digital televisions (Television, TV), desktop computers, and the like.
  • PDA Personal Digital Assistant
  • PAD tablet computer
  • PMP portable multimedia player
  • in-vehicle terminals eg, in-vehicle navigation terminals
  • stationary terminals such as digital televisions (Television, TV), desktop computers, and the like.
  • the electronic device shown in FIG. 5 is only
  • the electronic device 400 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 401, which may be based on a program stored in a read-only memory (Read-Only Memory, ROM) 402 or from a storage device 408 is a program loaded into a random access memory (RAM) 403 to perform various appropriate actions and processes.
  • ROM Read-Only Memory
  • RAM random access memory
  • various programs and data required for the operation of the electronic device 400 are also stored.
  • the processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404.
  • An Input/Output (I/O) interface 405 is also connected to the bus 404 .
  • the following devices can be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD) output device 407 , a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409 .
  • Communication means 409 may allow electronic device 400 to communicate wirelessly or by wire with other devices to exchange data.
  • FIG. 5 shows electronic device 400 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication device 409, or from the storage device 408, or from the ROM 402.
  • the processing device 401 When the computer program is executed by the processing device 401, the above-mentioned functions defined in the target tracking method of the embodiment of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above.
  • Computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory (Erasable Programmable Read-Only Memory) Memory, EPROM, or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • the program code embodied on the computer readable medium can be transmitted by any suitable medium, including but not limited to: electric wire, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the above.
  • the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects.
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include Local Area Network (LAN), Wide Area Network (WAN), Internet (eg, the Internet), and peer-to-peer networks (eg, Ad-Hoc peer-to-peer network), as well as any current Known or future developed networks.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: extracts the first video frame in the target video, and determines that the target area is in the first video frame. the first position information in a video frame; perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points; wherein, the second video frame is the target video The adjacent video frames of the first video frame in the above; and fitting the target feature points to obtain the second position information of the target area in the second video frame.
  • Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.
  • the remote computer may be connected to the user computer through any kind of network, including a LAN or WAN, or may be connected to an external computer (eg, using an Internet service provider to connect through the Internet).
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (Application Specific Standard Products) Standard Product, ASSP), system on chip (System on Chip, SOC), complex programmable logic device (Complex Programmable Logic Device, CPLD) and so on.
  • FPGAs Field Programmable Gate Arrays
  • ASICs Application Specific Integrated Circuits
  • ASSP Application Specific Standard Products
  • ASSP Application Specific Standard Products
  • SOC System on Chip
  • complex programmable logic device Complex Programmable Logic Device, CPLD
  • the present disclosure provides a target tracking method, including:
  • Fitting the target feature points to obtain second position information of the target area in the second video frame
  • determining an initial feature point according to the first position information includes:
  • the edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
  • the edge contour of the target area in the first video frame is sampled according to the first position information, and the initial feature points are determined, including: :
  • an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
  • the target feature points are fitted to obtain second position information of the target area in the second video frame, including: :
  • the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
  • the target tracking method provided by the present disclosure further includes:
  • the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
  • the method further includes:
  • the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
  • the determining a change parameter of the second video frame relative to the first video frame includes:
  • the multiplexing condition is that the change parameter is less than or equal to a change threshold.
  • the target tracking method provided by the present disclosure further includes:
  • the first position information is determined as the second position information of the target area in the second video frame.
  • the present disclosure provides a target tracking device, including:
  • a first position module for extracting the first video frame in the target video, and determining the first position information of the target area in the first video frame;
  • a tracking module configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. Video frames adjacent to the video frame;
  • a second position module configured to fit the target feature points to obtain second position information of the target area in the second video frame.
  • the tracking module is configured to:
  • the edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
  • the tracking module is configured to:
  • an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
  • the second location module is used for:
  • the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
  • the device further includes a detection module for:
  • the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
  • the device further includes a multiplexing judgment module, configured to: in the first video frame of the determined target area in the first video frame After location information,
  • the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
  • the multiplexing judgment module is specifically configured to:
  • the multiplexing condition is that the change parameter is less than or equal to a change threshold.
  • the device further includes a multiplexing module for:
  • the first position information is determined as the second position information of the target area in the second video frame.
  • the present disclosure provides an electronic device, comprising:
  • a memory for storing the processor-executable instructions
  • the processor is configured to read the executable instructions from the memory, and execute the instructions to implement any one of the target tracking methods provided in the present disclosure.
  • the present disclosure provides a computer-readable storage medium storing a computer program for executing any of the objects provided by the present disclosure tracking method.
  • the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the target tracking method as provided in any one of the present disclosure.
  • the present disclosure provides a computer program, the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor, implements any one of the methods provided by the present disclosure.
  • the described target tracking method is not limited to one or more embodiments of the present disclosure.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The embodiments of the present disclosure relate to a target tracking method and apparatus, a device and a medium. The method comprises: extracting a first video frame from a target video, and determining first location information of a target area in the first video frame; performing optical flow tracking on a second video frame according to an initial feature point determined from the first location information, so as to obtain target feature points, wherein the second video frame is a video frame adjacent to the first video frame in the target video; and fitting the target feature points to obtain second location information of the target area in the second video frame. By using the technical solution, on the basis of detecting a target area of a video frame of a video, the location of the target area in other video frames can be determined more accurately by means of feature point tracking and fitting, thereby avoiding the detection of each video frame, improving the calculation efficiency of tracking, and realizing rapid and accurate target recognition and tracking for each image frame in the video.

Description

一种目标跟踪方法、装置、设备及介质A target tracking method, device, equipment and medium
相关申请交叉引用Cross-reference to related applications
本申请要求于2021年3月15日提交的、申请号为202110276358.7、名称为“一种目标跟踪方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用并入本文。This application claims the priority of the Chinese Patent Application No. 202110276358.7 filed on March 15, 2021 and entitled "A Target Tracking Method, Apparatus, Equipment and Medium", the entire contents of which are incorporated herein by reference.
技术领域technical field
本公开涉及视频处理技术领域,尤其涉及一种目标跟踪方法、装置、设备及介质。The present disclosure relates to the technical field of video processing, and in particular, to a target tracking method, apparatus, device and medium.
背景技术Background technique
随着智能终端技术的不断发展,对视频内容识别和跟踪等需求日益增加。目前,对视频内容的识别和跟踪存在准确性较低、不能满足需求的缺陷。With the continuous development of intelligent terminal technology, the demand for video content identification and tracking is increasing. At present, the identification and tracking of video content has the defects of low accuracy and can not meet the needs.
发明内容SUMMARY OF THE INVENTION
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种目标跟踪方法、装置、设备及介质。In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a target tracking method, apparatus, device and medium.
本公开实施例提供了一种目标跟踪方法,所述方法包括:The embodiment of the present disclosure provides a target tracking method, the method includes:
提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame;
根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;Perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein, the second video frame is the neighbor of the first video frame in the target video video frame;
对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。Fitting the target feature points to obtain second position information of the target area in the second video frame.
本公开实施例还提供了一种目标跟踪装置,所述装置包括:Embodiments of the present disclosure also provide a target tracking device, the device comprising:
第一位置模块,用于提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;A first position module, for extracting the first video frame in the target video, and determining the first position information of the target area in the first video frame;
跟踪模块,用于根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;A tracking module, configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. Video frames adjacent to the video frame;
第二位置模块,用于对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。A second position module, configured to fit the target feature points to obtain second position information of the target area in the second video frame.
本公开实施例还提供了一种电子设备,所述电子设备包括:处理器;用于存储所述处理器可执行指令的存储器;所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现如本公开实施例提供的目标跟踪方法。An embodiment of the present disclosure further provides an electronic device, the electronic device includes: a processor; a memory for storing instructions executable by the processor; the processor for reading the memory from the memory The instructions can be executed, and the instructions can be executed to implement the target tracking method provided by the embodiments of the present disclosure.
本公开实施例还提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行如本公开实施例提供的目标跟踪方法。An embodiment of the present disclosure further provides a computer-readable storage medium, where the storage medium stores a computer program, and the computer program is used to execute the target tracking method provided by the embodiment of the present disclosure.
本公开实施例还提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如本公开实施例提供的目标跟踪方法。Embodiments of the present disclosure also provide a computer program product, including a computer program, which, when executed by a processor, implements the target tracking method provided by the embodiments of the present disclosure.
本公开实施例还提供了一种计算机程序,所述计算机程序存储在计算机可读存储介质中,所述计算机程序被处理器执行时实现如本公开实施例提供的目标跟踪方法。An embodiment of the present disclosure also provides a computer program, where the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor, implements the target tracking method provided by the embodiment of the present disclosure.
本公开实施例提供的技术方案与现有技术相比具有如下优点:本公开实施例提供的目标跟踪方案,提取目标视频中的第一视频帧,并确定目标区域在第一视频帧中的第一位置信息;根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,第二视频帧为目标视频中第一视频帧的相邻视频帧;对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。采用上述技术方案,在对视频的一个视频帧的目标区域检测的基础上,通过特征点跟踪和拟合即可实现更加准确地确定其他视频帧中目标区域的位置,避免了对每个视频帧的检测,提升了跟踪的计算效率,实现了快速并且准确地对视频中每一图像帧的目标识别和跟踪。Compared with the prior art, the technical solution provided by the embodiment of the present disclosure has the following advantages: the target tracking solution provided by the embodiment of the present disclosure extracts the first video frame in the target video, and determines the first video frame of the target area in the first video frame. position information; perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; The target feature points are fitted to obtain second position information of the target area in the second video frame. By adopting the above technical solution, on the basis of detecting the target area of one video frame of the video, the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
附图说明Description of drawings
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent when taken in conjunction with the accompanying drawings and with reference to the following detailed description. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
图1为本公开实施例提供的一种目标跟踪方法的流程示意图;FIG. 1 is a schematic flowchart of a target tracking method according to an embodiment of the present disclosure;
图2为本公开实施例提供的另一种目标跟踪方法的流程示意图;FIG. 2 is a schematic flowchart of another target tracking method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种目标跟踪的示意图;3 is a schematic diagram of a target tracking provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种目标跟踪装置的结构示意图;FIG. 4 is a schematic structural diagram of a target tracking device according to an embodiment of the present disclosure;
图5为本公开实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for the purpose of A more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the protection scope of the present disclosure.
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and/or in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this regard.
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。As used herein, the term "including" and variations thereof are open-ended inclusions, ie, "including but not limited to". The term "based on" is "based at least in part on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below.
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。It should be noted that concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or interdependence.
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。It should be noted that the modifications of "a" and "a plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless the context clearly indicates otherwise, they should be understood as "one or a plurality of". multiple".
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。The names of messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of these messages or information.
图1为本公开实施例提供的一种目标跟踪方法的流程示意图,该方法可以由目标跟踪装置执行,其中该装置可以采用软件和/或硬件实现,一般可集成在电子设备中。如图1所示,该方法包括:FIG. 1 is a schematic flowchart of a target tracking method according to an embodiment of the present disclosure. The method may be executed by a target tracking apparatus, where the apparatus may be implemented by software and/or hardware, and may generally be integrated in an electronic device. As shown in Figure 1, the method includes:
步骤101、提取目标视频中的第一视频帧,并确定目标区域在第一视频帧中的第一位置信息。Step 101: Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame.
其中,目标视频可以为任意一个需要进行检测和跟踪的视频,可以为采用具有视频采集功能的设备拍摄得到的视频,也可以为从互联网或其他设备获取得到的视频,具体不限。视频帧也称图像帧,可以为组成视频的最小单位,第一视频帧可以为目标视频中的任意一个视频帧,本公开实施例中以第一视频帧为目标视频中按照时间顺序的第一个视频帧为例。目标区域是指具有预设形状的区域,视频中可以为具有预设形状的物体所在的区域,预设形状具体不限,例如预设形状可以包括椭圆形、圆形和矩形等,具体视频中目标区域可以为椭圆形物体所在区域。The target video may be any video that needs to be detected and tracked, may be a video captured by a device with a video capture function, or may be a video obtained from the Internet or other devices, which is not limited in detail. A video frame is also called an image frame, which can be the smallest unit that composes a video. The first video frame can be any video frame in the target video. video frame as an example. The target area refers to an area with a preset shape. In the video, it can be the area where an object with a preset shape is located. The preset shape is not limited. For example, the preset shape can include an ellipse, a circle, and a rectangle. The target area can be the area where the elliptical object is located.
本公开实施例中,获取目标视频之后,可以从目标视频中提取第一视频帧,并采用预设检测算法对第一视频帧进行目标区域的检测,确定目标区域在第一视频帧中的第一位置信息。上述预设检测算法可以为基于深度学习的检测算法或轮廓检测算法等,具体可以根据实际情况确定,例如目标区域为椭圆形区域时,预设检测算法可以为任意一种椭圆检测算法,采用椭圆检测算法对第一视频帧进行轮廓检测,然后对轮廓检测得到的椭圆轮廓进行拟合,得到目标区域在第一视频帧中的位置信息。第一位置信息可以为能够表征目标区域在第一视频帧中的位置的信息,具体可以包括目标区域在第一视频帧中的顶点坐标、中心点坐标等信息。In the embodiment of the present disclosure, after the target video is acquired, the first video frame may be extracted from the target video, and a preset detection algorithm is used to detect the target area of the first video frame, and determine the No. 1 position of the target area in the first video frame. a location information. The above-mentioned preset detection algorithm may be a deep learning-based detection algorithm or a contour detection algorithm, etc., which may be determined according to the actual situation. For example, when the target area is an oval area, the preset detection algorithm may be any ellipse detection algorithm, and an ellipse detection algorithm is used. The detection algorithm performs contour detection on the first video frame, and then fits the elliptical contour obtained by the contour detection to obtain the position information of the target area in the first video frame. The first position information may be information that can represent the position of the target area in the first video frame, and may specifically include information such as vertex coordinates and center point coordinates of the target area in the first video frame.
步骤102、根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,第二视频帧为目标视频中第一视频帧的相邻视频帧。Step 102: Perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein the second video frame is an adjacent video frame of the first video frame in the target video.
其中,第二视频帧是指目标视频中与上述第一视频帧相邻的一个视频帧,可以为按照时间顺序的下一个视频帧。初始特征点可以为对第一视频帧中的目标区域的轮廓进行采样得到的点。The second video frame refers to a video frame adjacent to the first video frame in the target video, which may be the next video frame in time sequence. The initial feature points may be points obtained by sampling the contour of the target area in the first video frame.
本公开实施例中,根据第一位置信息确定初始特征点,包括:根据第一位置信息对第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。可选的,根据第一位置信息对第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点,包括:当目标区域为椭圆形区域,根据第一位置信息将目标区域在极坐标下进行表示得到椭圆轮廓;其中,第一位置信息包括目标区域在第一视频帧中的顶点坐标和/或中心点坐标;按照预设极角间隔在椭圆轮廓中进行采样,得到初始特征点。In the embodiment of the present disclosure, determining the initial feature point according to the first position information includes: sampling the edge contour of the target area in the first video frame according to the first position information to determine the initial feature point. Optionally, sampling the edge contour of the target area in the first video frame according to the first position information, and determining the initial feature points, including: when the target area is an elliptical area, according to the first position information, the target area is in polar coordinates. Perform the following representation to obtain an ellipse outline; wherein, the first position information includes vertex coordinates and/or center point coordinates of the target area in the first video frame; sampling is performed in the ellipse outline according to preset polar angle intervals to obtain initial feature points.
其中,预设极角间隔可以根据实际情况设置,例如预设极角间隔可以设置为5度。本公开实施例中,基于上述确定的第一位置信息可以对第一视频帧中的目标区域进行采样,进而确定初始特征点,以目标区域为椭圆形区域为例,根据第一位置信息将第一视频帧的椭圆形区域的椭圆方程在极坐标下进行表示得到椭圆轮廓,并根据预设极角间隔在椭圆轮廓上进行采样,每间隔预设极角间隔采集一个特征点,得到多个初始特征点。之后,在第二视频帧中对上述采样得到的初始特征点采用光流跟踪算法进行跟踪,保留跟踪成功的特征点为目标特征点,剔除跟踪失败的特征点。The preset polar angle interval may be set according to actual conditions, for example, the preset polar angle interval may be set to 5 degrees. In this embodiment of the present disclosure, the target area in the first video frame may be sampled based on the first location information determined above, and then the initial feature points may be determined. Taking the target area as an elliptical area as an example, the The ellipse equation of the elliptical region of a video frame is expressed in polar coordinates to obtain the ellipse outline, and sampling is performed on the ellipse outline according to the preset polar angle interval, and a feature point is collected at each preset polar angle interval to obtain a plurality of initial Feature points. After that, in the second video frame, the optical flow tracking algorithm is used to track the initial feature points obtained by the above sampling, and the feature points that are successfully tracked are reserved as the target feature points, and the feature points that fail to be tracked are eliminated.
步骤103、对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。Step 103: Fit the target feature points to obtain second position information of the target area in the second video frame.
本公开实施例中,基于目标特征点拟合目标区域,确定目标区域在第二视频帧中的第二位置信息,包括:如果目标特征点在目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。In the embodiment of the present disclosure, fitting the target area based on the target feature points, and determining the second position information of the target area in the second video frame, including: if the coverage area of the target feature points on the edge contour of the target area is greater than or equal to a predetermined If the range is set, the target feature points are fitted to obtain the second position information of the target area in the second video frame.
其中,预设范围是指预先设置的满足目标区域形状的范围,具体可以根据实际情况设置,例如预设范围可以为边缘轮廓的整个范围的3/4。具体的,确定目标特征点之后,可以判断目标点在目标区域的边缘轮廓上的覆盖范围是否大于或等于预设范围,若是,则采用拟合算法对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。The preset range refers to a preset range that satisfies the shape of the target area, which may be set according to actual conditions. For example, the preset range may be 3/4 of the entire range of the edge contour. Specifically, after determining the target feature points, it can be determined whether the coverage of the target points on the edge contour of the target area is greater than or equal to the preset range, and if so, use a fitting algorithm to fit the target feature points to obtain the target area in second position information in the second video frame.
示例性的,当目标区域为椭圆形区域,如果目标特征点在椭圆轮廓上的分大于或等于椭圆轮廓的3/4,则采用随机采样一致性(Random Sample Consensus,RANSAC)算法进行椭圆拟合,也即每次从目标特征点中随机抽取5个,判断这5个点中内点集的数量,直至找到最大内点集,采用最大内点集对应的5个点进行椭圆拟合,上述内点集是指在椭圆轮廓上的点的集合。Exemplarily, when the target area is an elliptical area, if the score of the target feature points on the elliptical outline is greater than or equal to 3/4 of the elliptical outline, a random sampling consistency (Random Sample Consensus, RANSAC) algorithm is used to perform ellipse fitting. , that is, 5 points are randomly selected from the target feature points each time, and the number of interior point sets in these 5 points is judged until the largest interior point set is found, and the 5 points corresponding to the maximum interior point set are used for ellipse fitting. The above The interior point set refers to the set of points on the contour of the ellipse.
本公开实施例中,目标跟踪方法还可以包括:如果目标特征点在目标区域的边缘轮廓上的覆盖范围小于预设范围,则通过对第二视频帧的检测确定目标区域在第二视频帧中的第二位置信息。当目标点在目标区域的边缘轮廓上的覆盖范围是否小于预设范围,则确定跟踪失败,可以采用预设检测算法重新对第二视频帧进行检测,确定目标区域的第二位置信息。上述预设检测算法可以为通过对第二视频帧的检测实现,可以为基于深度学习的检测算法或轮廓检测算法等,具体不限。In the embodiment of the present disclosure, the target tracking method may further include: if the coverage of the target feature points on the edge contour of the target area is smaller than the preset range, determining that the target area is in the second video frame by detecting the second video frame the second location information. When the coverage area of the target point on the edge contour of the target area is smaller than the preset area, it is determined that the tracking fails, and a preset detection algorithm can be used to re-detect the second video frame to determine the second position information of the target area. The above-mentioned preset detection algorithm may be implemented by detecting the second video frame, and may be a deep learning-based detection algorithm or a contour detection algorithm, etc., which is not limited in particular.
可以理解的是,确定目标区域在第二视频帧中的位置信息之后,可以将第二视频帧确定为新的第一视频帧以及第二视频帧相邻的第三视频帧确定为新的第二视频帧,返回执行步骤102,直到完成对视频中每一视频帧的目标区域的位置确定。It can be understood that after determining the position information of the target area in the second video frame, the second video frame can be determined as the new first video frame and the third video frame adjacent to the second video frame can be determined as the new first video frame. For two video frames, go back to step 102 until the determination of the position of the target area of each video frame in the video is completed.
本公开实施例提供的目标跟踪方案,提取目标视频中的第一视频帧,并确定目标区域在第一视频帧中的第一位置信息;根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,第二视频帧为目标视频中第一视频帧的相邻视频帧;对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。采用上述技术方案,在对视频的一个视频帧的目标区域检测的基础上,通过特征点跟踪和拟合即可实现更加准确地确定其他视频帧中目标区域的位置,避免了对每个视频帧的检测,提升了跟踪的计算效率,实现了快速并且准确地对视频中每一图像帧的目标识别和跟踪。The target tracking solution provided by the embodiment of the present disclosure extracts the first video frame in the target video, and determines the first position information of the target area in the first video frame; The frame is subjected to optical flow tracking to obtain target feature points; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; the target feature points are fitted to obtain the first video frame of the target area in the second video frame. 2. Location information. By adopting the above technical solution, on the basis of detecting the target area of one video frame of the video, the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
在一些实施例中,在确定目标区域在第一视频帧中的第一位置信息之后,还包括:确定第二视频帧相对于第一视频帧的变化参数;根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点,包括:如果基于变化参数确定第二视频帧不满足复用条件,则执行根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点。可选的,复用条件为变化参数小于或等于变化阈值。In some embodiments, after determining the first position information of the target area in the first video frame, the method further includes: determining a change parameter of the second video frame relative to the first video frame; initial features determined according to the first position information Perform optical flow tracking on the second video frame to obtain the target feature point, including: if it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, performing the initial feature point determined according to the first position information to the second video frame. Perform optical flow tracking to obtain target feature points. Optionally, the multiplexing condition is that the change parameter is less than or equal to the change threshold.
其中,变换参数是指表征第二视频帧相对于第一视频帧的变化情况的参数。复用条件是指第二视频帧对目标区域的位置确定能否复用第一视频帧的具体判断条件。其中,变化阈值是指预先设置的阈值,可以根据实际情况设置,例如通过为第二视频帧中特征点相对于第一视频帧中对应的特征点的移动信息表征变化参数时,变换阈值可以为距离阈值,设置为0.8。具体的,确定第二视频帧相对于第一视频帧的变化参数之后,可以将变化参数与变化阈值进行比对,如果确定变化参数大于变化阈值,则可以确定第二视频帧不满足复用条件,需要重新跟踪,执行根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;否则确定第二视频帧满足复用条件。The transformation parameter refers to a parameter representing the change of the second video frame relative to the first video frame. The multiplexing condition refers to a specific judging condition for determining whether the first video frame can be multiplexed by the second video frame to the position of the target area. The change threshold refers to a preset threshold, which can be set according to the actual situation. For example, when the change parameter is represented by the movement information of the feature points in the second video frame relative to the corresponding feature points in the first video frame, the transformation threshold can be Distance threshold, set to 0.8. Specifically, after determining the change parameter of the second video frame relative to the first video frame, the change parameter may be compared with the change threshold, and if it is determined that the change parameter is greater than the change threshold, it may be determined that the second video frame does not meet the multiplexing condition , re-tracking is required, and optical flow tracking is performed on the second video frame based on the initial feature point determined according to the first position information to obtain the target feature point; otherwise, it is determined that the second video frame satisfies the multiplexing condition.
在一些实施例中,确定第二视频帧相对于第一视频帧的变化参数,包括:提取第一视频帧中的第一特征点;根据第一特征点对第二视频帧进行光流跟踪,确定第二特征点,将第二特征点与第一特征点之间的移动距离确定为变化参数。上述第一特征点可以为采用加速分段测试提 取特征(Features From Accelerated Segment Test,FAST)角点检测算法对第一视频帧检测得到的角点,角点是指极值点,即在某方面属性特别突出的点。检测的对象可以为整个第一视频帧,也可以仅为上述目标区域,具体不限。In some embodiments, determining a change parameter of the second video frame relative to the first video frame includes: extracting a first feature point in the first video frame; performing optical flow tracking on the second video frame according to the first feature point, A second feature point is determined, and a moving distance between the second feature point and the first feature point is determined as a change parameter. The above-mentioned first feature point may be a corner point detected on the first video frame by adopting an accelerated segmentation test (Features From Accelerated Segment Test, FAST) corner detection algorithm, and a corner point refers to an extreme point, that is, in a certain aspect Attributes that stand out in particular. The detected object may be the entire first video frame, or may only be the above-mentioned target area, which is not particularly limited.
具体的,对第一视频帧可以采用FAST角点检测算法提取得到第一特征点,将第一特征点作为KLT(Kanade Lucas Tomasi)光流跟踪算法的输入,得到输出的跟踪成功的第二特征点,之后由于第一特征点和第二特征点的数量可以为多个,可以计算第一特征点和第二整点的移动距离的平均值,将该移动距离的平均值确定为变换参数。Specifically, the FAST corner detection algorithm can be used to extract the first feature point for the first video frame, and the first feature point can be used as the input of the KLT (Kanade Lucas Tomasi) optical flow tracking algorithm to obtain the output of the second feature of successful tracking. Then, since the number of the first feature point and the second feature point can be multiple, the average value of the moving distance of the first feature point and the second whole point can be calculated, and the average value of the moving distance is determined as the transformation parameter.
本公开实施例中,目标跟踪方法还可以包括:如果基于变化参数确定第二视频帧满足复用条件,则将第一位置信息确定为目标区域在第二视频帧中的第二位置信息。如果确定变化参数小于或等于变化阈值,则说明当前相机基本处于静止状态,相邻两个视频帧的目标区域的位置相似,第二视频帧满足复用条件,可以将第一位置信息赋值给第二视频帧,也即目标区域在第一视频帧和第二视频帧中的位置信息相同。In the embodiment of the present disclosure, the target tracking method may further include: if it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, determining the first position information as the second position information of the target area in the second video frame. If it is determined that the change parameter is less than or equal to the change threshold, it means that the current camera is basically in a stationary state, the positions of the target areas of two adjacent video frames are similar, and the second video frame satisfies the multiplexing condition, and the first position information can be assigned to the first position information. The two video frames, that is, the location information of the target area in the first video frame and the second video frame are the same.
上述方案中,通过对相邻两个视频帧增加复用条件的判断,当视频中相邻两个视频帧的变化较大时,采用上述特征点跟踪和拟合实现目标区域的位置的确定;当视频中相邻两个视频帧的变化或差异较小时,则说明两个视频帧相似性较高,此时下一个视频帧可以直接复用上一个视频帧的目标区域的位置信息,不用重新进行检测,节省了工作量,提高了计算效率。In the above scheme, by adding the judgment of multiplexing conditions to two adjacent video frames, when the change of the two adjacent video frames in the video is large, the above-mentioned feature point tracking and fitting are used to realize the determination of the position of the target area; When the change or difference between two adjacent video frames in the video is small, the similarity between the two video frames is high, and the next video frame can directly reuse the position information of the target area of the previous video frame without redoing The detection saves the workload and improves the computing efficiency.
图2为本公开实施例提供的另一种目标跟踪方法的流程示意图,本实施例在上述实施例的基础上,进一步优化了上述目标跟踪方法。如图2所示,该方法包括:FIG. 2 is a schematic flowchart of another target tracking method provided by an embodiment of the present disclosure. On the basis of the foregoing embodiment, this embodiment further optimizes the foregoing target tracking method. As shown in Figure 2, the method includes:
步骤201、提取目标视频中的第一视频帧,并确定目标区域在第一视频帧中的第一位置信息。Step 201: Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame.
步骤202、提取第一视频帧中的第一特征点。Step 202: Extract the first feature point in the first video frame.
步骤203、根据第一特征点对第二视频帧进行光流跟踪,确定第二特征点,将第二特征点与第一特征点之间的移动距离确定为变化参数。Step 203: Perform optical flow tracking on the second video frame according to the first feature point, determine the second feature point, and determine the moving distance between the second feature point and the first feature point as a change parameter.
其中,第二视频帧为目标视频中第一视频帧的相邻视频帧。The second video frame is an adjacent video frame of the first video frame in the target video.
步骤204、基于变化参数确定第二视频帧是否满足复用条件,若是,则执行步骤210;否则,执行步骤205。Step 204: Determine whether the second video frame satisfies the multiplexing condition based on the change parameter, if yes, go to Step 210; otherwise, go to Step 205.
其中,复用条件为变化参数小于或等于变化阈值。如果变化参大于变化阈值,则确定第二视频帧不满足复用条件,执行步骤205;否则,确定第二视频帧满足复用条件,执行步骤210。The multiplexing condition is that the change parameter is less than or equal to the change threshold. If the change parameter is greater than the change threshold, it is determined that the second video frame does not meet the multiplexing condition, and step 205 is executed; otherwise, it is determined that the second video frame meets the multiplexing condition, and step 210 is executed.
步骤205、根据第一位置信息对第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。Step 205: Sampling the edge contour of the target area in the first video frame according to the first position information to determine initial feature points.
可选的,根据第一位置信息对第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点,包括:当目标区域为椭圆形区域,根据第一位置信息将目标区域在极坐标下进行表示得到椭圆轮廓;其中,第一位置信息包括目标区域在第一视频帧中的顶点坐标和/或中心点坐标;按照预设极角间隔在椭圆轮廓中进行采样,得到初始特征点。Optionally, sampling the edge contour of the target area in the first video frame according to the first position information, and determining the initial feature points, including: when the target area is an elliptical area, according to the first position information, the target area is in polar coordinates. Perform the following representation to obtain an ellipse outline; wherein, the first position information includes vertex coordinates and/or center point coordinates of the target area in the first video frame; sampling is performed in the ellipse outline according to preset polar angle intervals to obtain initial feature points.
步骤206、根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点。Step 206: Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points.
步骤207、目标特征点在目标区域的边缘轮廓上的覆盖范围是否大于或等于预设范围,若是,则执行步骤208;否则,执行步骤209。Step 207: Check whether the coverage range of the target feature point on the edge contour of the target area is greater than or equal to the preset range, if so, go to Step 208; otherwise, go to Step 209.
如果目标特征点在目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则执行步骤208;否则,执行步骤209。If the coverage area of the target feature point on the edge contour of the target area is greater than or equal to the preset area, step 208 is performed; otherwise, step 209 is performed.
步骤208、对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。Step 208: Fit the target feature points to obtain second position information of the target area in the second video frame.
步骤209、通过对第二视频帧的检测确定目标区域在第二视频帧中的第二位置信息。Step 209: Determine the second position information of the target area in the second video frame by detecting the second video frame.
步骤210、将第一位置信息确定为目标区域在第二视频帧中的第二位置信息。Step 210: Determine the first position information as the second position information of the target area in the second video frame.
接下来通过一个具体的示例对本公开实施例中的目标跟踪方法进行进一步说明。示例性的,图3为本公开实施例提供的一种目标跟踪的示意图,针对视频的跟踪过程可以包括:步骤21、对上一帧进行椭圆检测。上一帧可以为视频的第一帧,具体可以采用任意一种椭圆检测方法进行检测,确定上一帧的椭圆位置。步骤22、当前帧静止检测是否通过,若是,则执行步骤26;否则,执行步骤23。具体对上一帧进行FAST角点检测,并基于上一帧的角点对当前帧进行KLT光流跟踪。计算前后两帧匹配点的平均移动距离。若距离小于0.8,则说明相机基本处于静止状态,静止检测通过,那么当前帧的椭圆位置和上一帧应该相似,并直接将上一帧的椭圆位置赋值给当前帧,执行步骤26。若距离大于0.8,则静止检测未通过,执行步骤23。步骤23、圆周极角采样,跟踪采样点。将上一帧的椭圆方程在极坐标下进行表示,并根据极角在椭圆圆周上进行特征点采样,每隔5度采一个点,共72个点;在当前帧图像中,对采样得到的特征点使用光流进行跟踪,并保留跟踪成功的点,剔除跟踪失败的点。步骤24、判断采样点范围是否满足要求,若是,则执行步骤25;否则,执行步骤27。若跟踪成功的点在椭圆圆周上的分布大于椭圆圆周的3/4,则确定采样点范围满足要求,执行步骤25。否则,确定采样点范围不满足要求,视为跟踪失败,则执行步骤27。步骤25、RANSAC拟合。根据特征点进行椭圆拟合,椭圆拟合采用RANSAC的方式完成,即每次从点集中随机抽样5个点,直至找到最大内点集的椭圆模型即可。步骤26、当前帧结束开始下一帧。步骤27、椭圆检测。对当前帧重新进行椭圆检测,确定椭圆位置之后继续执行步骤26,直到视频中每一帧均确定椭圆位置。Next, the target tracking method in the embodiment of the present disclosure will be further described by using a specific example. Exemplarily, FIG. 3 is a schematic diagram of a target tracking provided by an embodiment of the present disclosure. The tracking process for a video may include: Step 21 , performing ellipse detection on the previous frame. The previous frame may be the first frame of the video. Specifically, any ellipse detection method may be used for detection to determine the ellipse position of the previous frame. Step 22: Whether the current frame stillness detection is passed, if yes, go to Step 26; otherwise, go to Step 23. Specifically, FAST corner detection is performed on the previous frame, and KLT optical flow tracking is performed on the current frame based on the corners of the previous frame. Calculate the average moving distance of matching points in the two frames before and after. If the distance is less than 0.8, it means that the camera is basically in a stationary state, and the stationary detection passes, then the ellipse position of the current frame should be similar to the previous frame, and directly assign the ellipse position of the previous frame to the current frame, and go to step 26. If the distance is greater than 0.8, the static detection fails, and step 23 is executed. Step 23: Sampling the circular polar angle, and track the sampling points. The ellipse equation of the previous frame is represented in polar coordinates, and the feature points are sampled on the circumference of the ellipse according to the polar angle, and a point is taken every 5 degrees, a total of 72 points; in the current frame image, the sampling obtained The feature points are tracked using optical flow, and the points that are successfully tracked are retained, and the points that fail to be tracked are eliminated. Step 24: Determine whether the sampling point range meets the requirements, if yes, go to Step 25; otherwise, go to Step 27. If the distribution of successfully tracked points on the circumference of the ellipse is greater than 3/4 of the circumference of the ellipse, it is determined that the sampling point range meets the requirements, and step 25 is performed. Otherwise, it is determined that the sampling point range does not meet the requirements, and it is considered that the tracking fails, and step 27 is executed. Step 25, RANSAC fitting. The ellipse fitting is performed according to the feature points, and the ellipse fitting is done by RANSAC, that is, 5 points are randomly sampled from the point set each time until the ellipse model with the largest inner point set is found. Step 26: The current frame ends and the next frame begins. Step 27, ellipse detection. The ellipse detection is performed again on the current frame, and after the ellipse position is determined, step 26 is continued until the ellipse position is determined for each frame in the video.
本方案中,采用特征点的光流跟踪、视频帧序列的静止检测和椭圆跟踪的质量判别,可以快速、准确地完成视频中每个图像帧的椭圆跟踪,不需要对每个视频帧进行检测,降低了计算量,保证了目标跟踪的实时性。In this solution, the optical flow tracking of feature points, the still detection of video frame sequences and the quality discrimination of ellipse tracking can be used to quickly and accurately complete the ellipse tracking of each image frame in the video, and it is not necessary to detect each video frame. , reducing the amount of calculation and ensuring the real-time performance of target tracking.
本公开实施例提供的目标跟踪方案,提取目标视频中的第一视频帧,并确定目标区域在第一视频帧中的第一位置信息;根据第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,第二视频帧为目标视频中第一视频帧的相邻视频帧;对目标特征点进行拟合,得到目标区域在第二视频帧中的第二位置信息。采用上述技术方案,在对视频的一个视频帧的目标区域检测的基础上,通过特征点跟踪和拟合即可实现更加准确地确定其他视频帧中目标区域的位置,避免了对每个视频帧的检测,提升了跟踪的计算效率,实现了快速并且准确地对视频中每一图像帧的目标识别和跟踪。The target tracking solution provided by the embodiment of the present disclosure extracts the first video frame in the target video, and determines the first position information of the target area in the first video frame; The frame is subjected to optical flow tracking to obtain target feature points; wherein, the second video frame is the adjacent video frame of the first video frame in the target video; the target feature points are fitted to obtain the first video frame of the target area in the second video frame. 2. Location information. By adopting the above technical solution, on the basis of detecting the target area of one video frame of the video, the position of the target area in other video frames can be more accurately determined through feature point tracking and fitting, avoiding the need for each video frame to be detected. It improves the computational efficiency of tracking and realizes fast and accurate target recognition and tracking of each image frame in the video.
图4为本公开实施例提供的一种目标跟踪装置的结构示意图,该装置可由软件和/或硬件实现,一般可集成在电子设备中。如图4所示,该装置包括:FIG. 4 is a schematic structural diagram of a target tracking apparatus provided by an embodiment of the present disclosure. The apparatus may be implemented by software and/or hardware, and may generally be integrated into an electronic device. As shown in Figure 4, the device includes:
第一位置模块301,用于提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;The first position module 301 is used to extract the first video frame in the target video, and determine the first position information of the target area in the first video frame;
跟踪模块302,用于根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;A tracking module 302, configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information, to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. A video frame adjacent to a video frame;
第二位置模块303,用于对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。The second position module 303 is configured to fit the target feature points to obtain second position information of the target area in the second video frame.
可选的,所述跟踪模块302用于:Optionally, the tracking module 302 is used for:
根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。The edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
可选的,所述跟踪模块302用于:Optionally, the tracking module 302 is used for:
当所述目标区域为椭圆形区域,根据所述第一位置信息将所述目标区域在极坐标下进行表示得到椭圆轮廓;其中,所述第一位置信息包括所述目标区域在所述第一视频帧中的顶点坐标和/或中心点坐标;按照预设极角间隔在所述椭圆轮廓中进行采样,得到所述初始特征点。When the target area is an elliptical area, an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
可选的,所述第二位置模块303用于:Optionally, the second location module 303 is used for:
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
可选的,所述装置还包括检测模块,用于:Optionally, the device further includes a detection module for:
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围小于所述预设范围,则通过对所述第二视频帧的检测确定所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
可选的,所述装置还包括复用判断模块,用于:在所述确定目标区域在所述第一视频帧中的第一位置信息之后,Optionally, the device further includes a multiplexing judging module, configured to: after determining the first position information of the target area in the first video frame,
确定所述第二视频帧相对于所述第一视频帧的变化参数;determining a change parameter of the second video frame relative to the first video frame;
根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点,包括:Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points, including:
如果基于所述变化参数确定所述第二视频帧不满足复用条件,则执行所述根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点。If it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
可选的,所述复用判断模块具体用于:Optionally, the multiplexing judgment module is specifically used for:
提取所述第一视频帧中的第一特征点;extracting the first feature point in the first video frame;
根据所述第一特征点对所述第二视频帧进行光流跟踪,确定第二特征点,将所述第二特征点与所述第一特征点之间的移动距离确定为所述变化参数。Perform optical flow tracking on the second video frame according to the first feature point, determine a second feature point, and determine the moving distance between the second feature point and the first feature point as the change parameter .
可选的,所述复用条件为所述变化参数小于或等于变化阈值。Optionally, the multiplexing condition is that the change parameter is less than or equal to a change threshold.
可选的,所述装置还包括复用模块,用于:Optionally, the device also includes a multiplexing module for:
如果基于所述变化参数确定所述第二视频帧满足所述复用条件,则将所述第一位置信息确定为所述目标区域在所述第二视频帧中的第二位置信息。If it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, the first position information is determined as the second position information of the target area in the second video frame.
本公开实施例所提供的目标跟踪装置可执行本公开任意实施例所提供的目标跟踪方法,具备执行方法相应的功能模块和有益效果。The target tracking device provided by the embodiment of the present disclosure can execute the target tracking method provided by any embodiment of the present disclosure, and has functional modules and beneficial effects corresponding to the execution method.
本公开实施例还提供一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被处理器执行时实现本公开任意实施例所提供的目标跟踪方法。An embodiment of the present disclosure also provides a computer program product, including a computer program/instruction, when the computer program/instruction is executed by a processor, the target tracking method provided by any embodiment of the present disclosure is implemented.
图5为本公开实施例提供的一种电子设备的结构示意图。下面具体参考图5,其示出了适于用来实现本公开实施例中的电子设备400的结构示意图。本公开实施例中的电子设备400可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,PDA)、PAD(平板电脑)、便携式多媒体播放器(Portable Media Player,PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字电视(Television,TV)、台式 计算机等等的固定终端。图5示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring specifically to FIG. 5 below, it shows a schematic structural diagram of an electronic device 400 suitable for implementing an embodiment of the present disclosure. The electronic device 400 in the embodiment of the present disclosure may include, but is not limited to, such as a mobile phone, a notebook computer, a digital broadcast receiver, a Personal Digital Assistant (PDA), a PAD (tablet computer), a portable multimedia player (Portable Media Player, PMP), in-vehicle terminals (eg, in-vehicle navigation terminals), etc., and stationary terminals such as digital televisions (Television, TV), desktop computers, and the like. The electronic device shown in FIG. 5 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
如图5所示,电子设备400可以包括处理装置(例如中央处理器、图形处理器等)401,其可以根据存储在只读存储器(Read-Only Memory,ROM)402中的程序或者从存储装置408加载到随机访问存储器(Random Access Memory,RAM)403中的程序而执行各种适当的动作和处理。在RAM 403中,还存储有电子设备400操作所需的各种程序和数据。处理装置401、ROM 402以及RAM 403通过总线404彼此相连。输入/输出(Input/Output,I/O)接口405也连接至总线404。As shown in FIG. 5 , the electronic device 400 may include a processing device (eg, a central processing unit, a graphics processor, etc.) 401, which may be based on a program stored in a read-only memory (Read-Only Memory, ROM) 402 or from a storage device 408 is a program loaded into a random access memory (RAM) 403 to perform various appropriate actions and processes. In the RAM 403, various programs and data required for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An Input/Output (I/O) interface 405 is also connected to the bus 404 .
通常,以下装置可以连接至I/O接口405:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置406;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置407;包括例如磁带、硬盘等的存储装置408;以及通信装置409。通信装置409可以允许电子设备400与其他设备进行无线或有线通信以交换数据。虽然图5示出了具有各种装置的电子设备400,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices can be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a Liquid Crystal Display (LCD) output device 407 , a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409 . Communication means 409 may allow electronic device 400 to communicate wirelessly or by wire with other devices to exchange data. Although FIG. 5 shows electronic device 400 having various means, it should be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置409从网络上被下载和安装,或者从存储装置408被安装,或者从ROM 402被安装。在该计算机程序被处理装置401执行时,执行本公开实施例的目标跟踪方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication device 409, or from the storage device 408, or from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the target tracking method of the embodiment of the present disclosure are executed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM,或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、射频(Radio Freqency,RF)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory (Erasable Programmable Read-Only Memory) Memory, EPROM, or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . The program code embodied on the computer readable medium can be transmitted by any suitable medium, including but not limited to: electric wire, optical fiber cable, radio frequency (RF), etc., or any suitable combination of the above.
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,Ad-Hoc端对端网络),以及任何当前已知或未来研发的网络。In some embodiments, the client and server can use any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol) to communicate, and can communicate with digital data in any form or medium Communication (eg, a communication network) interconnects. Examples of communication networks include Local Area Network (LAN), Wide Area Network (WAN), Internet (eg, the Internet), and peer-to-peer networks (eg, Ad-Hoc peer-to-peer network), as well as any current Known or future developed networks.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: extracts the first video frame in the target video, and determines that the target area is in the first video frame. the first position information in a video frame; perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points; wherein, the second video frame is the target video The adjacent video frames of the first video frame in the above; and fitting the target feature points to obtain the second position information of the target area in the second video frame.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括LAN或WAN—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing operations of the present disclosure may be written in one or more programming languages, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and This includes conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. Where a remote computer is involved, the remote computer may be connected to the user computer through any kind of network, including a LAN or WAN, or may be connected to an external computer (eg, using an Internet service provider to connect through the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Product,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)等等。The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (Application Specific Standard Products) Standard Product, ASSP), system on chip (System on Chip, SOC), complex programmable logic device (Complex Programmable Logic Device, CPLD) and so on.
根据本公开的一个或多个实施例,本公开提供了一种目标跟踪方法,包括:According to one or more embodiments of the present disclosure, the present disclosure provides a target tracking method, including:
提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame;
根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;Perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein, the second video frame is the neighbor of the first video frame in the target video video frame;
对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。Fitting the target feature points to obtain second position information of the target area in the second video frame.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,根据所述第一位置信息确定初始特征点,包括:According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, determining an initial feature point according to the first position information includes:
根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。The edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点,包括:According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, the edge contour of the target area in the first video frame is sampled according to the first position information, and the initial feature points are determined, including: :
当所述目标区域为椭圆形区域,根据所述第一位置信息将所述目标区域在极坐标下进行表示得到椭圆轮廓;其中,所述第一位置信息包括所述目标区域在所述第一视频帧中的顶点坐标和/或中心点坐标;按照预设极角间隔在所述椭圆轮廓中进行采样,得到所述初始特征点。When the target area is an elliptical area, an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息,包括:According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, the target feature points are fitted to obtain second position information of the target area in the second video frame, including: :
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,还包括:According to one or more embodiments of the present disclosure, the target tracking method provided by the present disclosure further includes:
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围小于所述预设范围,则通过对所述第二视频帧的检测确定所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,在所述确定目标区域在所述第一视频帧中的第一位置信息之后,还包括:According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, after the determining the first position information of the target area in the first video frame, the method further includes:
确定所述第二视频帧相对于所述第一视频帧的变化参数;determining a change parameter of the second video frame relative to the first video frame;
根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点,包括:Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points, including:
如果基于所述变化参数确定所述第二视频帧不满足复用条件,则执行所述根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点。If it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,所述确定所述第二视频帧相对于所述第一视频帧的变化参数,包括:According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, the determining a change parameter of the second video frame relative to the first video frame includes:
提取所述第一视频帧中的第一特征点;extracting the first feature point in the first video frame;
根据所述第一特征点对所述第二视频帧进行光流跟踪,确定第二特征点,将所述第二特征点与所述第一特征点之间的移动距离确定为所述变化参数。Perform optical flow tracking on the second video frame according to the first feature point, determine a second feature point, and determine the moving distance between the second feature point and the first feature point as the change parameter .
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,所述复用条件为所述变化参数小于或等于变化阈值。According to one or more embodiments of the present disclosure, in the target tracking method provided by the present disclosure, the multiplexing condition is that the change parameter is less than or equal to a change threshold.
根据本公开的一个或多个实施例,本公开提供的目标跟踪方法中,还包括:According to one or more embodiments of the present disclosure, the target tracking method provided by the present disclosure further includes:
如果基于所述变化参数确定所述第二视频帧满足所述复用条件,则将所述第一位置信息确定为所述目标区域在所述第二视频帧中的第二位置信息。If it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, the first position information is determined as the second position information of the target area in the second video frame.
根据本公开的一个或多个实施例,本公开提供了一种目标跟踪装置,包括:According to one or more embodiments of the present disclosure, the present disclosure provides a target tracking device, including:
第一位置模块,用于提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;A first position module, for extracting the first video frame in the target video, and determining the first position information of the target area in the first video frame;
跟踪模块,用于根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;A tracking module, configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. Video frames adjacent to the video frame;
第二位置模块,用于对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。A second position module, configured to fit the target feature points to obtain second position information of the target area in the second video frame.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述跟踪模块用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the tracking module is configured to:
根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。The edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述跟踪模块用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the tracking module is configured to:
当所述目标区域为椭圆形区域,根据所述第一位置信息将所述目标区域在极坐标下进行表示得到椭圆轮廓;其中,所述第一位置信息包括所述目标区域在所述第一视频帧中的顶点坐标和/或中心点坐标;按照预设极角间隔在所述椭圆轮廓中进行采样,得到所述初始特征点。When the target area is an elliptical area, an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first Vertex coordinates and/or center point coordinates in the video frame; sampling in the elliptical outline according to preset polar angle intervals to obtain the initial feature points.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述第二位置模块用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the second location module is used for:
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述装置还包括检测模块,用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the device further includes a detection module for:
如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围小于所述预设范围,则通过对所述第二视频帧的检测确定所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述装置还包括复用判断模块,用于:在所述确定目标区域在所述第一视频帧中的第一位置信息之后,According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the device further includes a multiplexing judgment module, configured to: in the first video frame of the determined target area in the first video frame After location information,
确定所述第二视频帧相对于所述第一视频帧的变化参数;determining a change parameter of the second video frame relative to the first video frame;
根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点,包括:Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points, including:
如果基于所述变化参数确定所述第二视频帧不满足复用条件,则执行所述根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点。If it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述复用判断模块具体用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the multiplexing judgment module is specifically configured to:
提取所述第一视频帧中的第一特征点;extracting the first feature point in the first video frame;
根据所述第一特征点对所述第二视频帧进行光流跟踪,确定第二特征点,将所述第二特征点与所述第一特征点之间的移动距离确定为所述变化参数。Perform optical flow tracking on the second video frame according to the first feature point, determine a second feature point, and determine the moving distance between the second feature point and the first feature point as the change parameter .
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述复用条件为所述变化参数小于或等于变化阈值。According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the multiplexing condition is that the change parameter is less than or equal to a change threshold.
根据本公开的一个或多个实施例,本公开提供的目标跟踪装置中,所述装置还包括复用模块,用于:According to one or more embodiments of the present disclosure, in the target tracking device provided by the present disclosure, the device further includes a multiplexing module for:
如果基于所述变化参数确定所述第二视频帧满足所述复用条件,则将所述第一位置信息确定为所述目标区域在所述第二视频帧中的第二位置信息。If it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, the first position information is determined as the second position information of the target area in the second video frame.
根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, comprising:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现如本公开提供的任一所述的目标跟踪方法。The processor is configured to read the executable instructions from the memory, and execute the instructions to implement any one of the target tracking methods provided in the present disclosure.
根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,所述存储介质存储有计算机程序,所述计算机程序用于执行如本公开提供的任一所述的目标跟踪方法。According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program for executing any of the objects provided by the present disclosure tracking method.
根据本公开的一个或多个实施例,本公开提供了一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如本公开提供的任一所述的目标跟踪方法。According to one or more embodiments of the present disclosure, the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the target tracking method as provided in any one of the present disclosure.
根据本公开的一个或多个实施例,本公开提供了一种计算机程序,所述计算机程序存储在计算机可读存储介质中,所述计算机程序被处理器执行时实现如本公开提供的任一所述的目标跟踪方法。According to one or more embodiments of the present disclosure, the present disclosure provides a computer program, the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor, implements any one of the methods provided by the present disclosure. The described target tracking method.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover, without departing from the above-mentioned disclosed concept, the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) with similar functions.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。Additionally, although operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, although the above discussion contains several implementation-specific details, these should not be construed as limitations on the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or logical acts of method, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims (14)

  1. 一种目标跟踪方法,其特征在于,包括:A target tracking method, comprising:
    提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;Extract the first video frame in the target video, and determine the first position information of the target area in the first video frame;
    根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;Perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain the target feature point; wherein, the second video frame is the neighbor of the first video frame in the target video video frame;
    对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。Fitting the target feature points to obtain second position information of the target area in the second video frame.
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点之前,还包括:The method according to claim 1, wherein, before the initial feature point determined according to the first position information performs optical flow tracking on the second video frame to obtain the target feature point, the method further comprises:
    根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点。The edge contour of the target area in the first video frame is sampled according to the first position information to determine initial feature points.
  3. 根据权利要求2所述的方法,其特征在于,根据所述第一位置信息对所述第一视频帧中的目标区域的边缘轮廓进行采样,确定初始特征点,包括:The method according to claim 2, wherein sampling the edge contour of the target area in the first video frame according to the first position information to determine initial feature points, comprising:
    当所述目标区域为椭圆形区域,根据所述第一位置信息将所述目标区域在极坐标下进行表示得到椭圆轮廓;其中,所述第一位置信息包括所述目标区域在所述第一视频帧中的顶点坐标和/或中心点坐标;When the target area is an elliptical area, an elliptical outline is obtained by representing the target area in polar coordinates according to the first position information; wherein, the first position information includes that the target area is in the first vertex coordinates and/or center point coordinates in the video frame;
    按照预设极角间隔在所述椭圆轮廓中进行采样,得到所述初始特征点。Sampling is performed in the elliptical outline according to a preset polar angle interval to obtain the initial feature point.
  4. 根据权利要求1-3中任一所述的方法,其特征在于,对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息,包括:The method according to any one of claims 1-3, wherein the fitting of the target feature points to obtain the second position information of the target area in the second video frame, comprising:
    如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围大于或等于预设范围,则对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is greater than or equal to a preset range, perform fitting on the target feature point to obtain the coverage area of the target area in the second video frame. second location information.
  5. 根据权利要求4所述的方法,其特征在于,还包括:The method of claim 4, further comprising:
    如果所述目标特征点在所述目标区域的边缘轮廓上的覆盖范围小于所述预设范围,则通过对所述第二视频帧的检测确定所述目标区域在所述第二视频帧中的第二位置信息。If the coverage range of the target feature point on the edge contour of the target area is smaller than the preset range, determining the coverage of the target area in the second video frame by detecting the second video frame second location information.
  6. 根据权利要求1-3中任一所述的方法,其特征在于,在所述确定目标区域在所述第一视频帧中的第一位置信息之后,还包括:The method according to any one of claims 1-3, wherein after the determining the first position information of the target area in the first video frame, the method further comprises:
    确定所述第二视频帧相对于所述第一视频帧的变化参数;determining a change parameter of the second video frame relative to the first video frame;
    根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点,包括:Perform optical flow tracking on the second video frame according to the initial feature points determined by the first position information to obtain target feature points, including:
    如果基于所述变化参数确定所述第二视频帧不满足复用条件,则执行所述根据所述第一位置信息确定的初始特征点对所述第二视频帧进行光流跟踪,得到目标特征点。If it is determined based on the change parameter that the second video frame does not meet the multiplexing condition, the initial feature point determined according to the first position information is performed to perform optical flow tracking on the second video frame to obtain target features point.
  7. 根据权利要求6所述的方法,其特征在于,所述确定所述第二视频帧相对于所述第一视频帧的变化参数,包括:The method according to claim 6, wherein the determining a change parameter of the second video frame relative to the first video frame comprises:
    提取所述第一视频帧中的第一特征点;extracting the first feature point in the first video frame;
    根据所述第一特征点对所述第二视频帧进行光流跟踪,确定第二特征点,将所述第二特征点与所述第一特征点之间的移动距离确定为所述变化参数。Perform optical flow tracking on the second video frame according to the first feature point, determine a second feature point, and determine the moving distance between the second feature point and the first feature point as the change parameter .
  8. 根据权利要求6所述的方法,其特征在于,所述复用条件为所述变化参数小于或等于变化阈值。The method according to claim 6, wherein the multiplexing condition is that the change parameter is less than or equal to a change threshold.
  9. 根据权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising:
    如果基于所述变化参数确定所述第二视频帧满足所述复用条件,则将所述第一位置信息确定为所述目标区域在所述第二视频帧中的第二位置信息。If it is determined based on the change parameter that the second video frame satisfies the multiplexing condition, the first position information is determined as the second position information of the target area in the second video frame.
  10. 一种目标跟踪装置,其特征在于,包括:A target tracking device, comprising:
    第一位置模块,用于提取目标视频中的第一视频帧,并确定目标区域在所述第一视频帧中的第一位置信息;A first position module, for extracting the first video frame in the target video, and determining the first position information of the target area in the first video frame;
    跟踪模块,用于根据所述第一位置信息确定的初始特征点对第二视频帧进行光流跟踪,得到目标特征点;其中,所述第二视频帧为所述目标视频中所述第一视频帧的相邻视频帧;A tracking module, configured to perform optical flow tracking on the second video frame according to the initial feature point determined by the first position information to obtain a target feature point; wherein, the second video frame is the first video frame in the target video. Video frames adjacent to the video frame;
    第二位置模块,用于对所述目标特征点进行拟合,得到所述目标区域在所述第二视频帧中的第二位置信息。A second position module, configured to fit the target feature points to obtain second position information of the target area in the second video frame.
  11. 一种电子设备,其特征在于,所述电子设备包括:An electronic device, characterized in that the electronic device comprises:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    所述处理器,用于从所述存储器中读取所述可执行指令,并执行所述指令以实现上述权利要求1-9中任一所述的目标跟踪方法。The processor is configured to read the executable instructions from the memory and execute the instructions to implement the target tracking method according to any one of the preceding claims 1-9.
  12. 一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机程序,所述计算机程序用于执行上述权利要求1-9中任一所述的目标跟踪方法。A computer-readable storage medium, characterized in that the storage medium stores a computer program, and the computer program is used to execute the target tracking method according to any one of the preceding claims 1-9.
  13. 一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序被处理器执行时实现上述权利要求1-9中任一所述的目标跟踪方法。A computer program product, characterized in that it includes a computer program, which, when executed by a processor, implements the target tracking method according to any one of claims 1-9.
  14. 一种计算机程序,其特征在于,所述计算机程序存储在计算机可读存储介质中,所述计算机程序被处理器执行时实现上述权利要求1-9中任一所述的目标跟踪方法。A computer program, characterized in that, the computer program is stored in a computer-readable storage medium, and when the computer program is executed by a processor, the target tracking method according to any one of the preceding claims 1-9 is implemented.
PCT/CN2022/080977 2021-03-15 2022-03-15 Target tracking method and apparatus, device and medium WO2022194157A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/468,647 US20240005552A1 (en) 2021-03-15 2023-09-15 Target tracking method and apparatus, device, and medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110276358.7 2021-03-15
CN202110276358.7A CN115082515A (en) 2021-03-15 2021-03-15 Target tracking method, device, equipment and medium

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/080985 Continuation-In-Part WO2022194158A1 (en) 2021-03-15 2022-03-15 Target tracking method and apparatus, device, and medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/468,647 Continuation-In-Part US20240005552A1 (en) 2021-03-15 2023-09-15 Target tracking method and apparatus, device, and medium

Publications (1)

Publication Number Publication Date
WO2022194157A1 true WO2022194157A1 (en) 2022-09-22

Family

ID=83240774

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/080977 WO2022194157A1 (en) 2021-03-15 2022-03-15 Target tracking method and apparatus, device and medium

Country Status (2)

Country Link
CN (1) CN115082515A (en)
WO (1) WO2022194157A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108492315A (en) * 2018-02-09 2018-09-04 湖南华诺星空电子技术有限公司 A kind of dynamic human face tracking
CN109598744A (en) * 2018-11-29 2019-04-09 广州市百果园信息技术有限公司 A kind of method, apparatus of video tracking, equipment and storage medium
CN109919971A (en) * 2017-12-13 2019-06-21 北京金山云网络技术有限公司 Image processing method, device, electronic equipment and computer readable storage medium
CN112258556A (en) * 2020-10-22 2021-01-22 北京字跳网络技术有限公司 Method and device for tracking designated area in video, readable medium and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109919971A (en) * 2017-12-13 2019-06-21 北京金山云网络技术有限公司 Image processing method, device, electronic equipment and computer readable storage medium
CN108492315A (en) * 2018-02-09 2018-09-04 湖南华诺星空电子技术有限公司 A kind of dynamic human face tracking
CN109598744A (en) * 2018-11-29 2019-04-09 广州市百果园信息技术有限公司 A kind of method, apparatus of video tracking, equipment and storage medium
CN112258556A (en) * 2020-10-22 2021-01-22 北京字跳网络技术有限公司 Method and device for tracking designated area in video, readable medium and electronic equipment

Also Published As

Publication number Publication date
CN115082515A (en) 2022-09-20

Similar Documents

Publication Publication Date Title
CN111783626B (en) Image recognition method, device, electronic equipment and storage medium
WO2020253616A1 (en) Audio collection device positioning method and apparatus, and speaker recognition method and system
WO2019080702A1 (en) Image processing method and apparatus
WO2022105622A1 (en) Image segmentation method and apparatus, readable medium, and electronic device
WO2020062494A1 (en) Image processing method and apparatus
CN111784712A (en) Image processing method, device, equipment and computer readable medium
CN112488095A (en) Seal image identification method and device and electronic equipment
WO2022028253A1 (en) Positioning model optimization method, positioning method, positioning device, and storage medium
CN111126159A (en) Method, apparatus, electronic device, and medium for tracking pedestrian in real time
CN112085733B (en) Image processing method, image processing device, electronic equipment and computer readable medium
CN112257598B (en) Method and device for identifying quadrangle in image, readable medium and electronic equipment
CN111783632B (en) Face detection method and device for video stream, electronic equipment and storage medium
CN112101258A (en) Image processing method, image processing device, electronic equipment and computer readable medium
WO2023020268A1 (en) Gesture recognition method and apparatus, and device and medium
WO2023138540A1 (en) Edge extraction method and apparatus, and electronic device and storage medium
WO2022194145A1 (en) Photographing position determination method and apparatus, device, and medium
WO2022194158A1 (en) Target tracking method and apparatus, device, and medium
WO2022194157A1 (en) Target tracking method and apparatus, device and medium
CN110765304A (en) Image processing method, image processing device, electronic equipment and computer readable medium
WO2022052889A1 (en) Image recognition method and apparatus, electronic device, and computer-readable medium
CN114863124A (en) Model training method, polyp detection method, corresponding apparatus, medium, and device
CN110348374B (en) Vehicle detection method and device, electronic equipment and storage medium
CN111860209B (en) Hand recognition method, device, electronic equipment and storage medium
CN111340813A (en) Image instance segmentation method and device, electronic equipment and storage medium
WO2022194061A1 (en) Target tracking method, apparatus and device, and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22770510

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22770510

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 20-02-2024)