so my code is using opencv with tesseract to extract a text from a image and what i want to do is to blacklist some parts of the image so the code don't check if there is a text here the code :
import numpy as np
img = cv2.imread('test.jpeg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
sensitivity = 70
lower_range = np.array([0,0,255-sensitivity])
upper_range = np.array([255,sensitivity,255])
mask = cv2.inRange(hsv, lower_range, upper_range)
cv2.imshow('image', img)
cv2.imshow('mask', mask)
cv2.waitKey(0)
cv2.destroyAllWindows()
Base image:

Parts of the image i want to blacklist (in red):

can someone help me doing this if this is possible ?
