davisinteractive.utils.operations

bezier_curve

bezier_curve(points, nb_points=1000)
Given a list of points compute a bezier curve from it.

Arguments

  • points: ndarray. Array of points with shape (N, 2) with N being the number of points and the second dimension representing the (x, y) coordinates.
  • nb_points: Integer. Number of points to sample from the bezier curve. This value must be larger than the number of points given in points. Maximum value 10000.

Returns

ndarray: Array of shape (1000, 2) with the bezier curve of the given path of points.

bresenham

bresenham(points)
Apply Bresenham algorithm for a list points.

More info: https://en.wikipedia.org/wiki/Bresenham's_line_algorithm

Arguments

  • points: ndarray. Array of points with shape (N, 2) with N being the number if points and the second coordinate representing the (x, y) coordinates.

Returns

ndarray: Array of points after having applied the bresenham algorithm.