import sys
import cv2
import numpy
import urllib
print("Python version: \n" + sys.version)
print("cv2 version: " + cv2.__version__)
print("numpy version: " + numpy.__version__)
print("urllib version: " + urllib.__version__)
url = 'http://goo.gl/41cgQr'
data = urllib.urlopen(url)
img = numpy.asarray(bytearray(data.read()), dtype='uint8')
img = cv2.imdecode(img, cv2.IMREAD_COLOR)
print("")
print "image info"
print "#row #column #channel"
print img.shape
print "#row * #column * #channel"
print img.size
cv2.imshow('image',img)
cv2.waitKey(0)
cv2.destroyWindow('image')
Thursday, October 8, 2015
Python/OpenCV, get image properties - number of row, column, color channel
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment