How to detect colors in a specified location in OpenCV

Solution for How to detect colors in a specified location in OpenCV
is Given Below:

What I want to do is cover the detected text with the color that surrounds that text. Then overlay that with the translated text. My question is, how can I get the color within the bounds of the rectangle of the detected text.

    from os import read
    from types import resolve_bases
    from googletrans import Translator
    import easyocr
    import cv2
    from matplotlib import pyplot as plt
    import numpy as np

    # Get Text from Image
    IMAGE_PATH = 'sign.jpg'

    reader = easyocr.Reader(['ko'], gpu=False)
    result = reader.readtext(IMAGE_PATH)
    result
    print(result)


    top_left = tuple(result[0][0][0])
    bottom_right = tuple(result[0][0][2])
    text = result[0][1]
    font = cv2.FONT_HERSHEY_COMPLEX

    img = cv2.imread(IMAGE_PATH)
    img = cv2.rectangle(img, top_left, bottom_right, (0, 255, 0), 5)
    img = cv2.putText(img, text, top_left, font, 1, (0, 0, 0), 2, cv2.LINE_AA)
    # plt.imshow(img)
    # plt.show()

    # Multiple Lines
    img = cv2.imread(IMAGE_PATH)
    for detection in result:
        top_left = tuple([int(val) for val in detection[0][0]])
        bottom_right = tuple([int(val) for val in detection[0][2]])
        # Translate
        translator = Translator()
        translation = translator.translate(
            detection[1], dest="en")

        text = translation.text
        font = cv2.FONT_HERSHEY_COMPLEX
        img = cv2.rectangle(img, top_left, bottom_right, (255, 255, 255), 10)
        img = cv2.putText(img, text, top_left, font, .75,
                        (0, 0, 0), 2, cv2.LINE_AA)

    plt.figure(figsize=(7, 7))
    plt.imshow(img)
    plt.show()

enter image description here