Hi Guys I have the following image
I want to draw contour around orange , green, light blue and pink box. I don't want to draw contour around black as well as dark blue box.
Things I Tried ... 1.) I converted the image to gray and applied thresholding but the resulting image was having only black and white colors. So that didnt work
ray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
ret,thresh = cv2.threshold(gray,100,255,cv2.THRESH_BINARY_INV)
2.) I tried masking the required image out . Even that didnt work ..
lower = np.array(param1)
upper = np.array(param2)
mask = cv2.inRange(img, lower, upper)
res = cv2.bitwise_and(img, img, mask= mask)
I dont understand what to do Of course there is one method of filtering out one color at a time and applying contour , but i want to avoid this approach.
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 am using python 2.7 with cv2