dailylog 4-16-20

less than 1 minute read

# "Idenitfy clouds in images of sky"
import cv2
import numpy as np

url = 'https://etserv.be/wp-content/uploads/2017/04/blue-clouds-day-fluffy-53594.jpeg'
req = urllib.request.urlopen(url)
arr = np.asarray(bytearray(req.read()), dtype=np.uint8)
img = cv2.imdecode(arr, -1) # 'Load it as it is'

# make gray
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2_imshow(img_gray)

# make mask
white = np.array([255,255,255])
lowerBound = np.array([80,80,80])
mask = cv2.inRange(img, lowerBound, white)

# show mask
cv2_imshow(mask)