Last active
June 9, 2020 19:16
-
-
Save offsouza/b55d115b7ceb306b5bd5198adc91a6cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import cv2 | |
import numpy as np | |
image = cv2.imread('images/5.bmp') | |
hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) | |
blur = cv2.medianBlur(hsv ,11) | |
lower = np.array([132,113,223]) | |
upper = np.array([140,153,255]) | |
mask = cv2.inRange(blur, lower, upper) | |
res = cv2.bitwise_and(image,image, mask= mask) | |
cv2.imshow("mask ",mask) | |
cv2.imshow('stack', np.hstack([image, res])) | |
cv2.waitKey(0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment