INNER CODE UNIT · Python

diff

chonyy/ML-auto-baseball-pitching-overlay · src/utils.py:66

            diff = last_frame.ball[0] - prev_frame.ball[0]
            speed = int(diff / (len(lost_idx) + 1))

            for idx, frame in enumerate(lost_idx):
                x = prev_frame.ball[0] + (speed * (idx + 1))
                y = int(poly(x))
                frame.ball_in_frame = True
                frame.ball = (x, y)
                frame.ball_color = color
                # print('Fill', x, y)


def distance(x, y):
    temp = (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2
    return temp ** (0.5)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…