Skip to content

Instantly share code, notes, and snippets.

@rich-hart
Created February 22, 2019 16:27
Show Gist options
  • Save rich-hart/868d8fb3120318e218e405a473606774 to your computer and use it in GitHub Desktop.
Save rich-hart/868d8fb3120318e218e405a473606774 to your computer and use it in GitHub Desktop.
code sample for removing a bluescreen.
import cv2
image = cv2.imread('Tribble.JPG')
hsv_image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV)
BLUE_RANGE_MIN_HSV = (100, 80, 70)
BLUE_RANGE_MAX_HSV = (185, 255, 255)
mask = cv2.inRange(hsv_image, BLUE_RANGE_MIN_HSV, BLUE_RANGE_MAX_HSV)
result = cv2.bitwise_and(image, image, mask=mask)
cv2.imwrite('result.png',result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment