Code Monkey home page Code Monkey logo

Comments (4)

wmuron avatar wmuron commented on June 3, 2024

Hi Dmytro. Please note that for order >= 1, the velocity (horizontal and vertical) is a part of the object state. I've prepared an example presenting the velocity here development...test-velocity (run examples/2d_multi_object_tracking.py example)

from motpy.

Dmytro-Shvetsov avatar Dmytro-Shvetsov commented on June 3, 2024

@wmuron Excellent example!
I dug into Kalman filters a bit more since I've posted the question and I tried to modify some parameters to measure a real km/h velocity of a vehicle. Am I understanding this correctly that your example evaluates pixel velocity and to solve my problem I would have to:

  1. project bounding boxes on the ground
  2. feed obtained boxes to the tracker and get the pixel velocity
  3. multiply the velocity by meters per pixel constant given the real environment distance

from motpy.

wmuron avatar wmuron commented on June 3, 2024

@Dmytro-Shvetsov One possible solution to project boxes on the ground is to calculate and use homography matrix to project the scene (along with each detection or track) to bird-eye view. Obviously, you'll still need to get obtain some kind of calibration data (e.g. width of the lane, lane marking length or some other known distances etc.) to calculate a relation of pixels (in bird eye view) to meters.
You can apply bird-eye transform on detections and track the transformed detections in bird-eye space or track in image space and transform active tracks to bird eye view. A couple of notes:

  • The problem with the second solution is that it might be non-trivial to convert image-space pixel velocities to mph values.
  • The problem with the first solution is that if your detections are unstable or quite distant from the ego camera, you might have trouble with the default matching function (because often transformed boxes won't overlap, especially in Y axis). Also the boxes after homography transform are not going to be rectangles (current IOU calculation relies on rectangular bounding boxes)
  • In both cases, you could consider transforming the detection boxes to their bottom parts (e.g. the bottom 10% of the vehicle close to the ground), which will help limit errors when applying using homography to transform to bird-eye view
  • Maybe you could try a hybrid approach, with tracking the bottom-box in image space and then "manual" velocity calculation for each vehicle in bird-eye space (since you know their IDs, it's easy).

from motpy.

Dmytro-Shvetsov avatar Dmytro-Shvetsov commented on June 3, 2024

@wmuron Got it. Thanks a lot!

from motpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.