-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmostraImagem.py
More file actions
27 lines (22 loc) · 791 Bytes
/
mostraImagem.py
File metadata and controls
27 lines (22 loc) · 791 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
import cv2
import numpy as np
img = cv2.imread("resources/planta.jpg")
print(img.shape)
print("hight, width, channel bgr")
cinza = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
redimecionar = cv2.resize(img, (1026, 906))
# borrado = cv2.GaussianBlur(cinza, (7, 7), 0)
# borda = cv2.Canny(img, 50, 50)
# kernel = np.ones((1, 2), np.uint8)
# precissaoBorda = cv2.dilate(borda, kernel, iterations=1)
# afinar = cv2.erode(precissaoBorda, kernel, iterations=1)
cv2.imshow("original", img)
cv2.imshow("cinza", cinza)
cv2.imshow("maior", redimecionar)
# cv2.imshow("borrado", borrado)
# cv2.imshow("borda", borda)
# cv2.imshow("precissao", precissaoBorda)
# cv2.imshow("afinar", afinar)
cv2.waitKey(0) # 0 mostra sempre, 1000 mostra por 1 min
if cv2.waitKey(0) == ord('q'):
cv2.destroyAllWindows()