To measure if there is a disturbance in traffic flow,
real time detection of cross ratio must be monitored. This
per-phase for accident detection is the gate to start accident
detection phase two. Mainly the assumption here is
whenever an accident occur it is inevitable that the traffic
flow will be slowed down and as a result the number of
cars crossing the out from the downstream will decrease.
The system takes this as the first sign to start detecting the
gaps in the road. First the system will pick a random queue
and check its cross ratio then set it as a starting point and
cycle through the queues and check there cross ratio in a
repeated manner. After picking the initial queue the system
will wait until the traffic light switches to green, because
normally that’s when the cars will start crossing. After the
green light switches on, two counters will start, one to
record the time of green light until it turned off and the
other will record the number of cars that crossed the sensor
that resides at the end of the downstream. Whenever a car
crosses the counter of cars will increment. This state will
preset until the green light is switched off. One that
happens the time counter will stop and the cars counter will
stop as well those two numbers is all the system needs to
calculate the cross ratio as shown in equation (1):