Part# 6.4 square chopping
Closed this issue · 2 comments
jackohulk99 commented
Thank for the great notebook to learn ,especially during the cov-19 homestay.
I don't know if mis-understood but the function below seems to make the image rectangle instead of square.
Do you mean .eg. crop((pad,0,pad+cols,cols) like in the previous course?
def make_square(img):
cols,rows = img.sizeif rows>cols: pad = (rows-cols)/2 img = img.crop((pad,0,cols,cols)) else: pad = (cols-rows)/2 img = img.crop((0,pad,rows,rows))
jeffheaton commented
Thanks, will take a look.
jeffheaton commented
I tried the code, as I have it and got the below result. What are you suggesting I change?
Before: 744x1157
After: 200x200
Before: 2592x3888
After: 200x200
Before: 2419x3888
After: 200x200
Before: 1704x2272
After: 200x200
Before: 2185x3700
After: 200x200
Before: 1834x2816
After: 200x200
Before: 1696x2544
After: 200x200