'Pytesseract OCR with different colors

I am trying to read this type of image with pytesseract but I have some issue with the part in yellow because the color transformation that works for other chracters won't work for those in yellow boxes. Also I want to keep the " numbers fo each row well split. Any idea how I could manage that? Thanks

enter image description here

gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
# invert = 255 - thresh

# OCR
data = pytesseract.image_to_string(thresh, config="--psm 6")
print(data)

cv2.imshow("thresh", thresh)
# cv2.imshow("invert", invert)
cv2.waitKey()

enter image description here

Returns: '> SKAPOVALOY 4 (15\nRINDERKNECH 6 [EY 15\n'



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source