mirror of
https://github.com/jlengrand/coffee_voyance.git
synced 2026-03-10 08:11:18 +00:00
Starts working with coffee pictures
This commit is contained in:
BIN
data/GetPicture1.jpeg
Normal file
BIN
data/GetPicture1.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 70 KiB |
BIN
data/GetPicture2.jpeg
Normal file
BIN
data/GetPicture2.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 76 KiB |
BIN
data/GetPicture3.jpeg
Normal file
BIN
data/GetPicture3.jpeg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
32
voyante.py
Normal file
32
voyante.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
|
||||
img1_location="data/GetPicture1.jpeg"
|
||||
img2_location="data/GetPicture2.jpeg"
|
||||
img3_location="data/GetPicture3.jpeg"
|
||||
|
||||
img1 = cv2.imread(img1_location,cv2.IMREAD_UNCHANGED)
|
||||
img1g = cv2.imread(img1_location,0)
|
||||
# img2 = cv2.imread(img2_location,cv2.IMREAD_UNCHANGED)
|
||||
# img3 = cv2.imread(img3_location,cv2.IMREAD_UNCHANGED)
|
||||
|
||||
|
||||
|
||||
height, width, channels = img1.shape
|
||||
cropimg1 = img1g[0:width-150, 0:height]
|
||||
|
||||
|
||||
blur = cv2.GaussianBlur(cropimg1,(5,5),0)
|
||||
ret3,th3 = cv2.threshold(blur,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
|
||||
|
||||
|
||||
cv2.imshow('imageg',img1g)
|
||||
cv2.imshow('imagecrop',cropimg1)
|
||||
cv2.imshow('imageout2',blur)
|
||||
cv2.imshow('imageout3',th3)
|
||||
|
||||
|
||||
|
||||
|
||||
cv2.waitKey(0)
|
||||
cv2.destroyAllWindows()
|
||||
Reference in New Issue
Block a user