Speed Tracking a moving object from another moving object

2.1k views Asked by At

I am new to computer vision, and need some advice on where to start.

The project is to estimate speed of a moving object(A) relative to the moving object(B) which is tracking it(A).

what should I need to do if I assume-

  1. if the background is appeared to be static(making the background single colored)
  2. if the background is moving (harder)

I want to do this using opencv and c++

Any advice on where to start, general steps would be very appreciated. Thanks in advance!

1

There are 1 answers

0
Totoro On

If your camera is attached to object B, first you will have to design an algorithm to detect and track object A. A simplified algorithm can be:

Loop the steps below:

  1. Capture video frame from the camera.
  2. If object A was not in the previous frame, detect object A (manual initialisation, detection using known features, etc.). Otherwise, track the object using the previous position and a tracking algorithm (openCV offers quite a few).
  3. Detect and record the current location of the object in image coordinates.
  4. Convert the location to real world coordinates.
  5. If previous locations and timestamps for the object were available, calculate its speed.

The best way to do this is to get started with at least a simple C++ program that captures frames from a camera, and keep adding steps for detection and tracking.