Skip to content

Instantly share code, notes, and snippets.

View alxcnwy's full-sized avatar
🧑‍🚀

Alex Conway alxcnwy

🧑‍🚀
View GitHub Profile
gistup
@alxcnwy
alxcnwy / rotate_bounding_box.py
Created June 23, 2021 14:44
Rotate bounding box and get new bounding coords
# answer to this reddit post:
# https://www.reddit.com/r/learnmachinelearning/comments/o6br1e/calculate_bounding_box_coordinates_from_contour/
import numpy as np
from numpy import sin, cos, sqrt, pi
import math
import matplotlib.pyplot as plt
center = (332, 209)
width = 56