Summary of the invention
One of technical matters to be solved by this invention is that a kind of intersection traffic flow detecting method need to be provided, and it can distinguish the vehicle of different travel directions.In addition, also provide a kind of intersection traffic flow detecting device.
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, each track of drafting intersection, described track comprises surveyed area and tracing area; Set step, set the attribute that drives towards in each track, described in drive towards attribute and comprise non-single wagon flow direction; Detecting step, the video image based on catching in described intersection detects the vehicle that occurs and roll away from the surveyed area in a track; Calculation procedure, if the attribute that drives towards in current track is non-single wagon flow direction, at described vehicle, roll away from after the surveyed area in current track, in the tracing area in current track, judge the travel direction of described vehicle, and this vehicle is added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track.
In one embodiment, in described detecting step, further comprising the steps: to adopt frame difference method to calculate successively the difference image of the consecutive frame of the video image being caught with first threshold interval, the variation of statistics foreground pixel exceedes the number of the pixel of Second Threshold, when the area of all pixels that obtain in statistics is greater than the 3rd threshold value with the Area Ratio that accounts for described surveyed area, has judged vehicle and occurred; After vehicle occurs, the Area Ratio recalculating if current is less than the 4th threshold value, judges this vehicle and rolls described surveyed area away from.
In one embodiment, described in drive towards attribute and also comprise single wagon flow direction, in described calculation procedure, further comprise: if the attribute that drives towards in current track is single wagon flow direction, the vehicle fleet size occurring on this track is added to the vehicle flowrate in this track.
In one embodiment, in described calculation procedure, by following steps, judge the travel direction of vehicle: 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 be comprise turn around, turn left, the combination in any of craspedodrome and right-hand rotation direction.
In one embodiment, according to the travel direction that judges described vehicle to get off: when the direction of the vertical current track of straight line of the vehicle driving trace of institute's matching, 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 track direction are counterclockwise miter angle, 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 track direction, 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 track direction are clockwise miter angle, determine that the travel direction of this vehicle is for turning right.
According to a further aspect in the invention, also provide a kind of intersection traffic flow detecting device, having comprised: drafting module, it is for drawing each track of intersection, and described track comprises surveyed area and tracing area; Setting module, it is for setting the attribute that drives towards in each track, described in drive towards attribute and comprise non-single wagon flow direction; Detection module, its video image based on catching in described intersection detects the vehicle that occurs and roll away from the surveyed area in a track; Computing module, it is for driving towards attribute while being non-single wagon flow direction in current track, and described vehicle rolls away from after the surveyed area in current track, in the tracing area in current track, judge the travel direction of described vehicle, and this vehicle is added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track.
In one embodiment, in described detection module, further comprise: judge module, it adopts frame difference method to calculate successively the difference image of the consecutive frame of the video image being caught with first threshold interval, the variation of statistics foreground pixel exceedes the number of the pixel of Second Threshold, when the area of all pixels that obtain in statistics is greater than the 3rd threshold value with the Area Ratio that accounts for described surveyed area, has judged vehicle and occurred; After vehicle occurs, the Area Ratio recalculating if current is less than the 4th threshold value, judges this vehicle and rolls described surveyed area away from.
In one embodiment, described in drive towards attribute and also comprise single wagon flow direction, when vehicle in front drive towards attribute while being single wagon flow direction, described computing module is added to the vehicle fleet size occurring on this track the vehicle flowrate in this track.
In one embodiment, described computing module is used mean shift method to follow the tracks of vehicle driving trace, and adopts vehicle driving trace described in least square fitting, and the vehicle driving trace based on institute's matching judges the travel direction of described vehicle.
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 being surveyed area and tracing area by current driveway partition, and set the attribute that travels in each track, the vehicle in the current track based on detected, calculate the travel direction of this vehicle, and then this vehicle can be added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track, and reached the effect of distinguishing the vehicle of different travel directions in vehicle flowrate calculates, effectively improved existing vehicle flowrate computing method.
Other features and advantages of the present invention will be set forth in the following description, and, partly from instructions, become apparent, or understand by implementing the present invention.Object of the present invention and other advantages can be realized and be obtained by specifically noted structure in instructions, claims and accompanying drawing.
Embodiment
Below with reference to drawings and Examples, describe embodiments of the present invention in detail, to the present invention, how application technology means solve technical matters whereby, and the implementation procedure of reaching technique effect can fully understand and implement according to this.It should be noted that, only otherwise form conflict, each feature in each embodiment and each embodiment in the present invention can mutually combine, and the technical scheme forming is all within protection scope of the present invention.
In addition, in the step shown in the process flow diagram of accompanying drawing, can in the computer system such as one group of computer executable instructions, carry out, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
the 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, each track of drafting 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, by the coordinate range that records each region, divide regional.
Step S120, sets the attribute that drives towards in each track, drives towards attribute and comprises non-single wagon flow direction and single wagon flow direction.
Easily understand, single wagon flow direction can be for turning around, turn left, craspedodrome or right-hand rotation direction, but not single wagon flow direction be comprise turn around, turn left, the combination in any of craspedodrome and right-hand rotation direction, as turned left to add craspedodrome, right-hand bend adds craspedodrome etc.
Please refer to Fig. 3, Fig. 3 is the schematic diagram of intersection three lane flow directions, and wherein, middle track represents the track of single wagon flow direction, the track on the left side represents to turn left to add the track of 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, the video image based on catching in intersection detects the vehicle that occurs and roll away from the surveyed area in a track.
Frame difference method is one of the moving object detection commonly used the most and dividing method, and its ultimate principle is exactly to adopt the time difference based on pixel to extract the moving region in image by closing value at adjacent two frames of image sequence or three interframe.
First, consecutive frame image respective pixel value is subtracted each other and obtained difference image, then to difference image binaryzation.At ambient brightness, change little in the situation that, if respective pixel value changes while being 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 in image that moving object causes, be foreground pixel by these zone markers.Utilize the pixel region of mark can determine the position of moving target in image.
In the present embodiment, adopt frame difference method to calculate successively the difference image of the consecutive frame of the video image being caught with first threshold T1 interval, the variation of statistics foreground pixel, it is the number that difference image difference exceedes the pixel of Second Threshold T2, when the area of all pixels that obtain in statistics is greater than the 3rd threshold value T3 with the Area Ratio that accounts for surveyed area, judge that vehicle occurs; After vehicle occurs, the Area Ratio recalculating if current is less than the 4th threshold value T4, judges that this vehicle rolls surveyed area away from.
For example, when T1 value is 1, show to get two continuous frames image calculation and obtain difference image.Statistical difference partial image difference in lane detection district is exceeded to the pixel point areas of T2=50 and account for this surveyed area Area Ratio note and be pFrontNum, if pFrontNum is greater than T3=0.5, show that detection zone has vehicle to occur; Appear at after surveyed area judging vehicle, if pFrontNum is less than T4=0.2, judge that this vehicle rolls surveyed area away from.
Step S131, judges whether the attribute that drives towards in current track is single wagon flow direction, if carry out step S150, otherwise carries out step S140.
Step S140, if the attribute that drives towards in current track is non-single wagon flow direction, at this vehicle, roll away from after the surveyed area in current track, in the tracing area in current track, judge the travel direction of vehicle, this vehicle is added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track.
Preferably, when vehicle rolls away from after surveyed area, adopt mean shift method to follow the tracks of vehicle driving trace, and adopt least square fitting vehicle driving trace.
Particularly, when the direction of the vertical current track of straight line of the vehicle driving trace of institute's matching, 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 track direction are counterclockwise miter angle, 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 track direction, 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 track direction are clockwise miter angle, determine that the travel direction of this vehicle is for turning right.
When after the travel direction of judgement place vehicle, this vehicle is added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track in step S160.
Step S150, is added to the vehicle fleet size occurring on this track the vehicle flowrate in this track.
That is to say, when the attribute that travels in track is single wagon flow direction, the vehicle fleet size occurring is added to the vehicle flowrate in this track on this track.
In sum, the traffic flow detecting method 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 in practice higher use value.
the 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 elaborated.
The intersection traffic flow detecting device of the present embodiment comprises drafting module 20, the setting module 21 being connected with drafting module 20, the detection module 22 being connected with setting module 21 and the computing module 23 being 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 that records each region.And setting module 21 is for setting the attribute that drives towards in each track, drives towards attribute and comprise non-single wagon flow direction.Be appreciated that driving towards attribute also comprises single wagon flow direction, as Through Lane of one way road and multilane etc.
In addition, the video image of detection module 22 based on catching in intersection detects the vehicle that occurs and roll away from the surveyed area in a track.
Preferably, detection module 22 further comprises judge module 22a, it adopts frame difference method to calculate successively the difference image of the consecutive frame of the video image being caught with first threshold T1 interval, the variation of statistics foreground pixel, it is the number that difference image difference exceedes the pixel of Second Threshold T2, when the area of all pixels that obtain in statistics is greater than the 3rd threshold value T3 with the Area Ratio that accounts for surveyed area, judge that vehicle occurs; After vehicle occurs, the Area Ratio recalculating if current is less than the 4th threshold value T4, judges that this vehicle rolls surveyed area away from.
Such as, when T1 value is 1, show to get two continuous frames image calculation and obtain difference image.Statistical difference partial image difference in lane detection district is exceeded to the pixel point areas of T2=50 and account for this surveyed area Area Ratio note and be pFrontNum, if pFrontNum is greater than T3=0.5, show that detection zone has vehicle to occur; Appear at after surveyed area judging vehicle, if pFrontNum is less than T4=0.2, judge that this vehicle rolls surveyed area away from.
Computing module 23 is for driving towards attribute while being non-single wagon flow direction in current track, and vehicle rolls away from after the surveyed area in current track, in the tracing area in current track, judge the travel direction of this vehicle, and this vehicle is added to the vehicle flowrate of the wagon flow direction corresponding with travel direction this vehicle current track.
Preferably, computing module 23 is used mean shift method to follow the tracks of vehicle driving trace, and adopts this vehicle driving trace of least square fitting, and the vehicle driving trace based on institute's matching judges the travel direction of this vehicle.
Particularly, when the direction of the vertical current track of straight line of the vehicle driving trace of institute's matching, 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 track direction are counterclockwise miter angle, 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 track direction, 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 track direction are clockwise miter angle, determine that the travel direction of this vehicle is for turning right.
When vehicle in front drive towards attribute while being single wagon flow direction, computing module 23 is added to the vehicle fleet size occurring on this track the vehicle flowrate in this track.
In sum, the traffic flow detecting device of the present embodiment has been distinguished the vehicle number of the different travel directions in same track, and not using vehicle flowrate as a static parameter measurement, effectively improved existing vehicle flowrate computing method, there is in practice higher use value.
The above; be only specific embodiment of the invention case, protection scope of the present invention is not limited to this, is anyly familiar with those skilled in the art in technical manual of the present invention; to modification of the present invention or replacement, all should be within protection scope of the present invention.