CN109035287A - Foreground image extraction method and device, moving vehicle recognition methods and device - Google Patents

Foreground image extraction method and device, moving vehicle recognition methods and device Download PDF

Info

Publication number
CN109035287A
CN109035287A CN201810720684.0A CN201810720684A CN109035287A CN 109035287 A CN109035287 A CN 109035287A CN 201810720684 A CN201810720684 A CN 201810720684A CN 109035287 A CN109035287 A CN 109035287A
Authority
CN
China
Prior art keywords
image
target
foreground image
moving
foreground
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
CN201810720684.0A
Other languages
Chinese (zh)
Other versions
CN109035287B (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.)
GCI Science and Technology Co Ltd
Original Assignee
GCI Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by GCI Science and Technology Co Ltd filed Critical GCI Science and Technology Co Ltd
Priority to CN201810720684.0A priority Critical patent/CN109035287B/en
Publication of CN109035287A publication Critical patent/CN109035287A/en
Application granted granted Critical
Publication of CN109035287B publication Critical patent/CN109035287B/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/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/215Motion-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/254Analysis of motion involving subtraction of images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/07Target detection

Abstract

The present invention relates to a kind of foreground image extraction method and devices, and the method comprising the steps of: obtaining target image and carry out the first foreground image that inter-frame difference obtains;It obtains target image and carries out the second foreground image that background subtraction is got;The profile that moving target is extracted from the first foreground image, the moving region of moving target is determined according to profile;First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, the foreground image of moving target is extracted from initial foreground image according to the moving region of moving target, so that the shared pixel characteristic of the first foreground image and the second foreground image is combined, and the profile of moving target can be accurately obtained using the first foreground image, and accurately reflect the moving region of the moving target in the picture, in conjunction with the foreground image of the Acquiring motion area moving target, the accuracy extracted to foreground image can be improved.A kind of moving vehicle recognition methods and device are also provided.

Description

Foreground image extraction method and device, moving vehicle recognition methods and device
Technical field
The present invention relates to technical field of image processing, mention more particularly to a kind of foreground image extraction method, foreground image Take device, moving vehicle recognition methods, moving vehicle identification device, computer equipment and computer readable storage medium.
Background technique
With the development of image processing techniques, image detection and identification technology are widely deployed the inspection to moving target In surveying and identifying, such as intelligent transportation system uses the detection identification technology based on Video Analysis Technology to automobile video frequency image In moving vehicle be measured in real time and identify.
Moving target can be detected and be identified by extracting moving target foreground image, traditional technology is before extraction It is easy to be influenced by disturbing factors such as noise present in image and shades during scape image, for example, working as moving target Video image when there is biggish noise sequence, will lead to wrong when the foreground image that extracts is detected for moving target Accidentally rate increases, and for being easy the foreground image extraction method by shadow interference, to moving target under nighttime conditions Detection accuracy is lower, leads to the detection inaccuracy to moving target.
Summary of the invention
Based on this, it is necessary to for the problem that traditional technology accuracy is relatively low, provide a kind of foreground image extraction method, preceding Scape image acquiring apparatus, moving vehicle recognition methods, moving vehicle identification device, computer equipment and computer-readable storage medium Matter.
A kind of foreground image extraction method, comprising steps of
It obtains target image and carries out the first foreground image that inter-frame difference obtains;Wherein, the target image is to carry fortune The image of moving-target;
It obtains the target image and carries out the second foreground image that background subtraction is got;
The profile that the moving target is extracted from first foreground image determines the movement mesh according to the profile Target moving region;
First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to the fortune The foreground image of the moving target is extracted from initial foreground image in the moving region of moving-target.
Above-mentioned foreground image extraction method carries out according to the first foreground image and the second foreground image plus operation obtains initially Foreground image is combined the shared pixel characteristic of two kinds of foreground images, can be avoided the disturbing factors pair such as noise, shade The influence that foreground image extracts, and the profile of moving target can be accurately obtained using the first foreground image, and accurately reflect Moving target is extracted from initial foreground image in conjunction with the moving region in moving region of the moving target in each frame image out Foreground image, can be improved the accuracy extracted to foreground image, also advantageously improve and moving target is detected With the accuracy of identification.
In one embodiment, a kind of moving vehicle recognition methods is provided, comprising steps of
The target image for carrying moving target is extracted from wagon flow sequence of video images;Wherein, the moving target includes Moving vehicle;
It obtains the target image and carries out the first foreground image that inter-frame difference obtains;The target image is obtained to be carried on the back The second foreground image that scape difference obtains;
The profile that the moving target is extracted from first foreground image determines the movement mesh according to the profile Target moving region;
First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to the fortune The foreground image of the moving target is extracted from initial foreground image in the moving region of moving-target;
The moving vehicle in the wagon flow sequence of video images is identified according to the foreground image.
Above-mentioned moving vehicle recognition methods, according to the first foreground image of target image in wagon flow sequence of video images and Two foreground images carry out plus operation obtains initial foreground image and the shared pixel characteristic of two kinds of foreground images is combined, energy The influence for enough avoiding the disturbing factors such as noise, shade from extracting foreground image, and can be accurate using the first foreground image To the profile of moving target, and moving region of the moving target in each frame image is accurately reflected, in conjunction with the moving region The foreground image that moving target is extracted from initial foreground image, can be improved the accuracy extracted to foreground image, also The foreground image is used to that the moving vehicle in wagon flow sequence of video images to be identified and be detected, is also improved to sport(s) car The accuracy for being detected and being identified.
In one embodiment, a kind of foreground image extraction element is provided, comprising:
First prospect obtains module, carries out the first foreground image that inter-frame difference obtains for obtaining target image;Wherein, The target image is the image for carrying moving target;
Second prospect obtains module, carries out the second foreground image that background subtraction is got for obtaining the target image;
Moving region determining module, for extracting the profile of the moving target from first foreground image, according to The profile determines the moving region of the moving target;
Sport foreground extraction module adds operation to obtain just for carrying out first foreground image and the second foreground image Beginning foreground image extracts the foreground picture of the moving target according to the moving region of the moving target from initial foreground image Picture.
Above-mentioned foreground image extraction element carries out according to the first foreground image and the second foreground image plus operation obtains initially Foreground image is combined the shared pixel characteristic of two kinds of foreground images, can be avoided the disturbing factors pair such as noise, shade The influence that foreground image extracts, and the profile of moving target can be accurately obtained using the first foreground image, and accurately reflect Moving target is extracted from initial foreground image in conjunction with the moving region in moving region of the moving target in each frame image out Foreground image, can be improved the accuracy extracted to foreground image, also advantageously improve and moving target is detected With the accuracy of identification.
In one embodiment, a kind of moving vehicle identification device is provided, comprising:
Target image extraction module, for extracting the target image for carrying moving target from wagon flow sequence of video images; Wherein, the moving target includes moving vehicle;
Foreground image obtains module, obtains the target image and carries out the first foreground image that inter-frame difference obtains;It obtains The target image carries out the second foreground image that background subtraction is got;
Moving region obtains module, for extracting the profile of the moving target from first foreground image, according to The profile determines the moving region of the moving target;
Foreground image extraction module adds operation to obtain just for carrying out first foreground image and the second foreground image Beginning foreground image extracts the foreground picture of the moving target according to the moving region of the moving target from initial foreground image Picture;
Moving vehicle identification module, for identifying the movement in the wagon flow sequence of video images according to the foreground image Vehicle.
Above-mentioned moving vehicle identification device, according to the first foreground image of target image in wagon flow sequence of video images and Two foreground images carry out plus operation obtains initial foreground image and the shared pixel characteristic of two kinds of foreground images is combined, energy The influence for enough avoiding the disturbing factors such as noise, shade from extracting foreground image, and can be accurate using the first foreground image To the profile of moving target, and moving region of the moving target in each frame image is accurately reflected, in conjunction with the moving region The foreground image that moving target is extracted from initial foreground image, can be improved the accuracy extracted to foreground image, also The foreground image is used to that the moving vehicle in wagon flow sequence of video images to be identified and be detected, is also improved to sport(s) car The accuracy for being detected and being identified.
A kind of computer equipment, including memory, processor and be stored on the memory and can be in the processing The computer program run on device, before the processor is realized when executing the computer program described in as above any one embodiment Scape image extraction method or moving vehicle recognition methods.
Above-mentioned computer equipment, by the computer program run on the processor, can be improved to foreground image into The accuracy that row extracts, can also improve the accuracy for being detected and being identified to moving target.
A kind of computer readable storage medium, is stored thereon with computer program, realization when which is executed by processor As above foreground image extraction method or moving vehicle recognition methods described in any one embodiment.
Above-mentioned computer readable storage medium can be improved and be carried out to foreground image by the computer program that it is stored The accuracy of extraction can also improve the accuracy for being detected and being identified to moving target.
Detailed description of the invention
Fig. 1 is the flow diagram of foreground image extraction method in one embodiment;
Fig. 2 is the structural schematic diagram of foreground image extraction element in one embodiment;
Fig. 3 is the flow diagram of moving vehicle recognition methods in one embodiment;
Fig. 4 is the structural schematic diagram of moving vehicle identification device in one embodiment;
Fig. 5 is the internal structure chart of computer equipment in one embodiment.
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.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
It should be noted that term involved in the embodiment of the present invention " first second " be only be similar pair of difference As not representing the particular sorted for object, it is possible to understand that ground, " first second " can be interchanged specific in the case where permission Sequence or precedence.It should be understood that the object that " first second " is distinguished is interchangeable under appropriate circumstances, so as to retouch here The embodiment of the present invention stated can be performed in other sequences than those illustrated or described herein.
In one embodiment, provide a kind of foreground image extraction method, with reference to Fig. 1, Fig. 1 be in one embodiment before The flow diagram of scape image extraction method, the foreground image extraction method may include steps of:
Step S101 obtains target image and carries out the first foreground image that inter-frame difference obtains.
Wherein, target image refers to that the image for carrying moving target, the image can be the image in sequence of video images, First foreground image refers to the foreground image that moving target is carried in the target image, which can be by right Target image obtains after carrying out frame differential method processing, and frame differential method, which refers to, does calculus of differences for target image and adjacent frame image Method to extract sport foreground image.
The available target image of this step and its adjacent frame image, and interframe is carried out to target image and its adjacent frame image Calculus of finite differences handles to obtain the first foreground image.
Step S102 obtains target image and carries out the second foreground image that background subtraction is got.
In this step, the second foreground image refers to the foreground image that moving target is carried in the target image, this second Foreground image can be by obtaining after carrying out background subtraction processing to target image, and background subtraction refers to current frame image The method for doing difference operation with background image to extract moving image.
Wherein, for background image, the first frame image in sequence of video images where target image can be set as carrying on the back Scape image carries out background pixel point statistics to the pixel of current frame image, and background image is arranged according to statistical result, for example, It should if some pixel of the real-time foreground image of current frame image was prospect by repeated detection before current time Pixel is set as background pixel point, generates background image according to multiple background pixel points.
The background image of the available target image of this step, and background difference is carried out to target image and its background image Method handles to obtain the second foreground image.
Step S103 extracts the profile of moving target from the first foreground image, the fortune of moving target is determined according to profile Dynamic region.
Wherein, the profile of moving target refers to the contour line of moving target in the target image, can pass through unified pixel The pixel of value is indicated in the target image, can be used for indicating the pixel model that the moving target is occupied in target image Enclose equal profile informations.
This step is mainly the profile that moving target is extracted from the first foreground image, and is determined and moved according to the profile The moving region of target in the target image can be the boundary rectangle pixel frame of the profile of the moving target;The moving region It is determined for the main movement range of moving target, can effectively shield in target image other pixels to moving target Interference, reduce the probability of error extraction foreground image, be conducive to improve the accuracy extracted to moving target foreground image.
First foreground image and the second foreground image are carried out plus operation obtain initial foreground image by step S104, according to The foreground image of moving target is extracted from initial foreground image in the moving region of moving target.
In this step, initial foreground image can be by corresponding pixel points in the first foreground image and the second foreground image Pixel value carry out plus operation obtains so that the shared pixel characteristic of the first foreground image and the second foreground image is combined, It can be avoided the influence that the disturbing factors such as noise, shade extract foreground image, specifically, which can be more Mending traditional frame differential method reduces prospect to occurring moving target erroneous judgement in target image when emergent moving target The influence of imaging accuracy, also compensating for traditional background subtraction can not effectively be transported in the case where scene dynamic change Moving-target characteristic causes target image to generate the defect that hollow phenomenon causes foreground image accuracy low;Then, fortune is utilized The moving region of moving-target extracts the foreground image of moving target from the initial foreground image, avoids initial foreground image It is interfered caused by extraction of other pixels the foreground image of moving target, when further reduced foreground image and extracting The probability of mistake improves the accuracy extracted to the foreground image of moving target.
Above-mentioned foreground image extraction method carries out according to the first foreground image and the second foreground image plus operation obtains initially Foreground image is combined the shared pixel characteristic of two kinds of foreground images, can be avoided the disturbing factors pair such as noise, shade The influence that foreground image extracts, and the profile of moving target can be accurately obtained using the first foreground image, and accurately reflect Moving target is extracted from initial foreground image in conjunction with the moving region in moving region of the moving target in each frame image out Foreground image, can be improved the accuracy extracted to foreground image, also advantageously improve and moving target is detected With the accuracy of identification.
In one embodiment, the acquisition target image in step S101 carries out the first foreground image that inter-frame difference obtains The step of may include:
Target image is subtracted each other respectively to obtain two frame difference images with adjacent two field pictures;According to the segmentation threshold pair of setting Difference image carries out binaryzation and obtains bianry image;The bianry image of difference image is subjected to multiplication and obtains the first foreground picture Picture.
The present embodiment mainly obtains first by carrying out three-frame difference processing to target image and its adjacent two field pictures Foreground image.
Target image and its adjacent two field pictures can be extracted, by target figure after carrying out low pass to sequence of video images As subtracting each other to obtain two frame difference images respectively with the gray value of adjacent two field pictures corresponding pixel points, further according to the segmentation threshold of setting Value carries out binary conversion treatment to two frame difference images respectively and obtains two frame bianry images, which is carried out multiplication Obtain the first foreground image.
Specifically, it is assumed that f (x, y, t-1), f (x, y, t), f (x, y, t+1) are certain pixel coordinate in image respectively The gray value of (x, y) at t-1, t and t+1 moment, f (x, y, t-1) can correspond to the previous frame image of target image, f (x, y, T) it can correspond to target image and f (x, y, t+1) can correspond to a later frame image of target image, two frame difference images It can indicate are as follows:
Diff (x, y, t)=| f (x, y, t)-f (x, y, t-1) |
Diff (x, y, t+1)=| f (x, y, t+1)-f (x, y, t) |
Diff (x, y, t) is the difference image of t moment, and diff (x, y, t+1) is the difference image at t+1 moment, by t moment Difference image with the t+1 moment is by choosing a threshold value properly divided for the foreground image of target image and background image point It opens to obtain bianry image, if TH is the segmentation threshold of setting, for determining, each pixel should belong to foreground picture in image As still falling within background area, to obtain corresponding bianry image:
The foreground image of target image are as follows: Htemporal foreground(x, y, t)=R (x, y, t) * R (x, y, t+1).
The scheme of above-described embodiment can effectively obtain the first foreground image of target image, and be calculated by three needle difference Method, which obtains first foreground image, more can comprehensively obtain the useful information such as target image such as profile, angle point, texture, have The accuracy extracted conducive to the foreground image guaranteed to moving target.
In one embodiment, the acquisition target image in step S102 carries out the second foreground image that background subtraction is got The step of may include:
The background image that target image is calculated according to initial background image and the context update factor, by background image and target Image carries out calculus of differences and obtains the second foreground image.
The present embodiment is mainly based upon the initial background image prestored and context update factor pair target image carries out background Difference processing obtains the second foreground image.Wherein, initial background image refers to the current background image for obtaining target image Image, it is the weight factor of context update, according to what is prestored that the size of the context update factor, which reflects the speed of context update, Initial background image and the context update factor can calculate the current background image of target image, then by background image and target figure As the pixel value of corresponding pixel points carries out available second foreground image of calculus of differences.
In general, algorithm complexity it is higher background model it is higher to the extraction accuracy of foreground image, for moving The effect of the detection of target is also better, and the present embodiment allows for the real-time needs of algorithm, the efficient back of one kind of proposition Scape model algorithm, for carrying out background calculus of differences to target image, thus the second foreground picture of the quick obtaining target image Picture improves extraction efficiency.
In one embodiment, further, in above-described embodiment according to initial background image and the context update factor Calculate target image background image the step of may include:
First frame image in image sequence is set as initial background image by step S201.
Wherein, image sequence is the image sequence for carrying target image, such as sequence of video images, this step can be from First frame image is extracted in the image sequence prestored, and the first frame image is set as initial background image, further increases back The extraction efficiency of scape image.
Step S202 obtains the context update factor;Determine the gray scale of each pixel of initial background image and target image Value;
This step mainly obtains the context update factor prestored, and obtains each picture of initial background image and target image The gray value of vegetarian refreshments.
Step S203, according to the gray value of initial background image and each pixel of target image, using following formula meter Calculate the gray value of each pixel of background image:
Wherein, HbackgroundThe gray value of each pixel of (x, y) expression background image, the α expression context update factor, one As take α=0.005,Indicate that the gray value of each pixel of initial background image, f (x, y) indicate target The gray value of each pixel of image, x indicate that the abscissa of pixel, y indicate the ordinate of pixel;
Step S204 obtains background image according to the gray value of each pixel of background image.
This step is according to the gray value of each pixel of the obtained background image of step S203 acquisition target image Background image.
By taking image sequence as an example, it can be assumed that Hbackground(x, y, t) is pixel (x, y) in background image in t moment Updated gray value, using first frame image currently entered as initial background image, opposite time t=1, at this time Hbackground(x, y, t0)=f (x, y, t), so what the moment of corresponding t ≠ 1 obtained is exactly that updated background image indicates Are as follows:
Hbackground(x, y, t)=(1- α) * Hbackground(x, y, t0)+α * f (x, y, t)
The size of α reflects the speed of context update, be context update weight factor, the value of the parameter can take α= 0.005。
The technical solution of the present embodiment, which realizes, extracts the background image of target image, and by the first frame figure As being set as initial background image, using the current background image of context update factor quick obtaining target image, further increase The extraction efficiency of background image.
In one embodiment, further, background image and target image are subjected to difference fortune in above-described embodiment Calculating the step of obtaining the second foreground image may include:
Target image and background image subtraction are obtained into background difference image;According to the segmentation threshold of setting to the background Difference image carries out binary conversion treatment, obtains the second foreground image.
Target image and the pixel value of background image corresponding pixel points are mainly carried out calculus of differences acquisition by the present embodiment Background difference image, and binary conversion treatment is carried out to the background difference image by segmentation threshold and obtains the second foreground image.
Specifically, background difference image is subtracted each other by the current realtime graphic of t moment and the current real-time background image of t moment It arrives, the current realtime graphic of t moment corresponds to target image, and background difference image can be calculated by following formula:
F (x, y, t)=| f (x, y, t)-Hbaxkground(x, y, t) |
Wherein, F (x, y, t) is the gray value of each pixel of background difference image, Hbackground(x, y, t) is background image Each pixel gray value, f (x, y, t) indicate target image each pixel gray value.
Background difference image F (x, y, t) is subjected to binary conversion treatment, the second prospect foreground picture of available target image Picture:
Wherein, TH indicates the segmentation threshold of setting, Hspatial_foreground(x, y, t) indicates each pixel of the second foreground image The gray value of point.
The technical solution of the present embodiment is based on target image and its background image carries out at background calculus of differences and binaryzation Reason, realizes the extraction to the second foreground image of target image.
In one embodiment, can also include the following steps:
Step S301 obtains coordinate and gray value to each pixel in binary image;
It may include subtract each other target image with adjacent two field pictures respectively two to binary image in this step Frame difference image, and target image and background image subtraction are obtained into background difference image;
This step is mainly the coordinate and gray value for obtaining each pixel for the image that will carry out binary conversion treatment.
Step S302 calculates gray value mean value and the side of each pixel according to the coordinate of each pixel and gray value Difference;
Segmentation threshold is arranged according to mean value and variance in step S303.
Be illustrated by taking two frame difference images and background difference image as an example, it is assumed that binaryzation two frame difference images and The size of background difference image is m × n, can by two frame difference image diff (x, y, t) and background difference image F (x, y, T) it is collectively expressed as difference image D (x, y, t), and is averaged μ using following formula to the corresponding pixel of the difference imagetWith Variance
Then, difference image D (x, y, t) is divided into the Background of foreground image and relative quiescent using following formula Picture:
Wherein, K is weight factor, and value range can take K=when this programme is verified generally 1.0~2.0 1.5, value crosses conference and most of foreground image pixel of moving target is considered as background image pixels point, too small then situation phase Instead.
The technical solution of the present embodiment can in conjunction with to each pixel of binary image pixel characteristic to segmentation threshold into Row setting can be in conjunction with to binary image by statistical natures such as pixel mean value, variances to each pixel of binary image Pixel feature the segmentation threshold of binaryzation is dynamically set, the accuracy of segmentation threshold is improved, to be conducive to pair Foreground image is accurately extracted.
In one embodiment, the step of moving region that moving target is determined according to profile in step S103 can wrap It includes:
The coordinate of each pixel of moving target is determined according to profile;According to the coordinate of each pixel of moving target Obtain the circumscribed rectangular region of moving target;Moving region is determined according to circumscribed rectangular region.
The coordinate that the present embodiment is mainly based upon each pixel of moving target obtains the boundary rectangle of the moving target, To determine the moving region of the moving target according to the boundary rectangle.
Wherein, the profile of moving target denotes the profile informations such as the position of the moving target in the target image, so The position of each point of moving target in the picture can be determined according to the profile of moving target, to extract in the target image The position coordinates of each pixel can calculate the boundary rectangle of the profile according to the position coordinates of each pixel and determine that this is external The region that rectangle is confined in the target image, the region which can be confined are set as the motor area of moving target Domain.
By taking image sequence as an example, it is assumed that have multiple moving targets in the foreground image of each frame image in image sequence Profile, (Xi, Yi) be i-th of moving target profile coordinate vector, wherein the coordinate vector is for reflecting the moving target Location information of the profile in flat field of view because the moving region of moving target changes over time, for image sequence For column, profile coordinate obtained in the image at each moment is different, it is possible to be indicated with coordinate vector, distinguish different moments The profile of prospect egative film moving target, then in the target image of t moment, the moving region of moving target can be indicated are as follows:
Wherein, Htemporal foreqround mask(x, y, t) is the gray value of each pixel in moving region of moving target, can Know that corresponding position in foreground image is completely covered in each of moving region of moving target white rectangle region just The profile of moving target.
The technical solution of the present embodiment determines the moving region of moving target by the boundary rectangle of profile, on the one hand can Effectively interference of other pixels to moving target in shielding target image, reduces the probability of error extraction foreground image, favorably It, can be on the other hand since the method for determination of the moving region is simple and efficient in the accuracy extracted to foreground image of raising Computational efficiency is improved, is conducive to improve the efficiency for extracting foreground image.
In one embodiment, the moving region according to moving target in step S104 is extracted from initial foreground image The step of foreground image of moving target may include:
The prospect egative film of the first foreground image is generated according to the moving region of moving target;By prospect egative film and initial prospect Image carries out multiplication and obtains the foreground image of moving target.
In the present embodiment, prospect egative film is the image for recording moving region, can be reflected in current frame image in real time The moving region of moving target.The present embodiment can be behind the moving region for obtaining the first foreground image, according to the moving region The pixel value of corresponding pixel points in first foreground image is set as 1, to obtain the prospect egative film of the first foreground image, then is used Following formula obtains the foreground image of moving target:
HFinal fore, qround=HTemporal fore, qround mask*HInitial motion fore, qround
Wherein, HTemporal fore, qround maskExpression prospect egative film, Hinitial motion foregroundIndicate initial foreground picture Picture, Hfinal foregroundIndicate the foreground image of moving target.
The scheme of the present embodiment is by generating the prospect egative film of the first foreground image and carrying out multiplying fortune with initial foreground image Calculation obtains the foreground image of moving target, can be modified to initial foreground image, when reduction extracts foreground image The probability for generating error extraction result, improves the accuracy and robustness extracted to foreground image, and the algorithm is set Haggle over simple, it is easy to accomplish.
In one embodiment, provide a kind of foreground image extraction element, with reference to Fig. 2, Fig. 2 be in one embodiment before The structural schematic diagram of scape image acquiring apparatus, the foreground image extraction element may include:
First prospect obtains module 101, carries out the first foreground image that inter-frame difference obtains for obtaining target image;Its In, the target image is the image for carrying moving target;
Second prospect obtains module 102, carries out the second foreground picture that background subtraction is got for obtaining the target image Picture;
Moving region determining module 103, for extracting the profile of the moving target, root from first foreground image The moving region of the moving target is determined according to the profile;
Sport foreground extraction module 104 adds operation to obtain for carrying out first foreground image and the second foreground image To initial foreground image, according to the moving region of the moving target before extracting the moving target in initial foreground image Scape image.
Above-mentioned foreground image extraction element carries out according to the first foreground image and the second foreground image plus operation obtains initially Foreground image is combined the shared pixel characteristic of two kinds of foreground images, can be avoided the disturbing factors pair such as noise, shade The influence that foreground image extracts, and the profile of moving target can be accurately obtained using the first foreground image, and accurately reflect Moving target is extracted from initial foreground image in conjunction with the moving region in moving region of the moving target in each frame image out Foreground image, can be improved the accuracy extracted to foreground image, also advantageously improve and moving target is detected With the accuracy of identification.
Foreground image extraction element of the invention and foreground image extraction method of the invention correspond, about foreground picture Specific as extraction element limits the restriction that may refer to above for foreground image extraction method, mentions in above-mentioned foreground image The technical characteristic and its advantages for taking the embodiment of method to illustrate are special suitable for the embodiment of foreground image extraction element This statement.Modules in above-mentioned foreground image extraction element can come real fully or partially through software, hardware and combinations thereof It is existing.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with software shape Formula is stored in the memory in computer equipment, executes the corresponding operation of the above modules in order to which processor calls.
In one embodiment, a kind of moving vehicle recognition methods is provided, with reference to Fig. 3, Fig. 3 is to transport in one embodiment The flow diagram of dynamic vehicle identification method, the moving vehicle recognition methods may include steps of:
Step S401 extracts the target image for carrying moving target from wagon flow sequence of video images;Wherein, the movement Target includes moving vehicle.
This step can first wagon flow video image carry out low-pass filtering treatment, obtain the feature of wagon flow video image as taken turns The useful information such as exterior feature, angle point, texture, while the bandwidth by adjusting filter obtain the preferable wagon flow video of smoothness Image can balance the inhibition and Fuzzy Processing of the noise to wagon flow video image by setting filter distribution standard deviation parameter σ, From extracting the target image for carrying moving target in treated wagon flow sequence of video images.
Step S402 obtains target image and carries out the first foreground image that inter-frame difference obtains;Target image is obtained to carry out The second foreground image that background subtraction is got.
Wherein, target image refer in wagon flow sequence of video images carry moving target such as moving vehicle image, first Foreground image refers to the foreground image that moving target is carried in the target image, which can be by target Image obtains after carrying out frame differential method processing, frame differential method refer to by target image and adjacent frame image do calculus of differences to The method for extracting sport foreground image.
Second foreground image refers to the foreground image that moving target is carried in wagon flow sequence of video images, second prospect Image can be by obtaining after carrying out background subtraction processing to target image, and background subtraction refers to current frame image and back The method that scape image does difference operation to extract moving image.
Wherein, for background image, the first frame image in wagon flow sequence of video images where target image can be set Background pixel point statistics is carried out for background image or to the pixel of current frame image, background image is arranged according to statistical result, For example, if some pixel of the real-time foreground image of current frame image was prospect by repeated detection before current time The pixel is set as background pixel point, generates background image according to multiple background pixel points.
The available target image of this step and its adjacent frame image, and interframe is carried out to target image and its adjacent frame image Calculus of finite differences handles to obtain the first foreground image, and obtains the background image of target image, and to target image and its Background It handles to obtain the second foreground image as carrying out background subtraction.
Step S403 extracts the profile of the moving target from first foreground image, is determined according to the profile The moving region of the moving target.
Wherein, the profile of moving target refers to the contour line of moving target such as moving vehicle in the target image, Ke Yitong The pixel for crossing unified pixel value is indicated in the target image, be can be used for indicating the moving target and is occupied in target image The profile informations such as pixel point range.
This step is mainly the profile that moving target is extracted from the first foreground image, and is determined and moved according to the profile The moving region of target in the target image can be the boundary rectangle pixel frame of the profile of the moving target;The moving region It is determined for the main movement range of moving target, can effectively shield in target image other pixels to moving target Interference, reduce the probability of error extraction foreground image, be conducive to improve the accuracy extracted to moving target foreground image.
First foreground image and the second foreground image are carried out plus operation obtain initial foreground image by step S404, The foreground image of the moving target is extracted from initial foreground image according to the moving region of the moving target.
In this step, initial foreground image can be by corresponding pixel points in the first foreground image and the second foreground image Pixel value carry out plus operation obtains so that the shared pixel characteristic of the first foreground image and the second foreground image is combined, It can be avoided the influence that the disturbing factors such as noise, shade extract foreground image, specifically, which can be more There is moving target erroneous judgement when mending traditional frame differential method to moving target such as moving vehicle emergent in target image And the influence of foreground image accuracy is reduced, also compensating for traditional background subtraction can not in the case where scene dynamic change Effectively obtaining moving target characteristic causes target image to generate the defect that hollow phenomenon causes foreground image accuracy low;So Afterwards, the foreground image for being extracted moving target from the initial foreground image using the moving region of moving target is avoided initial It is interfered caused by extraction of other pixels of foreground image the foreground image of moving target, further reduced foreground image The probability that mistake occurs when extraction, improves the accuracy extracted to the foreground image of moving target.
Step S405 identifies the moving vehicle in wagon flow sequence of video images according to foreground image.
This step be mainly from extracted in wagon flow sequence of video images carry moving target foreground image after, in the past Moving vehicle is identified in each moving target of scape image.
Above-mentioned moving vehicle recognition methods, according to the first foreground image of target image in wagon flow sequence of video images and Two foreground images carry out plus operation obtains initial foreground image and the shared pixel characteristic of two kinds of foreground images is combined, energy The influence for enough avoiding the disturbing factors such as noise, shade from extracting foreground image, and can be accurate using the first foreground image To the profile of moving target, and moving region of the moving target in each frame image is accurately reflected, in conjunction with the moving region The foreground image that moving target is extracted from initial foreground image, can be improved the accuracy extracted to foreground image, also The foreground image is used to that the moving vehicle in wagon flow sequence of video images to be identified and be detected, is also improved to sport(s) car The accuracy for being detected and being identified.
In one embodiment, the acquisition target image in step S402 carries out the first foreground image that inter-frame difference obtains The step of may include:
Target image is subtracted each other respectively to obtain two frame difference images with adjacent two field pictures;According to the segmentation threshold pair of setting Difference image carries out binaryzation and obtains bianry image;The bianry image of difference image is subjected to multiplication and obtains the first foreground picture Picture.
In one embodiment, the acquisition target image in step S402 carries out the second foreground image that background subtraction is got The step of may include:
The background image that target image is calculated according to initial background image and the context update factor, by background image and target Image carries out calculus of differences and obtains the second foreground image.
In one embodiment, further, in above-described embodiment according to initial background image and the context update factor Calculate target image background image the step of may include:
First frame image in wagon flow sequence of video images is set as initial background image by step S501.
This step can extract first frame image from the wagon flow sequence of video images prestored, and the first frame image is set For initial background image, the extraction efficiency of background image is further increased.
Step S502 obtains the context update factor;Determine the gray scale of each pixel of initial background image and target image Value.
This step mainly obtains the context update factor prestored, and obtains each picture of initial background image and target image The gray value of vegetarian refreshments.
Step S503, according to the gray value of initial background image and each pixel of target image, using following formula meter Calculate the gray value of each pixel of background image:
Wherein, HbackgroundThe gray value of each pixel of (x, y) expression background image, the α expression context update factor, one As take α=0.005,Indicate that the gray value of each pixel of initial background image, f (x, y) indicate target The gray value of each pixel of image, x indicate that the abscissa of pixel, y indicate the ordinate of pixel.
Step S504 obtains background image according to the gray value of each pixel of background image.
This step is mainly to obtain target image according to the gray value of each pixel of the obtained background image of step S203 The background image.
In one embodiment, further, background image and target image are subjected to difference fortune in above-described embodiment Calculating the step of obtaining the second foreground image may include:
Target image and background image subtraction are obtained into background difference image;According to the segmentation threshold of setting to the background Difference image carries out binary conversion treatment, obtains the second foreground image.
In one embodiment, further including can be with following steps:
Step S601 obtains coordinate and gray value to each pixel in binary image;
In this step, to binary image may include by the target image in wagon flow video image respectively with adjacent two frame The two frame difference images that image subtraction obtains, and by wagon flow video image target image and background image subtraction carried on the back Scape difference image;
This step is mainly the coordinate and gray value for obtaining each pixel for the image that will carry out binary conversion treatment.
Step S602 calculates gray value mean value and the side of each pixel according to the coordinate of each pixel and gray value Difference;
Segmentation threshold is arranged according to mean value and variance in step S603.
In one embodiment, the step of moving region that moving target is determined according to profile in step S403 can wrap It includes:
The coordinate of each pixel of moving target is determined according to profile;According to the coordinate of each pixel of moving target Obtain the circumscribed rectangular region of moving target;Moving region is determined according to circumscribed rectangular region.
In one embodiment, the moving region according to moving target in step S404 is extracted from initial foreground image The step of foreground image of moving target may include:
The prospect egative film of the first foreground image is generated according to the moving region of moving target;By prospect egative film and initial prospect Image carries out multiplication and obtains the foreground image of moving target.
In one embodiment, a kind of moving vehicle identification device is provided, with reference to Fig. 4, Fig. 4 is to transport in one embodiment The structural schematic diagram of dynamic vehicle identifier, the moving vehicle identification device may include:
Target image extraction module 401, for extracting the target figure for carrying moving target from wagon flow sequence of video images Picture;Wherein, the moving target includes moving vehicle;
Foreground image obtains module 402, obtains the target image and carries out the first foreground image that inter-frame difference obtains;It obtains The target image is taken to carry out the second foreground image that background subtraction is got;
Moving region obtains module 403, for extracting the profile of the moving target, root from first foreground image The moving region of the moving target is determined according to the profile;
Foreground image extraction module 404 adds operation to obtain for carrying out first foreground image and the second foreground image To initial foreground image, according to the moving region of the moving target before extracting the moving target in initial foreground image Scape image;
Moving vehicle identification module 405, for being identified in the wagon flow sequence of video images according to the foreground image Moving vehicle.
Above-mentioned moving vehicle identification device, according to the first foreground image of target image in wagon flow sequence of video images and Two foreground images carry out plus operation obtains initial foreground image and the shared pixel characteristic of two kinds of foreground images is combined, energy The influence for enough avoiding the disturbing factors such as noise, shade from extracting foreground image, and can be accurate using the first foreground image To the profile of moving target, and moving region of the moving target in each frame image is accurately reflected, in conjunction with the moving region The foreground image that moving target is extracted from initial foreground image, can be improved the accuracy extracted to foreground image, also The foreground image is used to that the moving vehicle in wagon flow sequence of video images to be identified and be detected, is also improved to sport(s) car The accuracy for being detected and being identified.
Moving vehicle identification device of the invention and moving vehicle recognition methods of the invention correspond, about sport(s) car The specific of identification device limits the restriction that may refer to above for moving vehicle recognition methods, knows in above-mentioned moving vehicle The technical characteristic and its advantages that the embodiment of other method illustrates are special suitable for the embodiment of moving vehicle identification device This statement.Modules in above-mentioned moving vehicle identification device can come real fully or partially through software, hardware and combinations thereof It is existing.Above-mentioned each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also be with software shape Formula is stored in the memory in computer equipment, executes the corresponding operation of the above modules in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can using as shown in figure 5, Fig. 5 as the internal structure chart of computer equipment in one embodiment.The computer equipment includes passing through Processor, memory, network interface, display screen and the input unit of system bus connection.Wherein, the processing of the computer equipment Device is for providing calculating and control ability.The memory of the computer equipment includes non-volatile memory medium, built-in storage.It should Non-volatile memory medium is stored with operating system and computer program.The built-in storage is the behaviour in non-volatile memory medium The operation for making system and computer program provides environment.The network interface of the computer equipment is used to pass through net with external terminal Network connection communication.To realize a kind of foreground image extraction method or moving vehicle identification when the computer program is executed by processor Method.The display screen of the computer equipment can be liquid crystal display or electric ink display screen, the computer equipment it is defeated Entering device can be the touch layer covered on display screen, be also possible to the key being arranged on computer equipment shell, trace ball or Trackpad can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 5, only part relevant to the present invention program is tied The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to the present invention program, specific computer equipment It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of when executing computer program
It obtains target image and carries out the first foreground image that inter-frame difference obtains;Target image progress background subtraction is obtained to get The second foreground image arrived;The profile that moving target is extracted from the first foreground image, the fortune of moving target is determined according to profile Dynamic region;First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to moving target The foreground image of moving target is extracted from initial foreground image in moving region.
In one embodiment, it is also performed the steps of when processor executes computer program
Target image is subtracted each other respectively to obtain two frame difference images with adjacent two field pictures;According to the segmentation threshold pair of setting Difference image carries out binaryzation and obtains bianry image;The bianry image of difference image is subjected to multiplication and obtains the first foreground picture Picture.
In one embodiment, it is also performed the steps of when processor executes computer program
The background image that target image is calculated according to initial background image and the context update factor, by background image and target Image carries out calculus of differences and obtains the second foreground image.
In one embodiment, it is also performed the steps of when processor executes computer program
First frame image in image sequence is set as initial background image;Obtain the context update factor;It determines The gray value of each pixel of initial background image and target image;According to initial background image and target image The gray value of each pixel calculates the gray value of each pixel of background image using following formula:According to each pixel of background image Gray value obtains background image.
In one embodiment, it is also performed the steps of when processor executes computer program
Target image and background image subtraction are obtained into background difference image;According to the segmentation threshold of setting to the background Difference image carries out binary conversion treatment, obtains the second foreground image.
In one embodiment, it is also performed the steps of when processor executes computer program
Obtain the coordinate and gray value to each pixel in binary image;According to the coordinate and ash of each pixel Angle value calculates the gray value mean value and variance of each pixel;According to mean value and variance, segmentation threshold is set.
In one embodiment, it is also performed the steps of when processor executes computer program
The coordinate of each pixel of moving target is determined according to profile;According to the coordinate of each pixel of moving target Obtain the circumscribed rectangular region of moving target;Moving region is determined according to circumscribed rectangular region.
In one embodiment, it is also performed the steps of when processor executes computer program
The prospect egative film of the first foreground image is generated according to the moving region of moving target;By prospect egative film and initial prospect Image carries out multiplication and obtains the foreground image of moving target.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor perform the steps of when executing computer program
The target image for carrying moving target is extracted from wagon flow sequence of video images;It obtains target image and carries out frame-to-frame differences The first foreground image got;It obtains target image and carries out the second foreground image that background subtraction is got;Before described first The profile that the moving target is extracted in scape image determines the moving region of the moving target according to the profile;It will be described First foreground image and the second foreground image carry out plus operation obtains initial foreground image, according to the motor area of the moving target The foreground image of the moving target is extracted from initial foreground image in domain;Wagon flow sequence of video images is identified according to foreground image In moving vehicle.
Computer equipment described in any of the above-described embodiment passes through the computer program run on the processor, energy The accuracy extracted to foreground image is enough improved, the accuracy for being detected and being identified to moving target can also be improved.
Those of ordinary skill in the art will appreciate that realizing the foreground image extraction method and moving vehicle of above-described embodiment All or part of the process in recognition methods is relevant hardware can be instructed to complete by computer program, described Computer program can be stored in a non-volatile computer read/write memory medium, which when being executed, can wrap Include the process of the embodiment such as above-mentioned each method.Wherein, used in each embodiment provided by the present invention to memory, deposit Any reference of storage, database or other media, may each comprise non-volatile and/or volatile memory.Non-volatile memories Device may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include random access memory (RAM) or external cache.Make To illustrate rather than limit to, RAM is available in many forms, such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) directly RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and Memory bus dynamic ram (RDRAM) etc..
Accordingly, in one embodiment, a kind of computer readable storage medium is provided, computer journey is stored thereon with Sequence performs the steps of when computer program is executed by processor
It obtains target image and carries out the first foreground image that inter-frame difference obtains;Target image progress background subtraction is obtained to get The second foreground image arrived;The profile that moving target is extracted from the first foreground image, the fortune of moving target is determined according to profile Dynamic region;First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to moving target The foreground image of moving target is extracted from initial foreground image in moving region.
In one embodiment, it is also performed the steps of when computer program is executed by processor
Target image is subtracted each other respectively to obtain two frame difference images with adjacent two field pictures;According to the segmentation threshold pair of setting Difference image carries out binaryzation and obtains bianry image;The bianry image of difference image is subjected to multiplication and obtains the first foreground picture Picture.
In one embodiment, it is also performed the steps of when computer program is executed by processor
The background image that target image is calculated according to initial background image and the context update factor, by background image and target Image carries out calculus of differences and obtains the second foreground image.
In one embodiment, it is also performed the steps of when computer program is executed by processor
First frame image in image sequence is set as initial background image;Obtain the context update factor; Determine the gray value of each pixel of initial background image and target image;According to initial background image and target The gray value of each pixel of image calculates the gray value of each pixel of background image using following formula:According to each pixel of background image Gray value obtains background image.
In one embodiment, it is also performed the steps of when computer program is executed by processor
Target image and background image subtraction are obtained into background difference image;According to the segmentation threshold of setting to the background Difference image carries out binary conversion treatment, obtains the second foreground image.
In one embodiment, it is also performed the steps of when computer program is executed by processor
Obtain the coordinate and gray value to each pixel in binary image;According to the coordinate and ash of each pixel Angle value calculates the gray value mean value and variance of each pixel;According to mean value and variance, segmentation threshold is set.
In one embodiment, it is also performed the steps of when computer program is executed by processor
The coordinate of each pixel of moving target is determined according to profile;According to the coordinate of each pixel of moving target Obtain the circumscribed rectangular region of moving target;Moving region is determined according to circumscribed rectangular region.
In one embodiment, it is also performed the steps of when computer program is executed by processor
The prospect egative film of the first foreground image is generated according to the moving region of moving target;By prospect egative film and initial prospect Image carries out multiplication and obtains the foreground image of moving target.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program performs the steps of when being executed by processor
The target image for carrying moving target is extracted from wagon flow sequence of video images;It obtains target image and carries out frame-to-frame differences The first foreground image got;It obtains target image and carries out the second foreground image that background subtraction is got;Before described first The profile that the moving target is extracted in scape image determines the moving region of the moving target according to the profile;It will be described First foreground image and the second foreground image carry out plus operation obtains initial foreground image, according to the motor area of the moving target The foreground image of the moving target is extracted from initial foreground image in domain;Wagon flow sequence of video images is identified according to foreground image In moving vehicle.
Computer readable storage medium described in any of the above-described embodiment can by the computer program that it is stored The accuracy extracted to foreground image is improved, the accuracy for being detected and being identified to moving target can also be improved.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited In contradiction, all should be considered as described in this specification.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously It cannot therefore be construed as limiting the scope of the patent.It should be pointed out that coming for those of ordinary skill in the art It says, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to protection of the invention Range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (10)

1. a kind of foreground image extraction method, which is characterized in that comprising steps of
It obtains target image and carries out the first foreground image that inter-frame difference obtains;Wherein, the target image is to carry movement mesh Target image;
It obtains the target image and carries out the second foreground image that background subtraction is got;
The profile that the moving target is extracted from first foreground image determines the moving target according to the profile Moving region;
First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to the movement mesh The foreground image of the moving target is extracted from initial foreground image in target moving region.
2. foreground image extraction method according to claim 1, which is characterized in that the acquisition target image carries out interframe The step of the first foreground image that difference obtains includes:
The target image is subtracted each other respectively to obtain two frame difference images with adjacent two field pictures;
Binaryzation is carried out to the difference image according to the segmentation threshold of setting and obtains bianry image;
The bianry image of the difference image is subjected to multiplication and obtains first foreground image.
3. foreground image extraction method according to claim 1, which is characterized in that described to obtain the target image progress The step of the second foreground image that background subtraction is got includes:
The background image that the target image is calculated according to initial background image and the context update factor, by the background image and Target image carries out calculus of differences and obtains the second foreground image.
4. foreground image extraction method according to claim 3, which is characterized in that described according to initial background image and back Scape updating factor calculates the step of background image of the target image and includes:
First frame image in image sequence is set as the initial background image;Wherein, described image sequence carries the mesh Logo image;
Obtain the context update factor;Determine the gray value of each pixel of the initial background image and target image;
According to the gray value of each pixel, the gray value of each pixel of the background image is calculated using following formula:
Wherein, Hbackground(x, y) indicates the gray value of each pixel of the background image, α indicate the context update because Son,Indicate that the gray value of each pixel of the initial background image, f (x, y) indicate the target figure The gray value of each pixel of picture, x indicate that the abscissa of pixel, y indicate the ordinate of pixel;
The background image is obtained according to the gray value of each pixel of the background image;
It is described to include: by the step of background image and target image progress calculus of differences the second foreground image of acquisition
The target image and background image subtraction are obtained into background difference image;
Binary conversion treatment is carried out to the background difference image according to the segmentation threshold of setting, obtains second foreground image.
5. foreground image extraction method according to claim 1, which is characterized in that the fortune according to the moving target Moving the step of foreground image of the moving target is extracted in region from initial foreground image includes:
The prospect egative film of first foreground image is generated according to the moving region of the moving target;Wherein, the prospect bottom Piece is the image for recording the moving region;
The prospect egative film and initial foreground image are subjected to multiplication and obtain the foreground image of the moving target.
6. foreground image extraction method according to any one of claims 1 to 5, which is characterized in that described according to the wheel Exterior feature determines that the step of moving region of the moving target includes:
The coordinate of each pixel of the moving target is determined according to the profile;
The circumscribed rectangular region of the moving target is obtained according to the coordinate of each pixel of the moving target;
The moving region is determined according to the circumscribed rectangular region.
7. foreground image extraction method according to claim 3 or 4, which is characterized in that further comprise the steps of:
Obtain the coordinate and gray value to each pixel in binary image;
The gray value mean value and variance of each pixel are calculated according to the coordinate of each pixel and gray value;
According to the mean value and variance, the segmentation threshold is set.
8. a kind of moving vehicle recognition methods, which is characterized in that comprising steps of
The target image for carrying moving target is extracted from wagon flow sequence of video images;Wherein, the moving target includes movement Vehicle;
It obtains the target image and carries out the first foreground image that inter-frame difference obtains;It obtains the target image and carries out background subtraction The second foreground image got;
The profile that the moving target is extracted from first foreground image determines the moving target according to the profile Moving region;
First foreground image and the second foreground image are carried out plus operation obtains initial foreground image, according to the movement mesh The foreground image of the moving target is extracted from initial foreground image in target moving region;
The moving vehicle in the wagon flow sequence of video images is identified according to the foreground image.
9. a kind of foreground image extraction element characterized by comprising
First prospect obtains module, carries out the first foreground image that inter-frame difference obtains for obtaining target image;Wherein, described Target image is the image for carrying moving target;
Second prospect obtains module, carries out the second foreground image that background subtraction is got for obtaining the target image;
Moving region determining module, for extracting the profile of the moving target from first foreground image, according to described Profile determines the moving region of the moving target;
Sport foreground extraction module, for carrying out first foreground image and the second foreground image before adding operation to obtain initially Scape image extracts the foreground image of the moving target according to the moving region of the moving target from initial foreground image.
10. a kind of moving vehicle identification device characterized by comprising
Target image extraction module, for extracting the target image for carrying moving target from wagon flow sequence of video images;Wherein, The moving target includes moving vehicle;
Foreground image obtains module, obtains the target image and carries out the first foreground image that inter-frame difference obtains;Described in acquisition Target image carries out the second foreground image that background subtraction is got;
Moving region obtains module, for extracting the profile of the moving target from first foreground image, according to described Profile determines the moving region of the moving target;
Foreground image extraction module, for carrying out first foreground image and the second foreground image before adding operation to obtain initially Scape image extracts the foreground image of the moving target according to the moving region of the moving target from initial foreground image;
Moving vehicle identification module, for identifying the sport(s) car in the wagon flow sequence of video images according to the foreground image ?.
CN201810720684.0A 2018-07-02 2018-07-02 Foreground image extraction method and device and moving vehicle identification method and device Active CN109035287B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810720684.0A CN109035287B (en) 2018-07-02 2018-07-02 Foreground image extraction method and device and moving vehicle identification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810720684.0A CN109035287B (en) 2018-07-02 2018-07-02 Foreground image extraction method and device and moving vehicle identification method and device

Publications (2)

Publication Number Publication Date
CN109035287A true CN109035287A (en) 2018-12-18
CN109035287B CN109035287B (en) 2021-01-12

Family

ID=65521533

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810720684.0A Active CN109035287B (en) 2018-07-02 2018-07-02 Foreground image extraction method and device and moving vehicle identification method and device

Country Status (1)

Country Link
CN (1) CN109035287B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111242051A (en) * 2020-01-16 2020-06-05 广州杰赛科技股份有限公司 Vehicle identification optimization method and device and storage medium
WO2020151172A1 (en) * 2019-01-23 2020-07-30 平安科技(深圳)有限公司 Moving object detection method and apparatus, computer device, and storage medium
CN111914627A (en) * 2020-06-18 2020-11-10 广州杰赛科技股份有限公司 Vehicle identification and tracking method and device
WO2021013049A1 (en) * 2019-07-19 2021-01-28 广州虎牙科技有限公司 Foreground image acquisition method, foreground image acquisition apparatus, and electronic device
US11501452B2 (en) 2020-08-10 2022-11-15 Honeywell International Inc. Machine learning and vision-based approach to zero velocity update object detection

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100220194A1 (en) * 2009-02-27 2010-09-02 Sony Corporation Image processing device, image processing system, camera device, image processing method, and program
CN106846359A (en) * 2017-01-17 2017-06-13 湖南优象科技有限公司 Moving target method for quick based on video sequence
CN107169985A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of moving target detecting method based on symmetrical inter-frame difference and context update
CN109034111A (en) * 2018-08-17 2018-12-18 北京航空航天大学 A kind of driver's hand based on deep learning is from steering wheel detection method and system
CN110853003A (en) * 2019-10-31 2020-02-28 北京推想科技有限公司 Hand epiphysis development grade determination method and related equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100220194A1 (en) * 2009-02-27 2010-09-02 Sony Corporation Image processing device, image processing system, camera device, image processing method, and program
CN106846359A (en) * 2017-01-17 2017-06-13 湖南优象科技有限公司 Moving target method for quick based on video sequence
CN107169985A (en) * 2017-05-23 2017-09-15 南京邮电大学 A kind of moving target detecting method based on symmetrical inter-frame difference and context update
CN109034111A (en) * 2018-08-17 2018-12-18 北京航空航天大学 A kind of driver's hand based on deep learning is from steering wheel detection method and system
CN110853003A (en) * 2019-10-31 2020-02-28 北京推想科技有限公司 Hand epiphysis development grade determination method and related equipment

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020151172A1 (en) * 2019-01-23 2020-07-30 平安科技(深圳)有限公司 Moving object detection method and apparatus, computer device, and storage medium
WO2021013049A1 (en) * 2019-07-19 2021-01-28 广州虎牙科技有限公司 Foreground image acquisition method, foreground image acquisition apparatus, and electronic device
CN111242051A (en) * 2020-01-16 2020-06-05 广州杰赛科技股份有限公司 Vehicle identification optimization method and device and storage medium
CN111242051B (en) * 2020-01-16 2023-09-15 广州杰赛科技股份有限公司 Vehicle identification optimization method, device and storage medium
CN111914627A (en) * 2020-06-18 2020-11-10 广州杰赛科技股份有限公司 Vehicle identification and tracking method and device
US11501452B2 (en) 2020-08-10 2022-11-15 Honeywell International Inc. Machine learning and vision-based approach to zero velocity update object detection

Also Published As

Publication number Publication date
CN109035287B (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN109035287A (en) Foreground image extraction method and device, moving vehicle recognition methods and device
Hou et al. An efficient nonlocal variational method with application to underwater image restoration
CN108833785B (en) Fusion method and device of multi-view images, computer equipment and storage medium
CN108510451B (en) Method for reconstructing license plate based on double-layer convolutional neural network
CN108198201A (en) A kind of multi-object tracking method, terminal device and storage medium
CN108492262A (en) It is a kind of based on gradient-structure similitude without ghost high dynamic range imaging method
JP2015522200A (en) Human face feature point positioning method, apparatus, and storage medium
CN102915545A (en) OpenCV(open source computer vision library)-based video target tracking algorithm
CN111080776B (en) Human body action three-dimensional data acquisition and reproduction processing method and system
CN110276831B (en) Method and device for constructing three-dimensional model, equipment and computer-readable storage medium
CN108762505A (en) Virtual object control method, device, storage medium based on gesture and equipment
CN110415280B (en) Remote sensing image and building vector registration method and system under multitask CNN model
US20220270204A1 (en) Image registration method, terminal, and computer storage medium
CN116310046B (en) Image processing method, device, computer and storage medium
WO2023273868A1 (en) Image denoising method and apparatus, terminal, and storage medium
CN108629792A (en) Laser eyepiece detection method and device based on background modeling Yu background difference
WO2022206680A1 (en) Image processing method and apparatus, computer device, and storage medium
CN112215877A (en) Image processing method and device, electronic equipment and readable storage medium
CN112308797A (en) Corner detection method and device, electronic equipment and readable storage medium
CN110348425B (en) Method, device and equipment for removing shading and computer readable storage medium
CN113192101B (en) Image processing method, device, computer equipment and storage medium
CN110211082B (en) Image fusion method and device, electronic equipment and storage medium
Xu et al. COCO-Net: A dual-supervised network with unified ROI-loss for low-resolution ship detection from optical satellite image sequences
CN113628259A (en) Image registration processing method and device
US20180182117A1 (en) Method for Generating Three Dimensional Images

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