I want to perform OCR in black background plate, to do so i want to implement this code in order to check it and if so to inverse the result of cv2.threshold but it doesn't work.
background = np.mean(thresh)
if int(background) < 100:
thresh = cv2.bitwise_not(thresh)
else:
pass
I didn't figure out where i'm wrong, can anyone help please!