Skip to content

Instantly share code, notes, and snippets.

@PeaceAndHiLight
Last active August 12, 2017 01:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeaceAndHiLight/02f43f5f92f5697ef43a to your computer and use it in GitHub Desktop.
Save PeaceAndHiLight/02f43f5f92f5697ef43a to your computer and use it in GitHub Desktop.
Test Numpy Method
#coding: utf-8
import cv2
import numpy as np
# 画像を読み込んでおきます
img = cv2.imread('sample.jpg')
# 画像の情報をみることができます
print 'ndim is ' + str(img.ndim)
print 'shape is ' + str(img.shape)
print 'size is ' + str(img.size)
print 'dtype is ' + str(img.dtype)
@PeaceAndHiLight
Copy link
Author

Test Numpy Method

ndim, shape, size, dtype

@PeaceAndHiLight
Copy link
Author

python2で書いてあるので、3で書き直す必要がありますね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment