CN105488542B - A kind of foreground object detection method and equipment - Google Patents
A kind of foreground object detection method and equipment Download PDFInfo
- Publication number
- CN105488542B CN105488542B CN201510982581.8A CN201510982581A CN105488542B CN 105488542 B CN105488542 B CN 105488542B CN 201510982581 A CN201510982581 A CN 201510982581A CN 105488542 B CN105488542 B CN 105488542B
- Authority
- CN
- China
- Prior art keywords
- foreground
- scenery
- img2
- img1
- image data
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/29—Graphical models, e.g. Bayesian networks
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Image Analysis (AREA)
Abstract
It includes foreground area detection module, prospect profile module, gradient computing module, foreground detection control module that inventor, which provides a kind of foreground object detection method and equipment, the equipment,.It is related to object identification field, relates generally to the identification of the foreground object of irregular movement.The foreground object detection method is according to the variation of the gradient value in prospect profile masks area, background is easily recognizable as after static compared to the object moved in single background Gauss model, and another object can be identified as when moving after the static long period, this method improves the recognition efficiency of foreground object and the consistency of identification.
Description
Technical field
The present invention relates to object identification fields, relate generally to the identification of the foreground object of irregular movement.
Background technique
Background object just refers to the object of static or slowly movement, and the object that foreground object just relatively moves
Body.So we can find out object detection one classification problem, that is, to determine whether a pixel belongs to background
Point.But in the foreground object of irregular movement, it is spaced foreground object static for a long time especially between movement twice,
Background object is easily recognizable as during static.
In the implementation of the present invention, following problem exists in the prior art in inventor, based on single background model
Detection method generally require the higher track algorithm of computation complexity (such as meanshift algorithm).Such methods can not simultaneously
State before confirming target following, such as the static rear multiple movement of object, easily identify as another object;And double-background model
Algorithm calculation amount is twice of single background model, the method for double-background model its substantially process is as follows:
Establish two different Gaussian Background models of renewal speed.It can be there are two types of implementation, first is that identical update frequency
Rate/period, different update speed;Second is that identical renewal speed, different update frequency/period.Used here as the second way, more
New frequency it is high be denoted as MOG_fast, renewal frequency it is low be denoted as MOG_slow.
Inputted video image starts to calculate into two Gauss models, and with respective frequency, before background and segmentation
Scape.Prospect is denoted as FG_fast and FG_slow respectively.
When FG_fast detects target prospect, but FG_slow is not detected, then determines the mesh that FG_fast is detected
Mark.
Distinguishing target prospect using additional method confirmation is residue or lost-and-found object, and in the threshold time of setting
After alarm.
Summary of the invention
It is given below and simplifying for one or more aspects is summarized to try hard to provide the basic comprehension to such aspect.This
The extensive overview of the not all aspect contemplated is summarized, and is both not intended to identify in all aspects key or decisive
The element also non-range attempted to define in terms of any or all.Its unique purpose be to provide in simplified form it is one or more
Some concepts of a aspect are using the sequence as more specifical explanation given later.
Inventor provides a kind of foreground object detection method, comprising steps of
A frame image IMG1 is obtained, described image IMG1 is input in background model and is calculated, updates background image data,
And mark foreground area;
If continue to obtain next frame image there is no the region for being marked as foreground area in described image IMG1, and
Based on the next frame image update background image data and label foreground area got, it is marked as if existing in image IMG1
The region of foreground area then marks prospect profile according to the foreground area, calculates prospect profile according to the prospect profile and covers
Mould region, the prospect profile masks area are annular region;
The background image data is calculated in the gradient value G_B1 and described image IMG1 of the prospect profile masks area
In the gradient value G_IMG1 of the prospect profile masks area;
Judge whether the object in foreground area is preceding scenery by G_B1 and G_IMG1;
The prospect profile masks area is made of the region between expansion profile and erosion profile;The expansion profile root
It is calculated according to prospect profile and expansion formula;The erosion profile is calculated according to prospect profile and corrosion formula;
The background model is Gaussian Background model;
It is described by G_B1 and G_IMG1 judge the object in foreground area whether be before scenery comprising steps of
Judge that the value of G_IMG1-G_B1 whether less than the first preset value, judges that the object in foreground area is if being less than
Preceding scenery, and marking preceding scenery is lost-and-found object, otherwise judges current foreground area without foreground object;
The foreground object detection method before label scenery be lost-and-found object after, further comprise the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input in the background model and is calculated more
Background image data after new;
Updated background image data is calculated in the gradient value G_B2 of the prospect profile masks area;
The value of the G_B2-G_B1 is judged whether less than the second preset value, if more than or equal to then cancel scenery before label
For lost-and-found object, continue the picture frame IMGx after obtaining if being less than;The picture frame IMGx of acquisition is input to the background mould
Background image data is updated in type, and calculates background image data in the gradient value G_Bx, Zhi Daojing of prospect profile masks area
The time T for crossing setting triggers lost-and-found object actuation of an alarm if the difference of G_Bx-G_B1 is respectively less than the second preset value in T time.
Further, it after foreground object detection method scenery before label is lost-and-found object, further comprises the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input in the background model and is calculated more
Background image data after new;Picture frame IMG2 is calculated in the gradient value G_IMG2 of the prospect profile masks area;
The value of the G_IMG2-G_B1 is judged whether less than the second preset value, if more than or equal to then cancel label prospect
Object is lost-and-found object, continues the picture frame after obtaining if being less than;By the picture frame IMGx of acquisition, and calculates picture frame IMGx and exist
The gradient value G_IMGx of prospect profile masks area, until the time T by setting, if the difference of G_IMGx-G_B1 is in T time
Less than the second preset value, then lost-and-found object actuation of an alarm is triggered.
Further, it after foreground object detection method scenery before label is lost-and-found object, further comprises the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated back
Scape image data;
Scenery obtains next frame image IMG2, is updated with IMG2 for lost-and-found object and after the time of setting before label
Background image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;
The value of the G_B2-G_B1 is judged whether less than the second preset value, if more than or equal to then cancel scenery before label
For lost-and-found object, lost-and-found object actuation of an alarm is triggered if being less than.
Further, it after foreground object detection method scenery before label is lost-and-found object, further comprises the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated back
Scape image data;
Scenery obtains next frame image IMG2 for lost-and-found object and after the time of setting before label, calculates IMG2 and exists
The gradient value G_IMG2 of the prospect profile masks area;
The value of the G_IMG2-G_B1 is judged whether less than the second preset value, if more than or equal to then cancel label prospect
Object is lost-and-found object, triggers lost-and-found object actuation of an alarm if being less than.
Further, described " judging whether the object in foreground area is preceding scenery by G_B1 and G_IMG1 " includes step
It is rapid:
Judge whether the difference of G_IMG1-G_B1 is greater than third preset value, is before the object for judging in foreground area is
Scenery, scenery is residue before marking, and otherwise judges the unmatched scenery of current foreground area.
It further, further include step after foreground object detection method scenery before label is residue,
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input in the background model and is calculated more
Background image data after new;
Updated background image data is calculated in the gradient value G_B2 of the prospect profile masks area;
Whether the value of the G_B2-G_B1 is judged less than the 4th preset value, and scenery is to leave before cancelling label if being less than
Otherwise object continues the picture frame after obtaining;The picture frame IMGx of acquisition is input in the background model and updates Background
As data, and calculate background image data in the gradient value G_Bx of prospect profile masks area, until the time by setting, if
The difference of G_Bx-G_B1 is all larger than the 4th preset value, then triggers residue actuation of an alarm.
Further, it after foreground object detection method scenery before label is residue, further comprises the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated back
Scape image data;
Scenery obtains next frame image IMG2, is updated with IMG2 for residue and after the time of setting before label
Background image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;
Whether the value of the G_B2-G_B1 is judged less than the 4th preset value, and scenery is to leave before cancelling label if being less than
Otherwise object triggers residue actuation of an alarm.
Further, it after foreground object detection method scenery before label is residue, further comprises the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated back
Scape image data;
Scenery calculates IMG2 to obtain next frame image IMG2 after residue and after the time of setting before label
In the gradient value G_IMG2 of the prospect profile masks area;
Whether the value of the G_IMG2-G_B1 is judged less than the 4th preset value, and scenery is something lost before cancelling label if being less than
Object is stayed, residue actuation of an alarm is otherwise triggered.
Further, it after foreground object detection method scenery before label is residue, further comprises the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input in the background model and is calculated more
Background image data after new;
Picture frame IMG2 is calculated in the gradient value G_IMG2 of the prospect profile masks area;
Whether the value of the G_IMG2-G_B1 is judged less than the 4th preset value, and scenery is something lost before cancelling label if being less than
Lost article, if more than or equal to then continue obtain after picture frame;Picture frame IMGx is obtained, and calculates picture frame IMGx in prospect
The gradient value G_IMGx in contours mask region, until the time T by setting, if the difference of G_IMGx-G_B1 is respectively less than in T time
Scenery is residue before then cancelling label, otherwise triggers residue actuation of an alarm.
Inventor also provides a kind of foreground detection equipment, including foreground area detection module, prospect profile module, gradiometer
Calculate module, preceding scene detection control module;
Described image IMG1 is input to background model for obtaining a frame image IMG1 by the foreground area detection module
Middle calculating updates background image data, and marks foreground area;
If the prospect profile module is used to judge in described image IMG1 there is no the region for being marked as foreground area,
Then continue to obtain next frame image, and based on the next frame image update background image data got and mark foreground area,
If there is the region for being marked as foreground area in image IMG1, prospect profile is marked according to the foreground area, according to institute
It states prospect profile and calculates prospect profile masks area, the prospect profile masks area is annular region;
The gradient computing module is for calculating the background image data in the gradient of the prospect profile masks area
Gradient value G_IMG1 of the value G_B1 and described image IMG1 in the prospect profile masks area;
The preceding scene detection control module be used for by G_B1 and G_IMG1 judge the object in foreground area whether be
Preceding scenery;Further include that prospect profile masks area obtains module, is used to obtain prospect profile masks area, the prospect profile
Masks area is made of the region between expansion profile and erosion profile;The expansion profile is according to prospect profile and expansion formula
It is calculated;The erosion profile is calculated according to prospect profile and corrosion formula;
The preceding scene detection control module is specifically used for judging whether the difference of G_IMG1-G_B1 is default less than first
Value judges the object in foreground area if being less than for preceding scenery, and scenery is lost-and-found object before marking, and otherwise judges current foreground zone
Domain is without foreground object;
The preceding scene detection control module is used to obtain the picture frame IMG2 after IMG1, and described image frame IMG2 is defeated
Enter into the background model and calculates updated background image data;Updated background image data is calculated before described
The gradient value G_B2 in scape contours mask region;Judge the value of the G_B2-G_B1 whether less than the second preset value, if more than or wait
Scenery is lost-and-found object before then cancelling label, continues the picture frame IMGx after obtaining if being less than;By the picture frame of acquisition
IMGx, which is input in the background model, updates background image data, and calculates background image data in prospect profile masks area
Gradient value G_Bx, until by setting time T, if the difference of G_Bx-G_B1 is respectively less than the second preset value in T time,
Trigger lost-and-found object actuation of an alarm.
Further, the preceding scene detection control module is used to obtain the picture frame after IMG1, by described image frame
It is input in the background model and calculates updated background image data;Scenery is lost-and-found object and passes through setting before label
Time T after, obtain next frame image IMG2, with IMG2 update background image data, calculate updated background image data
In the gradient value G_B2 of the prospect profile masks area;Judge the value of the G_B2-G_B1 whether less than the second preset value, if
It is lost-and-found object more than or equal to scenery before then cancelling label, triggers lost-and-found object actuation of an alarm if being less than.
Further, it is pre- to judge whether the difference of G_IMG1-G_B1 is greater than third for the preceding scene detection control module
It is to judge object in foreground area for preceding scenery, scenery is residue before marking, and otherwise judges current foreground area if value
Unmatched scenery.
Further, the preceding scene detection control module is used to obtain the picture frame IMG2 after IMG1, by the figure
Updated background image data is calculated as frame IMG2 is input in the background model;Calculate updated background image number
According to the gradient value G_B2 in the prospect profile masks area;Judge the value of the G_B2-G_B1 whether less than the 4th preset value,
Scenery is residue before cancelling label if being less than, and otherwise continues the picture frame after obtaining;The picture frame IMGx of acquisition is defeated
Enter into the background model and update background image data, and calculates background image data in the gradient of prospect profile masks area
Value G_Bx, until the time T by setting triggers something lost if the difference of G_Bx-G_B1 is both greater than the 4th preset value in T time
Stay object actuation of an alarm.
Further, the preceding scene detection control module is used to obtain the picture frame after IMG1, by described image frame
It is input in the background model and calculates updated background image data;Scenery is after residue and by setting before label
After fixed time T, next frame image IMG2 is obtained, background image data is updated with IMG2, calculates updated background image number
According to the gradient value G_B2 in the prospect profile masks area;Judge the value of the G_B2-G_B1 whether less than the 4th preset value,
Scenery is residue before cancelling label if being less than, and otherwise triggers residue actuation of an alarm.
In addition, additional aspect may include a kind of for realizing a kind of first generation of foreground object detection method described herein
Code collection.Further aspect in this regard can include: at least one processor including execution;Including computer-readable medium
Computer program product, the computer-readable medium include that can be executed by computer to detect and respond the instruction of foreground object;
It or include the equipment of the device or component for detecting and responding foreground object.To address related purpose before capable of reaching, this
Or more aspect include in the feature for being hereinafter fully described and particularly pointing out in the following claims.Be described below with it is attached
Figure illustrates certain illustrative aspects of this one or more aspect.But these features are only to indicate to adopt
With several in the various modes of the principle of various aspects, and this description is intended to cover all such aspects and its waits efficacious prescriptions
Face.
It is different from the prior art, this method is detected according to the variation of the gradient value in prospect profile masks area with reaching
The purpose of foreground object.Be easily recognizable as background after static compared to the object moved in single background Gauss model, and it is static compared with
It can be identified as another object when moving after long-time again, this method improves recognition efficiency and the identification of foreground object
Consistency.Again because during foreground object tracks and identifies, it is only necessary to the ladder of extra computation tracking prospect profile masks area
Degree variation is needed compared to the identification of the foreground object of double-background model with different two different Backgrounds of frequency or periodic maintenance
Layer data, this method significantly reduce the calculation scale of data.And before this method can be detected by less calculating
Scenery body is not required to detect foreground object by the Background From Layer for calculating multiple weightings that (usual weighted background is in foreground object
At the beginning of moving, weighted background will not have greatly changed), reduce the delay of foreground object detection.
Detailed description of the invention
Disclosed aspect is described below with reference to attached drawing, provide attached drawing be in order to illustrate and non-limiting disclosed side
Face, similar label indicates similar elements in attached drawing, and wherein:
Fig. 1 is foreground object detection method flow chart described in specific embodiment;
Fig. 2 is the detection method flow chart again of foreground area described in specific embodiment;
Fig. 3 is lost-and-found object detection method flow chart described in specific embodiment;
Fig. 4 is the detection method flow chart again of lost-and-found object described in specific embodiment;
Fig. 5 is remnant object detection method flow chart described in specific embodiment;
Fig. 6 is the detection method flow chart again of residue described in specific embodiment;
Fig. 7 is reference time axis;
Fig. 8 is the example of the image IMG1 inputted at the t1 moment;
Fig. 9 is the example of background image data in t1 moment model;
Figure 10 is the foreground area example that t1 moment model identifies;
Figure 11 is the example of foreground area profile described in specific embodiment;
Figure 12 is the example of prospect profile masks area described in specific embodiment;
Figure 13 is background image data in prospect profile masks area combination t1 moment model described in specific embodiment
Example;
Figure 14 is that the image IMG1 of the input at prospect profile masks area combination t1 moment described in specific embodiment shows
Example;
Figure 15 is that foreground object described in specific embodiment stands the t2 moment after a period of time, prospect profile masks area
In conjunction with the example of background image data in t2 moment model;
Figure 16 is the example of the image IMG1 inputted at another specific embodiment t1 moment;
Figure 17 is the example of background image data in another specific embodiment t1 moment model;
Figure 18 is the foreground area example that another specific embodiment t1 moment model identifies;
Figure 19 is background image in prospect profile masks area combination t1 moment model described in another specific embodiment
The example of data;
Figure 20 is the image of the input at prospect profile masks area combination t1 moment described in another specific embodiment
IMG1 example;
Figure 21 is that foreground object described in another specific embodiment stands the t2 moment after a period of time, prospect profile mask
Region combines the example of background image data in t2 moment model;
It Figure 22, is EM equipment module figure described in another specific embodiment;
It Figure 23, is prospect profile masks area schematic diagram.
Appended drawing reference:
20, equipment;
201, foreground area detection module;
203, prospect profile module;
205, gradient computing module;
207, foreground detection control module;
301, erosion profile;
302, prospect profile;
303, profile is expanded.
Specific embodiment
Technology contents, construction feature, the objects and the effects for detailed description technical solution, below in conjunction with specific reality
It applies example and attached drawing is cooperated to be explained in detail.In the following description, numerous details is elaborated for explanatory purposes to provide pair
The thorough understanding of one or more aspects.It will be evident that such aspect can also be practiced without these details.
Heretofore described image frame sequence refers mainly to the sequence that picture frame is arranged in sequentially in time, such as often
The sequence that the video pictures that the video monitoring seen is recorded are constituted.Image frame sequence can make video file, be also possible to video
Stream.It should be noted that it is image that picture frame, which is sometimes referred to as,.
A kind of calculating contour of object mask is inventors herein proposed, then by calculating picture frame in contour of object masks area
Gradient, and then identify foreground object and judge the method for the motion state of foreground object.It can be used for searching tracking and seek
Look for generation opposing stationary object for a long time.
Referring to Fig. 1, a kind of method and step of identification foreground object includes:
S101 carries out modeling processing to the image sequence of input, obtains background image data;
S102 obtains next frame image IMG1, and described image IMG1 is input in above-mentioned model and is calculated, for updating back
Scape image data and label foreground area;
If there is no region to be noted as foreground area, return step S102 in S103 described image IMG1;
If so, then S104 calculates prospect profile according to the prospect profile according to foreground area label prospect profile
Masks area;
S105 calculates the background image data in the gradient value G_B1 of the prospect profile masks area, and described in calculating
Gradient value G_IMG1 of the image IMG1 in the prospect profile masks area;
S106 judges whether G_B1 and G_IMG1 reaches the trigger condition of the determination foreground object of setting, triggers if reaching
It is determined as preceding scenery.
Preferred G_B1 corresponds to the background image data in the model after input picture IMG1 in the prospect profile mask
The gradient value in region, the background image data before being also possible to corresponding input IMG1 in further embodiments is in the prospect wheel
The gradient value of wide masks area.Preferably, G_IMG1 can be correspondence image IMG1 in the ladder of the prospect profile masks area
Angle value is also possible to corresponding input IMG1 rear backdrop image data in the prospect profile masks area in further embodiments
Gradient value.
In above method step, step S101~S103 main function is by modeling in the image sequence for identifying input
Background image data and foreground area.Described is modeled as establishing Background Recognition model, which goes out background with before for identification
Scape can be the model that the foreground detection based on moving object is established, and be also possible to establish based on moving object and color detection
Model.It is generally according to the background image data and foreground area in the image update model of input.In different models,
The background image data is generally different.Such as in Gaussian Background model, the background image data is the back of Weighted Coefficients
Scape image data.The weight in background image data is indicated by the transparency of article in the picture in some embodiments,
The object of transparency is got over, weight is smaller, and static background object is opaque.The preferred model is Gaussian Background model.
The Gaussian Background model can be the model based on single background, be also possible to the model based on double backgrounds, it may also be said to mixed
Close the model of other methods, such as color or image segmentation etc..Image frame sequence is input in Gaussian Background model, according to input
Picture frame generate weighting background image data.In the background image data of weighting, the bigger region of weight, is background
A possibility that it is bigger;Preferred Gaussian Background model background image data can be generated by following methods.
Wherein, (x, y) is image pixel coordinates, and BG (x, y) indicates that pixel coordinate is the point of (x, y) in background image data
Pixel value.N is currently valid background model number, and GMM_weight and GMM_mean are corresponding Model Weight and
Value, i.e. GMM_weightnIndicate the weight of n-th of model, GMM_meann(x, y) indicates (x, y) pixel in 1~n mould
Mean value in type.
Background image data and foreground area are identified by modeling, please refers to Fig. 7~15, and Fig. 7 indicates input picture frame
The time shaft of sequence.At the t1 moment, next frame IMG1 is inputted into model, IMG1 is as shown in figure 8, the region outlined in Fig. 8 is
Preceding scenery region.The background image data in model is expressed as Fig. 9 at this time, and foreground area is expressed as Figure 10;In Figure 10
White and gray area indicate the region that foreground object occurs, i.e. foreground area, in further embodiments, because using model
Or the difference of calculation method, obtained foreground area may be different, such as in some simple moving object foreground detections
In, foreground area may be represented as a rectangular area.Preferably, the prospect profile is white and gray area union
Profile.Profile delineation foreground object and its shade region in general.It should be noted that according to actual treatment
It needs, heretofore described next frame can be next in the frame sequence of the sampling composition of video timing equal intervals
Frame.It is recorded when i.e. such as original video is, the time sequencing number that the frame in video is occurred by it is 1,2,3,4,5,6,
7,8,9,10 ..., interval is taken as 3, then chooses Isosorbide-5-Nitrae, and 7,11 ..., i.e. the next frame of frame 4 is frame 7, and the next frame of frame 7 is frame
11.It is also possible to after video timing is segmented at equal intervals in further embodiments, the figure of the random site among unit section
As frame.For example, the time sequencing number that original sequence of frames of video is occurred by it is 1,2,3,4,5,6 ..., interval is taken as 3,
It is then segmented into 1~3,4~6,7~11 ..., 1~3 and selects a frame as first frame, select a frame as next frame in 4~6 frames.
Marking the union profile is prospect profile, and with reference to Figure 11, the profile of label is shown in profile A.According to what is obtained
Prospect profile calculates prospect profile masks area, and prospect profile masks area is also referred to as prospect profile mask.In some implementations
In example, as shown in figure 12, in the shown embodiment, prospect profile mask is annular region (in such as figure between profile D and profile E
Region).The method for calculating prospect profile mask by prospect profile, can be different in various embodiments, lead to
It may be differentiated for crossing the prospect profile mask of distinct methods generation.The preferred prospect profile mask can be by following
Method generates:
FG_mask=dilate (FG) & (~erode (FG)) ... (formula 2)
Wherein, FG is two-value prospect, indicates that prospect profile, dilate indicate that morphological dilations, erode indicate that morphology is rotten
Erosion ,~indicating that two-value negates, & indicates that two-value is asked and FG_mask expression prospect prospect profile masks area.Figure 12 is please referred to, is schemed
Middle profile D is to be calculated by prospect profile according to Expanded Operators, and profile is that E is calculated by prospect profile according to corrosion in figure
What son was calculated.Region of the contours mask region between profile D and profile E.
Expansion and corrosion are to morphologic operation, are the bases of Morphological scale-space, more about erosion operator, corrosion
It calculates or the introduction of expansion calculating is please referred to by Electronic Industry Press, Paul Gonzales write, " the number that Ruan Qiuqi, Ruan Yuzhi etc. are translated
Word image procossing " chapter 9 content.Figure 23 is please referred to, prospect profile 302 is expanded after expansion calculation formula calculates
Profile 303;Prospect profile 302 obtains erosion profile 301 after corrosion calculation formula calculates;Expand profile 303 and corrosion wheel
Region, that is, prospect profile masks area between exterior feature 301.It is written that Paul Gonzales more are please referred to about the introduction of erosion operator
The chapter 9 content of " Digital Image Processing ".
Prospect profile masks area includes the boundary of foreground object, after foreground object appearance, the pictorial element in the region
It is complicated before occurring relatively, the gradient value of image, the gradient value before foreground object appearance are calculated in prospect profile masks area
Gradient value after occurring less than the object;Or the gradient value before foreground object disappearance is greater than the gradient value after the object disappears.
It please refers to shown in Figure 13~Figure 15, Figure 13 is the view of background image data combination prospect profile masks area, figure
14 be the view of IMG1 combination prospect profile masks area, and Figure 15 is that preceding scenery stands the background image data knot after a period of time
Close the view of prospect profile masks area.
Image gradient can regard image as two-dimensional discrete function, and image gradient is exactly this two-dimensional discrete function in fact
Derivation.According to the variation of the gradient value in prospect profile masks area in Figure 13~Figure 15, the mesh of detection foreground object can be reached
's.Since the gradient value in the background mask region and background mask region of different objects has very big probability to be different,
The consistency that can be thus identified in time sequencing by the recognition efficiency and same object of this method raising different objects.
It is easily recognizable as background after the object moved in single background Gauss model compared to the prior art is static, and it is static
It can be identified as another object when moving after the long period again, this method improves recognition efficiency and the identification of foreground object
Consistency.Again because during foreground object tracks and identifies, it is only necessary to which extra computation tracks prospect profile masks area
Change of gradient is needed compared to the identification of the foreground object of double-background model with different two different backgrounds of frequency or periodic maintenance
Figure layer data, this method significantly reduce the calculation scale of data.And this method can be detected by less calculating
Foreground object is not required to detect foreground object by the Background From Layer for calculating multiple weightings that (usual weighted background is in preceding scenery
At the beginning of body moves, weighted background will not have greatly changed), reduce the delay of foreground object detection.
In further embodiments, in order to further increase the accuracy of identification of foreground object, in above-mentioned identification foreground area
On the basis of, the also displacement of calculating foreground area within the set time, and set displacement threshold values.Within the set time, if prospect
The displacement of identification region is more than setting threshold values, then judges that the object of the foreground area is kept in motion, abandon marking the prospect
The profile in region.With reference to Fig. 2.It should be noted that being set in different embodiments in order to detect the foreground object of different characteristic
The time of fixed displacement threshold values and setting is different;Such as when tracking supermarket doorway and the when of moving and static shopping cart
When, the time of setting can be 15 minutes or more, and the shorter time then can be set in the illegal parking on tracking road.
It is in further embodiments, described that " S106 judges whether G_B1 and G_IMG1 reaches the determination foreground object of setting
Trigger condition " can be to judge that whether G_IMG1 subtracts the difference of G_B1 less than the first preset value.In further embodiments, institute
Stating " S106 judges whether G_B1 and G_IMG1 reaches the trigger condition of the determination foreground object of setting " can be to judge G_IMG1
Whether the difference for subtracting G_B1 is greater than the first preset value.According to different embodiments, the first preset value can be one with parameter
Expression formula, such as x*G_B1, then Rule of judgment is G_IMG1-G_B1 > x*G_B1;Wherein the value of x can be 1 or 0, such as x
When being 0, then Rule of judgment is G_IMG1 > G_B1, and when such as x is 1, then Rule of judgment is G_IMG1 > 0.
In further embodiments, the foreground object detection method can also be applied to lose in object detection.Work as
Judge G_IMG1 subtract G_B1 difference be less than the first preset value after, be judged as and identify preceding scenery, and identify in foreground area
Object be foreground object, and mark foreground object be lost-and-found object, further include in further embodiments step S201 triggering lose
Lost article early warning (lost-and-found object early warning is also referred to as the first movement).Lost-and-found object early warning can be through triggering prior-warning device, such as
LED, buzzer, computer etc. are flashed by LED light, buzzer rings a sound, are occurred one in the computer picture of control centre and are mentioned
Show the modes early warning such as frame.
Please refer to Fig. 7 and Figure 16~Figure 21, it is assumed that t1 moment object is removed, and the corresponding picture IMG1 of t1, is compared at this time
Picture before IMG1, object is removed in IMG1, leaves background, IMG1 is as shown in figure 16.In order to make it easy to understand, being used in Figure 16
Line width identifies the position for the object being removed.Picture IMG1 is inputted at the t1 moment, at this time background image (the i.e. image in model
BG1) as shown in figure 17, the foreground area detected in model at this time is as shown in figure 18.(scheme in t1 moment background image data
Picture BG1) combine the view of prospect profile masks area as shown in figure 19, the view of image IMG1 combination prospect profile masks area
As shown in figure 20.Foreground object is lost the t2 moment after a period of time, and background image data (i.e. image BG2) combines prospect wheel
The view of wide masks area is as shown in figure 21.It can be understood that it is to constantly update in a model that background image, which is, for different
T2 moment, background image are different, i.e. BG2 is different.
Also start one when marking foreground object is lost-and-found object to further increase the accuracy of the detection of lost-and-found object
A timer, timer set different overtime thresholds according to different loss objects and place.It is to lose from label foreground object
Object rises, and after the time threshold of setting, has returned if detecting and losing object, has cancelled the lost-and-found object of label.Another
In a little embodiments, if also triggering lost-and-found object early warning after label foreground object is lost-and-found object;Detecting that losing object has returned
Gui Hou cancels lost-and-found object early warning, or also issues the movement for recalling lost-and-found object early warning.
Preferably, with reference to Fig. 3, detecting the method that lost-and-found object has returned may is that after triggering lost-and-found object early warning and passes through
After the time of setting,
S211 continues to obtain next frame image IMG2 and calculates image IMG2 in the ladder of the prospect profile masks area
Angle value G_IMG2;
S212 judges that whether the G_IMG2 subtracts G_B1 less than the second preset value, and it is pre- to cancel lost-and-found object if more than then S222
Alert, otherwise S221 triggers lost-and-found object alarm (lost-and-found object alarm is also referred to as the second movement).
It is understood that background image model can also be updated with IMG2, calculates updated background image data and exist
The gradient value G_B2 of the prospect profile masks area;And judge that the G_B2 subtracts G_B1 whether less than the second preset value, if greatly
In then cancelling lost-and-found object early warning, lost-and-found object alarm is otherwise triggered.
Preferably, second preset value can be 0, that is, when judging G_IMG2 < G_B1, trigger lost-and-found object alarm.
It is understood that the method that detection lost-and-found object has returned is also possible to after triggering lost-and-found object early warning with reference to Fig. 4
And in the time T by setting, next frame image IMGx is constantly calculated in the gradient value G_ of the prospect profile masks area
IMGx;G_IMGx-G_B1 is judged whether less than the second preset value, in the time T of setting, if G_IMGx-G_B1 is greater than or waits
Then cancel lost-and-found object early warning in the second preset value, otherwise after the time T by the setting, triggering lost-and-found object alarm.It can be with
It is 2~n that is understood, which is the value of x, i.e. G_IMGx can be G_IMG2, G_IMG3, G_IMG4 etc., but in the method, x's
Value is incremental.
In some embodiments, scenery is the picture frame after also acquisition IMG1, by the figure after lost-and-found object before label
Updated background image data is calculated as frame is input in the background model;
The method that detection lost-and-found object has returned was also possible in the time after triggering lost-and-found object early warning and by setting,
Next frame image IMGx is constantly obtained, the picture frame IMGx of acquisition is input to update background image number in the background model
According to, and background image data is calculated in the gradient value G_IMGx of prospect profile masks area;In the time T of setting, institute is judged
Whether the value for stating G_IMGx-G_B1 is greater than the second preset value, is lost-and-found object if more than scenery before label is then cancelled, is otherwise passing through
After the time T of the setting, the second movement of triggering.
It should be noted that in the method described in the present invention, picture frame is inputted in the background model always calculate and
Background image data is updated, during updating background image data, if identifying foreground area, through the above steps really
Scenery is lost-and-found object before fixed, and is further confirmed that.
Second movement can be triggering lost-and-found object alarm device.
In further embodiments, referring to Fig. 5, the foreground object detection method can also be applied to leave object detection
In.I.e. after judging that G_IMG1 subtracts the difference of G_B1 and is greater than third preset value, indicate that the object in foreground area is preceding scenery
Body, and marking preceding object is residue, further includes step S410 triggering residue early warning (residue in further embodiments
Early warning is also referred to as third movement).
A timer can also be started, timer is according to different something lost when object is residue before label referring to Fig. 5
Object and place is stayed to set different overtime thresholds.From marking preceding object to be residue, using the time threshold of setting
Afterwards, it has been removed if detecting and leaving object, has cancelled the residue of label, in further embodiments, if being left in label
Residue early warning is also triggered after object, then cancel residue early warning or issues the movement of mapping residue early warning.
Preferably, the method that detection residue has been removed may is that after triggering residue early warning and by setting
After time,
S411 continues to obtain next frame image IMG2 and calculates image IMG2 in the ladder of the prospect profile masks area
Angle value G_IMG2;
S412 judges that whether the G_IMG2 subtracts G_B1 less than the 4th preset value, and it is pre- to cancel residue by S430 if being less than
Alert, otherwise S420 triggers residue alarm (residue alarm is also referred to as the 4th movement).
It is understood that background image model can also be constantly updated, and after triggering residue early warning and by setting
After the fixed time, image IMG2 is obtained, background image model is updated by IMG2, calculates updated background image data in institute
State the gradient value G_B2 of prospect profile masks area;And by judging that whether the G_B2 subtracts G_B1 less than the 4th preset value, if
Less than residue early warning is then cancelled, residue alarm is otherwise triggered.
It is understood that the method that detection residue has been removed is also possible in triggering lost-and-found object early warning referring to Fig. 6
Afterwards and in the time by setting, the next frame image is constantly calculated in the gradient value G_ of the prospect profile masks area
IMGx;Judge that G_IMGx-G_B1 whether less than the 4th preset value, cancels if G_IMGx-G_B1 is less than the 4th preset value and leaving
Object early warning, otherwise after the time of the setting, triggering residue is alarmed.
It is understood that in one embodiment, residue can be further confirmed that by following step method, these
Step includes,
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated back
Scape image data;Scenery obtains next frame image IMG2, more with IMG2 for lost-and-found object and after the time of setting before label
New background image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;Sentence
Break the G_B2-G_B1 value whether less than the 4th preset value, scenery is residue before cancelling label if being less than, if G_B2-
The difference of G_B1 is greater than the 4th preset value, then triggers the 4th movement.
In one embodiment, residue can be further confirmed that by following step method:
These steps include obtaining the picture frame IMG2 after IMG1, described image frame IMG2 being input to the background
Updated background image data is calculated in model;Updated background image data is calculated in the prospect profile masked area
The gradient value G_B2 in domain;Judge that the value of the G_B2-G_B1 whether less than the 4th preset value, cancels scenery before label if being less than
For residue, otherwise continue the picture frame after obtaining;The picture frame IMGx of acquisition is input in the background model and is updated
Background image data, and background image data is calculated in the gradient value G_Bx of prospect profile masks area, until by setting
Time, if the difference of G_Bx-G_B1 is all not more than the 4th preset value, the 4th movement of triggering.
For ease of description can also the first movement be referred to as lost-and-found object early warning movement, the second movement is that lost-and-found object alarm is dynamic
Make, third movement is that residue early warning acts, and the 4th movement is residue actuation of an alarm.In some embodiments for example valuable
The sales counter of article, when finding that the object on cabinet face disappears, i.e., when judging that G_IMG1-G_B1 less than the first preset value, can touch
Lost-and-found object early warning is sent out, the first movement can be warning light flashing etc., be also possible to the standby signal that related personnel knows, when passing through
After the preset time, such as after 2 minutes, by comparing G_IMGx and G_B1 or by comparing G_Bx and G_B1, (comparison procedure is joined
Examine the method being previously mentioned) determine that the object in cabinet face disappears, then the second alarm action is triggered, the second alarm action can be buzzing
Device pipes.First movement in some embodiments and the second movement can be what the same warning device was completed, for example, triggering
When the first movement, alarm etc. flashes at a slow speed, and when triggering second acts, alarm lamp, which is used, flashes at a slow speed faster speed than above-mentioned
Flashing.It is understood that third movement the first movement similar with the 4th movement and the second movement.It can be understood that alarm dress
Setting can be with prior-warning device, such as LED, buzzer, computer etc., i.e., is flashed by LED light, buzzer one sound of sound, in control
Occur modes early warning or the alarms such as a prompting frame in the computer picture of the heart.
Inventor also provides a kind of foreground detection equipment, for realizing the above method.Figure 22 is please referred to, the equipment 20 is wrapped
Include foreground area detection module 201, prospect profile module 203, gradient computing module 205, foreground detection control module 207;
The foreground area detection module 201 obtains background image for carrying out modeling processing to the image sequence of input
Data and foreground area.
The prospect profile module 203 is used for according to obtained foreground area label prospect profile, further according to the prospect
Profile calculates prospect profile masks area;
The gradient computing module 205 is for calculating given image in the gradient value of given area;
The foreground detection control module 207 is used to judge the numerical value change of the gradient value of prospect profile masks area, if
Numerical value change reaches setting trigger condition, then triggers the object for judging foreground area as foreground object.
It should be noted that the back in future can also be used the present invention is not limited to use existing background modeling method
What scape modeling method calculated arrives background image data and foreground area.
In other preferred embodiments, the image sequence that the foreground area detection module 201 is used to input is defeated
Enter to Gaussian Background model and calculate, obtains background image data and foreground area.
In further embodiments, the gradient computing module is covered for calculating background image data in the prospect profile
The gradient value G_B1 in mould region, and described image IMG1 is calculated in the gradient value G_IMG1 of the prospect profile masks area;
The foreground detection control module is used to judge the difference of G_IMG1 and G_B1 numerical value, if difference reaches first
When trigger condition is set, lost-and-found object early warning is triggered.
In further embodiments, the foreground detection control module is used to obtain the picture frame IMG2 after IMG1, will
Described image frame IMG2, which is input in the background model, calculates updated background image data;Calculate updated background
Gradient value G_B2 of the image data in the prospect profile masks area;Judge whether the value of the G_B2-G_B1 is greater than second
Preset value is lost-and-found object if more than scenery before label is then cancelled, otherwise continues the picture frame after obtaining;By the picture frame of acquisition
IMGx, which is input in the background model, updates background image data, and calculates background image data in prospect profile masks area
Gradient value G_Bx, until the time by setting, if the difference of G_Bx-G_B1 is both less than the second preset value, triggering second is dynamic
Make.
In further embodiments, second movement is triggering warning device.
In further embodiments, the preceding scene detection control module is used to obtain the picture frame after IMG1, by institute
It states picture frame and is input in the background model and calculate updated background image data;Before label scenery be lost-and-found object simultaneously
After time T by setting, next frame image IMG2 is obtained, background image data is updated with IMG2, calculates updated background
Gradient value G_B2 of the image data in the prospect profile masks area;Judge the value of the G_B2-G_B1 whether less than second
Preset value, if more than or equal to then cancel label before scenery be lost-and-found object, if the difference of G_B2-G_B1 is both less than the second preset value,
Then the second movement of triggering.In further embodiments, the foreground detection control module is used to obtain the picture frame after IMG1,
Described image frame is input in the background model and calculates updated background image data;Scenery is to lose before label
After object and after the time of setting, next frame image IMG2 is obtained, background image data is updated with IMG2, calculates updated
Gradient value G_B2 of the background image data in the prospect profile masks area;Judge whether the value of the G_B2-G_B1 is greater than
Second preset value is lost-and-found object if more than scenery before label is then cancelled, otherwise then the second movement of triggering.
In further embodiments, the foreground detection control module is used to obtain the picture frame after IMG1, will be described
Picture frame, which is input in the background model, calculates updated background image data;Before label scenery be lost-and-found object after simultaneously
After the time of setting, next frame image IMG2 is obtained, calculates IMG2 in the gradient value G_ of the prospect profile masks area
IMG2;Judge whether the value of the G_IMG2-G_B1 is greater than the second preset value, marks preceding scenery for loss if more than then cancelling
Object, otherwise then the second movement of triggering.
In further embodiments, the second movement is triggering warning device.
In further embodiments, the foreground detection control module judges whether the difference of G_IMG1-G_B1 is greater than
Third preset value is to judge object in foreground area for preceding scenery, and scenery is residue before marking, before otherwise judgement is current
The unmatched scenery of scene area.
In further embodiments, the foreground detection control module is greater than third with the difference for judging G_IMG1-G_B1
When preset value, also triggering third movement.
In further embodiments, the third movement is triggering prior-warning device.
It in further embodiments, further include step after foreground object detection method scenery before label is lost-and-found object
It is rapid: to obtain the picture frame after IMG1, described image frame is input in the background model and calculates updated Background
As data;Scenery obtains next frame image IMG2 for lost-and-found object and after the time of setting before label, calculates IMG2 in institute
State the gradient value G_IMG2 of prospect profile masks area;Judge the value of the G_IMG2-G_B1 whether less than the second preset value, if
It is lost-and-found object more than or equal to scenery before then cancelling label, triggers lost-and-found object actuation of an alarm if being less than.
In further embodiments, the 4th movement is triggering warning device.
In further embodiments, the foreground detection control module is used to obtain the picture frame obtained after IMG1
Described image frame IMG2 is input in the background model and calculates updated background image data by IMG2;It calculates and updates
Gradient value G_B2 of the background image data afterwards in the prospect profile masks area;Judging the value of the G_IMG2-G_B1 is
No less than the 4th preset value, scenery is residue before cancelling label if being less than, and otherwise continues the picture frame after obtaining;It will obtain
The picture frame IMGx obtained, and picture frame IMGx is calculated in the gradient value G_IMGx of prospect profile masks area, until by setting
Time, if G_IMGx-G_B1 difference all be not more than the 4th preset value, triggering the 4th movement.
In further embodiments, the foreground detection control module is used to obtain the picture frame after IMG1, will be described
Picture frame, which is input in the background model, calculates updated background image data;Before label scenery be residue after simultaneously
After the time of setting, next frame image IMG2 is obtained, background image data is updated with IMG2, calculates updated Background
As data are in the gradient value G_B2 of the prospect profile masks area;Judge that the value of the G_B2-G_B1 is less than with the 4th in advance
If value, scenery is residue before cancelling label if being less than, and otherwise triggers the 4th movement.
In further embodiments, which is characterized in that the 4th movement is triggering warning device.
In further embodiments, the foreground detection control module is used to obtain the picture frame after IMG1, will be described
Picture frame, which is input in the background model, calculates updated background image data;Before label scenery be residue after simultaneously
After the time of setting, next frame image IMG2 is obtained, calculates IMG2 in the gradient value G_ of the prospect profile masks area
IMG2;Whether the value of the G_IMG2-G_B1 is judged less than the 4th preset value, and scenery is to leave before cancelling label if being less than
Object, otherwise then the 4th movement of triggering.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or the terminal device that include a series of elements not only include those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or end
The intrinsic element of end equipment.In the absence of more restrictions, being limited by sentence " including ... " or " including ... "
Element, it is not excluded that there is also other elements in process, method, article or the terminal device for including the element.This
Outside, herein, " being greater than ", " being less than ", " being more than " etc. are interpreted as not including this number;" more than ", " following ", " within " etc. understand
Being includes this number.
It should be understood by those skilled in the art that, the various embodiments described above can provide as method, apparatus or computer program production
Product.Complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in these embodiments
Form.The all or part of the steps in method that the various embodiments described above are related to can be instructed by program relevant hardware come
It completes, the program can store in the storage medium that computer equipment can be read, for executing the various embodiments described above side
All or part of the steps described in method.The computer equipment, including but not limited to: personal computer, server, general-purpose computations
It is machine, special purpose computer, the network equipment, embedded device, programmable device, intelligent mobile terminal, smart home device, wearable
Smart machine, vehicle intelligent equipment etc.;The storage medium, including but not limited to: RAM, ROM, magnetic disk, tape, CD, sudden strain of a muscle
It deposits, USB flash disk, mobile hard disk, storage card, memory stick, webserver storage, network cloud storage etc..
The various embodiments described above are referring to the method according to embodiment, equipment (system) and computer program product
Flowchart and/or the block diagram describes.It should be understood that can be realized by computer program instructions every in flowchart and/or the block diagram
The combination of process and/or box in one process and/or box and flowchart and/or the block diagram.It can provide these computers
Program instruction generates a machine to the processor of computer equipment, so that the finger executed by the processor of computer equipment
It enables and generates to specify in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of function.
These computer program instructions, which may also be stored in, to be able to guide computer equipment computer operate in a specific manner and sets
In standby readable memory, so that the instruction being stored in the computer equipment readable memory generates the manufacture including command device
Product, command device realization refer in one or more flows of the flowchart and/or one or more blocks of the block diagram
Fixed function.
These computer program instructions can also be loaded into computer equipment, so that executing on a computing device a series of
Operating procedure is to generate computer implemented processing, so that the instruction executed on a computing device is provided for realizing in process
The step of function of being specified in figure one process or multiple processes and/or block diagrams one box or multiple boxes.
Although the various embodiments described above are described, once a person skilled in the art knows basic wounds
The property made concept, then additional changes and modifications can be made to these embodiments, so the above description is only an embodiment of the present invention,
It is not intended to limit scope of patent protection of the invention, it is all to utilize equivalent structure made by description of the invention and accompanying drawing content
Or equivalent process transformation, being applied directly or indirectly in other relevant technical fields, similarly includes in patent of the invention
Within protection scope.
Claims (14)
1. a kind of foreground object detection method, which is characterized in that comprising steps of
A frame image IMG1 is obtained, described image IMG1 is input in background model and is calculated, updates background image data, and mark
Remember foreground area;
If continuing to obtain next frame image, and be based on there is no the region for being marked as foreground area in described image IMG1
The next frame image update background image data and label foreground area got, is marked as prospect if existing in image IMG1
The region in region then marks prospect profile according to the foreground area, calculates prospect profile masked area according to the prospect profile
Domain, the prospect profile masks area are annular region;
The background image data is calculated in the gradient value G_B1 and described image IMG1 of the prospect profile masks area in institute
State the gradient value G_IMG1 of prospect profile masks area;
Judge whether the object in foreground area is preceding scenery by G_B1 and G_IMG1;
The prospect profile masks area is made of the region between expansion profile and erosion profile;The expansion profile is before
Scape profile and expansion formula are calculated;The erosion profile is calculated according to prospect profile and corrosion formula;
The background model is Gaussian Background model;
It is described by G_B1 and G_IMG1 judge the object in foreground area whether be before scenery comprising steps of
Judge that the value of G_IMG1-G_B1 whether less than the first preset value, judges the object in foreground area for prospect if being less than
Object, and marking preceding scenery is lost-and-found object, otherwise judges current foreground area without foreground object;
The foreground object detection method before label scenery be lost-and-found object after, further comprise the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input to after calculating update in the background model
Background image data;
Updated background image data is calculated in the gradient value G_B2 of the prospect profile masks area;
The value of the G_B2-G_B1 is judged whether less than the second preset value, if more than or equal to cancel the preceding scenery of label then to lose
Lost article continues the picture frame IMGx after obtaining if being less than;The picture frame IMGx of acquisition is input in the background model
Background image data is updated, and calculates background image data in the gradient value G_Bx of prospect profile masks area, until by setting
Fixed time T triggers lost-and-found object actuation of an alarm if the difference of G_Bx-G_B1 is respectively less than the second preset value in T time.
2. a kind of foreground object detection method according to claim 1, which is characterized in that the foreground object detection method
After scenery is lost-and-found object before label, further comprise the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input to after calculating update in the background model
Background image data;Picture frame IMG2 is calculated in the gradient value G_IMG2 of the prospect profile masks area;
Judge the value of the G_IMG2-G_B1 whether less than the second preset value, if more than or equal to then cancel label before scenery be
Lost-and-found object continues the picture frame after obtaining if being less than;By the picture frame IMGx of acquisition, and picture frame IMGx is calculated in prospect
The gradient value G_IMGx in contours mask region, until the time T by setting, if the difference of G_IMGx-G_B1 is respectively less than in T time
Second preset value then triggers lost-and-found object actuation of an alarm.
3. a kind of foreground object detection method according to claim 1, which is characterized in that the foreground object detection method
After scenery is lost-and-found object before label, further comprise the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated Background
As data;
Scenery obtains next frame image IMG2 for lost-and-found object and after the time of setting before label, updates background with IMG2
Image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;
The value of the G_B2-G_B1 is judged whether less than the second preset value, if more than or equal to cancel the preceding scenery of label then to lose
Lost article triggers lost-and-found object actuation of an alarm if being less than.
4. a kind of foreground object detection method according to claim 3, which is characterized in that the foreground object detection method
After scenery is lost-and-found object before label, further comprise the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated Background
As data;
Scenery obtains next frame image IMG2 for lost-and-found object and after the time of setting before label, calculates IMG2 described
The gradient value G_IMG2 of prospect profile masks area;
Judge the value of the G_IMG2-G_B1 whether less than the second preset value, if more than or equal to then cancel label before scenery be
Lost-and-found object triggers lost-and-found object actuation of an alarm if being less than.
5. a kind of foreground object detection method according to claim 1, which is characterized in that described " to pass through G_B1 and G_
IMG1 judges whether the object in foreground area is preceding scenery " comprising steps of
Judge whether the difference of G_IMG1-G_B1 is greater than third preset value, be judge object in foreground area for preceding scenery,
Scenery is residue before marking, and otherwise judges the unmatched scenery of current foreground area.
6. a kind of foreground object detection method according to claim 5, which is characterized in that the foreground object detection method
It further include step after scenery is residue before label,
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input to after calculating update in the background model
Background image data;
Updated background image data is calculated in the gradient value G_B2 of the prospect profile masks area;
Whether the value of the G_B2-G_B1 is judged less than the 4th preset value, and scenery is residue before cancelling label if being less than, no
Then continue the picture frame after obtaining;The picture frame IMGx of acquisition is input to update background image number in the background model
According to, and background image data is calculated in the gradient value G_Bx of prospect profile masks area, until the time by setting, if G_
The difference of Bx-G_B1 is all larger than the 4th preset value, then triggers residue actuation of an alarm.
7. a kind of foreground object detection method according to claim 5, which is characterized in that the foreground object detection method
After scenery is residue before label, further comprise the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated Background
As data;
Scenery obtains next frame image IMG2 for residue and after the time of setting before label, updates background with IMG2
Image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;
Whether the value of the G_B2-G_B1 is judged less than the 4th preset value, and scenery is residue before cancelling label if being less than, no
Then trigger residue actuation of an alarm.
8. a kind of foreground object detection method according to claim 5, which is characterized in that the foreground object detection method
After scenery is residue before label, further comprise the steps of:
The picture frame after IMG1 is obtained, described image frame is input in the background model and calculates updated Background
As data;
Scenery calculates IMG2 in institute to obtain next frame image IMG2 after residue and after the time of setting before label
State the gradient value G_IMG2 of prospect profile masks area;
Whether the value of the G_IMG2-G_B1 is judged less than the 4th preset value, scenery is residue before cancelling label if being less than,
Otherwise residue actuation of an alarm is triggered.
9. a kind of foreground object detection method according to claim 8, which is characterized in that the foreground object detection method
After scenery is residue before label, further comprise the steps of:
The picture frame IMG2 after IMG1 is obtained, described image frame IMG2 is input to after calculating update in the background model
Background image data;
Picture frame IMG2 is calculated in the gradient value G_IMG2 of the prospect profile masks area;
Whether the value of the G_IMG2-G_B1 is judged less than the 4th preset value, scenery is lost-and-found object before cancelling label if being less than,
If more than or equal to then continue obtain after picture frame;Picture frame IMGx is obtained, and calculates picture frame IMGx in prospect profile
The gradient value G_IMGx of masks area, until by setting time T, if G_IMGx-G_B1 in T time difference respectively less than if take
The scenery before marking that disappears is residue, otherwise triggers residue actuation of an alarm.
10. a kind of foreground detection equipment, which is characterized in that calculated including foreground area detection module, prospect profile module, gradient
Module, preceding scene detection control module;
Described image IMG1 is input to background model and fallen into a trap by the foreground area detection module for obtaining a frame image IMG1
It calculates, updates background image data, and mark foreground area;
If the prospect profile module is used to judge that the region for being marked as foreground area to be not present in described image IMG1, after
It is continuous to obtain next frame image, and based on the next frame image update background image data and label foreground area got, if figure
As there is the region for being marked as foreground area in IMG1, then prospect profile is marked according to the foreground area, before described
Scape profile calculates prospect profile masks area, and the prospect profile masks area is annular region;
The gradient computing module is for calculating the background image data in the gradient value G_ of the prospect profile masks area
Gradient value G_IMG1 of the B1 and described image IMG1 in the prospect profile masks area;
The preceding scene detection control module is used to judge whether the object in foreground area is prospect by G_B1 and G_IMG1
Object;Further include that prospect profile masks area obtains module, is used to obtain prospect profile masks area, the prospect profile mask
Region is made of the region between expansion profile and erosion profile;The expansion profile is calculated according to prospect profile and expansion formula
It obtains;The erosion profile is calculated according to prospect profile and corrosion formula;
The preceding scene detection control module be specifically used for judging the difference of G_IMG1-G_B1 whether less than the first preset value, if
Less than the object then judged in foreground area for preceding scenery, mark before scenery be lost-and-found object, otherwise judge current foreground area without
Foreground object;
The preceding scene detection control module is used to obtain the picture frame IMG2 after IMG1, and described image frame IMG2 is input to
Updated background image data is calculated in the background model;Updated background image data is calculated in the prospect wheel
The gradient value G_B2 of wide masks area;The value of the G_B2-G_B1 is judged whether less than the second preset value, if more than or equal to then
Cancelling scenery before marking is lost-and-found object, continues the picture frame IMGx after obtaining if being less than;The picture frame IMGx of acquisition is defeated
Enter into the background model and update background image data, and calculates background image data in the gradient of prospect profile masks area
Value G_Bx, until the time T by setting triggers something lost if the difference of G_Bx-G_B1 is respectively less than the second preset value in T time
Lost article actuation of an alarm.
11. a kind of foreground detection equipment according to claim 10, which is characterized in that the preceding scene detection control module
For obtaining the picture frame after IMG1, described image frame is input in the background model and calculates updated Background
As data;Before label after time T of the scenery for lost-and-found object and by setting, next frame image IMG2 is obtained, is updated with IMG2
Background image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;Judgement
The value of the G_B2-G_B1 whether less than the second preset value, if more than or equal to then cancel label before scenery be lost-and-found object, if small
In then triggering lost-and-found object actuation of an alarm.
12. a kind of foreground detection equipment according to claim 10, which is characterized in that the preceding scene detection control module
Whether be greater than third preset value with the difference for judging G_IMG1-G_B1, be judge object in foreground area for preceding scenery, mark
Scenery is residue before remembering, otherwise judges the unmatched scenery of current foreground area.
13. a kind of foreground detection equipment according to claim 12, which is characterized in that the preceding scene detection control module
For obtaining the picture frame IMG2 after IMG1, described image frame IMG2 is input to after calculating update in the background model
Background image data;Updated background image data is calculated in the gradient value G_B2 of the prospect profile masks area;Sentence
Break the G_B2-G_B1 value whether less than the 4th preset value, scenery is residue before cancelling label if being less than, and is otherwise continued
Picture frame after acquisition;The picture frame IMGx of acquisition is input in the background model and updates background image data, and is counted
Background image data is calculated in the gradient value G_Bx of prospect profile masks area, until the time T by setting, if in T time
The difference of G_Bx-G_B1 is both greater than the 4th preset value, then triggers residue actuation of an alarm.
14. a kind of foreground detection equipment according to claim 12, which is characterized in that the preceding scene detection control module
For obtaining the picture frame after IMG1, described image frame is input in the background model and calculates updated Background
As data;Before label scenery be residue after and the time T by setting after, obtain next frame image IMG2, more with IMG2
New background image data calculates updated background image data in the gradient value G_B2 of the prospect profile masks area;Sentence
Break the G_B2-G_B1 value whether less than the 4th preset value, scenery is residue before cancelling label if being less than, and is otherwise triggered
Residue actuation of an alarm.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510982581.8A CN105488542B (en) | 2015-12-24 | 2015-12-24 | A kind of foreground object detection method and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510982581.8A CN105488542B (en) | 2015-12-24 | 2015-12-24 | A kind of foreground object detection method and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105488542A CN105488542A (en) | 2016-04-13 |
CN105488542B true CN105488542B (en) | 2019-04-23 |
Family
ID=55675513
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510982581.8A Active CN105488542B (en) | 2015-12-24 | 2015-12-24 | A kind of foreground object detection method and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105488542B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106128023A (en) * | 2016-07-18 | 2016-11-16 | 四川君逸数码科技股份有限公司 | A kind of wisdom gold eyeball identification foreign body leaves over alarm method and device |
CN108062510B (en) * | 2017-11-17 | 2022-02-11 | 维库(厦门)信息技术有限公司 | Multi-target tracking result real-time dynamic display method and computer equipment |
CN108073930A (en) * | 2017-11-17 | 2018-05-25 | 维库(厦门)信息技术有限公司 | A kind of target detection and tracking based on multiple irregular ROI |
CN111832349A (en) | 2019-04-18 | 2020-10-27 | 富士通株式会社 | Method and device for identifying error detection of carry-over object and image processing equipment |
CN111091097A (en) * | 2019-12-20 | 2020-05-01 | 中国移动通信集团江苏有限公司 | Method, device, equipment and storage medium for identifying remnants |
CN115439737B (en) * | 2022-10-13 | 2023-04-21 | 哈尔滨市科佳通用机电股份有限公司 | Railway box car window fault image recognition method based on image restoration |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102509075A (en) * | 2011-10-19 | 2012-06-20 | 北京国铁华晨通信信息技术有限公司 | Remnant object detection method and device |
CN102902960A (en) * | 2012-09-25 | 2013-01-30 | 武汉烽火众智数字技术有限责任公司 | Leave-behind object detection method based on Gaussian modelling and target contour |
CN104063878A (en) * | 2013-03-20 | 2014-09-24 | 富士通株式会社 | Motion object detection device, motion object detection method and electronic device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9082019B2 (en) * | 2013-06-14 | 2015-07-14 | National Yunlin University Of Science And Technology | Method of establishing adjustable-block background model for detecting real-time image object |
-
2015
- 2015-12-24 CN CN201510982581.8A patent/CN105488542B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102509075A (en) * | 2011-10-19 | 2012-06-20 | 北京国铁华晨通信信息技术有限公司 | Remnant object detection method and device |
CN102902960A (en) * | 2012-09-25 | 2013-01-30 | 武汉烽火众智数字技术有限责任公司 | Leave-behind object detection method based on Gaussian modelling and target contour |
CN104063878A (en) * | 2013-03-20 | 2014-09-24 | 富士通株式会社 | Motion object detection device, motion object detection method and electronic device |
Non-Patent Citations (2)
Title |
---|
An Abandoned/Removed Objects Detection Algorithm and Its Evaluation on PETS Datasets;Paolo Spagnolo.et.al;《Video and Signal Based Surveillance, 2006. AVSS "06. IEEE International Conference on》;20061211;全文 * |
基于视频分析的遗留及遗失物检测;高军;《中国优秀硕士学位论文全文数据库 信息科技辑》;20140915(第 09 期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN105488542A (en) | 2016-04-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105488542B (en) | A kind of foreground object detection method and equipment | |
Fuentes et al. | People tracking in surveillance applications | |
CN111062273B (en) | Method for tracing, detecting and alarming remaining articles | |
CN111881853B (en) | Method and device for identifying abnormal behaviors in oversized bridge and tunnel | |
Sengar et al. | Detection of moving objects based on enhancement of optical flow | |
CN110298323B (en) | Frame-fighting detection method, system and device based on video analysis | |
Lian et al. | A novel method on moving-objects detection based on background subtraction and three frames differencing | |
Liu et al. | Moving object detection and tracking based on background subtraction | |
Armanfard et al. | TED: A texture-edge descriptor for pedestrian detection in video sequences | |
Shyam et al. | Abandoned object detection using pixel-based finite state machine and single shot multibox detector | |
Ng et al. | Background subtraction using a pixel-wise adaptive learning rate for object tracking initialization | |
CN111914670A (en) | Method, device and system for detecting left-over article and storage medium | |
CN103049748B (en) | Behavior monitoring method and device | |
Lin et al. | Left-luggage detection from finite-state-machine analysis in static-camera videos | |
Mirabi et al. | People tracking in outdoor environment using Kalman filter | |
Zhou et al. | Dynamic background subtraction using spatial-color binary patterns | |
Yang et al. | Combining Gaussian mixture model and HSV model with deep convolution neural network for detecting smoke in videos | |
CN107832732A (en) | Method for detecting lane lines based on ternary tree traversal | |
Agrawal et al. | Segmentation of moving objects using numerous background subtraction methods for surveillance applications | |
Zarka et al. | Real-time human motion detection and tracking | |
Wei et al. | Target-tracking based early fire smoke detection in video | |
Li et al. | Moving vehicle detection based on an improved interframe difference and a Gaussian model | |
Gao et al. | Region-based moving shadow detection using watershed algorithm | |
Li et al. | Improved CAMShift object tracking based on Epanechnikov Kernel density estimation and Kalman filter | |
Zhang et al. | Background modeling by exploring multi-scale fusion of texture and intensity in complex scenes |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 350108, No. 2, building 9, 7 hi tech Avenue, Fuzhou Town, Minhou County, Fujian, China Applicant after: Fujian star net joint information system Co., Ltd. Address before: 350108, No. 2, building 9, 7 hi tech Avenue, Fuzhou Town, Minhou County, Fujian, China Applicant before: Fujian Star-Net Security Technology Co., Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |