I'm trying to improve the accuracy of my image to string code, however, the background is constantly changing, from either a darker blue background to a green background while the text remains constantly white. Unfortunately most questions I've found on StackOverflow were all with black text instead of white so most preprocessing I've seen doesn't really work since the text I wish to withdraw is white, not black.
I've tried:
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
txt = pytesseract.image_to_string(gray,config ='--psm 6')
However, the results are mediocre at best, it more often than not gets it wrong.

