0

I want to estimate vehicle speed. For calibration (converting pixels to meter) I only have two photos from camera.

enter image description here

  1. In the first photo one vehicle is on top of the image (Photo 1).
  2. In the second photo the same vehicle is moved for 12 meters (Photo 2).

The information that I have in meters includes:

  1. Movement Distance in meters (Purple line)
  2. License plate dimensions (X, Y -> its width and height in meters)
  3. H Height of the license plate from the ground in meters

I want to know how can I write a function with these information to take an arbitrary license plate L (i.e. its width and height and location on the image in pixels) and return the distance from the first photos license plate (or any arbitrary location) in meters (Orange lice marked as Question?).

If the camera were in the top of the road we could simply convert pixels to meter but in perspective view I do not know how can I do this if it is possible?

The problem is when vehicle is small for example 5 pixel of movement (up -> down) is about 0.5 meter and when vehicle is near the camera and is larger 5 pixels is about 0.2 meter (Numbers are just for example).

Update: Using a third point between Photo 1 and Photo 2 I created a polynomial function with two degrees (a + bx + cx^2) and now I can calculate distance. I measured speed and the result is about ±4 Km/h.

In the following picture X is start height of the license plate in pixels and Y is the distance in meters.

enter image description here

arcsin
  • 441
  • 4
  • 10
  • I assume you also have the time difference between the two photos? – PeterT Feb 04 '22 at 23:13
  • Of course I have – arcsin Feb 04 '22 at 23:14
  • 2
    What accuracy do you need? For a reliable speed enforcement you will need photogrammetry. For a good speed estimate you can use ground plane assumption, where you can precompute all geound plane 3D positions in the camera-image once. Or you can use camera intrinsics and known license plate size to compute the distance change. – Micka Feb 04 '22 at 23:59
  • Another good method the precisely establish speed is to use two cameras far apart—maybe 100 m. The time stamp each camera sees the same car is all you need then. – Cris Luengo Feb 05 '22 at 15:07
  • see the links in [#2 reconstruct the scene into 3D mesh](https://stackoverflow.com/a/35752786/2521214) however the best link (for your task) [selection criteria for different projections](https://stackoverflow.com/a/32795205/2521214) has been auto deleted and you have too low rep for seeing it but it still might be found in some web archive ... Also this [Specifiyng speed from visual size](https://stackoverflow.com/a/24245776/2521214) mighr get handy – Spektre Feb 07 '22 at 07:06

0 Answers0