Last active
July 8, 2016 09:12
-
-
Save qingswu/845836fdb59408e9ef110786fd982f7b to your computer and use it in GitHub Desktop.
Get the minimum/maximum width/height of all the jpg images in current folder.
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
#!/usr/bin/env python | |
from glob import glob | |
import cv2 | |
jpgs = glob('./*.jpg') | |
shapes = [cv2.imread(f).shape for f in jpgs] | |
a = [list(i) for i in shapes] | |
width = [row[1] for row in a] | |
height = [row[0] for row in a] | |
print 'width min:', min(width), ', max:', max(width), '; height min:', min(height), ', max:', max(height) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment