optical flow estimation

Status
Not open for further replies.

asmao

Newbie level 4
Joined
Dec 27, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,308
Hi,
i want to now if its possible to estimate the road traffic velocity using the optical flow?
and witch algorithm can be used .
thanks.
 

1.

One way is to set up two light sensors so a vehicle will drive past the first, then the second. Measure the distance between them.

You time the interval between the interruptions. Distance divided by time gives you the speed of a vehicle.

2.

Or do you want a computer to watch a video of the traffic, and measure traffic flow? That will require a sophisticated algorithm.

Each frame must be digitized and sent to the computer.

Your program looks at the region where vehicles first appear.

When a bunch of pixels changes to a different color in that region, then your program calls that a vehicle.

Record the time it crosses a timing mark.

When the next frame arrives, look along the range of positions where a vehicle would normally be.

Keep track of vehicle positions from one frame to the next, until it passes the second timing mark.

As in method #1, you need to measure the real distance between your timing marks.

You calculate the vehicle's speed based on the quantity of frames it takes to travel between the two marks.
 

thank you for your reply,
I want to use the second way but without tracking each vehicle and mark the position of each one ,the computer will look at all of the motion vehicles and plot a motion vectors for every pixel witch are used for estimate the velocity, but there is many algorith-ms for the calculate of motion vectors with optical flow, witch one is good ?, and how to obtain the velocity from that motion vect-ors?
 

If you 'want the computer to do it', then you must tell the computer how to do it step by incremental step. That's what programming is about.

To keep track of several vehicles, you will use array variables.

The vehicles have different velocities. Your code must distinguish how much ground is travelled by each vehicle per frame, or ten frames, or whatever your time window is.

Then you average their motion.

Whether you track one vehicle, or several...

You will have to deal with foreshortening. Distances in the background are different from distances in the foreground. This affects resolution which affects accuracy.

This is where geometry and trig enter in. To get accuracy within 10% you must know real distances to 10%. To get accuracy within 5% you must know real distances to 5%. Etc.

If you're writing your own code then the labor-intensive part will be to look at groups of pixels and distinguish what is a vehicle.

Do you have color video? Then it's easiest to identify a vehicle as pixels with red or green or blue content. It's more or less unique to each vehicle that you're tracking.

If you have black & white video then your code must recognize shapes and patterns that resemble a vehicle. Then it searches for those same shapes and patterns in an area of the next frame where you would expect the vehicle to have moved to.

Labor intensive. Don't know if anyone is marketing (free or otherwise) a program that does the above in the ways your project requires.
 

thank you,
I have a color video with optical flow i will plot the motion vectors of all the pixels of each frame, and i think to calculate the sum of all motion vectors and divide the result on the time frame ,to obtain the mean velocity in the frame.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…