Tracker

Tracks the position of various elements in a golf swing.

class golfdetection.tracker.Tracker
__init__()

Initialize the trackers with none values.

Variables
  • ball – List of 2 values

  • shaft – List of 4 values. Each pair is single coordinate value.

is_empty()

Check if the user has selected any tracker.

Returns

True if a tracker has non None value

merge_default(obj)
to_json()

Returns json string repr. if all values are null then return empty string

update_ball(x, y)

Store the position of the ball.

Parameters
  • x – screen x coordinate of the ball tracker.

  • y – screen y coordinate of the ball tracker.

update_shaft(x, y)

Store the pos of the shaft.

Parameters
  • x – screen x corodinate of the shaft tracker.

  • y – screen y corordinate of the shaft tracker.

golfdetection.tracker.make_from_json(json_str)