generate_velocity_field#
- sunkit_image.asda.generate_velocity_field(vx, vy, i, j, r=3)[source]#
Given a point
[i, j]
, generate a velocity field which contains a region with a size of(2r+1) x (2r+1)
centered at[i, j]
from the original velocity fieldvx
andvy
.- Parameters:
vx (
numpy.ndarray
) – Velocity field in the x direction.vy (
numpy.ndarray
) – Velocity field in the y direction.i (
int
) – first dimension of the pixel position of a target point.j (
int
) – second dimension of the pixel position of a target point.r (
int
, optional) – Maximum distance of neighbor points from target point. Default value is 3.
- Returns:
numpy.ndarray
– The first dimension is a velocity field which contains a region with a size of(2r+1) x (2r+1)
centered at[i, j]
from the original velocity fieldvx
andvy
. the second dimension is similar as the first dimension, but with the mean velocity field subtracted from the original velocity field.