hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
lower_red = np.array([0,50,50])
upper_red = np.array([10, 255, 255])
mask0 = cv2.inRange(hsv, lower_red, upper_red)
lower_red = np.array([170, 50, 50])
upper_red = np.array([180, 255, 255])
mask1 = cv2.inRange(hsv, lower_red, upper_red)
mask = mask0+mask1
hasRed = np.sum(mask)
if hasRed > 0:
print("red dettected")
balance = pytesseract.image_to_string(img, config='outputbase digits')
print(balance)
else:
print("red not dettected")