def get_color(self, frame, color1, color2): mask = cv2.inRange(self.hsv, color1, color2) res = cv2.bitwise_and(frame, frame, mask = mask) return res