CN112634327A - Tracking method based on YOLOv4 model - Google Patents

Tracking method based on YOLOv4 model Download PDF

Info

Publication number
CN112634327A
CN112634327A CN202011516516.3A CN202011516516A CN112634327A CN 112634327 A CN112634327 A CN 112634327A CN 202011516516 A CN202011516516 A CN 202011516516A CN 112634327 A CN112634327 A CN 112634327A
Authority
CN
China
Prior art keywords
picture
target
current
frame
storing
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202011516516.3A
Other languages
Chinese (zh)
Inventor
赵守风
沈志勇
姚一峰
黄欣
段振华
陈海涛
张翰林
徐琴琴
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Xuntu Information Technology Co ltd
Original Assignee
Hefei Xuntu Information Technology Co ltd
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 Hefei Xuntu Information Technology Co ltd filed Critical Hefei Xuntu Information Technology Co ltd
Priority to CN202011516516.3A priority Critical patent/CN112634327A/en
Publication of CN112634327A publication Critical patent/CN112634327A/en
Pending legal-status Critical Current

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
    • G06T7/248Analysis of motion using feature-based methods, e.g. the tracking of corners or segments involving reference images or patches
    • 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/20081Training; Learning
    • 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/20084Artificial neural networks [ANN]

Landscapes

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

Abstract

The invention discloses a multiple target tracking method based on a YOLOv4 model, which is used for detecting and tracking a target object in a video by utilizing the YOLOv4 model, has better tracking and de-duplication effects and is suitable for the multiple target tracking requirement in a complex scene video.

Description

Tracking method based on YOLOv4 model
Technical Field
The invention relates to a tracking method based on a YOLOv4 model.
Background
In a single picture, the deep learning model Yolov4 model can well identify and locate the target.
However, in video processing, there are many frames of pictures in the period from appearance to disappearance of the target, and therefore, many repetitions of the detected target appear. For this case, the repetitive problem can be solved to some extent using the tracking algorithm Deep SORT.
In the fields of intelligent transportation and the like, scenes of video data are complex, targets are many, large-area shielding exists, and the situations of target tracking failure and target loss still occur when Deep SORT is used according to a conventional method, so that a large number of repeated targets appear, and the detection efficiency is seriously influenced.
Therefore, it is urgently needed to provide a better method for solving the technical problem.
Disclosure of Invention
The invention aims to provide a tracking method based on a YOLOv4 model, which is used for detecting and tracking a target object in a video by utilizing the YOLOv4 model, has better tracking and de-duplication effects and meets the multi-target tracking requirement in a complex scene video.
In order to achieve the above object, the present invention provides a tracking method based on YOLOv4 model, including:
step 1, inputting an original picture into YOLOv4, outputting a detected target picture by YOLOv4, and numbering the target picture respectively to form an ID number; if the frame is the first frame, directly giving an ID (identity) and storing the picture and corresponding coordinate information and width and height;
step 2, if the frame is not the first frame, calculating the IOU intersection ratio, if the calculated value is larger than the threshold value, giving a new ID, storing information and storing the picture into newfile; if the calculated value is smaller than the threshold value, calculating the similarity, if the calculated value reaches the threshold value, determining that the picture of the previous frame and the detected picture of the current frame are the same target, deleting the picture of the previous frame and storing the picture of the current target into the newfile; then, traversing the next target of the current frame, and calculating by using the same method; if the calculated similarity value exceeds the threshold value, defining the current target as a new target, giving a new ID, and then independently storing the graph, the corresponding ID and the information;
step 3, when the target of the current frame is detected and the previous frame is found to have the undetected target, determining that the target is lost, and independently storing the graph, the corresponding ID and the information into the lossfile;
step 4, traversing the newly added picture in newfile and the lost picture in lossfile, and carrying out similarity calculation on the newly added picture and the lost picture in lossfile to judge whether the newly added picture and the lost picture are the same target; at this time, a threshold value is set through the ID or the frame number, whether the current ID is larger than the set ID or not is compared, if the current ID is larger than the set ID, the current ID is directly deleted, and if the current ID is not larger than the set ID, the current ID is reserved;
and 5, performing continuous cyclic detection according to the steps 1 to 4.
According to the technical scheme, the method is not used for carrying out the de-duplication on the basis of YOLOv4+ DeepsORT, but directly carries out the de-duplication on the basis of YOLOv4, and directly outputs the de-duplication to the method when the YOLOv4 detects the target object, so that the method can replace the DeepsORT and has better tracking and de-duplication effects.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
fig. 1 is a schematic flow chart of a tracking method based on the YOLOv4 model in the present invention.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present invention, are given by way of illustration and explanation only, not limitation.
In the present invention, unless otherwise specified, the directional terms included in the terms merely represent the directions of the terms in a conventional use state or are colloquially known by those skilled in the art, and should not be construed as limiting the terms.
Referring to fig. 1, the present invention provides a tracking method based on YOLOv4 model, including:
step 1, inputting an original picture into YOLOv4, outputting a detected target picture by YOLOv4, and numbering the target picture respectively to form an ID number; if the frame is the first frame, directly giving an ID (identity) and storing the picture and corresponding coordinate information and width and height;
step 2, if the frame is not the first frame, calculating the IOU intersection ratio, if the calculated value is larger than the threshold value, giving a new ID, storing information and storing the picture into newfile; if the calculated value is smaller than the threshold value, calculating the similarity, if the calculated value reaches the threshold value, determining that the picture of the previous frame and the detected picture of the current frame are the same target, deleting the picture of the previous frame and storing the picture of the current target into the newfile; then, traversing the next target of the current frame, and calculating by using the same method; if the calculated similarity value exceeds the threshold value, defining the current target as a new target, giving a new ID, and then independently storing the graph, the corresponding ID and the information;
step 3, when the target of the current frame is detected and the previous frame is found to have the undetected target, determining that the target is lost, and independently storing the graph, the corresponding ID and the information into the lossfile;
step 4, traversing the newly added picture in newfile and the lost picture in lossfile, and carrying out similarity calculation on the newly added picture and the lost picture in lossfile to judge whether the newly added picture and the lost picture are the same target; at this time, a threshold value is set through the ID or the frame number, whether the current ID is larger than the set ID or not is compared, if the current ID is larger than the set ID, the current ID is directly deleted, and if the current ID is not larger than the set ID, the current ID is reserved;
and 5, performing continuous cyclic detection according to the steps 1 to 4.
Specifically, after an original picture is input into YOLOv4, YOLOv4 outputs detected target pictures, after the target pictures are taken, the original picture is respectively numbered, namely, an ID number (the first frame is all numbered and the target pictures are stored while the center coordinates (relative to a large picture) and the width and the height of the target pictures are stored), when a new frame of picture is obtained, a corresponding small detection target is output after the YOLO detection, then the corresponding center coordinates and the width and the height are respectively obtained, at this time, the target picture of the current frame is traversed, the values of the detection frame of the current frame and the target detection frame of the previous frame are obtained by an IOU (cross-over ratio) method, whether the candidate target is a current frame is determined by the value of the IOU, then, the similarity algorithm is used for calculation, if the similarity reaches a certain threshold value, the current detection target of the current frame appears in the previous frame, at this time, the picture of the current frame is stored to replace the picture of the previous frame, the ID remains unchanged and then the next target of the current frame is traversed, with the same aspect being calculated.
If the target of the current frame is found, the target of the previous frame is found through the IOU, or the similarity calculation exceeds a threshold value, the current target is defined as a new target, a new ID is given, and then the graph and the corresponding ID and information are independently stored.
When the target of the current frame is detected, and the previous frame is found to have the undetected target, the target is determined to be lost, and the graph, the ID and the corresponding information are independently stored.
In this case, the target may be out of the view of the video due to occlusion in the lost target, or the target may be out of the view of the video due to occlusion in the newly added target, and the target may appear again or a new target may enter the view of the video. Therefore, at this time, it is only necessary to calculate the similarity between the newly added pictures and the lost pictures to determine whether the pictures are the same target, but here, a threshold needs to be set through the ID (or the number of frames), that is, when the pictures are far away from the current frame, the pictures are saved, and the other pictures are discarded, so that the number of the lost pictures and the number of the newly added pictures can be controlled.
And then carrying out continuous cycle detection.
Through the technical scheme, the method is not used for carrying out de-duplication on the basis of YOLOv4+ DeepsORT, but directly carries out de-duplication on the basis of YOLOv4, and directly outputs the de-duplication to the method when a target object is detected by YOLOv4, so that the method can replace the DeepsORT and has better tracking and de-duplication effects.
The preferred embodiments of the present invention have been described in detail with reference to the accompanying drawings, however, the present invention is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present invention within the technical idea of the present invention, and these simple modifications are within the protective scope of the present invention.
It should be noted that the various technical features described in the above embodiments can be combined in any suitable manner without contradiction, and the invention is not described in any way for the possible combinations in order to avoid unnecessary repetition.
In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as the disclosure of the present invention as long as it does not depart from the spirit of the present invention.

Claims (1)

1. A tracking method based on a YOLOv4 model is characterized by comprising the following steps:
step 1, inputting an original picture into YOLOv4, outputting a detected target picture by YOLOv4, and numbering the target picture respectively to form an ID number; if the frame is the first frame, directly giving an ID (identity) and storing the picture and corresponding coordinate information and width and height;
step 2, if the frame is not the first frame, calculating the IOU intersection ratio, if the calculated value is larger than the threshold value, giving a new ID, storing information and storing the picture into newfile; if the calculated value is smaller than the threshold value, calculating the similarity, if the calculated value reaches the threshold value, determining that the picture of the previous frame and the detected picture of the current frame are the same target, deleting the picture of the previous frame and storing the picture of the current target into the newfile; then, traversing the next target of the current frame, and calculating by using the same method; if the calculated similarity value exceeds the threshold value, defining the current target as a new target, giving a new ID, and then independently storing the graph, the corresponding ID and the information;
step 3, when the target of the current frame is detected and the previous frame is found to have the undetected target, determining that the target is lost, and independently storing the graph, the corresponding ID and the information into the lossfile;
step 4, traversing the newly added picture in newfile and the lost picture in lossfile, and carrying out similarity calculation on the newly added picture and the lost picture in lossfile to judge whether the newly added picture and the lost picture are the same target; at this time, a threshold value is set through the ID or the frame number, whether the current ID is larger than the set ID or not is compared, if the current ID is larger than the set ID, the current ID is directly deleted, and if the current ID is not larger than the set ID, the current ID is reserved;
and 5, performing continuous cyclic detection according to the steps 1 to 4.
CN202011516516.3A 2020-12-21 2020-12-21 Tracking method based on YOLOv4 model Pending CN112634327A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011516516.3A CN112634327A (en) 2020-12-21 2020-12-21 Tracking method based on YOLOv4 model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011516516.3A CN112634327A (en) 2020-12-21 2020-12-21 Tracking method based on YOLOv4 model

Publications (1)

Publication Number Publication Date
CN112634327A true CN112634327A (en) 2021-04-09

Family

ID=75320219

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011516516.3A Pending CN112634327A (en) 2020-12-21 2020-12-21 Tracking method based on YOLOv4 model

Country Status (1)

Country Link
CN (1) CN112634327A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177931A (en) * 2021-05-19 2021-07-27 北京明略软件系统有限公司 Method and device for detecting and tracking key component

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018058595A1 (en) * 2016-09-30 2018-04-05 富士通株式会社 Target detection method and device, and computer system
CN108985162A (en) * 2018-06-11 2018-12-11 平安科技(深圳)有限公司 Object real-time tracking method, apparatus, computer equipment and storage medium
CN110717403A (en) * 2019-09-16 2020-01-21 国网江西省电力有限公司电力科学研究院 Face multi-target tracking method
WO2020082258A1 (en) * 2018-10-24 2020-04-30 深圳鲲云信息科技有限公司 Multi-objective real-time tracking method and apparatus, and electronic device
CN111429483A (en) * 2020-03-31 2020-07-17 杭州博雅鸿图视频技术有限公司 High-speed cross-camera multi-target tracking method, system, device and storage medium
WO2020164282A1 (en) * 2019-02-14 2020-08-20 平安科技(深圳)有限公司 Yolo-based image target recognition method and apparatus, electronic device, and storage medium
CN111582062A (en) * 2020-04-21 2020-08-25 电子科技大学 Re-detection method in target tracking based on YOLOv3
CN111626277A (en) * 2020-08-03 2020-09-04 杭州智诚惠通科技有限公司 Vehicle tracking method and device based on over-station inter-modulation index analysis
CN112016445A (en) * 2020-08-27 2020-12-01 重庆科技学院 Monitoring video-based remnant detection method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018058595A1 (en) * 2016-09-30 2018-04-05 富士通株式会社 Target detection method and device, and computer system
CN108985162A (en) * 2018-06-11 2018-12-11 平安科技(深圳)有限公司 Object real-time tracking method, apparatus, computer equipment and storage medium
WO2020082258A1 (en) * 2018-10-24 2020-04-30 深圳鲲云信息科技有限公司 Multi-objective real-time tracking method and apparatus, and electronic device
WO2020164282A1 (en) * 2019-02-14 2020-08-20 平安科技(深圳)有限公司 Yolo-based image target recognition method and apparatus, electronic device, and storage medium
CN110717403A (en) * 2019-09-16 2020-01-21 国网江西省电力有限公司电力科学研究院 Face multi-target tracking method
CN111429483A (en) * 2020-03-31 2020-07-17 杭州博雅鸿图视频技术有限公司 High-speed cross-camera multi-target tracking method, system, device and storage medium
CN111582062A (en) * 2020-04-21 2020-08-25 电子科技大学 Re-detection method in target tracking based on YOLOv3
CN111626277A (en) * 2020-08-03 2020-09-04 杭州智诚惠通科技有限公司 Vehicle tracking method and device based on over-station inter-modulation index analysis
CN112016445A (en) * 2020-08-27 2020-12-01 重庆科技学院 Monitoring video-based remnant detection method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177931A (en) * 2021-05-19 2021-07-27 北京明略软件系统有限公司 Method and device for detecting and tracking key component

Similar Documents

Publication Publication Date Title
CN107633526B (en) Image tracking point acquisition method and device and storage medium
CN105894464B (en) A kind of medium filtering image processing method and device
CN111652902B (en) Target tracking detection method, electronic equipment and device
WO2014136623A1 (en) Method for detecting and tracking objects in sequence of images of scene acquired by stationary camera
KR102265315B1 (en) Method and apparatus for estimating image optical flow
CN110648363A (en) Camera posture determining method and device, storage medium and electronic equipment
CN111310759B (en) Target detection inhibition optimization method and device for dual-mode cooperation
CN108898148B (en) Digital image corner detection method, system and computer readable storage medium
CN110009662B (en) Face tracking method and device, electronic equipment and computer readable storage medium
TW201917696A (en) Object detection and tracking method and system
CN115423846A (en) Multi-target track tracking method and device
CN114049383B (en) Multi-target tracking method and device and readable storage medium
JP2006244074A (en) Moving object close-up frame detection method and program, storage medium storing program, moving object close-up shot detection method, moving object close-up frame or shot detection method and program, and storage medium storing program
CN112634327A (en) Tracking method based on YOLOv4 model
CN109961516B (en) Surface acquisition method, device and non-transitory computer readable recording medium
CN116330658B (en) Target tracking method, device and system based on depth image and image pickup equipment
CN110009683B (en) Real-time on-plane object detection method based on MaskRCNN
KR102336284B1 (en) Moving Object Detection Method and System with Single Camera
CN111860161B (en) Target shielding detection method
US8179967B2 (en) Method and device for detecting movement of an entity provided with an image sensor
KR101915402B1 (en) Method for matching feature of image by progressive graph optimization
JPH03204783A (en) Image tracking device
CN112634332A (en) Tracking method based on YOLOv4 model and DeepsORT model
CN114677625B (en) Object detection method, device, apparatus, storage medium, and program product
CN114115640B (en) Icon determination method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination