CN106570440A - People counting method and people counting device based on image analysis - Google Patents
People counting method and people counting device based on image analysis Download PDFInfo
- Publication number
- CN106570440A CN106570440A CN201510649524.8A CN201510649524A CN106570440A CN 106570440 A CN106570440 A CN 106570440A CN 201510649524 A CN201510649524 A CN 201510649524A CN 106570440 A CN106570440 A CN 106570440A
- Authority
- CN
- China
- Prior art keywords
- image block
- sample
- classifier
- strong classifier
- frame
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
- G06V20/53—Recognition of crowd images, e.g. recognition of crowd congestion
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a people counting method and a people counting device capable of automatically improving detection precision, and a public transport passenger counting method and device. The method comprises the following steps: utilizing a strong classifier to carry out traversal on each image frame to be measured and obtained in real time to obtain a set (B) of feature image blocks comprising human head features, wherein the strong classifier is obtained by carrying out training by utilizing a sample database (A) formed by positive samples and negative samples of the feature image blocks comprising head pixel features, and is processed through a strong learning algorithm; utilizing a weak classifier to carry out traversal on each image frame to be measured and obtained in real time to obtain a set (C) of feature image blocks comprising human head features, wherein the weak classifier can obtain positive samples not existing in the sample database (A), and is processed through a weak learning algorithm; serving the feature image blocks existing in the set (C) and not existing in the set (B) as positive samples and adding the positive samples to the sample database (A), and carrying out training again to update the strong classifier; and carrying out real-time head detection through the updated strong classifier to obtain the number of people.
Description
Technical field
The present invention relates to a kind of demographic method and people counting device, more specifically, relate to
And the demographic method and people counting device based on graphical analyses, especially bus passenger flow
Statistical method and statistic device.
Background technology
In actual life, artificial abortion's statistics of variables has very high practical value.For example, for exhibition
Look at the intensive party sexual activity of activity, competitive sports et al. degree of flowing through, controlled by people's flow monitoring
Number of participants, can reduce the generation of tread event.System to each outpatient service department patient's flow of hospital
Meter, is conducive to the consultation time rule of patient is summed up according to patient's consultation time, and science is closed
Reason ground allotment doctor, the watch time of nurse, shorten waiting time of patient etc..Especially
It is that, in public traffic management field, bus passenger flow analysis can reflect real bus operation situation, be
Science formulates the basis of bus dispatching method, is to provide the guarantee of high-quality bus service.
Method of the people flow rate statistical of early stage using artificial counting, but there is statistics in artificial counting
Personnel leak because tired tell noses, human cost need persistence input etc. drawback.Occurred again later
The modes such as triroller gate mode, infrared induction statistical, gravity sensing mode, especially
Infrared induction statistical is widely used, but infrared induction statistical is present to be installed
Affect attractive in appearance, easy by drawbacks such as extraneous factor interference.
In recent years, computer technology is developed rapidly, and with hardware cost decline with
And continuous renewal and perfect, the demographics side based on image of various Computer Vision algorithms
Method gradually in real life is applied and popularizes.For example in 1 (CN of patent documentation
A kind of public traffice passenger flow statistical method based on Computer Vision is disclosed in 104156983A).
The method is by obtaining to the photographic head being acquired in vertical direction installed in buses roof
Video processed, count bus passenger flow quantity.The method can be effectively reduced and be gathered around because of passenger
Squeeze cause to block, the impact of the factor to passenger flow statisticses such as light change change, statistical accuracy is high,
It is considered as to be best suitable for one of method of bus passenger flow statistics.
Patent documentation 1:CN 104156983 A
The content of the invention
Problems to be solved by the invention
But the prior art such as example described in patent documentation 1 there are the following problems.It no matter is based on
How outstanding the demographic method of graphical analyses is, it is also not possible to accomplishes absolute no missing inspection and flase drop,
So needing to make its further self study or improving precision by other means.And such as buses
Unmanned monitor state is in Deng the people counting device overwhelming majority time under applied environment, so as to lead
Cause counting precision be lifted in time, it is impossible to be improved with the carrying out of detection process.
The purpose of the present invention is the above-mentioned deficiency for overcoming prior art, there is provided one kind can be carried automatically
Rise the demographic method and people counting device of accuracy of detection.
For solving the technical scheme of problem
In order to solve above-mentioned problem, the present invention can be a kind of demographics based on graphical analyses
Method, it is characterised in that:The image acquisition step of each testing image frame is obtained in real time;Grader
Step is updated, strong classifier and Weak Classifier are utilized during human detection to real-time acquirement
Each testing image frame is analyzed, wherein, above-mentioned strong classifier is to advance with by comprising human body
Obtained by the Sample Storehouse that the positive sample of the characteristic image block of feature and negative sample are constituted is trained,
Processed with strong learning algorithm, what above-mentioned Weak Classifier did not had in being obtained in that above-mentioned Sample Storehouse
Positive sample, is processed with weak learning algorithm, will be detected by above-mentioned Weak Classifier and can not be by
The characteristic image block that strong classifier is detected is added in above-mentioned Sample Storehouse as new positive sample,
And using renewal after above-mentioned Sample Storehouse re-start training, to carry out more to above-mentioned strong classifier
Newly;The real-time each above-mentioned testing image frame for obtaining is entered with the above-mentioned strong classifier after using renewal
Row real-time body detects that statistics obtains the demographics step of number.
The demographic method of the present invention, it is also possible to which above-mentioned grader updates step to be included:Utilize
Above-mentioned strong classifier is traveled through to the real-time each testing image frame for obtaining, and is obtained as above-mentioned spy
The step of first image block set of the set for levying image block;Using Weak Classifier to acquirement in real time
Each above-mentioned testing image frame traveled through, obtain of the set as features described above image block
The step of two image block sets;With to above-mentioned first image block set and above-mentioned second image block collection
Characteristic image block in conjunction is compared, if there is not having in above-mentioned first image block set and
The characteristic image block having in above-mentioned second image block set, then using these characteristic image blocks as new
Positive sample be added in the above-mentioned Sample Storehouse of above-mentioned strong classifier, and using update after it is above-mentioned
Sample Storehouse re-starts training, the step of to be updated to strong classifier.
The demographic method of the present invention, it is also possible in above-mentioned image acquisition step, using with mirror
Head obtain each above-mentioned testing image frame from top to the photographic head that the mode of ground level sets up, on
State characteristics of human body's behaviour head feature that characteristic image block is included.
The demographic method of the present invention, it is also possible to also including artificial judgment step, by above-mentioned the
The characteristic image block for not having and having in above-mentioned second image block set in one image block set periodically leads to
Cross network and be sent to server, whether artificial judgment features described above image block is remotely carried out by user
For positive sample, will be deemed as not being that the characteristic image block of positive sample is deleted from above-mentioned Sample Storehouse,
And using renewal after above-mentioned Sample Storehouse be trained, to be updated to strong classifier.
The demographic method of the present invention, it is also possible to which above-mentioned strong classifier obtains features described above image
The method of the characteristics of human body included by block is HOG.
The demographic method of the present invention, it is also possible to which above-mentioned Weak Classifier working method is as follows:Obtain
Take continuous n two field pictures;Average is taken to the pixel of above-mentioned n two field pictures, reference background frame is obtained;
Present frame is subtracted each other with reference background frame pixel-by-pixel and obtains differing from frame;Examined by threshold value set in advance
Survey dark circular contour in obtaining difference frame and carry out acquisitor's head feature as head part region.
The demographic method of the present invention, or a kind of bus passenger flow method of counting, which is special
Levy and be:The number of bus passenger flow is counted using above-mentioned demographic method.
In order to solve above-mentioned problem, the present invention can be a kind of demographics based on graphical analyses
Device, it is characterised in that:The image acquisition unit of each above-mentioned testing image frame is obtained in real time;It is right
The each above-mentioned testing image frame for obtaining in real time is traveled through, and is obtained as features described above image block
The strong classifier of the first image block set of set, above-mentioned strong classifier is to advance with by including
The Sample Storehouse that the positive sample of the characteristic image block of characteristics of human body and negative sample are constituted is trained and obtains
, processed with strong learning algorithm;The real-time each above-mentioned testing image frame for obtaining is carried out time
Go through, obtain the Weak Classifier of the second image block set of set as features described above image block,
The positive sample that above-mentioned Weak Classifier does not have in being obtained in that above-mentioned Sample Storehouse, is entered with weak learning algorithm
Row is processed;Grader updating block, to above-mentioned first image block set and above-mentioned second image block
Characteristic image block in set is compared, if there is not having in above-mentioned first image block set
And the characteristic image block having in above-mentioned second image block set, then using these characteristic image blocks as
New positive sample is added in the above-mentioned Sample Storehouse of above-mentioned strong classifier, and using upper after updating
State Sample Storehouse and re-start training, to be updated to strong classifier;It is upper after updating with utilizing
Stating strong classifier carries out real-time body's detection to the real-time each above-mentioned testing image frame for obtaining, and counts
Obtain the demographics unit of number.
The present invention people counting device, it is also possible to above-mentioned image acquisition unit be with camera lens towards
The mode of ground level sets up from top and obtains the photographic head of each above-mentioned testing image frame, features described above
Characteristics of human body's behaviour head feature that image block is included.
The people counting device of the present invention, it is also possible to also including artificial judgment unit, by above-mentioned the
The characteristic image block for not having and having in above-mentioned second image block set in one image block set periodically leads to
Cross network and be sent to server, whether artificial judgment features described above image block is remotely carried out by user
For positive sample, will be deemed as not being that the characteristic image block of positive sample is deleted from above-mentioned Sample Storehouse,
And using renewal after above-mentioned Sample Storehouse be trained, to be updated to strong classifier.
The people counting device of the present invention, it is also possible to which above-mentioned strong classifier obtains features described above image
The device of the characteristics of human body included by block is HOG.
The people counting device of the present invention, it is also possible to which above-mentioned Weak Classifier working method is as follows:Obtain
Take continuous n two field pictures;Average is taken to the pixel of above-mentioned n two field pictures, reference background frame is obtained;
Present frame is subtracted each other with reference background frame pixel-by-pixel and obtains differing from frame;Examined by threshold value set in advance
Survey dark circular contour in obtaining difference frame and carry out acquisitor's head feature as head part region.
The present invention can also be a kind of bus passenger flow counting assembly, it is characterised in that:Using right
It is required that any one of 8~12 above-mentioned people counting devices count the number of bus passenger flow.
Invention effect
The demographic method and people counting device of the present invention being capable of automatic lifting accuracy of detection.
Description of the drawings
Fig. 1 is the functional block diagram of embodiments of the present invention 1.
Fig. 2 is the flow chart of embodiments of the present invention 1.
Fig. 3 is the functional block diagram of embodiments of the present invention 2.
Fig. 4 is the flow chart of embodiments of the present invention 2.
Fig. 5 is the fundamental block diagram for illustrating head detection algorithm.
Fig. 6 is the figure for illustrating the method for Weak Classifier.
Specific embodiment
<Embodiment 1>
First embodiments of the present invention 1 are described in detail.Present embodiment is with public transport visitor
Illustrate as a example by flowmeter number system, but be not limited to bus passenger flow number system.
In the present embodiment, for example by carrying out in vertical direction installed in buses roof
The photographic head of collection obtains each two field picture.Bus passenger flow number system is by analyzing photographic head collection
Each two field picture and detected whether human body to carry out passenger flow counting.
During human detection, for the single people occurred in video scene, typically all
Preferably can detect.However, in actual application scenarios, people not always individually goes out
It is existing.For example present embodiment buses peak period, in fact it could happen that multidigit passenger squeeze into
The situation of car door, now, the problem that can occur unavoidably to block between passenger mutually, in this feelings
Under condition, to detect that passenger has certain difficulty exactly.Therefore, will take the photograph in present embodiment
As head is set up in the roof near car door mouth in the way of towards underbody plane, from top shoot into
The passenger for going out car door.
The main cause vertically set up using photographic head is, under vertical photographic head, even if work as taking advantage of
When visitor occurs occlusion issue between limbs, the passenger that gets on or off the bus can be still extracted more complete
Header information.Therefore, the present invention is using the demographic method based on head detection.
Under vertical photographic head, human body head has and is similar to round shape, but different people it
Between there is also difference, even same people is in different positions, nose shape can also change.
Therefore, may be because of being difficult to construct enough templates using the method based on template matching
Verification and measurement ratio is reduced to cover all different nose shapes.Present embodiment is mainly using being based on
The HOG (Histogram of Oriented Gradient, histograms of oriented gradients) of machine learning
Method is trained change tool of the grader for obtaining to nose shape to detect the number of people by head feature
There is certain robustness.
HOG is mainly the gradient direction of localized region and is calculated, then with rectangular histogram retouching
State, i.e., which is a kind of feature descriptor of image local overlapping region.Retouch compared to further feature
State, such as color characteristic, quasi-Haar wavelet feature etc., the advantage that HOG has which unique.
First, HOG feature descriptions can effectively overcome the optics shape of image in less spatial domain
Become and geometric deformation, because HOG is the statistics with histogram to image local area unit.
Secondly, under the conditions of the normalization etc. of region overlapping calculation and regional area, although human body
Head has differences, to different people, different hair styles, even same people is in different positions
Put, shape can also change, but these fine distinctions can't have a strong impact on detection effect
Really.
Therefore, the present invention is main is used as detecting the feature description of human body head from HOG features
Son.
Sample set needed for building sorter model training, is that head detection sorter model was trained
The first step of journey, including positive sample and negative sample, the i.e. selection of head sample and non-head sample.
Head sample is used as training positive sample collection, the quantity which is chosen and relationship between quality to final point
Class device detects the quality of performance.Machine learning algorithm is utilized to train the classification of a function admirable
Device needs to prepare training sample as much as possible, and make its cover it is various it can happen that.
Such as:During training head grader, should cover as far as possible under different illumination conditions, Various Complex background
Pedestrian head;In view of under vertical photographic head, although human body head is similar to round shape,
But difference is there is also, even same people is in different positions, shape can also change, because
This, need to choose different hair styles, diverse location, the human body head of different angles as positive sample,
To reduce even avoiding the occurrence of missing inspection as far as possible.
When non-head sample is chosen, mainly based on the picture comprising parts of body, but,
Exhaustive all of such picture is wanted to be impossible, it is not passenger that can only prepare those as much as possible
Head, but the picture of doubtful head of passenger.
It is due to the head sample-size disunity of Manual interception, unsuitable as the input picture trained,
So the original sample of intercepting must be processed by interpolation etc. that same size is zoomed to,
Such as 32 (pixel) × 32 (pixel).
After positive sample and negative sample is got out, need to extract the HOG features of these samples.
The process for extracting HOG features is as described below.
First, pretreatment is carried out to sample image, in order to reduce shade and the illumination of image local
The interference of change, can first whole image carry out color space standards, before this, generally
Coloured image is converted into into gray-scale maps first.Because, the work of colouring information in subsequent gradients are calculated
With little.Certainly, the contribution due to Image semantic classification to final effect is meagre, description described later
Sub- normalized can also reach similar effect, so this step can also be omitted.
Then, calculate image gradient.The Gradient Features of image are not only insensitive to illumination variation,
And the contour feature of object can be shown.Method most commonly is exactly simple using one one
In the horizontal and vertical directions go respectively by application for the discrete gradient masterplate of dimension.For example with conventional
[- 1,0,1] gradient operator and [1,0, -1]TGradient operator is done convolution algorithm to original image respectively and is obtained
The gradient component in x, y direction, concrete calculation are as follows.
The gradient at pixel (x, y) place is:
Gx(x, y)=H (x+1, y)-H (x-1, y)
Gy(x, y)=H (x, y+1)-H (x, y-1)
In formula, field pixel values of the H (x, y) for input pixel (x, y), Gx(x,y)、Gy(x,
Y) horizontal gradient value and vertical gradient value of the point are represented respectively.The then ladder at pixel (x, y) place
Degree amplitude and gradient direction are shown below:
Then, calculate the gradient orientation histogram of each unit.The step is mainly topography
Region provides a coding, and we divide the image into several units, as the sample for preparing is
32 (pixel) × 32 (pixel), therefore, each unit selection is 4 × 4 pixels.And
By the gradient direction of each unit be divided equally into 9 it is interval.The gradient information of 4 × 4 pixels is calculated,
The gradient direction of each pixel is corresponded to into this 9 interval, the characteristic vectors of 9 dimension of composition.
Then, multiple units are combined into into a big block (block), and by the ladder of each block
Although the Gradient Features that degree rectangular histogram is normalized image are insensitive to local illumination variation,
When region increases, still can be disturbed by illuminance abrupt variation and shade so that gradient intensity becomes
Change increase.This is accomplished by the gradient standardization of localized region.Its ultimate principle is adjacent
Multiple units combine a larger connecting section (blocks).Meanwhile, with block to image
Carry out overlap sampling, i.e., the feature of same unit can repeatedly be calculated in the different blocks,
It is embodied in last characteristic vector with different values after standardization.Although increased superfluous
Remaining information, but so utilize overlapping block and standardized method calculating feature effectively can improve
Classifying quality.
Then, all pieces in image of histogram vectors are collected, the block of region overlap is included,
They are combined, final HOG Feature Descriptors are formed.The head sample for example chosen
This picture size is 32 × 32 pixels, is divided into 8 × 8 and amounts to 64 units, per 2 × 2
Unit constitutes the local message in a block, block with 9 × 4 vector description images for amounting to 36 dimensions.
Collect 7 × 7 blocks for amounting to 49 overlaps on image altogether, so finally produce 1764 tieing up
The Global Information of vector description image.
Final step is exactly that the HOG features extracted are input to SVM (Support Vector
Machine, support vector machine) in grader, an optimal hyperlane is found as decision function.
Based on HOG feature extractions, linear SVM as grader head detection method
Two parts can be divided into:The off-line training step of grader and real-time head detection stage.
Its flow process framework is as shown in Figure 5.
Grader off-line training step:The stage is by being input to substantial amounts of positive Negative training sample
It is trained in supporting vector machine model, obtains for the optimum classifier under these training samples.
Be likely to be multi-categorizer under practical situation, but in the present embodiment, it is only necessary to differentiate head/
Non-head, so training a two classification device using linear SVM.
The real-time head detection stage:The stage is the picture or video sequence for needing detection
Be input in the grader for training, figure is extracted by setting detection window moving step length and scaling
As the dimension scale of window, detection window is allowed to be scanned on different positions, according to classification
The result of decision of device differentiates that these windows are head zone or non-head region, finally in picture
Or labelling is lifted one's head the position in portion in video sequence.
Strong classifier in present embodiment is formed by HOG methods, but it is also possible to use other
Algorithm.As long as the higher algorithm of accuracy rate can be used as strong classifier, for example, can also adopt
The grader of deep learning.Due to accurate using great amount of samples training HOG graders in actually used
Really rate is higher, it is advantageous to.Additionally, so-called " accuracy rate is higher " is relative concept, not
There is clear and definite numerical indication.
In the practical application of the present invention, generally, when passenger flow counting device is installed on buses,
Grader off-line training has been completed in advance, strong classifier has been defined, using the strong classifier
Very high accuracy of detection can be obtained when real-time head detection is counted.But in actually used
It has also been found that still there is missing inspection and flase drop, discovery is analyzed to the situation of these missing inspections, flase drop
Main reason is that the sample size of Sample Storehouse is not sufficient enough, such as certain passenger leaves long hair and makes
Its head is differed greatly with circle (ellipse), and this feature was never present in Sample Storehouse.
But as the passenger flow counting device overwhelming majority time on buses is in offline
State, can not update grader to improve precision at any time, and existing equipment also cannot oneself in addition
Judge whether to there occurs missing inspection/flase drop and sample record when there is missing inspection/flase drop is got off.This makes
Existing passenger flow counting device generally existing once installation after its accuracy of detection with regard to unique fixation
High-precision problem cannot further be put forward.
In this regard, the present inventor is by the strong classification in strong learning algorithm as above-mentioned utilization HOG
The Weak Classifier that a weak learning algorithm is added on the basis of device makees the sample of missing inspection in real time
It is appended in the Sample Storehouse of strong classifier for positive sample, and using the Sample Storehouse after updating automatically
Re-start the training strong classifier higher to obtain precision.Thereby, it is possible to constantly improve visitor
The precision of flowmeter counting apparatus.
As the example of a Weak Classifier, for example, can realize as follows.Obtain continuous n
Two field picture;Average is taken to the pixel of above-mentioned n two field pictures, reference background frame is obtained;By present frame
Subtract each other with reference background frame pixel-by-pixel and obtain differing from frame;Carry out judging by threshold value set in advance
To binary map;During in binary map, detection obtains difference frame, dark circular contour is used as person head area
Domain.
The rectangular area of size is specified in binary map, the method for judging wherein whether to have circular contour
For example it is as described below.
As shown in fig. 6, there was only two kinds of pixel colors in binary map:Black and white.If the number of people
Portion region is black.
The center superposition of rectangle A1 and circle A2.
A) for A1, wherein sum of all pixels W*H=N1, height of the W for A1 are calculated, H is
The width of A1,
Assume that the black number of pixels in A1 is B1;
B) for A2, the number for calculating wherein pixel is about (W/2)2* Pi=N2,
Assume that the black number of pixels in A2 is B2;
If c) following condition meets, judge that A2 centers are personnel's head center, while former
Positive sample of the A1 regions in figure as person head:
B2>n2*N2;
B1<n1*N2。
Binary map is traveled through by said method, find out Weak Classifier and be considered person head
Position.
Wherein, above-mentioned n1 and n2 take the real number close to 1, and representative value is exactly 1.
N1 and n2 can be used for the classifying quality for controlling Weak Classifier;N1*n2/ (n1+n2) is closer to
1/2, then Weak Classifier classification is stricter, it is contemplated that the positive sample of detection is fewer.
Weak Classifier compared with strong classifier, due to being simple pattern match, so loss
Certainly it is higher than strong classifier, but it depends on Sample Storehouse unlike strong classifier, so
Can recognize that strong classifier None- identified based on Sample Storehouse head out.By by weak point
The recognition result of class device is compared with the recognition result of strong classifier, by the identification of Weak Classifier
As a result it is middle presence and in the recognition result of strong classifier non-existent recognition result as positive sample mend
It is charged in the Sample Storehouse of strong classifier, makes the strong classifier that original accuracy of detection is fixed also can
Momentarily updated.Also, Weak Classifier can be controlled by above-mentioned control parameter n1, n2
Accuracy of detection, it is to avoid there is excessive non-positive sample and added to strong classifier as positive sample
In Sample Storehouse.
Below the specific structure and flow process of present embodiment are illustrated.
Fig. 1 is the functional block diagram of embodiments of the present invention 1.
In Fig. 1,11 is image acquisition unit, obtains each testing image frame in real time.In this enforcement
In mode, for example, installed in buses roof by camera lens towards in the way of ground level from top
The photographic head being acquired.
12 is strong classifier, is processed with strong learning algorithm.Strong classifier 12 advance with by
The Sample Storehouse A that the positive sample of the characteristic image block comprising head part's feature and negative sample are constituted is carried out
Train and obtain.The real-time each testing image frame for obtaining can be carried out time using strong classifier 12
Go through, so as to obtain the image block set of the set as the characteristic image block comprising head part's feature
B。
13 is Weak Classifier, is processed with weak learning algorithm.Weak Classifier 13 is although loss
Higher than strong classifier, but the positive sample not having in being obtained in that strong classifier.Using weak typing
Device 13 can be traveled through to the real-time each testing image frame for obtaining, so as to obtain as comprising people
The image block set C of the set of the characteristic image block of head feature.
14 is grader updating block, to the element in image block set B and image block set C
It is compared.If there is the element for having and not having in image block set B in image block set C,
Then it is added to these elements as new positive sample in the Sample Storehouse A of strong classifier, obtains sample
This storehouse E, and be trained using Sample Storehouse E, to be updated to strong classifier.
15 is number statistic unit, using the strong classifier after renewal to each to be measured of real-time acquirement
Picture frame carries out real-time head detection, and statistics obtains number.
Below the idiographic flow of embodiment 1 is illustrated.
The process step of embodiment 1 is as shown in Figure 2.
First, in image acquisition step S21, obtained by image acquisition unit 11 in real time and respectively treated
Altimetric image frame.In the present embodiment, for example by installed in buses roof with camera lens face
Each two field picture is obtained to the photographic head that the mode of ground level is acquired from top.
Then, in step S22, using 12 pairs of each testing images for obtaining in real time of strong classifier
Frame is traveled through, so as to obtain the figure of the set as the characteristic image block comprising head part's feature
As set of blocks B.As described above, strong classifier 12 is processed with strong learning algorithm.It is strong to classify
Device 12 is by advancing with by the positive sample and negative sample of the characteristic image block comprising head part's feature
Sample Storehouse A is trained and obtains.In the present embodiment, strong used by strong classifier 12
Habit algorithm is HOG.
Then, in step S23, using 13 pairs of each testing images for obtaining in real time of Weak Classifier
Frame is traveled through, and obtains the image block of the set as the characteristic image block comprising head part's feature
Set C.As described above, Weak Classifier is processed with weak learning algorithm.Although Weak Classifier
13 loss is higher than strong classifier 12, but does not just have during it is obtained in that strong classifier 12
Sample.
Then, in step S241, by grader updating block 14 to image block set B and
Image block set C is compared.Set subtraction D=B-C is.If the element number in D
It is not 0, that is, the element for having and not having in B in there is C branches to step S242, by D
Element be added in Sample Storehouse A, obtain Sample Storehouse E.Then using sample in step S243
This storehouse E re-starts training, updates strong classifier.
Finally, in step s 25, respectively the treating to real-time acquirement using the strong classifier after renewal
Altimetric image frame carries out real-time head detection, and statistics obtains number.
According to present embodiment, constantly strong classifier can be updated, automatically improve strong
The accuracy of detection of grader.
(embodiment)
Below a specific embodiment of the present invention is illustrated.
In the present embodiment, image acquisition unit 11 is regarded using model Haikang prestige
The 600 line photographic head of DS-2CE5582P-IRP, installed in buses roof, apart from underbody face
It is about high 2.5 meters.The optical axis of the stationary lens of photographic head and the angle of plumb line<25 degree, with camera lens
Mode towards ground level is acquired from top.
As described above, by using the positive sample by head zone pixel characteristic and negative sample structure
Into Sample Storehouse (A) be trained obtained by strong classifier based on HOG to photographic head reality
When each testing image frame for obtaining traveled through, obtain the characteristic image block comprising head part's feature
Set (B);Using the Weak Classifier processed based on above-mentioned weak learning algorithm to real-time
The each testing image frame for obtaining is traveled through, and obtains the characteristic image block comprising head part's feature
Set (C);The characteristic image block conduct that will have and not have in gathering (B) in set (C)
Positive sample is added in Sample Storehouse (A), re-starts training, strong classifier is updated;
Real-time head detection is carried out using the strong classifier after renewal, statistics obtains number.
Actual product is tested.Only do not used using strong classifier in test first weak
Grader, obtains accuracy of detection 80% or so.Then and with strong classifier and Weak Classifier (from
Line use), i.e. the method for the present embodiment, discovery can add 5% or so and not detected by HOG
Positive sample.As in bus passenger flow, passenger has sizable multiplicity, so add 5% more
Sample has very big meaning for follow-up statistical accuracy.
<Embodiment 2>
Then embodiments of the present invention 2 are described in detail.To embodiment 2 and enforcement
1 identical part of mode marks identical label and omits the description.
As illustrated in embodiment 1, Weak Classifier is the study weaker than strong classifier
Algorithm, although positive sample can be supplemented in strong classifier, to the positive sample supplemented can
Query is left by property, now by these samples are sent back server regularly, by manually entering
Row is further to be judged to significantly improve reliability.
Fig. 3 is the functional block diagram of embodiments of the present invention 2.As shown in figure 3, this embodiment party
Formula 2 has added artificial judgment unit 16 compared with embodiment 1.Artificial judgment unit 16
By network and including image acquisition unit 11, strong classifier 12, Weak Classifier 13, grader
The passenger flow counting device front end connection of updating block 14 and demographics unit 15.By image block
The element for having and not having in image block set B in set C is periodically sent to server by network,
Carry out whether artificial judgment element is positive sample by user, will be deemed as the element for not being positive sample
Delete from Sample Storehouse E, obtain Sample Storehouse G, and be trained using Sample Storehouse G, it is right to come
Strong classifier is updated.
The process step of embodiment 2 is as shown in Figure 4.
As shown in figure 4, the flow process of present embodiment 2 is roughly the same with embodiment 1, difference
It is also to have added step S261 and step S262.
In step S261, the element of D is regularly sent to into server by network, by remote
The user of journey carries out whether artificial judgment element is positive sample, is then labeled as 1 if positive sample,
0 is labeled as then if not positive sample.
In step S262, the result of above-mentioned labelling is sent back to passenger flow counting device front end, visitor
Flowmeter counting apparatus front end deleted from Sample Storehouse E according to labelling be marked as be not positive sample sample
This, obtains Sample Storehouse G.
Then training is re-started using Sample Storehouse G in step S263, to enter to strong classifier
Row updates.
According to present embodiment, the accuracy of detection of strong classifier can be further improved.
The above be only the present invention preferred embodiment, it is noted that for this area
Technical staff for, without departing from the principle of the invention and basis on the premise of, can also make
Some improvement, retouching, exchonge step combination etc., these improve, retouch, exchonge step combination
Etc. should also be protection scope of the present invention.
It will be understood by those skilled in the art that the present invention can be provided as method, system or calculate
Machine program product.The present invention can realize by hardware completely, be realized by software completely, or combine
Software and hardware is realizing.And, the present invention can include calculating using at one or more
Machine usable program code computer-usable storage medium (including but not limited to disk memory,
CD-ROM, optical memory etc.) on the form of computer program implemented.
The present invention is according to the method for the specific embodiment of the invention, system or computer program
The flow chart and/or block diagram of product is describing.It should be understood that can be by computer program instructions reality
Each flow process and/or square frame and flow chart and/or block diagram in existing flow chart and/or block diagram
In flow process and/or square frame combination.These computer program instructions can be supplied to general meter
The process of calculation machine, special-purpose computer, Embedded Processor or other programmable data processing devices
Device is realizing one by the computing device of computer or other programmable data processing devices
Instruction is produced for realizing in one square frame of one flow process of flow chart or multiple flow processs and/or block diagram
Or the device of the function of specifying in multiple square frames.
These computer program instructions can also be stored in and can guide computer or other programmable numbers
According in the computer-readable memory that processing equipment is worked in a specific way so that be stored in the meter
Instruction in calculation machine readable memory produces the manufacture for including command device, the command device reality
Present one flow process of flow chart or one square frame of multiple flow processs and/or block diagram or multiple square frame middle fingers
Fixed function.
These computer program instructions can also be loaded into computer or other programmable datas are processed
On equipment so that series of operation steps is performed on computer or other programmable devices to produce
The computer implemented process of life, so as to the instruction performed on computer or other programmable devices
There is provided for realizing in one square frame or many of one flow process of flow chart or multiple flow processs and/or block diagram
The step of function of specifying in individual square frame.
Industrial utilizability
The present invention demographic method and people counting device can automatic lifting accuracy of detection,
The various regions for needing statistical number of person such as market, hospital can be applied to, particularly with public transport visitor
Stream statistics are highly useful.
Claims (13)
1. a kind of demographic method based on graphical analyses, it is characterised in that include:
The image acquisition step of each testing image frame is obtained in real time;
Grader updates step, and strong classifier and Weak Classifier pair are utilized during human detection
The each testing image frame for obtaining in real time is analyzed, wherein, the strong classifier is to advance with
The Sample Storehouse being made up of the positive sample and negative sample of the characteristic image block comprising characteristics of human body is instructed
Obtained by white silk, processed with strong learning algorithm, the Weak Classifier is obtained in that the sample
The positive sample not having in storehouse, is processed with weak learning algorithm,
The characteristic image block that will be detected and can not be detected by strong classifier by the Weak Classifier
It is added in the Sample Storehouse as new positive sample, and using the Sample Storehouse weight after updating
Newly it is trained, to be updated to the strong classifier;With
The strong classifier after using renewal is carried out to the real-time each described testing image frame for obtaining
Real-time body detects that statistics obtains the demographics step of number.
2. demographic method as claimed in claim 1, it is characterised in that:
The grader updates step to be included:
The real-time each described testing image frame for obtaining is traveled through using the strong classifier, obtained
To the set as the characteristic image block the first image block set the step of;
The real-time each described testing image frame for obtaining is traveled through using Weak Classifier, made
For the set of the characteristic image block the second image block set the step of;With
Characteristic image block in described first image set of blocks and second image block set is entered
Row compares, if there is not having and second image block set in described first image set of blocks
In the characteristic image block that has, then these characteristic image blocks are added to as new positive sample described
In the Sample Storehouse of strong classifier, and using renewal after the Sample Storehouse re-start training,
The step of to be updated to strong classifier.
3. demographic method as claimed in claim 2, it is characterised in that:
In described image acquisition step, using by camera lens towards the shooting set up in the way of ground level
Head obtains each testing image frame from top,
Characteristics of human body's behaviour head feature that the characteristic image block is included.
4. demographic method as claimed in claim 2 or claim 3, it is characterised in that:
Also include artificial judgment step, will not have in described first image set of blocks and described second
The characteristic image block having in image block set is periodically sent to server by network, remote by user
Whether characteristic image block described in Cheng Jinhang artificial judgments is positive sample, will be deemed as not being positive sample
Characteristic image block delete from the Sample Storehouse, and using renewal after the Sample Storehouse carry out
Training, to be updated to strong classifier.
5. the demographic method as any one of claim 2~4, it is characterised in that:
The strong classifier obtains the method for the characteristics of human body included by the characteristic image block
HOG。
6. the demographic method as described in claim 3 or 4, it is characterised in that:
The Weak Classifier working method is as follows:Obtain continuous n two field pictures;To the n frames figure
The pixel of picture takes average, obtains reference background frame;By present frame pixel-by-pixel with reference background frame phase
Subtract and obtain differing from frame;Dark circular contour in difference frame is obtained by threshold test set in advance to be used as
Head part carrys out in region acquisitor's head feature.
7. a kind of bus passenger flow method of counting, it is characterised in that:
Using the demographic method statistics bus passenger flow any one of claim 1~6
Number.
8. a kind of people counting device based on graphical analyses, it is characterised in that:
The image acquisition unit of each testing image frame is obtained in real time;
The real-time each described testing image frame for obtaining is traveled through, is obtained as the characteristic pattern
As the strong classifier of the first image block set of the set of block, the strong classifier is to advance with
The Sample Storehouse being made up of the positive sample and negative sample of the characteristic image block comprising characteristics of human body is instructed
Obtained by white silk, processed with strong learning algorithm;
The real-time each described testing image frame for obtaining is traveled through, is obtained as the characteristic pattern
As the Weak Classifier of the second image block set of the set of block, the Weak Classifier is obtained in that institute
The positive sample not having in stating Sample Storehouse, is processed with weak learning algorithm;
Grader updating block, to described first image set of blocks and second image block set
In characteristic image block be compared, if there is not having and institute in described first image set of blocks
The characteristic image block having in stating the second image block set, then using these characteristic image blocks as new
Positive sample is added in the Sample Storehouse of the strong classifier, and using the sample after updating
This storehouse re-starts training, to be updated to strong classifier;With
The strong classifier after using renewal is carried out to the real-time each described testing image frame for obtaining
Real-time body detects that statistics obtains the demographics unit of number.
9. people counting device as claimed in claim 8, it is characterised in that:
Described image acquisition unit is to obtain each towards setting up in the way of ground level from top by camera lens
The photographic head of the testing image frame,
Characteristics of human body's behaviour head feature that the characteristic image block is included.
10. people counting device as claimed in claim 8 or 9, it is characterised in that:
Also include artificial judgment unit, will not have in described first image set of blocks and described second
The characteristic image block having in image block set is periodically sent to server by network, remote by user
Whether characteristic image block described in Cheng Jinhang artificial judgments is positive sample, will be deemed as not being positive sample
Characteristic image block delete from the Sample Storehouse, and using renewal after the Sample Storehouse carry out
Training, to be updated to strong classifier.
11. people counting devices as any one of claim 8~10, it is characterised in that:
The strong classifier obtains the device of the characteristics of human body included by the characteristic image block
HOG。
12. people counting devices as described in claim 9 or 10, it is characterised in that:
The Weak Classifier working method is as follows:Obtain continuous n two field pictures;To the n frames figure
The pixel of picture takes average, obtains reference background frame;By present frame pixel-by-pixel with reference background frame phase
Subtract and obtain differing from frame;Dark circular contour in difference frame is obtained by threshold test set in advance to be used as
Head part carrys out in region acquisitor's head feature.
A kind of 13. bus passenger flow counting assemblys, it is characterised in that:
Using the people counting device statistics bus passenger flow any one of claim 8~12
Number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510649524.8A CN106570440A (en) | 2015-10-09 | 2015-10-09 | People counting method and people counting device based on image analysis |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510649524.8A CN106570440A (en) | 2015-10-09 | 2015-10-09 | People counting method and people counting device based on image analysis |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106570440A true CN106570440A (en) | 2017-04-19 |
Family
ID=58507694
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510649524.8A Pending CN106570440A (en) | 2015-10-09 | 2015-10-09 | People counting method and people counting device based on image analysis |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106570440A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107194418A (en) * | 2017-05-10 | 2017-09-22 | 中国科学院合肥物质科学研究院 | A kind of Aphids in Rice Field detection method based on confrontation feature learning |
CN108804987A (en) * | 2017-05-04 | 2018-11-13 | 株式会社日立制作所 | Door open and-shut mode detection method and device and stream of people's detecting system |
CN108830145A (en) * | 2018-05-04 | 2018-11-16 | 深圳技术大学(筹) | A kind of demographic method and storage medium based on deep neural network |
CN110895037A (en) * | 2019-12-01 | 2020-03-20 | 王娟 | Real-time correction system for cold air amplitude |
CN112257797A (en) * | 2020-10-29 | 2021-01-22 | 瓴盛科技有限公司 | Sample image generation method of pedestrian head image classifier and corresponding training method |
JP2022537865A (en) * | 2020-05-28 | 2022-08-31 | ベイジン・センスタイム・テクノロジー・デベロップメント・カンパニー・リミテッド | Object counting method, device, electronic device, storage medium and program |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102831473A (en) * | 2012-08-03 | 2012-12-19 | 无锡慧眼电子科技有限公司 | People counting method based on monocular vision |
CN103208008A (en) * | 2013-03-21 | 2013-07-17 | 北京工业大学 | Fast adaptation method for traffic video monitoring target detection based on machine vision |
CN103593672A (en) * | 2013-05-27 | 2014-02-19 | 深圳市智美达科技有限公司 | Adaboost classifier on-line learning method and Adaboost classifier on-line learning system |
CN103871082A (en) * | 2014-03-31 | 2014-06-18 | 百年金海科技有限公司 | Method for counting people stream based on security and protection video image |
CN104063713A (en) * | 2014-07-04 | 2014-09-24 | 中国地质大学(武汉) | Semi-autonomous on-line studying method based on random fern classifier |
CN104156983A (en) * | 2014-08-05 | 2014-11-19 | 天津大学 | Public transport passenger flow statistical method based on video image processing |
US10009579B2 (en) * | 2012-11-21 | 2018-06-26 | Pelco, Inc. | Method and system for counting people using depth sensor |
-
2015
- 2015-10-09 CN CN201510649524.8A patent/CN106570440A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102831473A (en) * | 2012-08-03 | 2012-12-19 | 无锡慧眼电子科技有限公司 | People counting method based on monocular vision |
US10009579B2 (en) * | 2012-11-21 | 2018-06-26 | Pelco, Inc. | Method and system for counting people using depth sensor |
CN103208008A (en) * | 2013-03-21 | 2013-07-17 | 北京工业大学 | Fast adaptation method for traffic video monitoring target detection based on machine vision |
CN103593672A (en) * | 2013-05-27 | 2014-02-19 | 深圳市智美达科技有限公司 | Adaboost classifier on-line learning method and Adaboost classifier on-line learning system |
CN103871082A (en) * | 2014-03-31 | 2014-06-18 | 百年金海科技有限公司 | Method for counting people stream based on security and protection video image |
CN104063713A (en) * | 2014-07-04 | 2014-09-24 | 中国地质大学(武汉) | Semi-autonomous on-line studying method based on random fern classifier |
CN104156983A (en) * | 2014-08-05 | 2014-11-19 | 天津大学 | Public transport passenger flow statistical method based on video image processing |
Non-Patent Citations (2)
Title |
---|
蒋先刚: "《数字图像模式识别工程项目研究》", 31 March 2014, 西南交通大学出版社 * |
辛颖: ""基于DSP的视觉客流检测系统研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108804987A (en) * | 2017-05-04 | 2018-11-13 | 株式会社日立制作所 | Door open and-shut mode detection method and device and stream of people's detecting system |
CN108804987B (en) * | 2017-05-04 | 2023-03-10 | 株式会社日立制作所 | Door opening and closing state detection method and device and people flow detection system |
CN107194418A (en) * | 2017-05-10 | 2017-09-22 | 中国科学院合肥物质科学研究院 | A kind of Aphids in Rice Field detection method based on confrontation feature learning |
CN107194418B (en) * | 2017-05-10 | 2021-09-28 | 中国科学院合肥物质科学研究院 | Rice aphid detection method based on antagonistic characteristic learning |
CN108830145A (en) * | 2018-05-04 | 2018-11-16 | 深圳技术大学(筹) | A kind of demographic method and storage medium based on deep neural network |
CN110895037A (en) * | 2019-12-01 | 2020-03-20 | 王娟 | Real-time correction system for cold air amplitude |
JP2022537865A (en) * | 2020-05-28 | 2022-08-31 | ベイジン・センスタイム・テクノロジー・デベロップメント・カンパニー・リミテッド | Object counting method, device, electronic device, storage medium and program |
CN112257797A (en) * | 2020-10-29 | 2021-01-22 | 瓴盛科技有限公司 | Sample image generation method of pedestrian head image classifier and corresponding training method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110188807B (en) | Tunnel pedestrian target detection method based on cascading super-resolution network and improved Faster R-CNN | |
CN106910203B (en) | The quick determination method of moving target in a kind of video surveillance | |
CN106570440A (en) | People counting method and people counting device based on image analysis | |
CN105373135B (en) | A kind of method and system of aircraft docking guidance and plane type recognition based on machine vision | |
CN108288033B (en) | A kind of safety cap detection method based on random fern fusion multiple features | |
CN103632158B (en) | Forest fire prevention monitor method and forest fire prevention monitor system | |
CN104091176B (en) | Portrait comparison application technology in video | |
CN111881730A (en) | Wearing detection method for on-site safety helmet of thermal power plant | |
CN106991668B (en) | Evaluation method for pictures shot by skynet camera | |
CN105844234A (en) | People counting method and device based on head shoulder detection | |
CN106600631A (en) | Multiple target tracking-based passenger flow statistics method | |
CN109543542A (en) | A kind of determination method whether particular place personnel dressing standardizes | |
CN109918971B (en) | Method and device for detecting number of people in monitoring video | |
CN105404857A (en) | Infrared-based night intelligent vehicle front pedestrian detection method | |
CN106709903B (en) | PM2.5 concentration prediction method based on image quality | |
CN107301378A (en) | The pedestrian detection method and system of Multi-classifers integrated in image | |
CN112287827A (en) | Complex environment pedestrian mask wearing detection method and system based on intelligent lamp pole | |
CN103729620B (en) | A kind of multi-view pedestrian detection method based on multi-view Bayesian network | |
CN105022999A (en) | Man code company real-time acquisition system | |
CN111242096B (en) | People number gradient-based people group distinguishing method | |
CN112071084A (en) | Method and system for judging illegal parking by utilizing deep learning | |
CN106023199B (en) | A kind of flue gas blackness intelligent detecting method based on image analysis technology | |
CN111091110A (en) | Wearing identification method of reflective vest based on artificial intelligence | |
CN115482474B (en) | Bridge deck vehicle load identification method and system based on aerial image | |
CN106548131A (en) | A kind of workmen's safety helmet real-time detection method based on pedestrian detection |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170419 |