I have some code, largely taken from various sources linked at the bottom of this post in Python, that takes an image of shape [height, width] and some bounding
[height, width]