Skip to content

Commit

Permalink
switch to python3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
makelove committed Jul 5, 2017
1 parent a640bc0 commit 68b7dd7
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 168 deletions.
336 changes: 187 additions & 149 deletions .idea/workspace.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ch04-图片/4.1_imread_imshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
import numpy as np
import cv2

print cv2.__version__
print(cv2.__version__)

# Load an color image in grayscale
img = cv2.imread('messi5.jpg',0)
img = cv2.imread('messi5.jpg', 0)
img.I
cv2.namedWindow('image',cv2.WINDOW_NORMAL)
cv2.imshow('image',img)
cv2.namedWindow('image', cv2.WINDOW_NORMAL)
cv2.imshow('image', img)
cv2.waitKey(0)
cv2.destroyAllWindows()

#
cv2.imwrite('messigray.png',img)
cv2.imwrite('messigray.png', img)
4 changes: 2 additions & 2 deletions ch09-图像的基础操作/9.itemset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import numpy as np

img=cv2.imread('../data/messi5.jpg')
print img.item(10,10,2)
print (img.item(10,10,2))
img.itemset((10,10,2),100)
print img.item(10,10,2)
print (img.item(10,10,2))
14 changes: 6 additions & 8 deletions ch09-图像的基础操作/9.shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
import cv2
import numpy as np

img = cv2.imread('../data/messi5.jpg', 0) # gray
print(img.shape)

img=cv2.imread('../data/messi5.jpg',0)#gray
print img.shape

img=cv2.imread('../data/messi5.jpg')
print img.shape

print img.size
print img.dtype
img = cv2.imread('../data/messi5.jpg')
print(img.shape)

print(img.size)
print(img.dtype)
4 changes: 2 additions & 2 deletions ch11-程序性能检测及优化/11.getTickCount.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
img1 = cv2.imread('../data/ml.jpg')

e1 = cv2.getTickCount()
for i in xrange(5,49,2):
for i in range(5,49,2):
img1 = cv2.medianBlur(img1,i)
e2 = cv2.getTickCount()
t = (e2 - e1)/cv2.getTickFrequency()
print t
print (t)
# Result I got is 0.521107655 seconds
4 changes: 2 additions & 2 deletions ch13-颜色空间转换/13.find_object_hsv.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
#的三层括号应 分别对应于 cvArray cvMat IplImage
green=np.uint8([[[0,255,0]]])
hsv_green=cv2.cvtColor(green,cv2.COLOR_BGR2HSV)
print hsv_green
print (hsv_green)
#[[[60 255 255]]]

black=np.uint8([[[0,0,0]]])
hsv_black=cv2.cvtColor(black,cv2.COLOR_BGR2HSV)
print hsv_black
print (hsv_black)
#[[[0 0 0]]]

0 comments on commit 68b7dd7

Please sign in to comment.