Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

speed measurement of a moving vehicle by image processing

Hi all ...
I want measure vehicle speed in a line of road using a cemera and Image Processing (and\or Machine Vision) capabilities in IMAQ Vision. 
This is my final project. Does anyone have related experiment ?
Does anyone have an idea ?
Which camera I must use ? (I want a low cost camera)
I think that a normal camera (with 25-30 Frame Per Secound) is enough. Right ?
Please see the attached pictures.I want make something like that.  
You know that processing time is very critical parameter is such project.
I think that we must get two frame from vehicle and detect vehicle in both image (with Thresholding an Edge detecting) and count number of pixels using edge detection capability and calibrate them. 
(Excuse me for my bad English)
Message Edited by mostafi on 05-25-2010 02:41 AM
Download All
0 Kudos
Message 1 of 8
(7,491 Views)
You forgot the attachment..:smileywink:
0 Kudos
Message 2 of 8
(7,489 Views)
0 Kudos
Message 3 of 8
(7,484 Views)

I saw this paper. But Its not enough. Its based on RADAR technology.

Message Edited by mostafi on 05-25-2010 03:19 AM
0 Kudos
Message 4 of 8
(7,480 Views)

Take two frames where you know the amount of time between the frames.  This is dt.

 

In each frame, you will need to locate the same point on the vehicle.  Subtract the position difference in pixels, then multiply by the scaling factor to get actual distance.  This is dx.

 

Divide dx/dt to get speed.  If your camera is not perpendicular to the road, include the cosine of the angle from perpendicular to the camera.

 

Difficulties:  It will be difficult to determine a scaling factor since it depends on the distance from the camera to the car.  The scaling factor may include the cosine factor, so don't include it twice.  Cars in different lanes may require different scaling factors.

 

Locating the same point on the car also might be difficult.  You might use background subtraction to find the leading edge of the car, or you might use pattern matching to find a point on the car.

 

If the car is heading almost straight toward the camera, it just won't work.  It needs to be close to perpendicular.  I would say 45 degrees would be about the max usable angle, but that is just a guess.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 8
(7,459 Views)

For the choice of camera, if this is for a student project, you could try USB webcams.  However, if they will work will depend on the lighting situation.  You need your car to be 'still' in the image to get a clear image.  This means the lighting has to be reasonable so that the 'shutter speed' is fast enough to make the car visible.  Does it only need to work in the day?  You will need a direct Show compliant web camera. 

See other posts about these cameras.  Many of these cameras can be run at a sufficient frame rate, if you reduce their resolution.  

 

0 Kudos
Message 6 of 8
(7,444 Views)
Thanks.
@ Bruce Ammons: Do you have a sample program ?
Can you draw an image of your desired system? (If possible)
Whether you have experience in this field ?
Can we build this system as well as with IMAQ Vision ? Does it perform as fast as possible for such processing ??

@ AZimmer: Yes this is a student project but I want make this project for an small company (maybe !) . And must work in the day and night too. For this case it seems I must use Infrared Cameras. But for beggining I want make it for works in day only.
Message Edited by mostafi on 05-26-2010 10:10 AM
Message Edited by mostafi on 05-26-2010 10:12 AM
0 Kudos
Message 7 of 8
(7,418 Views)

No sample program, especially for a school project.

 

It is all a matter of angles and distances.  To measure the speed of something using vision, you need to look at it from the side and see how far it moves in a given amount of time.  You can figure out the frame rate you need based on the amount of time it takes the fastest object to cross your field of view.  You need to calibrate the system to know how much displacement each pixel represents.  An easy way to do that is just set up two cones within the field of view and measure the distance between the cones using the camera and a measuring tape.

 

IMAQ Vision can handle it just fine.  The image processing should be a minor part of the project - subtracting the background and locating the leading edge of an object are pretty easy and fast.  Figuring out camera, lens, lighting, etc. will be more of a challenge.  Any current computer will handle the processing just fine.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 8
(7,409 Views)