Created
February 1, 2020 20:00
-
-
Save connectwithprakash/77aa3e5c043ca7e36c502a46ad6d51a4 to your computer and use it in GitHub Desktop.
Cropping image of desired aspect ratio using windowing algorithm with known center of window/
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
| image = plt.imread(file_path) | |
| m, n = image.shape[0:-1] | |
| image = crop(image, center=(m//2+290, n//2), aspect_ratio=(1.4/2.0)) | |
| plt.imsave('output.jpg', image) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment