Problem in removing particular colors from the given image
Hi Guys I have the following image
I want to know if there is any method which basically removes black and blue box from the image and the final image contains only orange , green pink and light blue box i.e. I want my output image to be displayed as
I am using python 2.7 with cv2
Update
Following the suggestion give by @StevenPuttemans
I converted my given image to HSV using following code
img = cv2.imread('Image.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
cv2.imshow('hsv',hsv)
I got output as
What procedure should i follow next to get my output as shown in 2nd image.
Convert your images to a color space where those black and blue colors are seperable from the others. As a first guess, HSV could already do the trick!
What procedure should i follow next sir @StevenPuttemans
Well, you need to find a function (or two) that results in a true value where the colors you are removing are, and false in the rest. Take a look at the pixel values for the colors you wish to remove. How are they different from the other colors? Is one value (of the 3) always lower or always higher? Then that's a good way to tell the difference. The threshold or bitwise functions can help turn that into a mask.
Start by splitting up into channels, then take a look at the HSV channel properties and like @Tetragramm said, try to define ranges which apply for your seperation boundary.
Thank U Guys