Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I solved it. Here's the code that got it working. My bounds were off

# Convert to HSV colorspace
hsv = cv2.cvtColor(im, cv2.COLOR_BGR2HSV)

# Define color range for masking
lower = n.array([0,100,100])
upper = n.array([20,255,255])

# Apply the mask
mask = cv2.inRange(hsv, lower, upper)

    #(source, destination, mask to apply)
result = cv2.bitwise_and(im,im, mask=mask)