-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCVtest1.py
More file actions
35 lines (23 loc) · 687 Bytes
/
CVtest1.py
File metadata and controls
35 lines (23 loc) · 687 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import cv2
import numpy as np
import matplotlib
def showimage(title,img):
cv2.imshow(title, img)
cv2.waitKey()
cv2d.destroyAllWindows()
# want grey scale can add 0 at the end
input = cv2.imread('./Master OpenCV/images/input.jpg')
# first is an title and the second is an variable
# cv2.imshow("Hello world", input)
# wait to press any key before continue
# cv2.waitKey()
# cv2.destroyAllWindows()
# gives the dimension of the image
# print input.shape
# print "the height is", input.shape[0], "pixels"
# cv2.imwrite('output.jpg', input)
gray_image = cv2.cvtColor(input, cv2.COLOR_BGR2GRAY)
# showimage("grey", gray_image)
B, G, R = input[0,0]
print input
pushtest