CN108428347A - A kind of vehicle count method and system based on more detection zones - Google Patents

A kind of vehicle count method and system based on more detection zones Download PDF

Info

Publication number
CN108428347A
CN108428347A CN201810458053.6A CN201810458053A CN108428347A CN 108428347 A CN108428347 A CN 108428347A CN 201810458053 A CN201810458053 A CN 201810458053A CN 108428347 A CN108428347 A CN 108428347A
Authority
CN
China
Prior art keywords
detection zone
frame
target track
present frame
state
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
Application number
CN201810458053.6A
Other languages
Chinese (zh)
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.)
China Three Gorges University CTGU
Original Assignee
China Three Gorges University CTGU
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 China Three Gorges University CTGU filed Critical China Three Gorges University CTGU
Priority to CN201810458053.6A priority Critical patent/CN108428347A/en
Publication of CN108428347A publication Critical patent/CN108428347A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/065Traffic control systems for road vehicles by counting the vehicles in a section of the road or in a parking area, i.e. comparing incoming count with outgoing count
    • 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/08Detecting or categorising vehicles

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Traffic Control Systems (AREA)

Abstract

The present invention provides a kind of vehicle count method and system based on more detection zones, the method includes:For carrying out the present frame of vehicle count in target traffic video, the state of first detection zone and the second detection zone in target track in the present frame is obtained;If first detection zone is possession state and second detection zone is idle state, judges whether the subsequent frame of the present frame meets the first preset condition successively according to the sequential of frame, the subsequent frame of first preset condition is met until getting;Wherein, first preset condition is that first detection zone in the target track is idle state and the second detection zone is possession state;The vehicle count value of the target track in a first direction is added 1, and the adjacent next frame of subsequent frame of first preset condition will be met as next present frame for carrying out vehicle count.The present invention improves the accuracy of vehicle count, reduces shadow effect.

Description

A kind of vehicle count method and system based on more detection zones
Technical field
The invention belongs to technical field of intelligent traffic, more particularly, to a kind of vehicle count based on more detection zones Method and system.
Background technology
In intelligent transportation, the vehicle flow acquired in real time in traffic is of great significance.For example, passing through vehicle flow reality The optimum control of existing traffic lights, to according to live traffic state, reasonably adjust wagon flow.The big direction of vehicle flowrate increases green light It lets pass the time, the relatively small direction of vehicle flowrate reduces green light and lets pass the time, and is not in situation when airway accounts for, and slows down viscous flow Phenomenon improves highway communication passage rate, Optimizing Urban Transportation.
Carry out the calculating of the magnitude of traffic flow generally there are two types of mode by video, one is based on to vehicle identification and with Track, it is another then be that analysis is occupied based on front and back scenic spot point.Former approach needs learn all contour of the vehicle Then it identifies, it is therefore desirable to larger calculation amount, and influenced due to blocking equal environment, it is whole under complicated traffic Discrimination is relatively low.And later approach is simple and efficient and flexibly, is widely used.The traditional method of later approach is A detection zone is set on each each track, the region in Fig. 1 in rectangle frame is detection zone, then passes through detection zone The front and back scape analysis in domain calculates how many foreground point in detection zone.If foreground point is more than predetermined threshold value, such as predetermined threshold value It is the 30% of detection zone, then assert that detection zone currently has vehicle to pass through, as.
List method for detecting area in the prior art is easy out in the case where hypographous or vehicle drives in the wrong direction Existing flase drop, it is inaccurate so as to cause vehicle count.
Invention content
To overcome the problems, such as that above-mentioned vehicle count is inaccurate or solves the above problems at least partly, the present invention provides one Vehicle count method and system of the kind based on more detection zones.
According to the first aspect of the invention, a kind of vehicle count method based on more detection zones is provided, including:
For carrying out the present frame of vehicle count in target traffic video, first of target track in the present frame is obtained The state of detection zone and the second detection zone;
If first detection zone in target track is possession state in the present frame and the second detection zone is idle shape State then judges whether the subsequent frame of the present frame meets the first preset condition successively according to the sequential of frame, full until getting The subsequent frame of foot first preset condition;Wherein, first preset condition is first detection zone in the target track It is possession state for idle state and the second detection zone;
The vehicle count value of the target track in a first direction is added 1, and first preset condition will be met The adjacent next frame of subsequent frame is as next present frame for carrying out vehicle count;Wherein, the first direction is from described the One detection zone is to the direction of second detection zone.
Specifically, if first detection zone in target track is possession state in the present frame and the second detection zone is Idle state then judges whether the subsequent frame of the present frame meets the first preset condition, until obtaining successively according to the sequential of frame The step of getting the subsequent frame for meeting first preset condition further include:
If second detection zone in target track is possession state in the present frame and the first detection zone is idle shape State, then judge whether the subsequent frame of present frame meets the second preset condition successively according to the sequential of frame, meets institute until getting State the subsequent frame of the second preset condition;Wherein, it is to account for that second preset condition, which is first detection zone in the target track, Stateful and the second detection zone is idle state;
Correspondingly, the vehicle count value of the target track in a first direction is added 1, and described first will be met and preset The adjacent next frame of subsequent frame of condition as it is next carry out vehicle count present frame the step of further include:
The vehicle count value of the target track in a second direction is added 1, and second preset condition will be met The adjacent next frame of subsequent frame is as next present frame for carrying out vehicle count;Wherein, the second direction is from described the Two detection zones are to the direction of first detection zone.
Specifically, the step of first detection zone in target track in the present frame and the state of the second detection zone is obtained Suddenly it specifically includes:
For carrying out the present frame of vehicle count in target traffic video, by first inspection in target track in the present frame It surveys region to be compared with first detection zone in target track in the reference frame of the target traffic video, obtain described current Foreground pixel in frame in first detection zone in target track;
By second detection in target track in second detection zone in target track in the present frame and the reference frame Region is compared, and obtains the foreground pixel in second detection zone in target track in the present frame;
The number for calculating foreground pixel in first detection zone in target track in the present frame accounts for first detection Foreground pixel in second detection zone in target track in the first ratio and the present frame of pixel total number in region Number accounts for the second ratio of pixel total number in second detection zone;
First ratio and second ratio are compared with predetermined threshold value respectively, obtain mesh in the present frame Mark the state of first detection zone and the second detection zone in track;Wherein, the state includes possession state and idle state.
Specifically, the predetermined threshold value includes the first predetermined threshold value and the second predetermined threshold value;Wherein, the described first default threshold Value is less than second predetermined threshold value;
Correspondingly, first ratio and second ratio are compared with predetermined threshold value respectively, are worked as described in acquisition The step of state of first detection zone and the second detection zone in target track, specifically includes in previous frame:
If first ratio is less than first predetermined threshold value, first detection zone in target track in the present frame Domain is idle state;
If first ratio is more than second predetermined threshold value, first detection zone in target track in the present frame Domain is possession state;
If second ratio is less than first predetermined threshold value, second detection zone in target track in the present frame Domain is idle state;
If second ratio is more than second predetermined threshold value, second detection zone in target track in the present frame Domain is possession state.
Specifically, the vehicle count value of the target track in a first direction is added 1, and described first will be met and preset The adjacent next frame of subsequent frame of condition is specifically included as the step of next present frame for carrying out vehicle count:
If first detection zone in target track is idle state and the second detection zone in a later frame of the present frame For possession state, then the vehicle count value of the target track in a first direction is added 1, and by second after the present frame Frame is as next present frame for carrying out vehicle count.
Specifically, the vehicle count value of the target track in a first direction is added 1, and described first will be met and preset The adjacent next frame of subsequent frame of condition is specifically included as the step of next present frame for carrying out vehicle count:
If first detection zone and the second detection zone in target track are all to occupy shape in a later frame of the present frame State then obtains the state of first detection zone and the second detection zone in target track in the second frame after the present frame;
If first detection zone in target track is idle state and the second detection zone in the second frame after the present frame For possession state, then the vehicle count value of the target track in a first direction is added 1, third frame after the present frame is made For next present frame for carrying out vehicle count.
A kind of vehicle counting system based on more detection zones is provided according to a second aspect of the present invention, including:
Acquisition module is obtained for the present frame for carrying out vehicle count in target traffic video in the present frame The state of first detection zone and the second detection zone in target track;
Judgment module, the first detection zone for the target track in the present frame are possession state and the second detection When region is idle state, judge whether the subsequent frame of the present frame meets the first preset condition successively according to the sequential of frame, Meet the subsequent frame of first preset condition until getting;Wherein, first preset condition is the target track First detection zone is idle state and the second detection zone is possession state;
Counting module for the vehicle count value of the target track in a first direction to be added 1, and will meet described The adjacent next frame of subsequent frame of one preset condition is as next present frame for carrying out vehicle count;Wherein, the first party First detection zone described in Xiang Weicong is to the direction of second detection zone.
Specifically, the judgment module is additionally operable to:
Second detection zone in target track is possession state in the present frame and the first detection zone is idle shape When state, judges whether the subsequent frame of present frame meets the second preset condition successively according to the sequential of frame, meet institute until getting State the subsequent frame of the second preset condition;Wherein, it is to account for that second preset condition, which is first detection zone in the target track, Stateful and the second detection zone is idle state;
Wherein, the counting module is additionally operable to:
The vehicle count value of the target track in a second direction is added 1, and second preset condition will be met The adjacent next frame of subsequent frame is as next present frame for carrying out vehicle count;Wherein, the second direction is from described the Two detection zones are to the direction of first detection zone.
According to the third aspect of the invention we, a kind of vehicle count equipment based on more detection zones is provided, including:
At least one processor, at least one processor and bus;Wherein,
The processor and memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to refer to Order is able to carry out foregoing method.
According to the fourth aspect of the invention, a kind of non-transient computer readable storage medium is provided, for storing such as preceding institute State the computer program of method.
The present invention provides a kind of vehicle count method and system based on more detection zones, this method on the one hand, by Two detection zones are set in each track of target video, and only vehicle enters the first detection zone, then follow-up to enter the Just vehicle is counted after two detection zones, the vehicle fleet size in a direction in track is counted to realize, automatically The vehicle count for filtering out another direction, to improve the accuracy of vehicle count;On the other hand, in hypographous situation Under, the states of two detection zones by identical shadow effect, and two detection zones in the case that state it is identical not into Row vehicle count, to reduce shadow effect.
Description of the drawings
Fig. 1 is single detection zone schematic diagram in the prior art;
Fig. 2 is the vehicle count method overall flow schematic diagram provided in an embodiment of the present invention based on more detection zones;
Fig. 3 is more detection zone signals in the vehicle count method provided in an embodiment of the present invention based on more detection zones Figure;
Fig. 4 is the vehicle counting system overall structure diagram provided in an embodiment of the present invention based on more detection zones;
Fig. 5 is the vehicle count equipment overall structure schematic diagram provided in an embodiment of the present invention based on more detection zones.
Specific implementation mode
With reference to the accompanying drawings and examples, the specific implementation mode of the present invention is described in further detail.Implement below Example is not limited to the scope of the present invention for illustrating the present invention.
A kind of vehicle count method based on more detection zones is provided in one embodiment of the invention, and Fig. 2 is this hair The vehicle count method overall flow schematic diagram based on more detection zones that bright embodiment provides, this method include:S101, for The present frame that vehicle count is carried out in target traffic video obtains first detection zone in target track and the second inspection in present frame Survey the state in region;
Wherein, target traffic video is the traffic video for needing to carry out vehicle count.In target traffic video there are one or Multiple tracks, there are two detection zones, i.e. the first detection zone and the second detection zone for setting on each track.Target track To need to carry out a track of vehicle count in target traffic video.As shown in figure 3, according to preset vehicle row on each track Direction is sailed, determines the first detection zone and the second detection zone in two detection zones of each row so that vehicle first passes through First detection zone, after pass through the second detection zone.As in Fig. 3 from vehicle in first track left side and second track Preset travel direction is direction from south to north, i.e., from the lower section in picture to top, therefore first track and from left side Lower zone is the first detection zone in two tracks, and upper area is the second detection zone.First detection zone and the second inspection Survey general travel speed of the distance between the region according to time interval and vehicle between adjacent two frame in target traffic video It is configured.For carrying out the present frame of vehicle count in target traffic video, first inspection in target track in present frame is obtained The state in region and the second detection zone is surveyed, state is for indicating whether there is vehicle in the first detection zone and the second detection zone .It is possession state when there is vehicle;It is idle state when not having vehicle.First detection in each frame of target traffic video The size in region is identical with position, and the size of the second detection zone is identical with position in each frame of target traffic video.
S102, if first detection zone in target track is possession state in present frame and the second detection zone is idle shape State then judges whether the subsequent frame of present frame meets the first preset condition successively according to the sequential of frame, until getting satisfaction The subsequent frame of one preset condition;Wherein, it is idle state and second that the first preset condition, which is first detection zone in target track, Detection zone is possession state;
Specifically, when the second detection that first detection zone in target track in present frame is possession state and target track When region is idle state, there is vehicle to enter the first detection zone, continues to judge successively first frame after present frame, second Whether frame ... nth frames meet the first preset condition, until getting the subsequent frame for meeting the first preset condition.First is pre- If the state that condition is first detection zone in target track is idle state, and the state of second detection zone in target track For possession state.Meet in the subsequent frame of the first preset condition vehicle in target track and leave the first detection zone and enters second Detection zone, a detection cycle are completed.
The vehicle count value of target track in a first direction is added 1, and will meet the follow-up of the first preset condition by S103 The adjacent next frame of frame is as next present frame for carrying out vehicle count;Wherein, first direction be from the first detection zone to The direction of second detection zone.
Specifically, the vehicle count value of target track in a first direction is added 1, rear vehicle can leave the second detection zone Domain.First direction refers to the preset travel direction in target track, i.e., from the first detection zone to the direction of the second detection zone. It may be because of situations such as traffic jam, vehicle deceleration meeting during vehicle drives into the second detection zone from the first detection zone There is vehicle and drives into the corresponding multiframe of the second detection zone process from the first detection zone.The follow-up of the first preset condition will be met The adjacent next frame of frame carries out vehicle count as new present frame iteration.
The present embodiment on the one hand, by the target track of target video be arranged two detection zones, only vehicle into Enter the first detection zone, just vehicle is counted after then subsequently entering the second detection zone, to realize to target track In the vehicle fleet size in a direction counted, the vehicle count in another direction is fallen in automatic fitration, to improve vehicle count Accuracy;On the other hand, in the case that hypographous, the states of two detection zones is by identical shadow effect, and two A detection zone is identical without vehicle count in state, to reduce shadow effect.
On the basis of the above embodiments, step S102 further includes in the present embodiment:If the of target track in present frame Two detection zones are possession state and the first detection zone is idle state, then after judging present frame successively according to the sequential of frame Whether continuous frame meets the second preset condition, and the subsequent frame of the second preset condition is met until getting;Wherein, the second preset condition The first detection zone for target track is possession state and the second detection zone is idle state;Correspondingly, step S103 is also Including:The vehicle count value of target track in a second direction is added 1, and the subsequent frame for meeting the second preset condition is adjacent Next frame is as next present frame for carrying out vehicle count;Wherein, second direction is from the second detection zone to the first detection The direction in region.
Specifically, when second detection zone in target track in the present frame of target traffic video is and target track One detection zone is idle state, illustrates that vehicle enters the second detection zone.Meet target in the subsequent frame of the second preset condition First detection zone in track is that second detection zone in possession state and target track is idle state, i.e. vehicle leaves second Detection zone enters the first detection zone, illustrates vehicle driving in reverse.At this point, being carried out to the vehicle of traveling to target track superinverse It counts.Second direction be with first party in the opposite direction, to realize the vehicle of reverse driving is counted, can be used for The statistics of violation reverse driving vehicle.The present embodiment realization counts two travel direction vehicles on a track, applies Range is more extensive.
On the basis of the above embodiments, step S101 is specific in the present embodiment:S1011, in target traffic video The present frame for carrying out vehicle count, will be in the reference frame of first detection zone in target track in present frame and target traffic video First detection zone in target track is compared, and obtains the foreground picture in first detection zone in target track in present frame Element;
Wherein, the reference frame of target traffic video refers to first detection zone and in target track in target traffic video The frame of equal idle state in two detection zones is the back of the body in first detection zone and the second detection zone in target track at this time Scape, if two detection zones are background from first track from right to left in Fig. 3, is idle state without foreground.It can be from mesh Chosen in mark traffic video do not have on target track vehicle by frame be used as with reference to frame.For in target traffic video into driving The present frame counted, by target carriage in the reference frame of first detection zone in target track in present frame and target traffic video First detection zone in road is compared, i.e., by the back of the body of first detection zone and the first detection zone in target track in present frame Scape is compared, and obtains the foreground in first detection zone in target track in present frame.Further, it is also possible to calculate in present frame Similitude between first detection zone and the background of the first detection zone in target track such as uses normalizated correlation coefficient meter Calculate similitude.If similitude is more than predetermined threshold value, illustrate first detection zone and the first detection zone in target track in present frame The background in domain is much like, does not have vehicle in first detection zone in target track in present frame, is idle state.If similitude is small In predetermined threshold value, the background of the first detection zone and the first detection zone that illustrate target track in present frame is dissimilar, currently There is vehicle in first detection zone in target track in frame, is possession state.
S1012, by second detection zone in target track in second detection zone in target track in present frame and reference frame Domain is compared, and obtains the foreground pixel in second detection zone in target track in present frame;
Wherein, the acquisition of the foreground pixel of the second detection zone and similarity is identical as the first detection zone, herein no longer It repeats.
S1013, the number for calculating foreground pixel in first detection zone in target track in present frame account for the first detection zone The number of foreground pixel accounts in second detection zone in target track in the first ratio and present frame of pixel total number in domain Second ratio of pixel total number in second detection zone;
Wherein, the first ratio is the number divided by first of foreground pixel in first detection zone in target track in present frame Pixel total number in detection zone, the second ratio are the number of foreground pixel in second detection zone in target track in present frame Divided by the second pixel total number in detection zone.
First ratio and the second ratio are compared with predetermined threshold value by S1014 respectively, obtain target track in present frame The first detection zone and the second detection zone state.
Specifically, the first ratio and the second ratio are compared with predetermined threshold value respectively.First ratio or the second ratio When larger, illustrate that the first detection zone or the second detection zone have vehicle entrance, is possession state;First ratio or the second ratio When smaller, illustrate that the first detection zone or the second detection zone enter either with or without vehicle, is idle state.
On the basis of the above embodiments, predetermined threshold value includes the first predetermined threshold value and the second default threshold in the present embodiment Value;Wherein, the first predetermined threshold value is less than the second predetermined threshold value;Correspondingly, step S1014 is specifically included:If the first ratio is less than First predetermined threshold value, then first detection zone in target track is idle state in present frame;If it is pre- that the first ratio is more than second If threshold value, then first detection zone in target track is possession state in present frame;If the second ratio is less than the first predetermined threshold value, Then second detection zone in target track is idle state in present frame;If the second ratio is more than the second predetermined threshold value, currently Second detection zone in target track is possession state in frame.
Specifically, if a predetermined threshold value is only arranged, when a vehicle is by target track, if the first detection zone or the The number of foreground pixel is near predetermined threshold value in two detection zones, it is easy to cause the first detection zone or second in the short time Detection zone frequent changes between possession state and idle state, to cause the vehicle count of mistake.The present embodiment uses two A predetermined threshold value can be to avoid such case.In addition, first detection zone in target track and the second inspection in calculating present frame When surveying the similarity between region and corresponding background, two predetermined threshold values can also be used.
On the basis of the various embodiments described above, step S103 is specifically included in the present embodiment:If in a later frame of present frame First detection zone in target track is idle state and the second detection zone is possession state, then by target track in first party Upward vehicle count value adds 1, and using the second frame after present frame as next present frame for carrying out vehicle count.
Specifically, first detection zone in target track detects for the second of possession state and target track in the current frame Region is idle state, i.e., vehicle enters the first detection zone.First detection zone in target track in a later frame of present frame Domain is idle state and the second detection zone is possession state, i.e., vehicle leaves the first detection zone into the second detection zone. Two frames complete a detection cycle, and the vehicle count value of target track in a first direction is added 1.By the second frame after present frame As new present frame, iteration carries out vehicle count.
On the basis of the various embodiments described above, step S103 is specifically included in the present embodiment:If in a later frame of present frame First detection zone and the second detection zone in target track are all possession state, then obtain after present frame target carriage in the second frame The state of first detection zone and the second detection zone in road;If after present frame in the second frame target track the first detection zone It is possession state for idle state and the second detection zone, then the vehicle count value of target track in a first direction is added 1, it will Third frame is as next present frame for carrying out vehicle count after present frame.
Specifically, first, vehicle enters the first detection zone in the target track of present frame;Then, in present frame First detection zone and the second detection zone in target track are all possession state in a later frame, i.e. vehicle occupies the first inspection simultaneously Survey region and the second detection zone;Finally, first detection zone in target track is idle state in the second frame after present frame And second detection zone be first state, i.e. vehicle leaves the first detection zone, into the second detection zone.Three frames complete one The vehicle count value of target track in a first direction is added 1 by detection cycle.Using the third frame after present frame as newly current Frame, iteration carry out vehicle count.
A kind of vehicle counting system based on more detection zones is provided in another embodiment of the present invention, and Fig. 4 is this The vehicle counting system overall structure diagram based on more detection zones that inventive embodiments provide, which includes acquisition module 1, judgment module 2 and counting module 3;Wherein:
Counting module 1 is used for the present frame for carrying out vehicle count in target traffic video, obtains target in present frame The state of first detection zone and the second detection zone in track;
Specifically, target traffic video is the traffic video for needing to carry out vehicle count.There are one in target traffic video Or multiple tracks, there are two detection zones, i.e. the first detection zone and the second detection zone for setting on each track.Target carriage Road is a track for needing to carry out vehicle count in target traffic video.As shown in figure 3, according to preset vehicle on each track Travel direction determines the first detection zone and the second detection zone in two detection zones of each row so that vehicle first leads to Cross the first detection zone, after pass through the second detection zone.As in Fig. 3 from first track left side and second track vehicle Preset travel direction be direction from south to north, i.e., from the lower section in picture to top, thus from left side first track and Lower zone is the first detection zone in second track, and upper area is the second detection zone.First detection zone and second The distance between detection zone is fast according to the general traveling of time interval and vehicle between adjacent two frame in target traffic video Degree is configured.Acquisition module 1 obtains target carriage in present frame for the present frame of progress vehicle count in target traffic video The state of first detection zone and the second detection zone in road, state is for indicating in the first detection zone and the second detection zone Whether vehicle is had.It is possession state when there is vehicle;It is idle state when not having vehicle.
Judgment module 2 is possession state and the second detection zone for first detection zone in target track in the current frame For idle state when, judge whether the subsequent frame of present frame meets the first preset condition successively according to the sequential of frame, until obtain To the subsequent frame for meeting the first preset condition;Wherein, it is idle shape that the first preset condition, which is first detection zone in target track, State and the second detection zone are possession state;
Specifically, when the second detection that first detection zone in target track in present frame is possession state and target track When region is idle state, there is vehicle to enter the first detection zone, continues to judge successively first frame after present frame, second Whether frame ... nth frames meet the first preset condition, until getting the subsequent frame for meeting preset condition.First default item Part is that the state of first detection zone in target track is idle state, and the state of the second detection zone is possession state.It is i.e. full Vehicle leaves the first detection zone into the second detection zone in target track in the subsequent frame of the first preset condition of foot.One inspection The period is surveyed to complete.
Counting module 3 is used to the vehicle count value of target track in a first direction adding 1, and will meet the first default item The adjacent next frame of subsequent frame of part is as next present frame for carrying out vehicle count;Wherein, first direction is from the first inspection Survey region to the direction of the second detection zone.
Specifically, the vehicle count value of target track in a first direction is added 1, rear vehicle can leave the second detection zone Domain.First direction refers to the preset travel direction in target track.In vehicle the second detection zone is driven into from the first detection zone During may will appear vehicle due to traffic jam or vehicle deceleration situation and drive into the second detection zone from the first detection zone The corresponding multiframe of domain process.Vehicle is carried out using the adjacent next frame of the subsequent frame for meeting preset condition as new present frame iteration It counts.
The present embodiment on the one hand, by the target track of target video be arranged two detection zones, only vehicle into Enter the first detection zone, just vehicle is counted after then subsequently entering the second detection zone, to realize to target track In the vehicle fleet size in a direction counted, the vehicle count in another direction is fallen in automatic fitration, to improve vehicle count Accuracy;On the other hand, in the case that hypographous, the states of two detection zones is by identical shadow effect, and two A detection zone is identical without vehicle count in state, to reduce shadow effect.
On the basis of the above embodiments, judgment module is additionally operable in the present embodiment:If the second detection zone is to occupy shape State and the first detection zone are idle state, then it is pre- to judge whether the subsequent frame of present frame meets second successively according to the sequential of frame If condition, the subsequent frame of the second preset condition is met until getting;Wherein, the second preset condition is first inspection in target track Survey region is possession state and the second detection zone is idle state;Correspondingly, counting module is additionally operable to:By target track Vehicle count value on two directions adds 1, and will meet the adjacent next frame of subsequent frame of the second preset condition as it is next into The present frame of row vehicle count;Wherein, second direction is from the second detection zone to the direction of the first detection zone.
Specifically, when second detection zone in target track in the present frame of target traffic video is and target track One detection zone is idle state, illustrates that vehicle enters the second detection zone.Meet target in the subsequent frame of the second preset condition First detection zone in track is that second detection zone in possession state and target track is idle state, i.e. vehicle leaves second Detection zone enters the first detection zone, illustrates vehicle driving in reverse.At this point, being carried out to the vehicle of traveling to target track superinverse It counts.Second direction be with first party in the opposite direction, to realize the vehicle of reverse driving is counted, can be used for The statistics of violation reverse driving vehicle.The present embodiment realization counts two travel direction vehicles on a track, applies Range is more extensive.
On the basis of the above embodiments, in the present embodiment acquisition module include the first comparison module, the second comparison module, Computing module and comparison module, wherein:First comparison module is used for for carrying out the current of vehicle count in target traffic video Frame, by first detection in target track in the reference frame of first detection zone in target track in present frame and target traffic video Region is compared, and obtains the foreground pixel in first detection zone in target track in present frame;Second comparison module is used for Second detection zone in target track in present frame is compared with second detection zone in target track in reference frame, is obtained Foreground pixel in present frame in second detection zone in target track;Computing module is for calculating target track in present frame The number of foreground pixel accounts in the first ratio and present frame of pixel total number in the first detection zone in first detection zone The number of foreground pixel accounts for the second ratio of pixel total number in the second detection zone in second detection zone in target track;Than It is used to the first ratio and the second ratio being compared with predetermined threshold value respectively compared with module, obtains the of target track in present frame The state of one detection zone and the second detection zone.
On the basis of the above embodiments, predetermined threshold value includes the first predetermined threshold value and the second default threshold in the present embodiment Value;Wherein, the first predetermined threshold value is less than the second predetermined threshold value;Correspondingly, comparison module is specifically used for:If the first ratio is less than the One predetermined threshold value, then first detection zone in target track is idle state in present frame;If it is default that the first ratio is more than second Threshold value, then first detection zone in target track is possession state in present frame;If the second ratio is less than the first predetermined threshold value, Second detection zone in target track is idle state in present frame;If the second ratio is more than the second predetermined threshold value, present frame Second detection zone in middle target track is possession state.
On the basis of the various embodiments described above, counting module is specifically used in the present embodiment:If in a later frame of present frame First detection zone in target track is idle state and the second detection zone is possession state, then by target track in first party Upward vehicle count value adds 1, and using the second frame after present frame as next present frame for carrying out vehicle count.
On the basis of the various embodiments described above, counting module is specifically used in the present embodiment:If in a later frame of present frame First detection zone and the second detection zone in target track are all possession state, then obtain after present frame target carriage in the second frame The state of first detection zone and the second detection zone in road;If after present frame in the second frame target track the first detection zone It is possession state for idle state and the second detection zone, then the vehicle count value of target track in a first direction is added 1, it will Third frame is as next present frame for carrying out vehicle count after present frame.
The present embodiment provides a kind of vehicle count equipment based on more detection zones, Fig. 5 is provided in an embodiment of the present invention Vehicle count equipment overall structure schematic diagram based on more detection zones, the equipment include:At least one processor 51, at least one A memory 52 and bus 53;Wherein,
Processor 51 and memory 52 complete mutual communication by bus 53;
Memory 52 is stored with the program instruction that can be executed by processor 51, and the instruction of processor caller is able to carry out State the method that each method embodiment is provided, such as including:For carrying out the present frame of vehicle count in target traffic video, obtain Take the state of first detection zone and the second detection zone in target track in present frame;If the first detection zone is possession state And second detection zone be idle state, then it is default to judge whether the subsequent frame of present frame meets first successively according to the sequential of frame Condition meets the subsequent frame of the first preset condition until getting;Wherein, the first preset condition is first detection in target track Region is idle state and the second detection zone is possession state;The vehicle count value of target track in a first direction is added 1, And the adjacent next frame of subsequent frame of the first preset condition will be met as next present frame for carrying out vehicle count.
The present embodiment provides a kind of non-transient computer readable storage medium, non-transient computer readable storage medium storages Computer instruction, computer instruction make computer execute the method that above-mentioned each method embodiment is provided, such as including:For mesh The present frame for carrying out vehicle count in traffic video is marked, first detection zone in target track and the second detection in present frame are obtained The state in region;If the first detection zone is possession state and the second detection zone is idle state, according to the sequential of frame according to Whether the secondary subsequent frame for judging present frame meets the first preset condition, and the subsequent frame of the first preset condition is met until getting; Wherein, the first preset condition is that first detection zone in target track is idle state and the second detection zone is possession state; The vehicle count value of target track in a first direction is added 1, and the subsequent frame for meeting the first preset condition is adjacent next Frame is as next present frame for carrying out vehicle count.
One of ordinary skill in the art will appreciate that:Realize that all or part of step of above method embodiment can pass through The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer read/write memory medium, the program When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes:ROM, RAM, magnetic disc or light The various media that can store program code such as disk.
Vehicle count apparatus embodiments based on more detection zones described above are only schematical, wherein conduct The unit that separating component illustrates may or may not be physically separated, the component shown as unit can be or Person may not be physical unit, you can be located at a place, or may be distributed over multiple network units.It can root According to actual need that some or all of module therein is selected to achieve the purpose of the solution of this embodiment.Ordinary skill Personnel are not in the case where paying performing creative labour, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can It is realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on Stating technical solution, substantially the part that contributes to existing technology can be expressed in the form of software products in other words, should Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including several fingers It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation The method of certain parts of example or embodiment.
Finally, the present processes are only preferable embodiment, are not intended to limit the scope of the present invention.It is all Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on should be included in the protection of the present invention Within the scope of.

Claims (10)

1. a kind of vehicle count method based on more detection zones, which is characterized in that including:
For carrying out the present frame of vehicle count in target traffic video, first detection in target track in the present frame is obtained The state in region and the second detection zone;
If first detection zone in target track is possession state in the present frame and the second detection zone is idle state, Judge whether the subsequent frame of the present frame meets the first preset condition successively according to the sequential of frame, until getting described in satisfaction The subsequent frame of first preset condition;Wherein, it is idle that first preset condition, which is first detection zone in the target track, State and the second detection zone are possession state;
The vehicle count value of the target track in a first direction is added 1, and the follow-up of first preset condition will be met The adjacent next frame of frame is as next present frame for carrying out vehicle count;Wherein, the first direction is from first inspection Survey region to the direction of second detection zone.
If 2. according to the method described in claim 1, it is characterized in that, in the present frame target track the first detection zone It is idle state for possession state and the second detection zone, then judges that the subsequent frame of the present frame is successively according to the sequential of frame The first preset condition of no satisfaction, until the step of getting the subsequent frame for meeting first preset condition further includes:
If second detection zone in target track is possession state in the present frame and the first detection zone is idle state, Judge whether the subsequent frame of the present frame meets the second preset condition successively according to the sequential of frame, until getting described in satisfaction The subsequent frame of second preset condition;Wherein, it is to occupy that second preset condition, which is first detection zone in the target track, State and the second detection zone are idle state;
Correspondingly, the vehicle count value of the target track in a first direction is added 1, and first preset condition will be met The adjacent next frame of subsequent frame as it is next carry out vehicle count present frame the step of further include:
The vehicle count value of the target track in a second direction is added 1, and the follow-up of second preset condition will be met The adjacent next frame of frame is as next present frame for carrying out vehicle count;Wherein, the second direction is from second inspection Survey region to the direction of first detection zone.
3. according to the method described in claim 1, it is characterized in that, obtaining first detection zone in target track in the present frame The step of state of domain and the second detection zone, specifically includes:
For carrying out the present frame of vehicle count in target traffic video, by first detection zone in target track in the present frame Domain is compared with first detection zone in target track in the reference frame of the target traffic video, is obtained in the present frame Foreground pixel in first detection zone in target track;
By second detection zone in target track in second detection zone in target track in the present frame and the reference frame It is compared, obtains the foreground pixel in second detection zone in target track in the present frame;
The number for calculating foreground pixel in first detection zone in target track in the present frame accounts for first detection zone In the first ratio and the present frame of middle pixel total number in second detection zone in target track foreground pixel number Account for the second ratio of pixel total number in second detection zone;
First ratio and second ratio are compared with predetermined threshold value respectively, obtain target carriage in the present frame The state of first detection zone and the second detection zone in road.
4. according to the method described in claim 3, it is characterized in that, the predetermined threshold value includes that the first predetermined threshold value and second are pre- If threshold value;Wherein, first predetermined threshold value is less than second predetermined threshold value;
Correspondingly, first ratio and second ratio are compared with predetermined threshold value respectively, obtain the present frame The step of state of first detection zone in middle target track and the second detection zone, specifically includes:
If first ratio is less than first predetermined threshold value, first detection zone in target track is in the present frame Idle state;
If first ratio is more than second predetermined threshold value, first detection zone in target track is in the present frame Possession state;
If second ratio is less than first predetermined threshold value, second detection zone in target track is in the present frame Idle state;
If second ratio is more than second predetermined threshold value, second detection zone in target track is in the present frame Possession state.
5. according to any methods of claim 1-4, which is characterized in that by the vehicle of the target track in a first direction Count value adds 1, and will meet the adjacent next frame of subsequent frame of first preset condition as next progress vehicle meter The step of several present frames, specifically includes:
If first detection zone in target track is idle state in a later frame of the present frame and the second detection zone is to account for It is stateful, then the vehicle count value of the target track in a first direction is added 1, and the second frame after the present frame is made For next present frame for carrying out vehicle count.
6. according to any methods of claim 1-4, which is characterized in that by the vehicle of the target track in a first direction Count value adds 1, and will meet the adjacent next frame of subsequent frame of first preset condition as next progress vehicle meter The step of several present frames, specifically includes:
If first detection zone and the second detection zone in target track are all possession state in a later frame of the present frame, Obtain the state of first detection zone and the second detection zone in target track in the second frame after the present frame;
If first detection zone in target track is idle state in the second frame after the present frame and the second detection zone is to account for It is stateful, then the vehicle count value of the target track in a first direction is added 1, using third frame after the present frame as under The present frame of one progress vehicle count.
7. a kind of vehicle counting system based on more detection zones, which is characterized in that including:
Acquisition module obtains target in the present frame for the present frame for carrying out vehicle count in target traffic video The state of first detection zone and the second detection zone in track;
Judgment module, the first detection zone for the target track in the present frame are possession state and the second detection zone For idle state when, judge whether the subsequent frame of the present frame meets the first preset condition successively according to the sequential of frame, until Get the subsequent frame for meeting first preset condition;Wherein, first preset condition is the first of the target track Detection zone is idle state and the second detection zone is possession state;
Counting module, for the vehicle count value of the target track in a first direction to be added 1, and it is pre- to meet described first If the adjacent next frame of the subsequent frame of condition is as next present frame for carrying out vehicle count;Wherein, the first direction is From first detection zone to the direction of second detection zone.
8. system according to claim 7, which is characterized in that the judgment module is additionally operable to:
Second detection zone in target track is possession state and when the first detection zone is idle state in the present frame, Judge whether the subsequent frame of present frame meets the second preset condition successively according to the sequential of frame, meets described second until getting The subsequent frame of preset condition;Wherein, it is possession state that second preset condition, which is first detection zone in the target track, And second detection zone be idle state;
Wherein, the counting module is additionally operable to:
The vehicle count value of the target track in a second direction is added 1, and the follow-up of second preset condition will be met The adjacent next frame of frame is as next present frame for carrying out vehicle count;Wherein, the second direction is from second inspection Survey region to the direction of first detection zone.
9. a kind of vehicle count equipment based on more detection zones, which is characterized in that including:
At least one processor, at least one processor and bus;Wherein,
The processor and memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the processor, and the processor calls described program to instruct energy Enough methods executed as described in claim 1 to 6 is any.
10. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited Computer instruction is stored up, the computer instruction makes the computer execute the method as described in claim 1 to 6 is any.
CN201810458053.6A 2018-05-14 2018-05-14 A kind of vehicle count method and system based on more detection zones Pending CN108428347A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810458053.6A CN108428347A (en) 2018-05-14 2018-05-14 A kind of vehicle count method and system based on more detection zones

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810458053.6A CN108428347A (en) 2018-05-14 2018-05-14 A kind of vehicle count method and system based on more detection zones

Publications (1)

Publication Number Publication Date
CN108428347A true CN108428347A (en) 2018-08-21

Family

ID=63163012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810458053.6A Pending CN108428347A (en) 2018-05-14 2018-05-14 A kind of vehicle count method and system based on more detection zones

Country Status (1)

Country Link
CN (1) CN108428347A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111476061A (en) * 2019-01-23 2020-07-31 阿里巴巴集团控股有限公司 Counting processing method, device and system in commodity production and electronic equipment
CN112069224A (en) * 2020-09-11 2020-12-11 重庆紫光华山智安科技有限公司 Vehicle passing number storage method and device, terminal and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136196A (en) * 2011-03-10 2011-07-27 北京大学深圳研究生院 Vehicle velocity measurement method based on image characteristics
CN102231236A (en) * 2011-06-14 2011-11-02 汉王科技股份有限公司 Method and device for counting vehicles
CN102324183A (en) * 2011-09-19 2012-01-18 华中科技大学 Vehicle detection and grasp shoot method based on compound virtual coil
CN102509490A (en) * 2011-10-13 2012-06-20 北京工业大学 Traffic information video acquisition experimental teaching method of modular design
CN102568216A (en) * 2012-02-27 2012-07-11 蚌埠投资集团有限公司 Intelligent bidirectional anti-loitering anti-following vehicle detection device
CN103456172A (en) * 2013-09-11 2013-12-18 无锡加视诚智能科技有限公司 Traffic parameter measuring method based on videos
CN107862873A (en) * 2017-09-26 2018-03-30 三峡大学 A kind of vehicle count method and device based on relevant matches and state machine

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102136196A (en) * 2011-03-10 2011-07-27 北京大学深圳研究生院 Vehicle velocity measurement method based on image characteristics
CN102231236A (en) * 2011-06-14 2011-11-02 汉王科技股份有限公司 Method and device for counting vehicles
CN102324183A (en) * 2011-09-19 2012-01-18 华中科技大学 Vehicle detection and grasp shoot method based on compound virtual coil
CN102509490A (en) * 2011-10-13 2012-06-20 北京工业大学 Traffic information video acquisition experimental teaching method of modular design
CN102568216A (en) * 2012-02-27 2012-07-11 蚌埠投资集团有限公司 Intelligent bidirectional anti-loitering anti-following vehicle detection device
CN103456172A (en) * 2013-09-11 2013-12-18 无锡加视诚智能科技有限公司 Traffic parameter measuring method based on videos
CN107862873A (en) * 2017-09-26 2018-03-30 三峡大学 A kind of vehicle count method and device based on relevant matches and state machine

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
刘肃亮: "交通车辆违章智能视频监控系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
汤一平 等: "轻量级的全息道路交通状态视觉检测的研究", 《计算机科学》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111476061A (en) * 2019-01-23 2020-07-31 阿里巴巴集团控股有限公司 Counting processing method, device and system in commodity production and electronic equipment
CN111476061B (en) * 2019-01-23 2023-05-02 阿里巴巴集团控股有限公司 Counting processing method, device and system in commodity production and electronic equipment
CN112069224A (en) * 2020-09-11 2020-12-11 重庆紫光华山智安科技有限公司 Vehicle passing number storage method and device, terminal and computer storage medium
CN112069224B (en) * 2020-09-11 2023-11-17 重庆紫光华山智安科技有限公司 Method, device, terminal and computer storage medium for storing number of passing vehicles

Similar Documents

Publication Publication Date Title
CN110688992B (en) Traffic signal identification method and device, vehicle navigation equipment and unmanned vehicle
CN106652445B (en) A kind of road traffic accident method of discrimination and device
CN107067768B (en) A kind of city supersaturation traffic flow self-organizing signal control method
CN104778834B (en) Urban road traffic jam judging method based on vehicle GPS data
CN103530874B (en) People stream counting method based on Kinect
CN108921956A (en) A kind of curb parking charge management method based on Video Analysis Technology
CN111680377B (en) Traffic situation simulation method, system and electronic equipment
CN109191830A (en) A kind of congestion in road detection method based on video image processing
CN104809887B (en) A kind of retrograde detection method of vehicle on expressway and autoalarm
CN107331170B (en) Intersection signal timing evaluation method and system based on the green light loss time
CN105260713A (en) Method and device for detecting lane line
CN105513362B (en) A kind of bus platform adjacent area bus running state evaluation verification method
CN105744232A (en) Method for preventing power transmission line from being externally broken through video based on behaviour analysis technology
CN105825669A (en) System and method for identifying urban expressway traffic bottlenecks
CN103985182A (en) Automatic public transport passenger flow counting method and system
CN105261034A (en) Method and device for calculating traffic flow on highway
CN107590999A (en) A kind of traffic state judging method based on bayonet socket data
CN109191871A (en) A kind of controlling system of traffic light
CN109272745A (en) A kind of track of vehicle prediction technique based on deep neural network
CN104794906A (en) Vehicle management platform of outdoor parking lot exit
CN106601023A (en) Indoor parking lot vehicle guiding and positioning system and method
KR20200102378A (en) Information processing method and device and storage medium
CN109118787A (en) A kind of car speed prediction technique based on deep neural network
CN101123038A (en) A dynamic information collection method for associated road segments of intersection
CN108428347A (en) A kind of vehicle count method and system based on more detection zones

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: 20180821