Summary of the invention
One of technical matters to be solved by this invention needs to provide a kind of intersection traffic flow detecting method, and it can distinguish the vehicle of different travel direction.In addition, a kind of intersection traffic flow detecting device is additionally provided.
In order to solve the problems of the technologies described above, the invention provides a kind of intersection traffic flow detecting method, comprising: plot step, draw each track of intersection, described track comprises surveyed area and tracing area; Setting procedure, what set each track drives towards attribute, described in drive towards attribute and comprise non-single wagon flow direction; Detecting step, detects based on the video image caught in described intersection and to occur and the vehicle rolled away from the surveyed area in a track; Calculation procedure, if the attribute that drives towards of current lane is non-single wagon flow direction, then roll the surveyed area of current lane away from described vehicle after, in the tracing area of current lane, judge the travel direction of described vehicle, and this vehicle is added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane.
In one embodiment, in described detecting step, further comprising the steps: to adopt frame difference method to calculate the difference image of the consecutive frame of the video image caught with first threshold interval successively, the change of statistics foreground pixel exceedes the number of the pixel of Second Threshold, when the area adding up all pixels obtained is greater than the 3rd threshold value with the area ratio accounting for described surveyed area, then judge that vehicle occurs; After vehicle occurs, the area ratio recalculated if current is less than the 4th threshold value, then judge that this vehicle rolls described surveyed area away from.
In one embodiment, described in drive towards attribute and also comprise single wagon flow direction, comprise further in described calculation procedure: if the attribute that drives towards of current lane is single wagon flow direction, then the vehicle fleet size that this track occurs is added to the vehicle flowrate in this track.
In one embodiment, in described calculation procedure, judged the travel direction of vehicle by following steps: use mean-shift method to follow the tracks of vehicle driving trace, and adopt vehicle driving trace described in least square fitting; Vehicle driving trace based on institute's matching judges the travel direction of described vehicle.
In one embodiment, described non-single wagon flow direction is comprise turning around, turn left, keeping straight on and the combination in any in right-hand rotation direction.
In one embodiment, according to the following travel direction judging described vehicle: when the linear vertical current lane direction of the vehicle driving trace of institute's matching, then determine that the travel direction of this vehicle is for turning around; When the straight line of the vehicle driving trace of institute's matching and current lane direction are counterclockwise miter angle, then determine that the travel direction of this vehicle is for turning left; When the straight line of the vehicle driving trace of institute's matching is parallel with current lane direction, then determine that the travel direction of this vehicle is for keeping straight on; When the straight line of the vehicle driving trace of institute's matching and current lane direction are clockwise miter angle, then determine that the travel direction of this vehicle is for turning right.
According to a further aspect in the invention, additionally provide a kind of intersection traffic flow detecting device, comprising: drafting module, it is for drawing each track of intersection, and described track comprises surveyed area and tracing area; Setting module, it drives towards attribute for what set each track, described in drive towards attribute and comprise non-single wagon flow direction; Detection module, it detects based on the video image caught in described intersection and to occur and the vehicle rolled away from the surveyed area in a track; Computing module, its for current lane to drive towards attribute be non-single wagon flow direction time, and after described vehicle rolls the surveyed area of current lane away from, in the tracing area of current lane, judge the travel direction of described vehicle, and this vehicle is added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane.
In one embodiment, in described detection module, comprise further: judge module, it adopts frame difference method to calculate the difference image of the consecutive frame of the video image caught with first threshold interval successively, the change of statistics foreground pixel exceedes the number of the pixel of Second Threshold, when the area adding up all pixels obtained is greater than the 3rd threshold value with the area ratio accounting for described surveyed area, then judge that vehicle occurs; After vehicle occurs, the area ratio recalculated if current is less than the 4th threshold value, then judge that this vehicle rolls described surveyed area away from.
In one embodiment, described in drive towards attribute and also comprise single wagon flow direction, Current vehicle to drive towards attribute be single wagon flow direction time, the vehicle fleet size that this track occurs is added to the vehicle flowrate in this track by described computing module.
In one embodiment, described computing module uses mean-shift method to follow the tracks of vehicle driving trace, and adopts vehicle driving trace described in least square fitting, and judges the travel direction of described vehicle based on the vehicle driving trace of institute's matching.
Compared with prior art, one or more embodiment of the present invention can have the following advantages by tool:
Traffic flow detecting method of the present invention, by current lane is divided into surveyed area and tracing area, and set the traveling attribute in each track, based on the vehicle of detected current lane, calculate the travel direction of this vehicle, and then this vehicle can be added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane, reach the effect distinguishing the vehicle of different travel direction in vehicle flowrate calculates, effectively improve existing vehicle flowrate computing method.
Other features and advantages of the present invention will be set forth in the following description, and, partly become apparent from instructions, or understand by implementing the present invention.Object of the present invention and other advantages realize by structure specifically noted in instructions, claims and accompanying drawing and obtain.
Embodiment
Describe embodiments of the present invention in detail below with reference to drawings and Examples, to the present invention, how application technology means solve technical matters whereby, and the implementation procedure reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each embodiment in the present invention and each feature in each embodiment can be combined with each other, and the technical scheme formed is all within protection scope of the present invention.
In addition, can perform in the computer system of such as one group of computer executable instructions in the step shown in the process flow diagram of accompanying drawing, and, although show logical order in flow charts, but in some cases, can be different from the step shown or described by order execution herein.
first embodiment
Fig. 1 is the process flow diagram of intersection traffic flow detecting method according to an embodiment of the invention.Below in conjunction with Fig. 1, the method is described in detail.
Step S110, draw each track of intersection, wherein, track comprises surveyed area and tracing area.
Draw out each track of urban intersection, and be surveyed area and tracing area by each driveway partition.Preferably, the coordinate range by recording each region divides regional.
Step S120, what set each track drives towards attribute, drives towards attribute and comprises non-single wagon flow direction and single wagon flow direction.
Easy understand, single wagon flow direction can for turning around, turning left, keep straight on or right-hand rotation direction, but not single wagon flow direction is comprise turning around, turn left, keeping straight on and the combination in any in right-hand rotation direction, and as turned left to add craspedodromes, right-hand bend adds craspedodrome etc.
Please refer to Fig. 3, Fig. 3 is the schematic diagram in three lanes wagon flow direction, intersection, and wherein, middle track represents the track in single wagon flow direction, the track on the left side represents the track turning left to add straightgoing vehicle flow path direction, and the track on the right represents that right-hand bend adds the track of straightgoing vehicle flow path direction.
Step S130, detects based on the video image caught in intersection and to occur and the vehicle rolled away from the surveyed area in a track.
Frame difference method is one of the moving object detection and dividing method commonly used the most, and its ultimate principle is exactly adopt the time difference based on pixel to extract moving region in image by closing value in adjacent two frames of image sequence or three interframe.
First, consecutive frame image respective pixel value is subtracted each other obtain difference image, then to difference image binaryzation.When ambient brightness changes little, if when the change of respective pixel value is less than pre-determined threshold value, can think to be background pixel herein, if the pixel value of image-region alters a great deal, can this is presumably because that moving object in image causes, be foreground pixel by these zone markers.Utilize the pixel region of mark can determine moving target position in the picture.
In the present embodiment, frame difference method is adopted to calculate the difference image of the consecutive frame of the video image caught with first threshold T1 interval successively, the change of statistics foreground pixel, namely difference image difference exceedes the number of the pixel of Second Threshold T2, when the area adding up all pixels obtained is greater than the 3rd threshold value T3 with the area ratio accounting for surveyed area, then judge that vehicle occurs; After vehicle occurs, the area ratio recalculated if current is less than the 4th threshold value T4, then judge that this vehicle rolls surveyed area away from.
For example, when T1 value is 1, show that getting two continuous frames image calculates difference image.By statistical difference partial image difference in lane detection district more than the pixel point areas of T2=50 with account for this surveyed area area ratio and be denoted as pFrontNum, if pFrontNum is greater than T3=0.5, show that detection zone has vehicle to occur; After judging that vehicle appears at surveyed area, if pFrontNum is less than T4=0.2, then judge that this vehicle rolls surveyed area away from.
Step S131, judges whether the attribute that drives towards of current lane is single wagon flow direction, if then carry out step S150, otherwise carries out step S140.
Step S140, if the attribute that drives towards of current lane is non-single wagon flow direction, then roll the surveyed area of current lane away from this vehicle after, in the tracing area of current lane, judge the travel direction of vehicle, this vehicle is added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane.
Preferably, after vehicle rolls surveyed area away from, adopt mean-shift method to follow the tracks of vehicle driving trace, and adopt least square fitting vehicle driving trace.
Particularly, when the linear vertical current lane direction of the vehicle driving trace of institute's matching, then determine that the travel direction of this vehicle is for turning around; When the straight line of the vehicle driving trace of institute's matching and current lane direction are counterclockwise miter angle, then determine that the travel direction of this vehicle is for turning left; When the straight line of the vehicle driving trace of institute's matching is parallel with current lane direction, then determine that the travel direction of this vehicle is for keeping straight on; When the straight line of the vehicle driving trace of institute's matching and current lane direction are clockwise miter angle, then determine that the travel direction of this vehicle is for turning right.
After the travel direction of judgement place vehicle, this vehicle is added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane in step S160.
Step S150, is added to the vehicle flowrate in this track by the vehicle fleet size that this track occurs.
That is, when the traveling attribute in track is single wagon flow direction, the vehicle fleet size that this track occurs is added to the vehicle flowrate in this track.
In sum, the traffic flow detecting method of the present embodiment, has distinguished the vehicle number of the different travel direction in same track, and not using vehicle flowrate as a static parameter measurement, effectively improve existing vehicle flowrate computing method, there is higher use value in practice.
second embodiment
Fig. 2 is the schematic diagram of intersection traffic flow detecting device according to an embodiment of the invention.Below in conjunction with Fig. 2, this device is described in detail.
The intersection traffic flow detecting device of the present embodiment comprises drafting module 20, the setting module 21 be connected with drafting module 20, the detection module 22 be connected with setting module 21 and the computing module 23 be connected with detection module 22.
Drafting module 20 is for drawing each track of intersection, and track comprises surveyed area and tracing area.Preferably, it divides regional by the coordinate range recording each region.And setting module 21 is for setting the attribute that drives towards in each track, drives towards attribute and comprising non-single wagon flow direction.Be appreciated that driving towards attribute also comprises single wagon flow direction, as the Through Lane etc. of one way road and multilane.
In addition, detection module 22 detects based on the video image caught in intersection and to occur and the vehicle rolled away from the surveyed area in a track.
Preferably, detection module 22 comprises judge module 22a further, it adopts frame difference method to calculate the difference image of the consecutive frame of the video image caught with first threshold T1 interval successively, the change of statistics foreground pixel, namely difference image difference exceedes the number of the pixel of Second Threshold T2, when the area adding up all pixels obtained is greater than the 3rd threshold value T3 with the area ratio accounting for surveyed area, then judge that vehicle occurs; After vehicle occurs, the area ratio recalculated if current is less than the 4th threshold value T4, then judge that this vehicle rolls surveyed area away from.
Such as, when T1 value is 1, show that getting two continuous frames image calculates difference image.By statistical difference partial image difference in lane detection district more than the pixel point areas of T2=50 with account for this surveyed area area ratio and be denoted as pFrontNum, if pFrontNum is greater than T3=0.5, show that detection zone has vehicle to occur; After judging that vehicle appears at surveyed area, if pFrontNum is less than T4=0.2, then judge that this vehicle rolls surveyed area away from.
Computing module 23 for current lane to drive towards attribute be non-single wagon flow direction time, and after vehicle rolls the surveyed area of current lane away from, in the tracing area of current lane, judge the travel direction of this vehicle, and this vehicle is added to the vehicle flowrate in the wagon flow direction corresponding with the travel direction of this vehicle of current lane.
Preferably, computing module 23 uses mean-shift method to follow the tracks of vehicle driving trace, and adopts this vehicle driving trace of least square fitting, and judges the travel direction of this vehicle based on the vehicle driving trace of institute's matching.
Particularly, when the linear vertical current lane direction of the vehicle driving trace of institute's matching, then determine that the travel direction of this vehicle is for turning around; When the straight line of the vehicle driving trace of institute's matching and current lane direction are counterclockwise miter angle, then determine that the travel direction of this vehicle is for turning left; When the straight line of the vehicle driving trace of institute's matching is parallel with current lane direction, then determine that the travel direction of this vehicle is for keeping straight on; When the straight line of the vehicle driving trace of institute's matching and current lane direction are clockwise miter angle, then determine that the travel direction of this vehicle is for turning right.
Current vehicle to drive towards attribute be single wagon flow direction time, the vehicle fleet size that this track occurs is added to the vehicle flowrate in this track by computing module 23.
In sum, the traffic flow detecting device of the present embodiment has distinguished the vehicle number of the different travel directions in same track, and not using vehicle flowrate as a static parameter measurement, effectively improve existing vehicle flowrate computing method, there is higher use value in practice.
The above; be only specific embodiment of the invention case, protection scope of the present invention is not limited thereto, and is anyly familiar with those skilled in the art in technical manual of the present invention; to amendment of the present invention or replacement, all should within protection scope of the present invention.