Comments (4)
Hello @pg37013 . Assuming that your Detection
instances in your detections
list have the pixel coordinates of its points, then the estimated velocity returned by object.estimate_velocity
will be in pixels/frame (so, how many pixels in the horizontal and vertical directions does the tracked point moves between consecutive frames).
To convert it to km/h, you will need some reference length relating pixels to kilometers (for example, if you know the real size of the objects you detected, you can use that). Secondly, you also need the FPS of the video to relate the time between consecutive frames and an hour.
Please, if you need more help or guidance, don't hesitate to ask.
from norfair.
Hello @aguscas
So, suppose that I have velocities = object.estimate_velocity
. How can I convert that to km/h
?
If I know the real size of an object, lets say: width= x m
and height=y m
and the fps
variable. How can I make de conversion?
from norfair.
So, you know the width in meters (x_meters m
), and also you know it in pixels (x_pixels pixels
), and similarly for the height.
width = x_meters m = x_pixels pixels
height = y_meters m = y_pixels pixels
Now, let's relate the velocity units meters/second with pixels/frame :
pixels/frame = (pixels/meters) * (meters/second) * (second/frame) = (pixels/meters) * (1/fps) * (meters/second)
So the velocity can be expressed as
velocity = velocity_in_pixels_per_frame * pixels/frame = velocity_in_pixels_per_frame * (pixels/meters) * (1/fps) * (meters/second)
So the velocity in meters per second is:
velocity_in_meters_per_second = velocity_in_pixels_per_frame * (pixels/meters) * (1/fps)
So in particular, looking in the horizontal and in the vertical directions:
horizontal_velocity_in_meters_per_second = horizontal_velocity_pixels_per_frame * (x_pixels/x_meters) * (1/fps)
vertical_velocity_in_meters_per_second = vertical_velocity_pixels_per_frame * (y_pixels/y_meters) * (1/fps)
In summary, just compute:
object.estimate_velocity @ np.diag( [(x_pixels/x_meters), (y_pixels/y_meters)] ) /fps
If this answer is not clear enough, please tell me
from norfair.
Will close this issue due to inactivity. Feel free to create another one if this was still unclear
from norfair.
Related Issues (20)
- To get a moving object's speed as single scalar value HOT 1
- How to start? HOT 6
- reid - how to use reid? HOT 2
- MotionEstimator with Reid HOT 2
- Reid in case of occlusion/object going out and coming back in the frame HOT 12
- error: (-28:Unknown error code -28) The input arrays should have at least 4 corresponding point sets to calculate Homography in function 'findHomography' HOT 6
- How to get object/track id and their bbox coordinates for a video? HOT 2
- Question about skip_period HOT 2
- Skipped frames on avi videos
- Suggestions to make the processing faster HOT 5
- Typing issues (example: `Detection.embedding` is `Unknown | None`)
- object ids in tracked_objects skipped a number? HOT 9
- Detection confidence when drawing tracked_objects' boxes? HOT 5
- Any tips on how to use Norfair for re-identification accross cameras HOT 1
- Ask a question about object tracking HOT 3
- Configure logging behavior? HOT 2
- The class of object being tracked changes over time HOT 3
- FixedCamera crashes with an inappropriate point array shape
- Detection age not always set
- Detection age not updated after merging tracked objects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from norfair.