Skip to content

Instantly share code, notes, and snippets.

@lachlanagnew
Created August 10, 2018 01:49
Show Gist options
  • Save lachlanagnew/d2640f7f256a809bdc702cc499aa99c9 to your computer and use it in GitHub Desktop.
Save lachlanagnew/d2640f7f256a809bdc702cc499aa99c9 to your computer and use it in GitHub Desktop.
mask = cv2.GaussianBlur(hsv, (11, 11), 0)
mask = cv2.inRange(mask, lower_range, upper_range)
res = cv2.bitwise_and(hsv, hsv, mask=mask)
res = cv2.cvtColor(cv2.cvtColor(res, cv2.COLOR_HSV2BGR), cv2.COLOR_BGR2GRAY)
res = cv2.erode(res, None, iterations=3)
res = cv2.dilate(res, None, iterations=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment