Skip to content
Discussion options

You must be logged in to vote

Take the polygon you're drawing for the zone.

If side AB is 10 units (whether you call that "meters" or "feet", it doesn't matter) in real life but 100 pixels in the image, the scale is 0.1 units/pixel
If side CD is 10 units but appears as 50 pixels due to perspective, the scale is 0.2 units/pixel

The output units depend entirely on what units were used for the distances parameter:

If distances were in meters → speed_magnitude is in m/s
If distances were in feet → speed_magnitude is in ft/s

So, the code simply takes what you have set for unit system and:

For metric zones (distances in meters): converts m/s to km/h
For imperial zones (distances in feet): converts ft/s to mph

The system is …

Replies: 1 comment 14 replies

Comment options

You must be logged in to vote
14 replies
@deweycash
Comment options

@hawkeye217
Comment options

@deweycash
Comment options

@hawkeye217
Comment options

Answer selected by deweycash
@hawkeye217
Comment options

@deweycash
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment