Plots
Awive provides some basic plotting capabilities.
awive.plots.draw_velocities(velocities, image, max_velocity=5)
Draw velocities arrows in an image.
The color of those arrows depends on the velocity value. max is red and min is blue.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
velocities
|
dict[str, dict[str, float]]
|
dictionary of velocities. keys are the velocity and values are dicts with three keys: "velocity", "position", and "count". velocity: velocity value in p/s. position: position of the velocity in pixels in y column count: number of occurrences of the velocity. |
required |
image
|
NDArray[uint8]
|
image to draw the velocities on. |
required |
max_velocity
|
float
|
maximum velocity value. if a velocity is higher than this value, it will be considered as this value. |
5
|
Returns:
Type | Description |
---|---|
NDArray[uint8]
|
an image with the velocities arrows. |
Source code in awive/plots.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|