Created
October 20, 2022 23:52
-
-
Save victormurcia/cdb89cb3ddbea610d7a1b2dd7f2910e7 to your computer and use it in GitHub Desktop.
crop lower part of player bounding box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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