import cv2

import numpy as np

image = cv2.imread("coloredchips.png")

# Convert BGR to HSV

hsv = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)

# define color strenght parameters in HSV

weaker = np.array([110, 100, 100])

stronger = np.array([130,255,255])

# Threshold the HSV image to obtain input color

mask = cv2.inRange(hsv, weaker, stronger)

cv2.imshow('Image',image)

cv2.imshow('Result',mask)

cv2.waitKey(0)

cv2.destroyAllWindows()