Skip to content

Instantly share code, notes, and snippets.

@victormurcia
Created October 20, 2022 23:52
Show Gist options
  • Select an option

  • Save victormurcia/cdb89cb3ddbea610d7a1b2dd7f2910e7 to your computer and use it in GitHub Desktop.

Select an option

Save victormurcia/cdb89cb3ddbea610d7a1b2dd7f2910e7 to your computer and use it in GitHub Desktop.
crop lower part of player bounding box
def crop_image(image,howMuch):
"""
Args:
img : (array) image of player bounding box
howMuch : (int) percent of image to crop (between 0 and 100)
Returns:
cropped_img : (array) cropped image
"""
val = howMuch/100
cropped_img = image[0:int(image.shape[0]*val),0:int(image.shape[0])]
return cropped_img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment