Population flow detection device and detection method
Technical field
The present invention relates to technical field of image processing, detection device height, effectively can be automatically adjusted more particularly, to one kind
Simplify image processing method, reduce enforcement difficulty, improve Detection accuracy, the population flow detection device for reducing cost and detection side
Method.
Background technology
With the improvement of living condition, the trip requirements of people increasingly increase.Many scenic spots, urban central zone all occur
Crowded situation.For trip of making rational planning for, resource utilization, improvement service quality are improved, to densely populated place location
The detection for carrying out flow of the people is imperative with monitoring.
Current main detection method includes artificial counting method, video analysis method.Artificial counting method is due to flow of personnel frequency
It is numerous, arbitrariness is also big causes practical operation difficulty, inefficiency, error very big.And video analysis rule due to different builds, wear
It, environmental aspect etc. can all influence testing result;If flow of the people is very intensive, the mounting height of detection device, which also becomes, influences inspection
An important factor for surveying result, and the processing speed of analytical equipment is limited to, current testing result is still not satisfactory.
Invention content
The goal of the invention of the present invention is to overcome image processing method complexity of the prior art, operating difficulties, efficiency
Lowly, the deficiency that error is larger, cost is higher, detection device height can be automatically adjusted, effectively simplify at image by providing one kind
Reason method, the population flow detection device and detection method reduce enforcement difficulty, improve Detection accuracy, reducing cost.
To achieve these goals, the present invention uses following technical scheme:
A kind of population flow detection device, including image grabber and processor;Image grabber includes people's row pressure detecting
Device, people's row pressure detector are connect by fluid pipeline with cylinder, the guide sleeve being connect with cylinder and the guide rail being adapted to guide sleeve, with
The infrared thermography and the automatic range finder on infrared thermography of guide sleeve connection;Processor includes image acquisition mould
Block, parameter setting module, image processing module, target tracking module and demographics module;Image grabber and processor electricity
Connection.
Preferably, people's row pressure detector includes walkway upper plate and walkway bottom plate;Walkway upper plate with
Seal cavity is equipped between the bottom plate of walkway, be equipped in seal cavity several respectively with walkway upper plate and walkway
The spring of bottom plate connection, fills out in seal cavity hydraulically full, and fluid pipeline is located in seal cavity.
Preferably, cylinder includes the cylinder body with fluid pipeline unicom, the gas vent on cylinder body, in cylinder body
Resetting spring, resetting spring one end connect with cylinder piston, and the resetting spring other end is connect with cylinder body, the fixation of cylinder piston
Frame is connect with guide sleeve;Guide sleeve is moved up and down along guide rail.
Preferably, infrared thermography is mounted on the top of area to be tested, area to be detected is obtained in a manner of top view angle
The image in domain;Image output frequency is more than 5Hz, and pixel output has linear close with the temperature value of corresponding detection zone in image
System.
A kind of detection method based on population flow detection device, includes the following steps:
(5-1) if stream of people's metric density is larger, walkway upper plate is pressed down against, and the liquid in seal cavity passes through liquid line
Road flows into cylinder, and the liquid-driving cylinder piston in cylinder moves up, and cylinder piston drives guide sleeve to move up, infrared heat into
As instrument moves up, the visual angle of bigger and clearer image are obtained;
(5-2) automatic range finder measures infrared thermography to the right angle setting height of bottom surface;
(5-3) initialization detection needed for parameter, including mounting height, infrared thermography visual angle, pedestrian's shape parameter,
Walking parameter, detection line parameter;Mounting height is set as the right angle setting height of the infrared thermography of automatic range finder measurement,
Infrared thermography visual angle includes infrared camera horizontal view angle θ, vertical angle of view γ, infrared camera horizontal pixel R and vertical
Pixel C, pedestrian's shape parameter include average height H, mean breadth W and average length L, and wherein average height takes average shoulder high
Degree, mean breadth take average shoulder width, and average length takes average trunk longitudinal separation;Parameter of walking includes walking average speed
With running average speed;Detection line parameter is mainly the arbitrary broken line being detected in region;
(5-4) image collection module reads the data of infrared thermography, according to the mean values of output data, by exporting
The linear relationship of value and temperature converts to obtain the mean temperature T in current region to be measured;Detection threshold value δ is determined by mean temperature T, is carried on the back
Scape temperature is closer to human body temperature, and detection threshold value is smaller, and ambient temperature differs bigger with human body temperature, and threshold value is bigger;
(5-5) is considered as background with averaging method background modeling, by preceding m frame image datas, records the output valve square of m frame pixels
Battle array gk, k=1 ... m are put into a queue, ask for the average value G of each pixel of m group images, hereafter, every n frame images,
The part update of pedestrian area will be not detected in image in queue, asking for the average value G of newest m groups image as background,
And so on dynamic update background;
(5-6) for the first time after the completion of background modeling, the image and the background model image progress of foundation that every frame is newly obtained are poor
Value calculates, and obtains foreground image;
(5-7) pre-processes foreground image, and independent detection zone is considered as to each pedestrian area in present image
Domain;
(5-8) obtains regional extent, regional center, regional extent is current pedestrian's infrared image area according to pedestrian area
Domain, regional center coordinate is current pedestrian position, using regional extent and regional center coordinate as present image analysis result;
(5-9) image analysis result is compared with historical position statistical result, according to comparing result carry out target with
Track;
(5-10) if do not found in historical position statistical result with the matched pedestrian of present image analysis result, depending on
For newly enter detection zone pedestrian, record newly into detection zone pedestrian initial position, into the moment, every time movement side
To data;If do not found in present image analysis result with pedestrian matched in historical position statistical result, be considered as
There is pedestrian to leave detection zone;Will in present image analysis result matching and the pedestrian image analysis result update that newly enters to going through
In history location status;
(5-11) has detected that pedestrian leaves detection zone, then judges whether pedestrian's initial position, historical position distinguish position
The both sides of detection line in parameter setting module:If pedestrian's initial position, historical position are located at the both sides of detection line respectively,
Then corresponding to a direction count value increases;Otherwise count value is constant, final updating count results;
(5-12) periodically updates background model, if present image has the region for detecting pedestrian, with existing background mould
Value in type in corresponding region is replaced, and forms new complete background image update model;
(5-13) updates corresponding parameter if parameter modification occurs for present image;Step (5-4) is come back to continue to hold
Row.
Preferably, step (5-7) includes the following steps:
(6-1) is according to detection threshold value δ by foreground image binary conversion treatment;
Foreground information handling result using closing operation, is avoided being unevenly distributed or being taken due to human body temperature by (6-2)
Decorations, which block, leads to pending area unobvious;
The mean breadth W of pedestrian, average length L are transformed into the detection width w under average height H by (6-3)H, detection length
Spend lH;Under average height, the actual range of each pixel representativeWherein, θ is horizontal for infrared camera
Visual angle, R are infrared camera horizontal pixel point;
Then the detection width under actual installation height is wH=W/dH, lH=L/dH;
If pending area is more than detection width wHWith detection length lHRange, with detection width or detection length pair
Unicom region is split.
Preferably, step (5-9) includes the following steps:
(7-1) target following uses joint probability method:Present image analysis result is calculated respectively to tie with historical position statistics
In fruit, the motion feature P per twin targetMWith provincial characteristics PSSimilar joint probability P, PMAnd PS;
P=PM·PS
Wherein, motion feature includes displacement distance, current pedestrian position and history moving direction deviation;Provincial characteristics includes
Statistics with histogram information;The probability P that displacement distance meets average moving distance is calculated respectivelyvAnd the history moving direction goodness of fit
Probability Po, histogram similarity probability PH;
PM=PV·PO
PS=PH
(7-2) historical position statistical result has m people, and present image detects that pedestrian has n people, then obtains the identical general of mn
Rate matrix is as follows:
It is matched line by line from high to low by overall identical probability, the probability highest that the i-th row jth arranges in probability matrix of coincideing, then
J-th of present image is matched with i-th in history image;Then other row P are enabledxj=0, x=1 ... m, x ≠ i, and continuation
With remaining most probable value, each movement position of the pedestrian in present image in historical position statistical result is determined successively;
It is extremely low with probability, be considered as in present image newly enter or historical position result in leave the pedestrian in region to be measured.
Therefore, the present invention has the advantages that:The present invention can be according to the size adjust automatically detection device of flow of the people
Such as the height of infrared thermography, the image that infrared thermography captures is more clear, reduces analytical error;It need not be directed to
Different height re-establishes model analysis;The detection method of the present invention is easy to implement, and accuracy is high, easy of integration to be set in infrared video
In standby;It is effective to simplify image processing method, enforcement difficulty is reduced, Detection accuracy is improved, reduces cost.
Description of the drawings
Fig. 1 is a kind of structure diagram of the image grabber of the present invention;
Fig. 2 is a kind of composition schematic diagram of the detection device of the present invention;
Fig. 3 is a kind of composition schematic diagram of the processor of the present invention;
Fig. 4 is a kind of detection zone schematic diagram of the present invention;
Fig. 5 is a kind of flow diagram of the detection method of the present invention.
In figure:Image grabber 1, processor 2, people's row pressure detector 3, fluid pipeline 4, cylinder 5, guide sleeve 6, guide rail 7,
Infrared thermography 8, automatic range finder 9, walkway upper plate 10, walkway bottom plate 11, seal cavity 12, spring 13, cylinder
Body 14, gas vent 15, resetting spring 16, cylinder piston 17, fixed frame 18.
Specific embodiment
The present invention will be further described with reference to the accompanying drawings and detailed description.
Embodiment as shown in Figure 1 and Figure 2 is a kind of population flow detection device, including image grabber 1 and processor 2;Figure
Picture getter includes people's row pressure detector 3, and people's row pressure detector is connect with cylinder 5 by fluid pipeline 4, connect with cylinder
Guide sleeve 6 and the guide rail 7 that is adapted to guide sleeve, the infrared thermography 8 being connect with guide sleeve and on infrared thermography from
Dynamic rangefinder 9;Processor shown in Fig. 3 includes image collection module, parameter setting module, image processing module, target following
Module and demographics module;Image grabber and processor electrical connection.People's row pressure detector includes walkway upper plate 10
With walkway bottom plate 11;Seal cavity 12 is equipped between walkway upper plate and walkway bottom plate, is equipped in seal cavity
Several springs 13 being connect respectively with walkway upper plate and walkway bottom plate fill out hydraulically full, liquid in seal cavity
Pipeline is located in seal cavity.Cylinder includes the cylinder body 14 with fluid pipeline unicom, and the gas vent 15 on cylinder body is set on
Resetting spring 16 in cylinder body, resetting spring one end are connect with cylinder piston 17, and the resetting spring other end is connect with cylinder body, cylinder
The fixed frame 18 of piston is connect with guide sleeve;Guide sleeve is moved up and down along guide rail.
Infrared thermography shown in Fig. 4 is mounted on the top of area to be tested, and area to be detected is obtained in a manner of top view angle
The image in domain;Image output frequency is more than 5Hz, and pixel output has linear close with the temperature value of corresponding detection zone in image
System.
A kind of detection method based on population flow detection device as shown in Figure 5, includes the following steps:
Step 100, if stream of people's metric density is larger, walkway upper plate is pressed down against, and the liquid in seal cavity passes through liquid
Body pipeline flows into cylinder, and the liquid-driving cylinder piston in cylinder moves up, and cylinder piston drives guide sleeve to move up, infrared
Thermal imaging system moves up, and obtains the visual angle of bigger and clearer image;
Step 200, automatic range finder measures infrared thermography to the right angle setting height on ground;
Step 300, the parameter needed for initialization detection, including mounting height, infrared thermography visual angle, pedestrian's build ginseng
Number, walking parameter, detection line parameter;The right angle setting that mounting height is set as the infrared thermography of automatic range finder measurement is high
Degree, infrared thermography visual angle include infrared camera horizontal view angle θ, vertical angle of view γ, infrared camera horizontal pixel R and hang down
Straight pixel C, pedestrian's shape parameter include average height H, mean breadth W and average length L, and wherein average height takes average shoulder
Highly, mean breadth takes average shoulder width, and average length takes average trunk longitudinal separation;Parameter of walking includes the average speed of walking
Degree and running average speed;Detection line parameter is mainly the arbitrary broken line being detected in region;
Step 400, image collection module reads the data of infrared thermography, according to the mean values of output data, by
The linear relationship of output valve and temperature converts to obtain the mean temperature T in current region to be measured;Detection threshold value is determined by mean temperature T
δ, ambient temperature is closer to human body temperature, and detection threshold value is smaller, and ambient temperature differs bigger with human body temperature, and threshold value is bigger;
Step 500, with averaging method background modeling, preceding m frame image datas is considered as background, record the output of m frame pixels
Value matrix gk, k=1 ... m are put into a queue, the average value G of each pixel of m group images are asked for, hereafter, every n frame figures
Picture will be not detected in the part update to queue of pedestrian area in image, ask for the average value G of newest m groups image as the back of the body
Scape, and so on dynamic update background;
Step 600, for the first time after the completion of background modeling, the image that every frame is newly obtained is carried out with the background model image established
Mathematic interpolation obtains foreground image;
Step 700, foreground image is pre-processed, each pedestrian independent detection zone being considered as in present image
Region;
Step 710, according to detection threshold value δ by foreground image binary conversion treatment;
Step 720, by foreground information handling result using closing operation, avoid being unevenly distributed due to human body temperature or by
Dress ornament, which blocks, leads to pending area unobvious;
Step 730, the detection width w mean breadth W of pedestrian, average length L being transformed under average height HH, detection
Length lH;Under average height, the actual range of each pixel representativeWherein, θ is infrared camera water
Angle is looked squarely, R is infrared camera horizontal pixel point;
Then the detection width under actual installation height is wH=W/dH, lH=L/dH;
If pending area is more than detection width wHWith detection length lHRange, with detection width or detection length pair
Unicom region is split;
Step 800, according to pedestrian area, regional extent, regional center are obtained, regional extent is current pedestrian's infrared image
Region, regional center coordinate is current pedestrian position, using regional extent and regional center coordinate as present image analysis result;
Step 900, image analysis result with historical position statistical result is compared, target is carried out according to comparing result
Tracking;
Step 910, target following uses joint probability method:Present image analysis result is calculated respectively to count with historical position
As a result in, the motion feature P per twin targetMWith provincial characteristics PSSimilar joint probability P, PMAnd PS;
P=PM·PS
Wherein, motion feature includes displacement distance, current pedestrian position and history moving direction deviation;Provincial characteristics includes
Statistics with histogram information;The probability P that displacement distance meets average moving distance is calculated respectivelyvAnd the history moving direction goodness of fit
Probability Po, histogram similarity probability PH;
PM=PV·PO
PS=PH
Step 920, historical position statistical result has m people, and present image detects that pedestrian has n people, then obtains the kiss of mn
It is as follows to close probability matrix:
It is matched line by line from high to low by overall identical probability, the probability highest that the i-th row jth arranges in probability matrix of coincideing, then
J-th of present image is matched with i-th in history image;Then other row P are enabledxj=0, x=1 ... m, x ≠ i, and continuation
With remaining most probable value, each movement position of the pedestrian in present image in historical position statistical result is determined successively;
It is extremely low with probability, be considered as in present image newly enter or historical position result in leave the pedestrian in region to be measured;
Step 1000, if do not found in historical position statistical result and the matched row of present image analysis result
People, is considered as the new pedestrian for entering detection zone, record newly the initial position into the pedestrian of detection zone, into the moment, every time
The data of moving direction;If it is not found in present image analysis result and row matched in historical position statistical result
People, being considered as has pedestrian to leave detection zone;By matching in present image analysis result and the pedestrian image analysis result newly entered
It updates in historical position state;
Step 1100, it has detected that pedestrian leaves detection zone, has then judged whether pedestrian's initial position, historical position are distinguished
The both sides of detection line in parameter setting module:If pedestrian's initial position, historical position are located at the two of detection line respectively
Side, then corresponding to a direction count value increases;Otherwise count value is constant, final updating count results;
Step 1200, background model is periodically updated, if present image has the region for detecting pedestrian, with existing background
Value in model in corresponding region is replaced, and forms new complete background image update model;
Step 1300, if parameter modification occurs for present image, corresponding parameter is updated;Step 400 is come back to continue to hold
Row.
It should be understood that this embodiment is only used to illustrate the invention but not to limit the scope of the invention.In addition, it should also be understood that,
After having read the content of the invention lectured, those skilled in the art can make various modifications or changes to the present invention, these etc.
Valency form is also fallen within the scope of the appended claims of the present application.