Starts working with coffee pictures

This commit is contained in:
julien Lengrand-Lambert
2015-10-03 11:07:43 +02:00
commit 98fcb78b65
4 changed files with 32 additions and 0 deletions

BIN
data/GetPicture1.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
data/GetPicture2.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
data/GetPicture3.jpeg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

32
voyante.py Normal file
View 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()