CN109636835A - Foreground target detection method based on template light stream - Google Patents

Foreground target detection method based on template light stream Download PDF

Info

Publication number
CN109636835A
CN109636835A CN201811536946.4A CN201811536946A CN109636835A CN 109636835 A CN109636835 A CN 109636835A CN 201811536946 A CN201811536946 A CN 201811536946A CN 109636835 A CN109636835 A CN 109636835A
Authority
CN
China
Prior art keywords
template
optical flow
foreground target
frame
picture
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.)
Granted
Application number
CN201811536946.4A
Other languages
Chinese (zh)
Other versions
CN109636835B (en
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.)
CHINACCS INFORMATION INDUSTRY Co Ltd
Original Assignee
CHINACCS INFORMATION INDUSTRY 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 CHINACCS INFORMATION INDUSTRY Co Ltd filed Critical CHINACCS INFORMATION INDUSTRY Co Ltd
Priority to CN201811536946.4A priority Critical patent/CN109636835B/en
Publication of CN109636835A publication Critical patent/CN109636835A/en
Application granted granted Critical
Publication of CN109636835B publication Critical patent/CN109636835B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/269Analysis of motion using gradient-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

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 invention discloses a kind of foreground target detection methods based on template light stream, are related to computer vision target detection technique field, and technical solution is, including S1, selection original template;Optical flow field in S2, acquisition template picture and subsequent video stream between each frame picture;S3, the optical flow field that S2 is got is calculated, counts the vector length size of optical flow field, when statistical result is greater than threshold value, determine that present frame has the target different from template;S3, template renewal;At interval of the timeT, setting present frame picture is new template.The beneficial effects of the present invention are: optical flow method is lower to machine configuration requirement, save the cost.A large amount of tape label data are not needed, so the object detection method based on deep learning that compares, technically simple, are saved the time, it is practical.By more new template, it is adapted to the slowly varying situation of video background image.

Description

Foreground target detection method based on template light stream
Technical field
The present invention relates to computer vision target detection technique field, in particular to a kind of prospect mesh based on template light stream Mark detection method.
Background technique
Foreground target detection in quasi-static background belongs to computer vision scope, all has in all trades and professions huge Practical application request, such as workshop, railroad track, airport hardstand, household safety-protection environment all swarm into given zone with detection The target in domain is as core function.
Research field is detected in general target, in recent years fast-developing depth learning technology, met in performance real Border use demand, these technical methods include but is not limited to YOLO (you only look once), SSD (Single Shot MultiBox Detector).Object detection method based on deep learning generally needs a large amount of tape label data (to expend very much Time and fund) model pre-training is carried out, while the high hardware environment (high performance video cards etc.) configured is needed, these difficulty limitations It is in the application to cost sensitivity industry.
In view of this, how to realize that target detection becomes one and valuable studies a question efficiently at low cost.
Summary of the invention
In order to achieve the above-mentioned object of the invention, in view of the above technical problems, before the present invention provides a kind of light stream based on template Scape object detection method.
Its technical solution is that this method is analyzed based on the optical flow field vector statistics of the every frame picture of video flowing, to detect prospect Target, comprising:
S1, original template is chosen;
Within a bit of time of the initial phase of video flowing, a frame picture is randomly assigned as template, if the picture In existing foreground target to be detected, then current template cancels, when needing to wait in video flowing there is no foreground target, again Set template;
Optical flow field in S2, acquisition template picture and subsequent video stream between each frame picture;
S3, the optical flow field that S2 is got is calculated, counts the vector length size of optical flow field, when statistical result is greater than threshold value When, determine that present frame has the target different from template;According to the experimental data given threshold of pre-training.
S4, template renewal;
When deviating or vibrating there are light variation, video camera, picture and template picture in live video stream Difference will gradually amplify, and then may cause error detection, to solve this problem, need timely replacement template.Specifically, at interval of Time T, if foreground target is not present in present frame, setting present frame picture is new template, if present frame there are foreground target, It then postpones by video flowing, until more new template when foreground target is not present in present frame.
Preferably, in the S3, the statistical method of optical flow field are as follows:
Using classical optical flow method (to improve computational efficiency, preferentially using pyramid Lucas Kanade optical flow method), will regard The template image that every frame image and S1 in frequency stream obtain carries out optical flow computation, calculates all light stream vectors in optical flow fieldLength The average value of degreeThat is:
Wherein, n is the total quantity of light stream vector in optical flow field;I is light stream vector subscript, indicates corresponding i-th of light stream Vector.
When light stream vector average valueWhen sharply increasing, determine that there are foreground targets.This is because the frame picture and template There are great differences for picture, and lead to that optical flow method is calculated is optical flow field (some feature in template picture background of mispairing The light stream of mispairing is constituted in point and live video stream between some incoherent characteristic point of foreground target), it cannot reflect light The misalignment of stream method same substance point in general sense, can but be used to judge whether there is new object.
Preferably, a threshold value V is set by pre-training, whenWhen determine there are foreground targets.
Preferably, in the S4, when the present frame of video flowing and the time interval t of template are greater than preset value T, setting is current The picture of frame is template.
Preferably, when the S4 more new template, detection present frame first whether there is foreground target;If result is "No" is then new template using present frame picture;
If result be "Yes" if wouldn't more new template, continue to test next frame, until a certain frame in do not occur prospect mesh When mark, use the frame picture as new template.
Preferably, template renewal time interval T is set according to the experimental data of pre-training.
Technical solution provided in an embodiment of the present invention has the benefit that optical flow method is lower to machine configuration requirement, Save the cost.A large amount of tape label data are not needed, so the object detection method based on deep learning that compares, technology letter It is single, it saves the time, it is practical.By more new template, it is adapted to the slowly varying situation of video background image.
Detailed description of the invention
Fig. 1 is the original template display diagram of the embodiment of the present invention.
Fig. 2 be the embodiment of the present invention without foreground target when optical flow field display diagram.
Fig. 3 is optical flow field display diagram when having a foreground target of the embodiment of the present invention.
Fig. 4 is the new template display diagram of the embodiment of the present invention.
Fig. 5 is the foreground target detection method flow chart based on template light stream of the embodiment of the present invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.Certainly, described herein specific examples are only used to explain the present invention, is not used to Limit the present invention.
It should be noted that in the absence of conflict, the feature in embodiment and embodiment in the invention can To be combined with each other.
In the description of the invention, it is to be understood that term " center ", " longitudinal direction ", " transverse direction ", "upper", "lower", The orientation or positional relationship of the instructions such as "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outside" is It is based on the orientation or positional relationship shown in the drawings, is merely for convenience of description the invention and simplifies description, rather than indicate Or imply that signified device or element must have a particular orientation, be constructed and operated in a specific orientation, therefore cannot understand For the limitation to the invention.In addition, term " first ", " second " etc. are used for description purposes only, and should not be understood as indicating Or it implies relative importance or implicitly indicates the quantity of indicated technical characteristic." first ", " second " etc. are defined as a result, Feature can explicitly or implicitly include one or more of the features.In the description of the invention, unless separately It is described, the meaning of " plurality " is two or more.
In the description of the invention, it should be noted that unless otherwise clearly defined and limited, term " peace Dress ", " connected ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, or integrally Connection;It can be mechanical connection, be also possible to be electrically connected;Can be directly connected, can also indirectly connected through an intermediary, It can be the connection inside two elements.For the ordinary skill in the art, on being understood by concrete condition State concrete meaning of the term in the invention.
Embodiment 1
Referring to Fig. 1 to Fig. 5, the present invention provides a kind of foreground target detection method based on template light stream, to detect train For whether there is train on track, detailed description of the present invention operating procedure.
Pre-training is carried out, real history video data is chosen, sets template, the light between calculation template and subsequent video frame Flow vector, artificial judgment whether there is foreground target, and statistics exists respectively and there is no the light under foreground target both of these case Flow field vector average value takes the average value of two end values as threshold value because the two results differ greatly.When detection Between when continuing for some time t, template respectively with exist and there is no the matched light stream vector statistical values of the video frame of foreground target Will be fairly close, so that there is mistake in matching result, to avoid this unfavorable as a result, must be when time interval is less than t, in time more New template, specifically, settable template renewal interval T are approximately equal to the half of t.
Step 1 chooses original template.
After artificially judging that target to be detected is not present in current video, a frame is randomly selected as original template, Fig. 1 For template example:
Step 2, optical flow field is calculated, foreground target is detected.
Using pyramid Lucas Kanade optical flow method, the light stream in video flowing between every frame picture and template picture is calculated ?.Fig. 2 and Fig. 3 is respectively foreground target to be not present and the case where there are foreground targets, the statistics for calculating light stream vector length is flat Mean value, as a result as shown in following two table.
(foreground target is not present) in 1 light stream vector length of table statistics
2 light stream vector length of table counts (there are foreground targets)
For the case where there are foreground targets, because the background mismatch in the foreground target and template of present frame causes to occur A large amount of mistake light stream vector, with respect to no prospect target conditions, the length of these vectors is very big, need to only select suitable threshold value V can be distinguished with the presence or absence of foreground target.For example V=1.0 is taken, and when being greater than this threshold value, that is, determine that there are foreground targets, it is on the contrary Foreground target is then not present.
Step 3, more new template.
For the slowly varying situation of reply background picture, template renewal algorithm is introduced.At interval of the time, check that present frame is No there are foreground targets, the use of present frame picture are new template if result is "No", wouldn't if result is "Yes" More new template continues to test next frame, until using the frame picture as new mould when not occurring foreground target in a certain frame Plate.Fig. 4 is updated template example (brightness is different from original template).
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (6)

1. the foreground target detection method based on template light stream, optical flow field vector statistics of this method based on the every frame picture of video flowing Analysis, to detect foreground target characterized by comprising
S1, original template is chosen;
In the initial phase of video flowing, be randomly assigned a frame picture as template, if in the picture it is existing it is to be detected before Scape target needs to wait for setting template again there is no when foreground target in video flowing then current template cancels;
Optical flow field in S2, acquisition template picture and subsequent video stream between each frame picture;
S3, the optical flow field that S2 is got is calculated, counts the vector length size of optical flow field, when statistical result is greater than threshold value, sentenced There is the target different from template in settled previous frame;
S4, template renewal;At interval of time T, if foreground target is not present in present frame, setting present frame picture is new mould Plate is postponed if there are foreground targets for present frame by video flowing, until more new template when foreground target is not present in present frame.
2. the foreground target detection method according to claim 1 based on template light stream, which is characterized in that in the S3, The statistical method of optical flow field are as follows:
The template image of every frame image and S1 acquisition in video flowing is subjected to optical flow computation, calculates all light streams arrows in optical flow field AmountLength average valueAccording to formula:
Wherein, n is the total quantity of light stream vector in optical flow field;
When light stream vector average valueWhen sharply increasing, determine that there are foreground targets.
3. the foreground target detection method according to claim 2 based on template light stream, which is characterized in that pass through pre-training A threshold value V is set, whenWhen determine there are foreground targets.
4. the foreground target detection method according to claim 3 based on template light stream, which is characterized in that in the S4, When the present frame of video flowing and the time interval t of template are greater than preset value T, the picture that present frame is arranged is template.
5. based on the foreground target detection method as claimed in claim 4 based on template light stream, which is characterized in that the S4 updates When template, detection present frame first whether there is foreground target;It the use of present frame picture is new mould if result is "No" Plate;If result is "Yes" wouldn't more new template, continue to test next frame, until in a certain frame when not occurring foreground target, Use the frame picture as new template.
6. based on the foreground target detection method as claimed in claim 4 based on template light stream, which is characterized in that according to pre-training Experimental data set template renewal time interval T.
CN201811536946.4A 2018-12-14 2018-12-14 Foreground object detection method based on template optical flow Active CN109636835B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811536946.4A CN109636835B (en) 2018-12-14 2018-12-14 Foreground object detection method based on template optical flow

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811536946.4A CN109636835B (en) 2018-12-14 2018-12-14 Foreground object detection method based on template optical flow

Publications (2)

Publication Number Publication Date
CN109636835A true CN109636835A (en) 2019-04-16
CN109636835B CN109636835B (en) 2023-07-04

Family

ID=66074326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811536946.4A Active CN109636835B (en) 2018-12-14 2018-12-14 Foreground object detection method based on template optical flow

Country Status (1)

Country Link
CN (1) CN109636835B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233967A (en) * 2019-06-20 2019-09-13 漳州智觉智能科技有限公司 Mould template image generation system and method
CN110264458A (en) * 2019-06-20 2019-09-20 漳州智觉智能科技有限公司 Mold monitoring system and method
CN110675369A (en) * 2019-04-26 2020-01-10 深圳市豪视智能科技有限公司 Coupling mismatch detection method and related equipment
CN111754550A (en) * 2020-06-12 2020-10-09 中国农业大学 Method and device for detecting dynamic barrier in motion state of agricultural machine

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800106A (en) * 2012-06-29 2012-11-28 刘怡光 Self-adaptation mean-shift target tracking method based on optical flow field estimation
US20150139484A1 (en) * 2013-11-19 2015-05-21 Xerox Corporation Time scale adaptive motion detection
CN104966305A (en) * 2015-06-12 2015-10-07 上海交通大学 Foreground detection method based on motion vector division
CN105654522A (en) * 2015-12-30 2016-06-08 青岛海尔股份有限公司 Frosting detection method and frosting detection system for evaporator
CN105894530A (en) * 2014-12-11 2016-08-24 深圳市阿图姆科技有限公司 Detection and tracking solution scheme aiming at motion target in video
CN106874949A (en) * 2017-02-10 2017-06-20 华中科技大学 A kind of moving platform moving target detecting method and system based on infrared image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800106A (en) * 2012-06-29 2012-11-28 刘怡光 Self-adaptation mean-shift target tracking method based on optical flow field estimation
US20150139484A1 (en) * 2013-11-19 2015-05-21 Xerox Corporation Time scale adaptive motion detection
CN105894530A (en) * 2014-12-11 2016-08-24 深圳市阿图姆科技有限公司 Detection and tracking solution scheme aiming at motion target in video
CN104966305A (en) * 2015-06-12 2015-10-07 上海交通大学 Foreground detection method based on motion vector division
CN105654522A (en) * 2015-12-30 2016-06-08 青岛海尔股份有限公司 Frosting detection method and frosting detection system for evaporator
CN106874949A (en) * 2017-02-10 2017-06-20 华中科技大学 A kind of moving platform moving target detecting method and system based on infrared image

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110675369A (en) * 2019-04-26 2020-01-10 深圳市豪视智能科技有限公司 Coupling mismatch detection method and related equipment
CN110675369B (en) * 2019-04-26 2022-01-14 深圳市豪视智能科技有限公司 Coupling mismatch detection method and related equipment
CN110233967A (en) * 2019-06-20 2019-09-13 漳州智觉智能科技有限公司 Mould template image generation system and method
CN110264458A (en) * 2019-06-20 2019-09-20 漳州智觉智能科技有限公司 Mold monitoring system and method
CN110233967B (en) * 2019-06-20 2021-10-01 漳州智觉智能科技有限公司 Mold template image generation system and method
CN110264458B (en) * 2019-06-20 2023-01-06 漳州智觉智能科技有限公司 Mold monitoring system and method
CN111754550A (en) * 2020-06-12 2020-10-09 中国农业大学 Method and device for detecting dynamic barrier in motion state of agricultural machine
CN111754550B (en) * 2020-06-12 2023-08-11 中国农业大学 Method and device for detecting dynamic obstacle in movement state of agricultural machine

Also Published As

Publication number Publication date
CN109636835B (en) 2023-07-04

Similar Documents

Publication Publication Date Title
CN109636835A (en) Foreground target detection method based on template light stream
US10198623B2 (en) Three-dimensional facial recognition method and system
CN105405154B (en) Target object tracking based on color-structure feature
CN103208008B (en) Based on the quick adaptive method of traffic video monitoring target detection of machine vision
CN111612820A (en) Multi-target tracking method, and training method and device of feature extraction model
Lee et al. Place recognition using straight lines for vision-based SLAM
EP4062374A1 (en) Fish biomass, shape, size, or health determination
CN103942525A (en) Real-time face optimal selection method based on video sequence
CN103530599A (en) Method and system for distinguishing real face and picture face
WO2013053159A1 (en) Method and device for tracking vehicle
CN110414376B (en) Method for updating face recognition model, face recognition camera and server
CN103778409A (en) Human face identification method based on human face characteristic data mining and device
CN102243765A (en) Multi-camera-based multi-objective positioning tracking method and system
CN109145742A (en) A kind of pedestrian recognition method and system
CN105701467A (en) Many-people abnormal behavior identification method based on human body shape characteristic
CN110287907B (en) Object detection method and device
CN110288627A (en) One kind being based on deep learning and the associated online multi-object tracking method of data
CN106612457B (en) Video sequence alignment schemes and system
CN103164693A (en) Surveillance video pedestrian detection matching method
CN109711267A (en) A kind of pedestrian identifies again, pedestrian movement's orbit generation method and device
CN111950345A (en) Camera identification method and device, electronic equipment and storage medium
CN109684990A (en) A kind of behavioral value method of making a phone call based on video
KR101214858B1 (en) Moving object detecting apparatus and method using clustering
CN116681729B (en) Anti-occlusion multi-target tracking method based on track prediction
CN101877135A (en) Moving target detecting method based on background reconstruction

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
GR01 Patent grant
GR01 Patent grant